<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"}} {{projectLongName}}
</a>
</a>
{{/if}}
<a class="component-name-file link-no-underline" href="{{dashboardUrl component}}">
- {{qualifierIcon componentQualifier}} {{componentLongName}}
+ {{qualifierIcon componentQualifier}} {{collapsePath componentLongName}}
</a>
</div>
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;
}
}
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);
this.$('.issues-workspace-list-component').remove();
}
});
-
--- /dev/null
+/*
+ * 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);
+};