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/grouped/grouped-rows-helpers.ts

25 lines
651 B

import {GroupObject} from '../../../../api/api-v3/hal-resources/wp-collection-resource.service';
export function groupIdentifier(group:GroupObject) {
return `${groupByProperty(group)}-${group.value || 'nullValue'}`;
}
export function groupName(group:GroupObject) {
let value = group.value;
if (value === null) {
return '-';
} else {
return value;
}
}
export function groupByProperty(group:GroupObject):string {
return group._links!.groupBy.href.split('/').pop()!;
}
/**
* Get the row group class name for the given group id.
*/
export function groupedRowClassName(groupIndex:number) {
return `__row-group-${groupIndex}`;
}