From c7d0592a331abcd6bef1c081fd3a56e0fd61adf7 Mon Sep 17 00:00:00 2001 From: Vijaykant Yadav Date: Wed, 17 Apr 2024 23:13:48 +0530 Subject: [PATCH] initial changes --- frontend/src/Editor/Editor.jsx | 14 --------- .../RightTopHeaderButtons/ManageAppUsers.jsx | 29 ++----------------- .../ActionConfigurationPanels/GotoApp.jsx | 18 +++++++++++- .../src/Editor/Inspector/EventManager.jsx | 21 ++++++++++++-- .../_components/NotificationCenter/index.jsx | 7 +---- 5 files changed, 40 insertions(+), 49 deletions(-) diff --git a/frontend/src/Editor/Editor.jsx b/frontend/src/Editor/Editor.jsx index 57c465e8a2..d6381cd802 100644 --- a/frontend/src/Editor/Editor.jsx +++ b/frontend/src/Editor/Editor.jsx @@ -389,19 +389,6 @@ const EditorComponent = (props) => { return editorRef; }; - const fetchApps = async (page) => { - const { apps } = await appService.getAll(page); - - updateState({ - apps: apps.map((app) => ({ - id: app.id, - name: app.name, - slug: app.slug, - current_version_id: app.current_version_id, - })), - }); - }; - const fetchOrgEnvironmentVariables = () => { orgEnvironmentVariableService.getVariables().then((data) => { const client_variables = {}; @@ -506,7 +493,6 @@ const EditorComponent = (props) => { useResolveStore.getState().actions.updateJSHints(); await fetchApp(props.params.pageHandle, true); - await fetchApps(0); await fetchOrgEnvironmentVariables(); await fetchOrgEnvironmentConstants(); initComponentVersioning(); diff --git a/frontend/src/Editor/Header/RightTopHeaderButtons/ManageAppUsers.jsx b/frontend/src/Editor/Header/RightTopHeaderButtons/ManageAppUsers.jsx index 8c0d8f32cb..8f626441b9 100644 --- a/frontend/src/Editor/Header/RightTopHeaderButtons/ManageAppUsers.jsx +++ b/frontend/src/Editor/Header/RightTopHeaderButtons/ManageAppUsers.jsx @@ -23,7 +23,6 @@ class ManageAppUsersComponent extends React.Component { this.state = { showModal: false, appId: null, - isLoading: true, isSlugVerificationInProgress: false, addingUser: false, newUser: {}, @@ -51,26 +50,9 @@ class ManageAppUsersComponent extends React.Component { componentDidMount() { const appId = this.props.appId; - this.fetchAppUsers(appId); this.setState({ appId }); } - fetchAppUsers = (appId) => { - appsService - .getAppUsers(appId) - .then((data) => - this.setState({ - users: data.users, - isLoading: false, - }) - ) - .catch((error) => { - this.setState({ isLoading: false }); - const errorMessage = error?.message || 'Something went wrong'; - toast.error(errorMessage); - }); - }; - hideModal = () => { this.setState({ showModal: false, @@ -95,7 +77,6 @@ class ManageAppUsersComponent extends React.Component { .then(() => { this.setState({ addingUser: false, newUser: {} }); toast.success('Added user successfully'); - this.fetchAppUsers(this.state.appId); }) .catch(({ error }) => { this.setState({ addingUser: false }); @@ -190,7 +171,7 @@ class ManageAppUsersComponent extends React.Component { }; render() { - const { isLoading, appId, isSlugVerificationInProgress, newSlug, isSlugUpdated } = this.state; + const { appId, isSlugVerificationInProgress, newSlug, isSlugUpdated } = this.state; const appLink = `${getHostURL()}/applications/`; const shareableLink = appLink + (this.props.slug || appId); @@ -238,11 +219,7 @@ class ManageAppUsersComponent extends React.Component { - {isLoading ? ( -
- -
- ) : ( + {