]> source.dussan.org Git - sonarqube.git/commitdiff
[NO JIRA] Remove second devops instance warning
authorguillaume-peoch-sonarsource <guillaume.peoch@sonarsource.com>
Thu, 12 Jan 2023 16:09:24 +0000 (17:09 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 13 Jan 2023 20:02:47 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionForm.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionFormRenderer.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmTabRenderer.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionForm-test.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmBindingDefinitionFormRenderer-test.tsx
server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/AlmBindingDefinitionForm-test.tsx.snap
server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/__snapshots__/AlmBindingDefinitionFormRenderer-test.tsx.snap
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index e5506523d0d8b9537284733a961dd3123c33ddd8..08fc333e5d77e9492ed00e6b623b8e21ccc27a52 100644 (file)
@@ -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}
index df196ffff4c5dc5a66ac06d6634804b2ae78428d..4abfd2ab835086fde04933c9ff4243929ea357b9 100644 (file)
@@ -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}
index 6ab1b47cbc33508f9e4f1f980f5c4a39e65efb19..dbc82d76c89ae11034b283591217ce6d1a37fb8b 100644 (file)
@@ -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">
index 052335fb12306cabffad302af38a899dfab04503..2d22762356f9a9651eea53c6383fea30facbaae3 100644 (file)
@@ -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}
             />
index ee069f36793e4d23b1812881abb0e1f4aca8feec..7b76ad160bb201145438c6792f047e7edb2fd288 100644 (file)
@@ -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}
index aa895adfeabfd041ed7710a353af6228e7e0c807..c006090672473999cd248a0e72bce771ded21634 100644 (file)
@@ -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()}
index 19fc742ed32b8d93948732ab882f48449b26e53e..f086eb31184a9829b60f89569d047ea88eb35fbd 100644 (file)
@@ -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={
     {
index 76e6f318f7d5828ff18b3d60cb91fad2eafaeaed..16e3977d2254677d69b5406ca38f28f358b9760f 100644 (file)
@@ -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"
index 2e9d77880f352d885c92eae2ba9ecf0142817951..c5065d204a8b7e80edad3f5115edc1a9e9f6042b 100644 (file)
@@ -1208,7 +1208,6 @@ settings.almintegration.delete.no_info=An unknown number of projects will no lon
 settings.almintegration.form.app_id.github.help=The App ID is found on your GitHub App's page on GitHub at Settings > Developer Settings > GitHub Apps
 settings.almintegration.form.header.create=Create a configuration
 settings.almintegration.form.header.edit=Edit the configuration
-settings.almintegration.form.second_instance_warning=Binding more than one instance of a DevOps Platform will deactivate the import of repositories from that DevOps Platform.
 settings.almintegration.form.name.azure=Configuration name
 settings.almintegration.form.name.azure.help=Give your configuration a clear and succinct name. This name will be used at project level to identify the correct configured Azure instance for a project.
 settings.almintegration.form.choose_bitbucket_variant=Select which variant you want to configure