diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2018-12-14 17:00:32 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2018-12-20 11:41:50 +0100 |
commit | 402ab19b0e1712eab73ac5abfc06f78a751918c1 (patch) | |
tree | b9e03a2fbc3c0cb1c8e85faf8505f3a4e025370e /server | |
parent | f52265203f1f7a2a9f2b3d3f8e4df83193d4b77c (diff) | |
download | sonarqube-402ab19b0e1712eab73ac5abfc06f78a751918c1.tar.gz sonarqube-402ab19b0e1712eab73ac5abfc06f78a751918c1.zip |
fix refreshing of the projects list
Diffstat (limited to 'server')
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> |