Add „show version“ link to version header && tighten permissions

pull/7347/head
Henriette Dinger 6 years ago
parent 47412a3a37
commit ba2d79f0b1
  1. 21
      frontend/src/app/modules/boards/board/board-actions/version/version-action.service.ts
  2. 4
      frontend/src/app/modules/common/path-helper/path-helper.service.ts
  3. 1
      modules/boards/config/locales/js-en.yml

@ -170,7 +170,7 @@ export class BoardVersionActionService implements BoardActionService {
return [
{
// Lock version
hidden: !version.isOpen(),
hidden: !version.isOpen() || (version.isLocked() && !version.$links.update),
linkText: this.I18n.t('js.boards.version.lock_version'),
onClick: () => {
this.patchVersionStatus(version, 'locked');
@ -179,7 +179,7 @@ export class BoardVersionActionService implements BoardActionService {
},
{
// Unlock version
hidden: !version.isLocked(),
hidden: !version.isLocked() || (version.isOpen() && !version.$links.update),
linkText: this.I18n.t('js.boards.version.unlock_version'),
onClick: () => {
this.patchVersionStatus(version, 'open');
@ -188,7 +188,7 @@ export class BoardVersionActionService implements BoardActionService {
},
{
// Close version
hidden: version.isClosed(),
hidden: version.isClosed() || (!version.isClosed() && !version.$links.update),
linkText: this.I18n.t('js.boards.version.close_version'),
onClick: () => {
this.patchVersionStatus(version, 'closed');
@ -197,13 +197,26 @@ export class BoardVersionActionService implements BoardActionService {
},
{
// Open version
hidden: !version.isClosed(),
hidden: !version.isClosed() || (version.isClosed() && !version.$links.update),
linkText: this.I18n.t('js.boards.version.open_version'),
onClick: () => {
this.patchVersionStatus(version, 'open');
return true;
}
},
{
// Show link
linkText: this.I18n.t('js.boards.version.show_version'),
href: this.pathHelper.versionShowPath(id),
onClick: (evt:JQuery.Event) => {
if (!LinkHandling.isClickedWithModifier(evt)) {
window.open(this.pathHelper.versionShowPath(id), '_blank');
return true;
}
return false;
}
},
{
// Edit link
hidden: !version.$links.update,

@ -168,6 +168,10 @@ export class PathHelperService {
return this.staticBase + '/versions/' + id + '/edit';
}
public versionShowPath(id:string|number) {
return this.staticBase + '/versions/' + id;
}
public workPackagesPath() {
return this.staticBase + '/work_packages';
}

@ -22,6 +22,7 @@ en:
lock_version: 'Lock version'
unlock_version: 'Unlock version'
edit_version: 'Edit version'
show_version: 'Show version'
new_board: 'New board'
add_list: 'Add list'

Loading…
Cancel
Save