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
start with cellbuilder
Klaus Zandersf47668998076
diff --git a/frontend/src/app/features/work-packages/components/wp-fast-table/builders/rows/single-row-builder.ts b/frontend/src/app/features/work-packages/components/wp-fast-table/builders/rows/single-row-builder.tsindex 77acc475ae5..a31a0e73cb9 100644--- a/frontend/src/app/features/work-packages/components/wp-fast-table/builders/rows/single-row-builder.ts+++ b/frontend/src/app/features/work-packages/components/wp-fast-table/builders/rows/single-row-builder.ts@@ -25,6 +25,7 @@ import {import { WorkPackageTable } from 'core-app/features/work-packages/components/wp-fast-table/wp-fast-table';import { WorkPackageViewBaselineService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-baseline.service';import { BaselineColumnBuilder } from 'core-app/features/work-packages/components/wp-fast-table/builders/baseline/baseline-column-builder';+import { ShareCellbuilder } from '../share-cell-builder';// Work package table row entriesexport const tableRowClassName = 'wp-table--row';@@ -47,6 +48,9 @@ export class SingleRowBuilder {// Relation cell builder instanceprotected relationCellBuilder = new RelationCellbuilder(this.injector);+ // Share cell builder instance+ protected shareCellBuilder = new ShareCellbuilder(this.injector);+// Details Link builderprotected contextLinkBuilder = new TableActionRenderer(this.injector);@@ -93,6 +97,10 @@ export class SingleRowBuilder {return this.relationCellBuilder.build(workPackage, column);}+ if (column.id === 'sharedWithUsers') {+ return this.shareCellBuilder.build(workPackage, column);+ }+// Handle property typesswitch (column.id) {case internalContextMenuColumn.id:diff --git a/frontend/src/app/features/work-packages/components/wp-fast-table/builders/share-cell-builder.ts b/frontend/src/app/features/work-packages/components/wp-fast-table/builders/share-cell-builder.tsnew file mode 100644index 00000000000..f99804bb1a7--- /dev/null+++ b/frontend/src/app/features/work-packages/components/wp-fast-table/builders/share-cell-builder.ts@@ -0,0 +1,24 @@+import { Injector } from '@angular/core';+import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';+import { QueryColumn } from '../../wp-query/query-column';+import { tdClassName } from './cell-builder';+import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';+import { IsolatedQuerySpace } from 'core-app/features/work-packages/directives/query-space/isolated-query-space';++export class ShareCellbuilder {+ @InjectField(IsolatedQuerySpace) isolatedQuerySpace:IsolatedQuerySpace;+ constructor(public readonly injector:Injector) {+ }++ public build(workPackage:WorkPackageResource, column:QueryColumn) {+ const td = document.createElement('td');+ td.classList.add(tdClassName, column.id);+ td.dataset.columnId = column.id;++console.log(this.isolatedQuerySpace.workPackageSharesCache.get(workPackage.id!).getValueOr([]));++ td.innerHTML = `Share ${this.isolatedQuerySpace.workPackageSharesCache.get(workPackage.id!).getValueOr([]).map((share) => share.user.name).join(', ')}`;++ return td;+ }+}