diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-12-09 10:35:59 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-12-09 14:28:10 +0100 |
commit | 73d214a4d36f23016f6dd1b8dd014343c502aa62 (patch) | |
tree | 778baa08d85a986826d742cb7f9ce6770f7532bb | |
parent | 26cbc7cbdd8c1b32ad5797b8060d4c954396bb92 (diff) | |
download | sonarqube-73d214a4d36f23016f6dd1b8dd014343c502aa62.tar.gz sonarqube-73d214a4d36f23016f6dd1b8dd014343c502aa62.zip |
return "id" instead of "uuid" from api/navigation/component
8 files changed, 8 insertions, 10 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ui/ws/ComponentNavigationAction.java b/server/sonar-server/src/main/java/org/sonar/server/ui/ws/ComponentNavigationAction.java index 5ddd14f0f9e..661c832a7cc 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/ui/ws/ComponentNavigationAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/ui/ws/ComponentNavigationAction.java @@ -136,7 +136,7 @@ public class ComponentNavigationAction implements NavigationWsAction { private void writeComponent(JsonWriter json, DbSession session, ComponentDto component, @Nullable SnapshotDto analysis) { json.prop("key", component.key()) - .prop("uuid", component.uuid()) + .prop("id", component.uuid()) .prop("name", component.name()) .prop("description", component.description()) .prop("isFavorite", isFavourite(session, component)); diff --git a/server/sonar-server/src/main/resources/org/sonar/server/ui/ws/example-component.json b/server/sonar-server/src/main/resources/org/sonar/server/ui/ws/example-component.json index 06c4125bda6..29703cbb350 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/ui/ws/example-component.json +++ b/server/sonar-server/src/main/resources/org/sonar/server/ui/ws/example-component.json @@ -1,6 +1,6 @@ { "key": "org.codehaus.sonar:sonar", - "uuid": "ABCD", + "id": "ABCD", "name": "Sonarqube", "description": "Open source platform for continuous inspection of code quality", "isFavorite": true, diff --git a/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_bread_crumbs_on_several_levels.json b/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_bread_crumbs_on_several_levels.json index efc3c542c61..fe5e8663833 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_bread_crumbs_on_several_levels.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_bread_crumbs_on_several_levels.json @@ -1,6 +1,6 @@ { "key": "palap:src/main/xoo/Source.xoo", - "uuid": "cdef", + "id": "cdef", "name": "Source.xoo", "isFavorite": false, "breadcrumbs": [ diff --git a/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_component_info_when_anonymous_no_snapshot.json b/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_component_info_when_anonymous_no_snapshot.json index b087d2f3573..ede37f60c36 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_component_info_when_anonymous_no_snapshot.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_component_info_when_anonymous_no_snapshot.json @@ -1,6 +1,6 @@ { "key": "polop", - "uuid": "abcd", + "id": "abcd", "name": "Polop", "description": "test project", "isFavorite": false, diff --git a/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_component_info_when_snapshot.json b/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_component_info_when_snapshot.json index a5d7e3aa3da..90752cb430a 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_component_info_when_snapshot.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_component_info_when_snapshot.json @@ -1,6 +1,6 @@ { "key": "polop", - "uuid": "abcd", + "id": "abcd", "name": "Polop", "description": "test project", "isFavorite": false, diff --git a/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_component_info_with_favourite.json b/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_component_info_with_favourite.json index 0bba0964ff0..1eea2061ade 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_component_info_with_favourite.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentNavigationActionTest/return_component_info_with_favourite.json @@ -1,6 +1,6 @@ { "key": "polop", - "uuid": "abcd", + "id": "abcd", "name": "Polop", "description": "test project", "isFavorite": true, diff --git a/server/sonar-web/src/main/js/app/store/rootActions.js b/server/sonar-web/src/main/js/app/store/rootActions.js index 717c52f4345..b2e9500aefd 100644 --- a/server/sonar-web/src/main/js/app/store/rootActions.js +++ b/server/sonar-web/src/main/js/app/store/rootActions.js @@ -44,8 +44,6 @@ export const fetchLanguages = () => dispatch => { ); }; -const mapUuidToId = project => ({ ...project, id: project.uuid }); - const addQualifier = project => ({ ...project, qualifier: project.breadcrumbs[project.breadcrumbs.length - 1].qualifier @@ -53,7 +51,7 @@ const addQualifier = project => ({ export const fetchProject = key => dispatch => ( getComponentNavigation(key).then( - component => dispatch(receiveComponents([mapUuidToId(addQualifier(component))])), + component => dispatch(receiveComponents([addQualifier(component)])), onFail(dispatch) ) ); diff --git a/server/sonar-web/src/main/js/apps/component/components/App.js b/server/sonar-web/src/main/js/apps/component/components/App.js index fe7d0d59d80..139838f7342 100644 --- a/server/sonar-web/src/main/js/apps/component/components/App.js +++ b/server/sonar-web/src/main/js/apps/component/components/App.js @@ -38,7 +38,7 @@ export default class App extends React.Component { return ( <div className="page"> - <SourceViewer component={{ id: this.state.component.uuid }}/> + <SourceViewer component={{ id: this.state.component.id }}/> </div> ); } |