From: Grégoire Aubert Date: Thu, 22 Nov 2018 15:13:46 +0000 (+0100) Subject: SONARCLOUD-178 Simplify SC onboarding popup X-Git-Tag: 7.5~46 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d639ccca707ae55c95bf0578a73bea503d836d0c;p=sonarqube.git SONARCLOUD-178 Simplify SC onboarding popup --- diff --git a/server/sonar-web/src/main/js/app/components/StartupModal.tsx b/server/sonar-web/src/main/js/app/components/StartupModal.tsx index bb92eb2c447..c26d26f032a 100644 --- a/server/sonar-web/src/main/js/app/components/StartupModal.tsx +++ b/server/sonar-web/src/main/js/app/components/StartupModal.tsx @@ -112,11 +112,6 @@ export class StartupModal extends React.PureComponent { this.setState({ modal: ModalKey.onboarding }); }; - openOrganizationOnboarding = () => { - this.setState({ automatic: false, modal: undefined }); - this.props.router.push({ pathname: '/create-organization', state: { paid: true } }); - }; - openProjectOnboarding = (organization?: T.Organization) => { if (isSonarCloud()) { this.setState({ automatic: false, modal: undefined }); @@ -183,7 +178,6 @@ export class StartupModal extends React.PureComponent { {modal === ModalKey.onboarding && ( diff --git a/server/sonar-web/src/main/js/apps/create/organization/CreateOrganization.tsx b/server/sonar-web/src/main/js/apps/create/organization/CreateOrganization.tsx index df312aa7804..fecfbdb42b2 100644 --- a/server/sonar-web/src/main/js/apps/create/organization/CreateOrganization.tsx +++ b/server/sonar-web/src/main/js/apps/create/organization/CreateOrganization.tsx @@ -93,7 +93,6 @@ type StateWithAutoImport = State & Required>; type TabKeys = 'auto' | 'manual'; interface LocationState { - paid?: boolean; tab?: TabKeys; } @@ -301,7 +300,7 @@ export class CreateOrganization extends React.PureComponent @@ -364,7 +362,6 @@ export class CreateOrganization extends React.PureComponent {almInstallId && almOrganization && !boundOrganization ? ( diff --git a/server/sonar-web/src/main/js/apps/create/organization/__tests__/CreateOrganization-test.tsx b/server/sonar-web/src/main/js/apps/create/organization/__tests__/CreateOrganization-test.tsx index 8e7cbd3ec60..59cc3a8139c 100644 --- a/server/sonar-web/src/main/js/apps/create/organization/__tests__/CreateOrganization-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/organization/__tests__/CreateOrganization-test.tsx @@ -106,14 +106,6 @@ it('should render with manual tab displayed', async () => { expect(getAlmAppInfo).not.toHaveBeenCalled(); }); -it('should preselect paid plan on manual creation', async () => { - const location = { state: { paid: true } }; - // @ts-ignore avoid passing everything from WithRouterProps - const wrapper = shallowRender({ location }); - await waitAndUpdate(wrapper); - expect(wrapper.find('ManualOrganizationCreate').prop('onlyPaid')).toBe(true); -}); - it('should render with auto tab displayed', async () => { const wrapper = shallowRender({ currentUser: { ...user, externalProvider: 'github' } }); await waitAndUpdate(wrapper); diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingModal.tsx b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingModal.tsx index 719ba4d4ba1..6805ac22c76 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingModal.tsx +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingModal.tsx @@ -21,7 +21,6 @@ import * as React from 'react'; import { connect } from 'react-redux'; import handleRequiredAuthentication from '../../../app/utils/handleRequiredAuthentication'; import Modal from '../../../components/controls/Modal'; -import OnboardingPrivateIcon from '../../../components/icons-components/OnboardingPrivateIcon'; import OnboardingProjectIcon from '../../../components/icons-components/OnboardingProjectIcon'; import OnboardingTeamIcon from '../../../components/icons-components/OnboardingTeamIcon'; import { Button, ResetButtonLink } from '../../../components/ui/buttons'; @@ -32,7 +31,6 @@ import '../styles.css'; interface OwnProps { onClose: () => void; - onOpenOrganizationOnboarding: () => void; onOpenProjectOnboarding: () => void; onOpenTeamOnboarding: () => void; } @@ -73,24 +71,13 @@ export class OnboardingModal extends React.PureComponent {
-
diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx index 7aa040268ff..f8884dd68f1 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx @@ -54,15 +54,6 @@ export class OnboardingPage extends React.PureComponent) => { - this.closeOnboarding(); - this.props.router.push(`/organizations/${key}`); - }; - - openOrganizationOnboarding = () => { - this.props.router.push({ pathname: '/create-organization', state: { paid: true } }); - }; - openTeamOnboarding = () => { this.setState({ modal: ModalKey.teamOnboarding }); }; @@ -74,7 +65,6 @@ export class OnboardingPage extends React.PureComponent diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/OnboardingModal-test.tsx b/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/OnboardingModal-test.tsx index 76c801faaf8..3ff570e8cde 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/OnboardingModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/OnboardingModal-test.tsx @@ -28,7 +28,6 @@ it('renders correctly', () => { @@ -38,7 +37,6 @@ it('renders correctly', () => { it('should correctly open the different tutorials', () => { const onClose = jest.fn(); - const onOpenOrganizationOnboarding = jest.fn(); const onOpenProjectOnboarding = jest.fn(); const onOpenTeamOnboarding = jest.fn(); const push = jest.fn(); @@ -46,7 +44,6 @@ it('should correctly open the different tutorials', () => { , @@ -57,7 +54,6 @@ it('should correctly open the different tutorials', () => { expect(onClose).toHaveBeenCalled(); wrapper.find('Button').forEach(button => click(button)); - expect(onOpenOrganizationOnboarding).toHaveBeenCalled(); expect(onOpenProjectOnboarding).toHaveBeenCalled(); expect(onOpenTeamOnboarding).toHaveBeenCalled(); }); diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/__snapshots__/OnboardingModal-test.tsx.snap b/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/__snapshots__/OnboardingModal-test.tsx.snap index 5888278c63d..1b5da9e7124 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/__snapshots__/OnboardingModal-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/__snapshots__/OnboardingModal-test.tsx.snap @@ -32,31 +32,8 @@ exports[`renders correctly 1`] = `
- onboarding.analyze_public_code + onboarding.analyze_your_code
-

- onboarding.analyze_public_code.note -

- -
- - - - - - - - - - - - - ); -} diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 5bca60ee0ee..2b4196f9e2a 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -2814,12 +2814,9 @@ onboarding.team.first_step=Well congrats, the first step is done! onboarding.team.how_to_join=To join a team, the only thing you need to do is to be a user registered on Sonarcloud. The administrator of the Sonarcloud organization you wish to join has to add you to his organization's members {link}. Ask him to do so! onboarding.team.work_in_progress=We are currently working on a better way to join a team or invite people to yours. -onboarding.analyze_public_code.note=Free -onboarding.analyze_public_code=Analyze public code -onboarding.analyze_private_code=Analyze private code -onboarding.analyze_private_code.note=From 10$ / month +onboarding.analyze_your_code.note=Free +onboarding.analyze_your_code=Analyze your code onboarding.contribute_existing_project=Join a team -onboarding.contribute_existing_project.note=Free onboarding.token.header=Provide a token onboarding.token.text=The token is used to identify you when an analysis is performed. If it has been compromised, you can revoke it at any point of time in your {link}.