|
|
|
@ -4,6 +4,7 @@ import {TabComponent} from 'core-components/wp-table/configuration-modal/tab-por |
|
|
|
|
import {WorkPackageTableGroupByService} from 'core-components/wp-fast-table/state/wp-table-group-by.service'; |
|
|
|
|
import {QueryGroupByResource} from 'core-components/api/api-v3/hal-resources/query-group-by-resource.service'; |
|
|
|
|
import {WorkPackageTableHierarchiesService} from 'core-components/wp-fast-table/state/wp-table-hierarchy.service'; |
|
|
|
|
import {WorkPackageTableSumService} from 'core-components/wp-fast-table/state/wp-table-sum.service'; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
template: require('!!raw-loader!./display-settings-tab.component.html') |
|
|
|
@ -13,6 +14,7 @@ export class WpTableConfigurationDisplaySettingsTab implements TabComponent { |
|
|
|
|
readonly I18n = this.injector.get(I18nToken); |
|
|
|
|
readonly wpTableGroupBy = this.injector.get(WorkPackageTableGroupByService); |
|
|
|
|
readonly wpTableHierarchies = this.injector.get(WorkPackageTableHierarchiesService); |
|
|
|
|
readonly wpTableSums = this.injector.get(WorkPackageTableSumService); |
|
|
|
|
|
|
|
|
|
// Display mode
|
|
|
|
|
public displayMode:'hierarchy'|'grouped'|'default' = 'default'; |
|
|
|
@ -21,11 +23,16 @@ export class WpTableConfigurationDisplaySettingsTab implements TabComponent { |
|
|
|
|
public currentGroup:QueryGroupByResource|null = null; |
|
|
|
|
public availableGroups:QueryGroupByResource[] = []; |
|
|
|
|
|
|
|
|
|
// Sums row display
|
|
|
|
|
public displaySums:boolean = false; |
|
|
|
|
|
|
|
|
|
public text = { |
|
|
|
|
label_group_by: this.I18n.t('js.label_group_by'), |
|
|
|
|
title: this.I18n.t('js.label_group_by'), |
|
|
|
|
placeholder: this.I18n.t('js.placeholders.default'), |
|
|
|
|
please_select: this.I18n.t('js.placeholders.selection'), |
|
|
|
|
display_sums: this.I18n.t('js.work_packages.query.display_sums'), |
|
|
|
|
display_sums_hint: this.I18n.t('js.work_packages.table_configuration.display_sums_hint'), |
|
|
|
|
display_mode: { |
|
|
|
|
default: this.I18n.t('js.work_packages.table_configuration.default_mode'), |
|
|
|
|
grouped: this.I18n.t('js.work_packages.table_configuration.grouped_mode'), |
|
|
|
@ -45,6 +52,9 @@ export class WpTableConfigurationDisplaySettingsTab implements TabComponent { |
|
|
|
|
// Update grouping state
|
|
|
|
|
let group = this.displayMode === 'grouped' ? this.currentGroup : null; |
|
|
|
|
this.wpTableGroupBy.set(group); |
|
|
|
|
|
|
|
|
|
// Update sums state
|
|
|
|
|
this.wpTableSums.setEnabled(this.displaySums); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public updateGroup(href:string) { |
|
|
|
@ -58,6 +68,8 @@ export class WpTableConfigurationDisplaySettingsTab implements TabComponent { |
|
|
|
|
this.displayMode = 'grouped'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.displaySums = this.wpTableSums.currentSum; |
|
|
|
|
|
|
|
|
|
this.wpTableGroupBy |
|
|
|
|
.onReady() |
|
|
|
|
.then(() => { |
|
|
|
|