From 402ab19b0e1712eab73ac5abfc06f78a751918c1 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Fri, 14 Dec 2018 17:00:32 +0100 Subject: [PATCH] fix refreshing of the projects list --- .../details/ProfileDetails.tsx | 22 ++++++++++--------- .../details/ProfileProjects.tsx | 3 +-- .../ProfileDetails-test.tsx.snap | 14 ------------ 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 (
- - + + {profile.actions && profile.actions.edit && !profile.isBuiltIn && ( - + )}
- - +
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; } interface State { @@ -114,7 +113,7 @@ export default class ProfileProjects extends React.PureComponent { 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" > @@ -86,25 +79,19 @@ exports[`renders without permissions 1`] = ` className="quality-profile-grid-left" >
-- 2.39.5