aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-12-14 17:00:32 +0100
committersonartech <sonartech@sonarsource.com>2018-12-20 11:41:50 +0100
commit402ab19b0e1712eab73ac5abfc06f78a751918c1 (patch)
treeb9e03a2fbc3c0cb1c8e85faf8505f3a4e025370e /server
parentf52265203f1f7a2a9f2b3d3f8e4df83193d4b77c (diff)
downloadsonarqube-402ab19b0e1712eab73ac5abfc06f78a751918c1.tar.gz
sonarqube-402ab19b0e1712eab73ac5abfc06f78a751918c1.zip
fix refreshing of the projects list
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.tsx22
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileDetails-test.tsx.snap14
3 files changed, 13 insertions, 26 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.tsx
index 8d2e9b49f8a..eb37f118f77 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.tsx
@@ -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>
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx
index 7ca7c13e2eb..f88766b3058 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx
@@ -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() {
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileDetails-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileDetails-test.tsx.snap
index 9ab3884c99b..42299aa5648 100644
--- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileDetails-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileDetails-test.tsx.snap
@@ -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>