diff options
author | guillaume-peoch-sonarsource <guillaume.peoch@sonarsource.com> | 2023-01-12 17:09:24 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-01-13 20:02:47 +0000 |
commit | d201300a097e97361d6dd49a3054be3c5e532b1e (patch) | |
tree | deb28d6eabf9bc5f6c43c8b364cae40434f34026 /server/sonar-web/src/main/js/apps | |
parent | 1d92a9229b3c0a7c2fe8548087c2ff71512bb999 (diff) | |
download | sonarqube-d201300a097e97361d6dd49a3054be3c5e532b1e.tar.gz sonarqube-d201300a097e97361d6dd49a3054be3c5e532b1e.zip |
[NO JIRA] Remove second devops instance warning
Diffstat (limited to 'server/sonar-web/src/main/js/apps')
8 files changed, 2 insertions, 82 deletions
diff --git a/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx b/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx index e5506523d0d..08fc333e5d7 100644 --- a/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx @@ -265,7 +265,6 @@ export class CreateProjectPage extends React.PureComponent<CreateProjectPageProp {creatingAlmDefinition && ( <AlmBindingDefinitionForm alm={creatingAlmDefinition} - alreadyHaveInstanceConfigured={false} onCancel={this.handleOnCancelCreation} afterSubmit={this.handleAfterSubmit} enforceValidation={true} diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionForm.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionForm.tsx index df196ffff4c..4abfd2ab835 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionForm.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionForm.tsx @@ -50,7 +50,6 @@ import AlmBindingDefinitionFormRenderer from './AlmBindingDefinitionFormRenderer interface Props { alm: AlmKeys; bindingDefinition?: AlmBindingDefinition; - alreadyHaveInstanceConfigured: boolean; onCancel: () => void; afterSubmit: (data: AlmBindingDefinitionBase) => void; enforceValidation?: boolean; @@ -260,7 +259,7 @@ export default class AlmBindingDefinitionForm extends React.PureComponent<Props, }; render() { - const { alm, bindingDefinition, alreadyHaveInstanceConfigured } = this.props; + const { alm, bindingDefinition } = this.props; const { formData, submitting, bitbucketVariant, validationError } = this.state; const isUpdate = !!bindingDefinition; @@ -270,7 +269,6 @@ export default class AlmBindingDefinitionForm extends React.PureComponent<Props, alm={alm} isUpdate={isUpdate} canSubmit={this.canSubmit()} - alreadyHaveInstanceConfigured={alreadyHaveInstanceConfigured} onCancel={this.handleOnCancel} onSubmit={this.handleFormSubmit} onFieldChange={this.handleFieldChange} diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormRenderer.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormRenderer.tsx index 6ab1b47cbc3..dbc82d76c89 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormRenderer.tsx @@ -41,7 +41,6 @@ export interface AlmBindingDefinitionFormProps { alm: AlmKeys; isUpdate: boolean; canSubmit: boolean; - alreadyHaveInstanceConfigured: boolean; onCancel: () => void; onSubmit: () => void; onFieldChange: (fieldId: keyof AlmBindingDefinition, value: string) => void; @@ -98,8 +97,7 @@ export default class AlmBindingDefinitionFormRenderer extends React.PureComponen }; render() { - const { isUpdate, alreadyHaveInstanceConfigured, canSubmit, submitting, validationError } = - this.props; + const { isUpdate, canSubmit, submitting, validationError } = this.props; const header = translate('settings.almintegration.form.header', isUpdate ? 'edit' : 'create'); const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => { @@ -120,11 +118,6 @@ export default class AlmBindingDefinitionFormRenderer extends React.PureComponen </div> <div className="modal-body modal-container"> - {alreadyHaveInstanceConfigured && !isUpdate && ( - <Alert className="big-spacer-bottom" variant="warning"> - {translate('settings.almintegration.form.second_instance_warning')} - </Alert> - )} {this.renderForm()} {validationError && !canSubmit && ( <Alert variant="error"> diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmTabRenderer.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmTabRenderer.tsx index 052335fb123..2d22762356f 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmTabRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmTabRenderer.tsx @@ -118,7 +118,6 @@ export default function AlmTabRenderer(props: AlmTabRendererProps) { <AlmBindingDefinitionForm alm={almTab} bindingDefinition={editedDefinition} - alreadyHaveInstanceConfigured={definitions.length > 0} onCancel={props.onCancel} afterSubmit={props.afterSubmit} /> diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionForm-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionForm-test.tsx index ee069f36793..7b76ad160bb 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionForm-test.tsx @@ -211,7 +211,6 @@ function shallowRender(props: Partial<AlmBindingDefinitionForm['props']> = {}) { <AlmBindingDefinitionForm alm={AlmKeys.GitHub} bindingDefinition={mockGithubBindingDefinition()} - alreadyHaveInstanceConfigured={false} onCancel={jest.fn()} afterSubmit={jest.fn()} {...props} diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionFormRenderer-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionFormRenderer-test.tsx index aa895adfeab..c0060906724 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionFormRenderer-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionFormRenderer-test.tsx @@ -30,7 +30,6 @@ import GithubForm from '../GithubForm'; it('should render correctly', () => { expect(shallowRender()).toMatchSnapshot(); - expect(shallowRender({ alreadyHaveInstanceConfigured: true })).toMatchSnapshot('second instance'); expect(shallowRender({ submitting: true })).toMatchSnapshot('submitting'); expect(shallowRender({ isUpdate: true })).toMatchSnapshot('editing'); expect(shallowRender({ validationError: 'this is a validation error' })).toMatchSnapshot( @@ -80,7 +79,6 @@ function shallowRender(props: Partial<AlmBindingDefinitionFormProps> = {}) { alm={AlmKeys.GitHub} isUpdate={false} canSubmit={false} - alreadyHaveInstanceConfigured={false} submitting={false} formData={mockGithubBindingDefinition()} onCancel={jest.fn()} diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/AlmBindingDefinitionForm-test.tsx.snap b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/AlmBindingDefinitionForm-test.tsx.snap index 19fc742ed32..f086eb31184 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/AlmBindingDefinitionForm-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/AlmBindingDefinitionForm-test.tsx.snap @@ -3,7 +3,6 @@ exports[`should render correctly: create 1`] = ` <AlmBindingDefinitionFormRenderer alm="github" - alreadyHaveInstanceConfigured={false} canSubmit={false} formData={ { @@ -28,7 +27,6 @@ exports[`should render correctly: create 1`] = ` exports[`should render correctly: edit 1`] = ` <AlmBindingDefinitionFormRenderer alm="github" - alreadyHaveInstanceConfigured={false} canSubmit={false} formData={ { diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/AlmBindingDefinitionFormRenderer-test.tsx.snap b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/AlmBindingDefinitionFormRenderer-test.tsx.snap index 76e6f318f7d..16e3977d225 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/AlmBindingDefinitionFormRenderer-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/AlmBindingDefinitionFormRenderer-test.tsx.snap @@ -351,70 +351,6 @@ exports[`should render correctly: editing 1`] = ` </Modal> `; -exports[`should render correctly: second instance 1`] = ` -<Modal - contentLabel="settings.almintegration.form.header.create" - onRequestClose={[MockFunction]} - shouldCloseOnOverlayClick={false} - size="medium" -> - <form - className="views-form" - onSubmit={[Function]} - > - <div - className="modal-head" - > - <h2> - settings.almintegration.form.header.create - </h2> - </div> - <div - className="modal-body modal-container" - > - <Alert - className="big-spacer-bottom" - variant="warning" - > - settings.almintegration.form.second_instance_warning - </Alert> - <GithubForm - formData={ - { - "appId": "123456", - "clientId": "client1", - "clientSecret": "**clientsecret**", - "key": "key", - "privateKey": "asdf1234", - "url": "http://github.enterprise.com", - "webhookSecret": "verySecretText!!", - } - } - onFieldChange={[MockFunction]} - /> - </div> - <div - className="modal-foot" - > - <SubmitButton - disabled={true} - > - settings.almintegration.form.save - <DeferredSpinner - className="spacer-left" - loading={false} - /> - </SubmitButton> - <ResetButtonLink - onClick={[MockFunction]} - > - cancel - </ResetButtonLink> - </div> - </form> -</Modal> -`; - exports[`should render correctly: submitting 1`] = ` <Modal contentLabel="settings.almintegration.form.header.create" |