From cc0735fe3d4817439ea9155ac822379f011a4c0a Mon Sep 17 00:00:00 2001 From: Muhsin Shah C P Date: Thu, 2 Nov 2023 11:42:56 +0530 Subject: [PATCH 1/8] [improvement] From now on, users will not be able to make the app public or access the shareable URL if the app has not been released (#8007) * started working on restricting users from accessing the app urls * worked on design changes * replaced the modal with error page * added: the tooltip * fix: design * refactoring: removed unwanted controller and service code * changed div title logic * updated: tooltip msg --- frontend/src/App/App.jsx | 7 + frontend/src/Editor/Header/index.js | 1 + frontend/src/Editor/ManageAppUsers.jsx | 329 +++++++++--------- frontend/src/Editor/Viewer.jsx | 6 +- .../_components/ErrorComponents/ErrorPage.jsx | 59 ++++ .../src/_components/ErrorComponents/index.js | 1 + .../ErrorComponents/static-modal.scss | 30 ++ frontend/src/_components/ToolTip.jsx | 4 + frontend/src/_helpers/constants.js | 18 + frontend/src/_helpers/handleAppAccess.js | 46 ++- frontend/src/_helpers/routes.js | 6 + frontend/src/_styles/theme.scss | 4 + server/src/controllers/apps.controller.ts | 5 + 13 files changed, 344 insertions(+), 172 deletions(-) create mode 100644 frontend/src/_components/ErrorComponents/ErrorPage.jsx create mode 100644 frontend/src/_components/ErrorComponents/index.js create mode 100644 frontend/src/_components/ErrorComponents/static-modal.scss diff --git a/frontend/src/App/App.jsx b/frontend/src/App/App.jsx index 5958d6ea70..ecc1c30a90 100644 --- a/frontend/src/App/App.jsx +++ b/frontend/src/App/App.jsx @@ -29,6 +29,7 @@ import SetupScreenSelfHost from '../SuccessInfoScreen/SetupScreenSelfHost'; export const BreadCrumbContext = React.createContext({}); import 'react-tooltip/dist/react-tooltip.css'; import { getWorkspaceIdOrSlugFromURL } from '@/_helpers/routes'; +import ErrorPage from '@/_components/ErrorComponents/ErrorPage'; const AppWrapper = (props) => { return ( @@ -95,6 +96,7 @@ class AppComponent extends React.Component { render() { const { updateAvailable, darkMode } = this.state; + let toastOptions = { style: { wordBreak: 'break-all', @@ -245,6 +247,11 @@ class AppComponent extends React.Component { /> )} } /> + } + /> diff --git a/frontend/src/Editor/ManageAppUsers.jsx b/frontend/src/Editor/ManageAppUsers.jsx index 0a5c924793..ebd8c7e637 100644 --- a/frontend/src/Editor/ManageAppUsers.jsx +++ b/frontend/src/Editor/ManageAppUsers.jsx @@ -10,6 +10,9 @@ import { Link } from 'react-router-dom'; import { getPrivateRoute, replaceEditorURL, getHostURL } from '@/_helpers/routes'; import { validateName } from '@/_helpers/utils'; import SolidIcon from '@/_ui/Icon/SolidIcons'; +import cx from 'classnames'; +import { ToolTip } from '@/_components/ToolTip'; +import { TOOLTIP_MESSAGES } from '@/_helpers/constants'; class ManageAppUsersComponent extends React.Component { constructor(props) { @@ -192,107 +195,102 @@ class ManageAppUsersComponent extends React.Component { const shareableLink = appLink + (this.props.slug || appId); const slugButtonClass = !_.isEmpty(newSlug.error) ? 'is-invalid' : 'is-valid'; const embeddableLink = ``; + const shouldWeDisableShareModal = !this.props.isVersionReleased; return ( -
- { - this.validateThePreExistingSlugs(); - this.setState({ showModal: true }); - }} + +
- - - - - {this.props.t('editor.share', 'Share')} - - - - - - {isLoading ? ( -
- -
- ) : ( -