diff --git a/frontend/app/angular4-modules.ts b/frontend/app/angular4-modules.ts index d2d05127f4..2711f6a23b 100644 --- a/frontend/app/angular4-modules.ts +++ b/frontend/app/angular4-modules.ts @@ -26,7 +26,7 @@ // See doc/COPYRIGHT.rdoc for more details. // ++ -import {InjectionToken, NgModule} from '@angular/core'; +import {NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {UpgradeModule} from '@angular/upgrade/static'; import {FormsModule} from '@angular/forms'; @@ -49,9 +49,7 @@ import {WorkPackageTableRelationColumnsService} from 'core-components/wp-fast-ta import {WorkPackageTableSelection} from 'core-components/wp-fast-table/state/wp-table-selection.service'; import {WorkPackageTableSortByService} from 'core-components/wp-fast-table/state/wp-table-sort-by.service'; import {WorkPackageTableTimelineService} from 'core-components/wp-fast-table/state/wp-table-timeline.service'; -import { - WorkPackageInlineCreateComponent, -} from 'core-components/wp-inline-create/wp-inline-create.component'; +import {WorkPackageInlineCreateComponent,} from 'core-components/wp-inline-create/wp-inline-create.component'; import {KeepTabService} from 'core-components/wp-single-view-tabs/keep-tab/keep-tab.service'; import {WorkPackageRelationsService} from 'core-components/wp-relations/wp-relations.service'; import {WpResizerDirectiveUpgraded} from 'core-components/wp-resizer/wp-resizer.directive'; @@ -71,16 +69,20 @@ import { $rootScopeToken, $stateToken, $timeoutToken, - columnsModalToken, exportModalToken, - FocusHelperToken, groupingModalToken, - halRequestToken, HalResourceToken, + columnsModalToken, + exportModalToken, + FocusHelperToken, + halRequestToken, + HalResourceToken, HookServiceToken, I18nToken, NotificationsServiceToken, - PathHelperToken, QueryFilterInstanceResourceToken, QueryResourceToken, saveModalToken, - settingsModalToken, shareModalToken, - sortingModalToken, - timelinesModalToken, + PathHelperToken, + QueryFilterInstanceResourceToken, + QueryResourceToken, + saveModalToken, + settingsModalToken, + shareModalToken, TimezoneServiceToken, upgradeService, upgradeServiceWithToken, @@ -189,7 +191,6 @@ import {WpRelationsAutocompleteComponent} from 'core-components/wp-relations/wp- import {WpRelationAddChildComponent} from 'core-components/wp-relations/wp-relation-add-child/wp-relation-add-child'; import {WpRelationParentComponent} from 'core-components/wp-relations/wp-relations-parent/wp-relations-parent.component'; import {OpModalService} from 'core-components/op-modals/op-modal.service'; -import {ColumnsModalComponent} from 'core-components/op-modals/modals/columns-modal.component'; import {WpTableConfigurationModalComponent} from 'core-components/wp-table/configuration-modal/wp-table-configuration.modal'; import {WpTableConfigurationColumnsTab} from 'core-components/wp-table/configuration-modal/tabs/columns-tab.component'; import {WpTableConfigurationDisplaySettingsTab} from 'core-components/wp-table/configuration-modal/tabs/display-settings-tab.component'; @@ -228,13 +229,10 @@ import {WpTableConfigurationTimelinesTab} from 'core-components/wp-table/configu upgradeServiceWithToken('TimezoneService', TimezoneServiceToken), upgradeServiceWithToken('v3Path', v3PathToken), upgradeServiceWithToken('wpDestroyModal', wpDestroyModalToken), - upgradeServiceWithToken('sortingModal', sortingModalToken), - upgradeServiceWithToken('groupingModal', groupingModalToken), upgradeServiceWithToken('shareModal', shareModalToken), upgradeServiceWithToken('saveModal', saveModalToken), upgradeServiceWithToken('settingsModal', settingsModalToken), upgradeServiceWithToken('exportModal', exportModalToken), - upgradeServiceWithToken('timelinesModal', timelinesModalToken), upgradeService('wpRelations', WorkPackageRelationsService), WorkPackageCacheService, WorkPackageEditingService, @@ -403,7 +401,6 @@ import {WpTableConfigurationTimelinesTab} from 'core-components/wp-table/configu // Embedded table WorkPackageEmbeddedTableComponent, // Modals - ColumnsModalComponent, WpTableConfigurationModalComponent, WpTableConfigurationColumnsTab, WpTableConfigurationDisplaySettingsTab, @@ -457,7 +454,6 @@ import {WpTableConfigurationTimelinesTab} from 'core-components/wp-table/configu WorkPackageRelationsHierarchyComponent, // Modals - ColumnsModalComponent, WpTableConfigurationModalComponent, WpTableConfigurationColumnsTab, WpTableConfigurationDisplaySettingsTab, diff --git a/frontend/app/components/modals/columns-modal/columns-modal.controller.ts b/frontend/app/components/modals/columns-modal/columns-modal.controller.ts deleted file mode 100644 index b34982764c..0000000000 --- a/frontend/app/components/modals/columns-modal/columns-modal.controller.ts +++ /dev/null @@ -1,115 +0,0 @@ -//-- copyright -// OpenProject is a project management system. -// Copyright (C) 2012-2015 the OpenProject Foundation (OPF) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License version 3. -// -// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -// Copyright (C) 2006-2013 Jean-Philippe Lang -// Copyright (C) 2010-2013 the ChiliProject Team -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// See doc/COPYRIGHT.rdoc for more details. -//++ - -import {wpControllersModule} from '../../../angular-modules'; -import {WorkPackageTableColumnsService} from '../../wp-fast-table/state/wp-table-columns.service'; -import {QueryColumn} from '../../wp-query/query-column'; - -function ColumnsModalController(this:any, - $scope:any, - $timeout:ng.ITimeoutService, - I18n:op.I18n, - columnsModal:any, - wpTableColumns:WorkPackageTableColumnsService, - ConfigurationService:any) { - var vm = this; - - vm.name = 'Columns'; - vm.closeMe = columnsModal.deactivate; - - vm.selectedColumns = []; - vm.availableColumns = []; - vm.unusedColumns = []; - - vm.text = { - closePopup: I18n.t('js.close_popup_title'), - columnsLabel: I18n.t('js.label_columns'), - selectedColumns: I18n.t('js.description_selected_columns'), - multiSelectLabel: I18n.t('js.work_packages.label_column_multiselect'), - applyButton: I18n.t('js.modals.button_apply'), - cancelButton: I18n.t('js.modals.button_cancel'), - upsaleRelationColumns: I18n.t('js.modals.upsale_relation_columns'), - upsaleRelationColumnsLink: I18n.t('js.modals.upsale_relation_columns_link') - }; - - vm.availableColumns = wpTableColumns.all; - vm.unusedColumns = wpTableColumns.unused; - vm.selectedColumns = angular.copy(wpTableColumns.getColumns()); - - vm.impaired = ConfigurationService.accessibilityModeEnabled(); - vm.selectedColumnMap = {}; - - vm.eeShowBanners = angular.element('body').hasClass('ee-banners-visible'); - - if (vm.impaired) { - vm.selectedColumns.forEach((column:QueryColumn) => { - vm.selectedColumnMap[column.id] = true; - }); - } - - vm.updateSelectedColumns = () => { - wpTableColumns.setColumns(vm.selectedColumns); - - columnsModal.deactivate(); - }; - - /** - * When a column is removed from the selection it becomes unused and hence available for - * selection again. When a column is added to the selection it becomes used and is - * therefore unavailable for selection. - * - * This function updates the unused columns according to the currently selected columns. - * - * @param selectedColumns Columns currently selected through the multi select box. - */ - vm.updateUnusedColumns = (selectedColumns:QueryColumn[]) => { - vm.unusedColumns = _.differenceBy(vm.availableColumns, selectedColumns, '$href'); - }; - - vm.setSelectedColumn = (column:QueryColumn) => { - if (vm.selectedColumnMap[column.id]) { - vm.selectedColumns.push(column); - } - else { - _.remove(vm.selectedColumns, (c: any) => c.id === column.id); - } - }; - - //hack to prevent dragging of close icons - $timeout(() => { - angular.element('.columns-modal-content .ui-select-match-close').on('dragstart', event => { - event.preventDefault(); - }); - }); - - $scope.$on('uiSelectSort:change', (event:any, args:any) => { - vm.selectedColumns = args.array; - }); -} - -wpControllersModule.controller('ColumnsModalController', ColumnsModalController); diff --git a/frontend/app/components/modals/columns-modal/columns-modal.service.html b/frontend/app/components/modals/columns-modal/columns-modal.service.html deleted file mode 100644 index 0cadff4b37..0000000000 --- a/frontend/app/components/modals/columns-modal/columns-modal.service.html +++ /dev/null @@ -1,89 +0,0 @@ -
-
- - -

{{ ::$ctrl.text.columnsLabel }}

- -
- - - - - {{ $item.name }} - -
-
-
- - - - -
- {{ ::$ctrl.text.multiSelectLabel }} -
-
- -
- - -
- -
-
-
- {{$ctrl.text.upsaleRelationColumns}} - -
-
- - -
-
-
diff --git a/frontend/app/components/modals/columns-modal/columns-modal.service.ts b/frontend/app/components/modals/columns-modal/columns-modal.service.ts deleted file mode 100644 index f5432a8a8a..0000000000 --- a/frontend/app/components/modals/columns-modal/columns-modal.service.ts +++ /dev/null @@ -1,40 +0,0 @@ -// -- copyright -// OpenProject is a project management system. -// Copyright (C) 2012-2015 the OpenProject Foundation (OPF) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License version 3. -// -// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -// Copyright (C) 2006-2013 Jean-Philippe Lang -// Copyright (C) 2010-2013 the ChiliProject Team -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// See doc/COPYRIGHT.rdoc for more details. -// ++ - -import {wpControllersModule} from '../../../angular-modules'; - -function columnsModalService(btfModal:any) { - return btfModal({ - controller: 'ColumnsModalController', - controllerAs: '$ctrl', - afterFocusOn: '#work-packages-settings-button', - templateUrl: '/components/modals/columns-modal/columns-modal.service.html' - }); -} - -wpControllersModule.factory('columnsModal', columnsModalService); diff --git a/frontend/app/components/modals/grouping-modal/grouping-modal.controller.ts b/frontend/app/components/modals/grouping-modal/grouping-modal.controller.ts deleted file mode 100644 index efdd434aa9..0000000000 --- a/frontend/app/components/modals/grouping-modal/grouping-modal.controller.ts +++ /dev/null @@ -1,54 +0,0 @@ -//-- copyright -// OpenProject is a project management system. -// Copyright (C) 2012-2015 the OpenProject Foundation (OPF) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License version 3. -// -// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -// Copyright (C) 2006-2013 Jean-Philippe Lang -// Copyright (C) 2010-2013 the ChiliProject Team -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// See doc/COPYRIGHT.rdoc for more details. -//++ - -import {wpControllersModule} from '../../../angular-modules'; -import {WorkPackageTableGroupByService} from '../../wp-fast-table/state/wp-table-group-by.service'; - -function GroupingModalController(this:any, - $scope:any, - groupingModal:any, - wpTableGroupBy:WorkPackageTableGroupByService, - I18n:op.I18n) { - this.name = 'GroupBy'; - this.closeMe = groupingModal.deactivate; - let emptyOption = {title: I18n.t('js.inplace.clear_value_label')}; - - $scope.vm = {}; - - wpTableGroupBy.onReady().then(() => { - $scope.vm.available = wpTableGroupBy.available; - $scope.vm.current = wpTableGroupBy.current; - }); - - $scope.updateGroupBy = () => { - wpTableGroupBy.set($scope.vm.current); - groupingModal.deactivate(); - }; -} - -wpControllersModule.controller('GroupingModalController', GroupingModalController); diff --git a/frontend/app/components/modals/grouping-modal/grouping-modal.service.html b/frontend/app/components/modals/grouping-modal/grouping-modal.service.html deleted file mode 100644 index c7ad8914da..0000000000 --- a/frontend/app/components/modals/grouping-modal/grouping-modal.service.html +++ /dev/null @@ -1,47 +0,0 @@ -
-
- - -

{{ ::I18n.t('js.label_group_by') }}

- -
-
- -
-
- -
-
-
- -
- - -
-
-
-
diff --git a/frontend/app/components/modals/grouping-modal/grouping-modal.service.ts b/frontend/app/components/modals/grouping-modal/grouping-modal.service.ts deleted file mode 100644 index 3c9bace38d..0000000000 --- a/frontend/app/components/modals/grouping-modal/grouping-modal.service.ts +++ /dev/null @@ -1,40 +0,0 @@ -//-- copyright -// OpenProject is a project management system. -// Copyright (C) 2012-2015 the OpenProject Foundation (OPF) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License version 3. -// -// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -// Copyright (C) 2006-2013 Jean-Philippe Lang -// Copyright (C) 2010-2013 the ChiliProject Team -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// See doc/COPYRIGHT.rdoc for more details. -//++ - -import {wpControllersModule} from '../../../angular-modules'; - -function groupingModalService(btfModal:any) { - return btfModal({ - controller: 'GroupingModalController', - controllerAs: '$ctrl', - afterFocusOn: '#work-packages-settings-button', - templateUrl: '/components/modals/grouping-modal/grouping-modal.service.html' - }); -} - -wpControllersModule.factory('groupingModal', groupingModalService); diff --git a/frontend/app/components/modals/sorting-modal/sorting-modal.controller.ts b/frontend/app/components/modals/sorting-modal/sorting-modal.controller.ts deleted file mode 100644 index 2168ab02d3..0000000000 --- a/frontend/app/components/modals/sorting-modal/sorting-modal.controller.ts +++ /dev/null @@ -1,107 +0,0 @@ -//-- copyright -// OpenProject is a project management system. -// Copyright (C) 2012-2015 the OpenProject Foundation (OPF) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License version 3. -// -// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -// Copyright (C) 2006-2013 Jean-Philippe Lang -// Copyright (C) 2010-2013 the ChiliProject Team -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// See doc/COPYRIGHT.rdoc for more details. -//++ - -import {wpControllersModule} from '../../../angular-modules'; -import {WorkPackageTableSortByService} from '../../wp-fast-table/state/wp-table-sort-by.service'; -import { - QUERY_SORT_BY_ASC, - QUERY_SORT_BY_DESC, - QuerySortByResource -} from '../../api/api-v3/hal-resources/query-sort-by-resource.service'; -import {QueryColumn} from '../../wp-query/query-column'; - -class SortModalObject { - constructor(public column: QueryColumn|null, - public direction: string) { - } -} - -function SortingModalController(this:any, - sortingModal:any, - $scope:any, - wpTableSortBy:WorkPackageTableSortByService, - I18n:op.I18n) { - this.name = 'Sorting'; - this.closeMe = sortingModal.deactivate; - - $scope.currentSortation = []; - $scope.availableColumns = []; - $scope.allColumns = []; - $scope.sortationObjects = []; - - wpTableSortBy.onReady().then(() => { - $scope.currentSortation = wpTableSortBy.currentSortBys; - let availableSortation = wpTableSortBy.available; - let allColumns:QueryColumn[] = _.map(availableSortation, sort => sort.column); - $scope.allColumns = _.uniqBy(allColumns, '$href'); - - _.each($scope.currentSortation, sort => { - $scope.sortationObjects.push(new SortModalObject(sort.column, - sort.direction.$href)); - }); - - fillUpSortElements(); - }); - - function fillUpSortElements() { - while ($scope.sortationObjects.length < 3) { - $scope.sortationObjects.push(new SortModalObject(null, QUERY_SORT_BY_ASC)); - } - } - - $scope.$watchCollection('sortationObjects', () => $scope.updatedSelection()); - - $scope.updatedSelection = () => { - let usedColumns = _.map($scope.sortationObjects, (object:SortModalObject) => object.column); - $scope.availableColumns = _.differenceBy($scope.allColumns, usedColumns, '$href'); - }; - - $scope.availableColumnsAndCurrent = (column:SortModalObject) => { - return _.uniqBy(_.concat($scope.availableColumns, _.compact([column])), '$href'); - }; - - $scope.updateSortation = () => { - let sortElements = ($scope.sortationObjects as SortModalObject[]) - .filter(object => object.column) - .map(object => _.find(wpTableSortBy.available, availableSort => - availableSort.column.$href === object.column!.$href && - availableSort.direction.$href === object.direction - )); - - wpTableSortBy.set(_.compact(sortElements)); - - sortingModal.deactivate(); - }; - - $scope.availableDirections = [ - {$href: QUERY_SORT_BY_ASC, name: I18n.t('js.label_ascending')}, - {$href: QUERY_SORT_BY_DESC, name: I18n.t('js.label_descending')} - ]; -} - -wpControllersModule.controller('SortingModalController', SortingModalController); diff --git a/frontend/app/components/modals/sorting-modal/sorting-modal.service.html b/frontend/app/components/modals/sorting-modal/sorting-modal.service.html deleted file mode 100644 index a1f11070e3..0000000000 --- a/frontend/app/components/modals/sorting-modal/sorting-modal.service.html +++ /dev/null @@ -1,56 +0,0 @@ -
- -
diff --git a/frontend/app/components/modals/sorting-modal/sorting-modal.service.ts b/frontend/app/components/modals/sorting-modal/sorting-modal.service.ts deleted file mode 100644 index 01d58728a3..0000000000 --- a/frontend/app/components/modals/sorting-modal/sorting-modal.service.ts +++ /dev/null @@ -1,40 +0,0 @@ -//-- copyright -// OpenProject is a project management system. -// Copyright (C) 2012-2015 the OpenProject Foundation (OPF) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License version 3. -// -// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -// Copyright (C) 2006-2013 Jean-Philippe Lang -// Copyright (C) 2010-2013 the ChiliProject Team -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// See doc/COPYRIGHT.rdoc for more details. -//++ - -import {wpControllersModule} from '../../../angular-modules'; - -function sortingModalService(btfModal:any) { - return btfModal({ - controller: 'SortingModalController', - controllerAs: '$ctrl', - afterFocusOn: '#work-packages-settings-button', - templateUrl: '/components/modals/sorting-modal/sorting-modal.service.html' - }); -} - -wpControllersModule.factory('sortingModal', sortingModalService); diff --git a/frontend/app/components/modals/timelines-modal/timelines-modal.controller.ts b/frontend/app/components/modals/timelines-modal/timelines-modal.controller.ts deleted file mode 100644 index 43508a5204..0000000000 --- a/frontend/app/components/modals/timelines-modal/timelines-modal.controller.ts +++ /dev/null @@ -1,75 +0,0 @@ -//-- copyright -// OpenProject is a project management system. -// Copyright (C) 2012-2015 the OpenProject Foundation (OPF) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License version 3. -// -// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -// Copyright (C) 2006-2013 Jean-Philippe Lang -// Copyright (C) 2010-2013 the ChiliProject Team -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// See doc/COPYRIGHT.rdoc for more details. -//++ - -import {wpControllersModule} from '../../../angular-modules'; -import {WorkPackageTableTimelineService} from '../../wp-fast-table/state/wp-table-timeline.service'; -import {WorkPackageTableColumnsService} from '../../wp-fast-table/state/wp-table-columns.service'; - -function TimelinesModalController(this:any, - timelinesModal:any, - $scope:any, - wpTableTimeline:WorkPackageTableTimelineService, - wpTableColumns:WorkPackageTableColumnsService, - I18n:op.I18n) { - this.name = 'Timelines'; - this.closeMe = timelinesModal.deactivate; - - $scope.text = { - apply: I18n.t('js.modals.button_apply'), - cancel: I18n.t('js.modals.button_cancel'), - close: I18n.t('js.close_popup_title'), - title: I18n.t('js.timelines.gantt_chart'), - labels: { - description: I18n.t('js.timelines.labels.description'), - bar: I18n.t('js.timelines.labels.bar'), - none: I18n.t('js.timelines.filter.noneSelection'), - left: I18n.t('js.timelines.labels.left'), - right: I18n.t('js.timelines.labels.right'), - farRight: I18n.t('js.timelines.labels.farRight') - } - }; - - // Current label models - const labels = wpTableTimeline.labels; - $scope.labels = _.clone(labels); - - // Available labels - const availableColumns = wpTableColumns - .allPropertyColumns - .sort((a, b) => a.name.localeCompare(b.name)); - - $scope.availableAttributes = [{ id: '', name: $scope.text.labels.none }].concat(availableColumns); - - // Save - $scope.updateLabels = () => { - wpTableTimeline.updateLabels($scope.labels); - timelinesModal.deactivate(); - }; -} - -wpControllersModule.controller('TimelinesModalController', TimelinesModalController); diff --git a/frontend/app/components/modals/timelines-modal/timelines-modal.service.html b/frontend/app/components/modals/timelines-modal/timelines-modal.service.html deleted file mode 100644 index 47543e7eb1..0000000000 --- a/frontend/app/components/modals/timelines-modal/timelines-modal.service.html +++ /dev/null @@ -1,45 +0,0 @@ -
- -
diff --git a/frontend/app/components/modals/timelines-modal/timelines-modal.service.ts b/frontend/app/components/modals/timelines-modal/timelines-modal.service.ts deleted file mode 100644 index f890855b49..0000000000 --- a/frontend/app/components/modals/timelines-modal/timelines-modal.service.ts +++ /dev/null @@ -1,40 +0,0 @@ -//-- copyright -// OpenProject is a project management system. -// Copyright (C) 2012-2015 the OpenProject Foundation (OPF) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License version 3. -// -// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -// Copyright (C) 2006-2013 Jean-Philippe Lang -// Copyright (C) 2010-2013 the ChiliProject Team -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// See doc/COPYRIGHT.rdoc for more details. -//++ - -import {wpControllersModule} from '../../../angular-modules'; - -function timelinesModalService(btfModal:any) { - return btfModal({ - controller: 'TimelinesModalController', - controllerAs: '$ctrl', - afterFocusOn: '#work-packages-settings-button', - templateUrl: '/components/modals/timelines-modal/timelines-modal.service.html' - }); -} - -wpControllersModule.factory('timelinesModal', timelinesModalService); diff --git a/frontend/app/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.ts b/frontend/app/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.ts index 2a271746a2..bec67db504 100644 --- a/frontend/app/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.ts +++ b/frontend/app/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.ts @@ -64,23 +64,13 @@ export class OpSettingsMenuDirective extends OpContextMenuTrigger implements OnD constructor(readonly elementRef:ElementRef, readonly opContextMenu:OPContextMenuService, - readonly wpTableColumns:WorkPackageTableColumnsService, - readonly wpTableSortBy:WorkPackageTableSortByService, - readonly wpTableGroupBy:WorkPackageTableGroupByService, - readonly wpTableHierarchies:WorkPackageTableHierarchiesService, - readonly wpTableTimeline:WorkPackageTableTimelineService, - readonly wpTableSum:WorkPackageTableSumService, readonly wpListService:WorkPackagesListService, readonly authorisationService:AuthorisationService, readonly states:States, - @Inject(columnsModalToken) readonly columnsModal:any, - @Inject(sortingModalToken) readonly sortingModal:any, - @Inject(groupingModalToken) readonly groupingModal:any, @Inject(shareModalToken) readonly shareModal:any, @Inject(saveModalToken) readonly saveModal:any, @Inject(settingsModalToken) readonly settingsModal:any, @Inject(exportModalToken) readonly exportModal:any, - @Inject(timelinesModalToken) readonly timelinesModal:any, @Inject(I18nToken) readonly I18n:op.I18n) { super(elementRef, opContextMenu); @@ -260,16 +250,6 @@ export class OpSettingsMenuDirective extends OpContextMenuTrigger implements OnD linkText: this.query.results.customFields && this.query.results.customFields.name, icon: 'icon-custom-fields', onClick: () => false - }, - { - // Timelines modal - disabled: !this.wpTableTimeline.isVisible, - linkText: this.I18n.t('js.timelines.gantt_chart') + ' ...', - icon: 'icon-view-timeline', - onClick: () => { - this.timelinesModal.activate(); - return true; - } } ]; } diff --git a/frontend/app/components/op-modals/modals/columns-modal.component.html b/frontend/app/components/op-modals/modals/columns-modal.component.html deleted file mode 100644 index 73efc27602..0000000000 --- a/frontend/app/components/op-modals/modals/columns-modal.component.html +++ /dev/null @@ -1,61 +0,0 @@ -
-
- - -

- -
- -
- -
- - -
- -
-
-
- {{text.upsaleRelationColumns}} - -
-
- - -
-
-
diff --git a/frontend/app/components/op-modals/modals/columns-modal.component.ts b/frontend/app/components/op-modals/modals/columns-modal.component.ts deleted file mode 100644 index 41cc60d30e..0000000000 --- a/frontend/app/components/op-modals/modals/columns-modal.component.ts +++ /dev/null @@ -1,120 +0,0 @@ -import {Component, ElementRef, Inject, OnInit} from '@angular/core'; -import {I18nToken, OpModalLocalsToken} from 'core-app/angular4-transition-utils'; -import {OpModalLocalsMap} from 'core-components/op-modals/op-modal.types'; -import {QueryColumn} from 'core-components/wp-query/query-column'; -import {ConfigurationService} from 'core-components/common/config/configuration.service'; -import {WorkPackageTableColumnsService} from 'core-components/wp-fast-table/state/wp-table-columns.service'; -import {OpModalComponent} from 'core-components/op-modals/op-modal.component'; - -@Component({ - template: require('!!raw-loader!./columns-modal.component.html') -}) -export class ColumnsModalComponent extends OpModalComponent { - - /* Close on escape? */ - public closeOnEscape = false; - - /* Close on outside click */ - public closeOnOutsideClick = false; - - public $element:JQuery; - - public text = { - closePopup: this.I18n.t('js.close_popup_title'), - columnsLabel: this.I18n.t('js.label_columns'), - selectedColumns: this.I18n.t('js.description_selected_columns'), - multiSelectLabel: this.I18n.t('js.work_packages.label_column_multiselect'), - applyButton: this.I18n.t('js.modals.button_apply'), - cancelButton: this.I18n.t('js.modals.button_cancel'), - upsaleRelationColumns: this.I18n.t('js.modals.upsale_relation_columns'), - upsaleRelationColumnsLink: this.I18n.t('js.modals.upsale_relation_columns_link') - }; - - - public availableColumns = this.wpTableColumns.all; - public unusedColumns = this.wpTableColumns.unused; - public selectedColumns = angular.copy(this.wpTableColumns.getColumns()); - - public impaired = this.ConfigurationService.accessibilityModeEnabled(); - public selectedColumnMap:{ [id:string]: boolean } = {}; - - public eeShowBanners:boolean; - - - -// //hack to prevent dragging of close icons -// $timeout(() => { -// angular.element('.columns-modal-content .ui-select-match-close').on('dragstart', event => { -// event.preventDefault(); -// }); -// }); -// -// $scope.$on('uiSelectSort:change', (event:any, args:any) => { -// vm.selectedColumns = args.array; -// }); - - - constructor(@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap, - @Inject(I18nToken) readonly I18n:op.I18n, - readonly wpTableColumns:WorkPackageTableColumnsService, - readonly ConfigurationService:ConfigurationService, - readonly elementRef:ElementRef) { - super(locals, elementRef); - } - - ngOnInit() { - this.$element = jQuery(this.elementRef.nativeElement); - this.impaired = true; // TODO - this.eeShowBanners = angular.element('body').hasClass('ee-banners-visible'); - - if (this.impaired) { - this.selectedColumns.forEach((column:QueryColumn) => { - this.selectedColumnMap[column.id] = true; - }); - } - } - - public updateSelectedColumns() { - this.wpTableColumns.setColumns(this.selectedColumns); - this.service.close(); - } - -/** - * When a column is removed from the selection it becomes unused and hence available for - * selection again. When a column is added to the selection it becomes used and is - * therefore unavailable for selection. - * - * This function updates the unused columns according to the currently selected columns. - * - * @param selectedColumns Columns currently selected through the multi select box. - */ - public updateUnusedColumns(selectedColumns:QueryColumn[]) { - this.unusedColumns = _.differenceBy(this.availableColumns, selectedColumns, '$href'); - } - - public setSelectedColumn(column:QueryColumn) { - if (this.selectedColumnMap[column.id]) { - this.selectedColumns.push(column); - } - else { - _.remove(this.selectedColumns, (c:QueryColumn) => c.id === column.id); - } - } - - /** - * Called when the user attempts to close the modal window. - * The service will close this modal if this method returns true - * @returns {boolean} - */ - public onClose():boolean { - this.afterFocusOn.focus(); - return true; - } - - public onOpen(modalElement:JQuery) { - } - - protected get afterFocusOn():JQuery { - return this.$element; - } -} diff --git a/frontend/app/components/wp-table/configuration-modal/tabs/timelines-tab.component.html b/frontend/app/components/wp-table/configuration-modal/tabs/timelines-tab.component.html index d6f4191b2a..1674c483ae 100644 --- a/frontend/app/components/wp-table/configuration-modal/tabs/timelines-tab.component.html +++ b/frontend/app/components/wp-table/configuration-modal/tabs/timelines-tab.component.html @@ -20,6 +20,7 @@ +