]> source.dussan.org Git - sonarqube.git/commitdiff
Fix wrong delete button usage in auto org import canceling
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Fri, 26 Apr 2019 12:25:36 +0000 (14:25 +0200)
committerSonarTech <sonartech@sonarsource.com>
Tue, 7 May 2019 18:21:27 +0000 (20:21 +0200)
server/sonar-web/src/main/js/apps/create/organization/AutoOrganizationCreate.tsx
server/sonar-web/src/main/js/apps/create/organization/AutoPersonalOrganizationBind.tsx
server/sonar-web/src/main/js/apps/create/organization/__tests__/AutoOrganizationCreate-test.tsx
server/sonar-web/src/main/js/apps/create/organization/__tests__/AutoPersonalOrganizationBind-test.tsx
server/sonar-web/src/main/js/apps/create/organization/__tests__/__snapshots__/AutoOrganizationCreate-test.tsx.snap
server/sonar-web/src/main/js/apps/create/organization/__tests__/__snapshots__/AutoPersonalOrganizationBind-test.tsx.snap

index 08ad2ed676f5231693ee4690e1e5937428c80bac..a9193117774f203f95d2b6daed0b3b239270f160 100644 (file)
@@ -25,7 +25,8 @@ import OrganizationDetailsStep from './OrganizationDetailsStep';
 import PlanStep from './PlanStep';
 import { Step } from './utils';
 import { Alert } from '../../../components/ui/Alert';
-import { DeleteButton } from '../../../components/ui/buttons';
+import { ButtonIcon } from '../../../components/ui/buttons';
+import ClearIcon from '../../../components/icons-components/ClearIcon';
 import RadioToggle from '../../../components/controls/RadioToggle';
 import { bindAlmOrganization } from '../../../api/alm-integration';
 import { sanitizeAlmId, getAlmMembersUrl, isGithub } from '../../../helpers/almIntegrations';
@@ -136,10 +137,9 @@ export default class AutoOrganizationCreate extends React.PureComponent<Props, S
                   name: <strong>{almOrganization.name}</strong>
                 }}
               />
-              <DeleteButton
-                className="little-spacer-left"
-                onClick={this.props.handleCancelImport}
-              />
+              <ButtonIcon className="little-spacer-left" onClick={this.props.handleCancelImport}>
+                <ClearIcon />
+              </ButtonIcon>
             </p>
 
             {hasUnboundOrgs && (
index c50cb5ff706d0b76d867242c4137a4d1990d9ec2..a97e49ed9514f08c9dca92cf04c9f487d1e32f9a 100644 (file)
@@ -23,11 +23,12 @@ import OrganizationDetailsForm from './OrganizationDetailsForm';
 import OrganizationDetailsStep from './OrganizationDetailsStep';
 import PlanStep from './PlanStep';
 import { Step } from './utils';
-import { DeleteButton } from '../../../components/ui/buttons';
+import ClearIcon from '../../../components/icons-components/ClearIcon';
+import OrganizationAvatar from '../../../components/common/OrganizationAvatar';
+import { ButtonIcon } from '../../../components/ui/buttons';
 import { getBaseUrl } from '../../../helpers/urls';
 import { translate } from '../../../helpers/l10n';
 import { sanitizeAlmId } from '../../../helpers/almIntegrations';
-import OrganizationAvatar from '../../../components/common/OrganizationAvatar';
 
 interface Props {
   almApplication: T.AlmApplication;
@@ -97,7 +98,9 @@ export default class AutoPersonalOrganizationBind extends React.PureComponent<Pr
                 personalName: importPersonalOrg && <strong>{importPersonalOrg.name}</strong>
               }}
             />
-            <DeleteButton className="little-spacer-left" onClick={this.props.handleCancelImport} />
+            <ButtonIcon className="little-spacer-left" onClick={this.props.handleCancelImport}>
+              <ClearIcon />
+            </ButtonIcon>
           </div>
           <OrganizationDetailsForm
             keyReadOnly={true}
index 151c5c51ed8b64e0168e5a06962cd14a8924c91d..0e5500e5160ea42152fe28cd7aa8ff42f9da0908 100644 (file)
@@ -62,7 +62,7 @@ it('should allow to cancel org import', () => {
   const handleCancelImport = jest.fn().mockResolvedValue({ key: 'foo' });
   const wrapper = shallowRender({ handleCancelImport });
 
-  click(wrapper.find('DeleteButton'));
+  click(wrapper.find('ButtonIcon'));
   expect(handleCancelImport).toBeCalled();
 });
 
index 7aec3fc266114b3637a7ca95e1bda5de187ba42a..8d9282c3f10a3ce64f11d8c958cd68d20f9ee552 100644 (file)
@@ -56,7 +56,7 @@ it('should allow to cancel org import', () => {
     handleCancelImport
   });
 
-  click(wrapper.find('DeleteButton'));
+  click(wrapper.find('ButtonIcon'));
   expect(handleCancelImport).toBeCalled();
 });
 
index 1af9195ea6814f644c3562e68407f0bd2fc901a6..89856c1c8b39df495b833ba92df644e3518f39d4 100644 (file)
@@ -31,10 +31,12 @@ exports[`should display choice between import or creation 1`] = `
             }
           }
         />
-        <DeleteButton
+        <ButtonIcon
           className="little-spacer-left"
           onClick={[MockFunction]}
-        />
+        >
+          <ClearIcon />
+        </ButtonIcon>
       </p>
       <RadioToggle
         disabled={false}
@@ -130,10 +132,12 @@ exports[`should render prefilled and create org 1`] = `
             }
           }
         />
-        <DeleteButton
+        <ButtonIcon
           className="little-spacer-left"
           onClick={[MockFunction]}
-        />
+        >
+          <ClearIcon />
+        </ButtonIcon>
       </p>
     </div>
     <OrganizationDetailsForm
index d465e5f0ac86bcf3df6f614c0b95f2a246940e64..0d4420b06ce9f60ceb6780dd5a4e137aeca4ba6c 100644 (file)
@@ -40,10 +40,12 @@ exports[`should render correctly 1`] = `
           }
         }
       />
-      <DeleteButton
+      <ButtonIcon
         className="little-spacer-left"
         onClick={[MockFunction]}
-      />
+      >
+        <ClearIcon />
+      </ButtonIcon>
     </div>
     <OrganizationDetailsForm
       keyReadOnly={true}