From: Stas Vilchik Date: Fri, 20 Oct 2017 13:26:27 +0000 (+0200) Subject: fix file permalink with branch X-Git-Tag: 6.7-RC1~124 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b5ced5bc4727e6a4757c51b447b0979096a0f7b9;p=sonarqube.git fix file permalink with branch --- diff --git a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx index a20ec1d527c..b1b2ac07fad 100644 --- a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx @@ -89,7 +89,10 @@ export class ComponentContainer extends React.PureComponent { } }; - Promise.all([getComponentNavigation(id), getComponentData(id, branch)]).then(([nav, data]) => { + Promise.all([ + getComponentNavigation(id, branch), + getComponentData(id, branch) + ]).then(([nav, data]) => { const component = this.addQualifier({ ...nav, ...data }); if (this.props.organizationsEnabled) { diff --git a/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx index cd5be6f916c..ed7838f8ea3 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx @@ -80,7 +80,7 @@ it("loads branches for module's project", () => { return doAsync().then(() => { expect(getBranches).toBeCalledWith('projectKey'); expect(getComponentData).toBeCalledWith('moduleKey', undefined); - expect(getComponentNavigation).toBeCalledWith('moduleKey'); + expect(getComponentNavigation).toBeCalledWith('moduleKey', undefined); }); }); @@ -102,7 +102,7 @@ it("doesn't load branches portfolio", () => { return doAsync().then(() => { expect(getBranches).not.toBeCalled(); expect(getComponentData).toBeCalledWith('portfolioKey', undefined); - expect(getComponentNavigation).toBeCalledWith('portfolioKey'); + expect(getComponentNavigation).toBeCalledWith('portfolioKey', undefined); expect(wrapper.find(Inner).exists()).toBeTruthy(); }); });