]> source.dussan.org Git - sonarqube.git/commitdiff
fix refreshing of the projects list
authorStas Vilchik <stas.vilchik@sonarsource.com>
Fri, 14 Dec 2018 16:00:32 +0000 (17:00 +0100)
committersonartech <sonartech@sonarsource.com>
Thu, 20 Dec 2018 10:41:50 +0000 (11:41 +0100)
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileDetails-test.tsx.snap

index 8d2e9b49f8abd2e751b55d4e37006ca5949bfad2..eb37f118f77c639740dd407f92577606d223e5ed 100644 (file)
@@ -34,29 +34,31 @@ interface Props {
 }
 
 export default function ProfileDetails(props: Props) {
-  const { profile } = props;
+  const { organization, profile } = props;
   return (
     <div>
       <div className="quality-profile-grid">
         <div className="quality-profile-grid-left">
-          <ProfileRules {...props} />
-          <ProfileExporters {...props} />
+          <ProfileRules organization={organization} profile={profile} />
+          <ProfileExporters
+            exporters={props.exporters}
+            organization={organization}
+            profile={profile}
+          />
           {profile.actions &&
             profile.actions.edit &&
             !profile.isBuiltIn && (
-              <ProfilePermissions
-                organization={props.organization || undefined}
-                profile={profile}
-              />
+              <ProfilePermissions organization={organization || undefined} profile={profile} />
             )}
         </div>
         <div className="quality-profile-grid-right">
-          <ProfileInheritance {...props} />
-          <ProfileProjects
-            organization={props.organization}
+          <ProfileInheritance
+            organization={organization}
             profile={profile}
+            profiles={props.profiles}
             updateProfiles={props.updateProfiles}
           />
+          <ProfileProjects organization={organization} profile={profile} />
         </div>
       </div>
     </div>
index 7ca7c13e2eb9db479f7671208987ce94ad919070..f88766b30581b2ebd4214fd18cfe2e394e518a26 100644 (file)
@@ -30,7 +30,6 @@ import { translate } from '../../../helpers/l10n';
 interface Props {
   organization: string | null;
   profile: Profile;
-  updateProfiles: () => Promise<void>;
 }
 
 interface State {
@@ -114,7 +113,7 @@ export default class ProfileProjects extends React.PureComponent<Props, State> {
 
   closeForm = () => {
     this.setState({ formOpen: false });
-    this.props.updateProfiles();
+    this.loadProjects();
   };
 
   renderDefault() {
index 9ab3884c99bf0c6e3f59fa44c66ea3e580266856..42299aa5648849e2eaf20fd750e7e0cf18ce5b19 100644 (file)
@@ -9,7 +9,6 @@ exports[`renders with edit permission 1`] = `
       className="quality-profile-grid-left"
     >
       <ProfileRules
-        exporters={Array []}
         organization="org"
         profile={
           Object {
@@ -18,8 +17,6 @@ exports[`renders with edit permission 1`] = `
             },
           }
         }
-        profiles={Array []}
-        updateProfiles={[MockFunction]}
       />
       <ProfileExporters
         exporters={Array []}
@@ -31,8 +28,6 @@ exports[`renders with edit permission 1`] = `
             },
           }
         }
-        profiles={Array []}
-        updateProfiles={[MockFunction]}
       />
       <ProfilePermissions
         organization="org"
@@ -49,7 +44,6 @@ exports[`renders with edit permission 1`] = `
       className="quality-profile-grid-right"
     >
       <ProfileInheritance
-        exporters={Array []}
         organization="org"
         profile={
           Object {
@@ -70,7 +64,6 @@ exports[`renders with edit permission 1`] = `
             },
           }
         }
-        updateProfiles={[MockFunction]}
       />
     </div>
   </div>
@@ -86,25 +79,19 @@ exports[`renders without permissions 1`] = `
       className="quality-profile-grid-left"
     >
       <ProfileRules
-        exporters={Array []}
         organization="org"
         profile={Object {}}
-        profiles={Array []}
-        updateProfiles={[MockFunction]}
       />
       <ProfileExporters
         exporters={Array []}
         organization="org"
         profile={Object {}}
-        profiles={Array []}
-        updateProfiles={[MockFunction]}
       />
     </div>
     <div
       className="quality-profile-grid-right"
     >
       <ProfileInheritance
-        exporters={Array []}
         organization="org"
         profile={Object {}}
         profiles={Array []}
@@ -113,7 +100,6 @@ exports[`renders without permissions 1`] = `
       <ProfileProjects
         organization="org"
         profile={Object {}}
-        updateProfiles={[MockFunction]}
       />
     </div>
   </div>