OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
import { Injectable } from '@angular/core';
import { BoardActionService } from 'core-app/features/boards/board/board-actions/board-action.service';
import { BannersService } from 'core-app/core/enterprise/banners.service';
export interface ITileViewEntry {
text:string;
attribute:string;
icon:string;
description:string;
image:string;
disabled?:boolean;
}
@Injectable({ providedIn: 'root' })
export class BoardActionsRegistryService {
constructor(
private bannersService:BannersService,
) {}
private mapping:{ [attribute:string]:BoardActionService } = {};
public add(attribute:string, service:BoardActionService):void {
this.mapping[attribute] = service;
}
public available():ITileViewEntry[] {
return _.map(this.mapping, (service:BoardActionService, attribute:string) => ({
attribute,
text: service.localizedName,
icon: '',
description: '',
image: '',
disabled: !this.bannersService.allowsTo('board_view'),
}));
}
public get(attribute:string):BoardActionService {
if (this.mapping[attribute]) {
return this.mapping[attribute];
}
throw new Error(`No action service exists for ${attribute}`);
}
}