subProject: issue.get('subProject'),
subProjectName: issue.get('subProjectLongName'),
project: issue.get('project'),
- projectName: issue.get('projectLongName')
+ projectName: issue.get('projectLongName'),
+ projectOrganization: issue.get('projectOrganization')
};
},
<a class="js-back">{{t "issues.return_to_list"}}</a>
</div>
- {{#with state.component}}
- <div class="component-name-parent">
- {{qualifierIcon "TRK"}} <a href="{{dashboardUrl project}}" title="{{projectName}}">{{projectName}}</a>
- </div>
- {{#if subProject}}
- <div class="component-name-parent">
- {{qualifierIcon "TRK"}} <a href="{{dashboardUrl subProject}}"
- title="{{subProjectName}}">{{subProjectName}}</a>
- </div>
+ <div class="component-name-parent">
+ {{#if organization}}
+ <a href="{{link '/organizations/' organization.key}}">{{organization.name}}</a>
+ <span class="slash-separator"></span>
{{/if}}
- <div class="component-name-file">
- {{qualifierIcon qualifier}} <a href="{{dashboardUrl key}}" title="{{name}}">{{fileFromPath name}}</a>
- </div>
- {{/with}}
+ {{#with state.component}}
+ {{#if project}}
+ <a href="{{dashboardUrl project}}" title="{{projectName}}">{{projectName}}</a>
+ <span class="slash-separator"></span>
+ {{/if}}
+ {{#if subProject}}
+ <a href="{{dashboardUrl subProject}}" title="{{subProjectName}}">{{subProjectName}}</a>
+ <span class="slash-separator"></span>
+ {{/if}}
+ <a href="{{dashboardUrl key}}" title="{{name}}">{{collapsePath name}}</a>
+ {{/with}}
+ </div>
{{else}}
{{#if state.canBulkChange}}
- <a class="js-selection icon-checkbox {{#if allSelected}}icon-checkbox-checked{{/if}} {{#if
- someSelected}}icon-checkbox-checked icon-checkbox-single{{/if}}"
+ <a class="js-selection icon-checkbox {{#if allSelected}}icon-checkbox-checked{{/if}} {{#if someSelected}}icon-checkbox-checked icon-checkbox-single{{/if}}"
data-toggle="tooltip" title="{{t 'issues.toggle_selection_tooltip'}}"></a>
{{else}}
<div class="component-name issues-workspace-list-component">
- {{#notNull organization}}
+ {{#if organization}}
<a class="link-no-underline" href="{{link '/organizations/' organization.key}}">
{{organization.name}}
</a>
<span class="slash-separator"></span>
- {{/notNull}}
+ {{/if}}
- <a class="link-no-underline" href="{{dashboardUrl project}}">
- {{projectLongName}}
- </a>
+ {{#if project}}
+ <a class="link-no-underline" href="{{dashboardUrl project}}">
+ {{projectLongName}}
+ </a>
+ <span class="slash-separator"></span>
+ {{/if}}
{{#if subProject}}
- <span class="slash-separator"></span>
<a class="link-no-underline" href="{{dashboardUrl subProject}}">
{{subProjectLongName}}
</a>
+ <span class="slash-separator"></span>
{{/if}}
- <span class="slash-separator"></span>
<a class="link-no-underline" href="{{dashboardUrl component}}">
{{collapsePath componentLongName}}
</a>
import WorkspaceHeaderView from '../../components/navigator/workspace-header-view';
import BulkChangeForm from './BulkChangeForm';
import Template from './templates/issues-workspace-header.hbs';
+import { getOrganization, areThereCustomOrganizations } from '../../store/organizations/utils';
export default WorkspaceHeaderView.extend({
template: Template,
const selectedCount = this.options.app.list.where({ selected: true }).length;
const allSelected = issuesCount > 0 && issuesCount === selectedCount;
const someSelected = !allSelected && selectedCount > 0;
- return {
+ const data = {
...WorkspaceHeaderView.prototype.serializeData.apply(this, arguments),
selectedCount,
allSelected,
someSelected
};
+ const component = this.options.app.state.get('component');
+ if (component) {
+ const qualifier = this.options.app.state.get('contextComponentQualifier');
+ if (qualifier === 'VW' || qualifier === 'SVW') {
+ // do nothing
+ } else if (qualifier === 'TRK') {
+ data.state.component.project = null;
+ } else if (qualifier === 'BRC') {
+ data.state.component.project = null;
+ data.state.component.subProject = null;
+ } else {
+ const organization = areThereCustomOrganizations() ? getOrganization(component.projectOrganization) : null;
+ Object.assign(data, { organization });
+ }
+ }
+ return data;
}
});
},
attachHtml (compositeView, childView, index) {
- const $container = this.getChildViewContainer(compositeView);
+ const container = this.getChildViewContainer(compositeView);
const model = this.collection.at(index);
if (model != null) {
const prev = index > 0 && this.collection.at(index - 1);
}
}
if (putComponent) {
- const organization = areThereCustomOrganizations() ?
- getOrganization(model.get('projectOrganization')) : null;
- $container.append(this.componentTemplate({
- ...model.toJSON(),
- organization
- }));
+ this.displayComponent(container, model);
}
}
- $container.append(childView.el);
+ container.append(childView.el);
+ },
+
+ displayComponent (container, model) {
+ const data = { ...model.toJSON() };
+ /* eslint-disable no-console */
+ const qualifier = this.options.app.state.get('contextComponentQualifier');
+ if (qualifier === 'VW' || qualifier === 'SVW') {
+ Object.assign(data, { organization: undefined });
+ } else if (qualifier === 'TRK') {
+ Object.assign(data, { organization: undefined, project: undefined });
+ } else if (qualifier === 'BRC') {
+ Object.assign(data, { organization: undefined, project: undefined, subProject: undefined });
+ } else {
+ const organization = areThereCustomOrganizations() ? getOrganization(model.get('projectOrganization')) : null;
+ Object.assign(data, { organization });
+ }
+ container.append(this.componentTemplate(data));
},
destroyChildren () {