OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/frontend/app/components/wp-fast-table/builders/modes/plain/plain-rows-builder.ts

41 lines
1.2 KiB

import {RowsBuilder} from "../rows-builder";
import {WorkPackageTable} from "../../../wp-fast-table";
import {injectorBridge} from "../../../../angular/angular-injector-bridge.functions";
import {WorkPackageTableRow} from "../../../wp-table.interfaces";
export class PlainRowsBuilder extends RowsBuilder {
// Injections
public I18n:op.I18n;
// The group expansion state
constructor(workPackageTable: WorkPackageTable) {
super(workPackageTable);
injectorBridge(this);
}
/**
* Rebuild the entire grouped tbody from the given table
* @param table
*/
public internalBuildRows(table:WorkPackageTable):[DocumentFragment,DocumentFragment] {
let tableBody = document.createDocumentFragment();
let timelineBody = document.createDocumentFragment();
table.rows.forEach((wpId:string) => {
let row = table.rowIndex[wpId];
let tr = this.buildEmptyRow(row);
row.element = tr;
this.appendRow(row.object, tr, tableBody, timelineBody);
tableBody.appendChild(tr);
});
return [tableBody, timelineBody];
}
public buildEmptyRow(row:WorkPackageTableRow, table?:WorkPackageTable) {
return this.rowBuilder.buildEmpty(row.object);
}
}
PlainRowsBuilder.$inject = ['states', 'I18n'];