aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2017-01-18 13:39:48 +0100
committerStas Vilchik <stas-vilchik@users.noreply.github.com>2017-01-24 09:25:53 +0100
commitd758d6bf03f5cd4ba5b9e55f7370a8dd95e4747a (patch)
tree2825081e5a3d10968d1c04292427021c01818e65 /server/sonar-web
parent0eb12aca0e73a4347d78c4746d57be489bad0903 (diff)
downloadsonarqube-d758d6bf03f5cd4ba5b9e55f7370a8dd95e4747a.tar.gz
sonarqube-d758d6bf03f5cd4ba5b9e55f7370a8dd95e4747a.zip
SONAR-8628 Display organizations on the Issues page
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-list-component.hbs7
-rw-r--r--server/sonar-web/src/main/js/apps/issues/workspace-list-view.js9
-rw-r--r--server/sonar-web/src/main/js/store/organizations/utils.js34
3 files changed, 47 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-list-component.hbs b/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-list-component.hbs
index 43d94de426f..ef3ed17285c 100644
--- a/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-list-component.hbs
+++ b/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-list-component.hbs
@@ -1,4 +1,9 @@
<div class="component-name issues-workspace-list-component">
+ {{#notNull organization}}
+ <span class="component-name-parent">
+ {{organization.name}}
+ </span>
+ {{/notNull}}
<a class="component-name-parent link-no-underline" href="{{dashboardUrl project}}">
{{qualifierIcon "TRK"}}&nbsp;{{projectLongName}}
</a>
@@ -8,6 +13,6 @@
</a>
{{/if}}
<a class="component-name-file link-no-underline" href="{{dashboardUrl component}}">
- {{qualifierIcon componentQualifier}}&nbsp;{{componentLongName}}
+ {{qualifierIcon componentQualifier}}&nbsp;{{collapsePath componentLongName}}
</a>
</div>
diff --git a/server/sonar-web/src/main/js/apps/issues/workspace-list-view.js b/server/sonar-web/src/main/js/apps/issues/workspace-list-view.js
index 453e6a5c5f0..536c67b0510 100644
--- a/server/sonar-web/src/main/js/apps/issues/workspace-list-view.js
+++ b/server/sonar-web/src/main/js/apps/issues/workspace-list-view.js
@@ -23,6 +23,7 @@ import IssueView from './workspace-list-item-view';
import EmptyView from './workspace-list-empty-view';
import Template from './templates/issues-workspace-list.hbs';
import ComponentTemplate from './templates/issues-workspace-list-component.hbs';
+import { getOrganization, areThereCustomOrganizations } from '../../store/organizations/utils';
const COMPONENT_HEIGHT = 29;
const BOTTOM_OFFSET = 60;
@@ -113,7 +114,12 @@ export default WorkspaceListView.extend({
}
}
if (putComponent) {
- $container.append(this.componentTemplate(model.toJSON()));
+ const organization = areThereCustomOrganizations() ?
+ getOrganization(model.get('projectOrganization')) : null;
+ $container.append(this.componentTemplate({
+ ...model.toJSON(),
+ organization
+ }));
}
}
$container.append(childView.el);
@@ -124,4 +130,3 @@ export default WorkspaceListView.extend({
this.$('.issues-workspace-list-component').remove();
}
});
-
diff --git a/server/sonar-web/src/main/js/store/organizations/utils.js b/server/sonar-web/src/main/js/store/organizations/utils.js
new file mode 100644
index 00000000000..b9696dfd83b
--- /dev/null
+++ b/server/sonar-web/src/main/js/store/organizations/utils.js
@@ -0,0 +1,34 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+// @flow
+import getStore from '../../app/utils/getStore';
+import { getOrganizationByKey, areThereCustomOrganizations as customOrganizations } from '../rootReducer';
+
+export const getOrganization = (key: string) => {
+ const store = getStore();
+ const state = store.getState();
+ return getOrganizationByKey(state, key);
+};
+
+export const areThereCustomOrganizations = () => {
+ const store = getStore();
+ const state = store.getState();
+ return customOrganizations(state);
+};