diff --git a/app/assets/stylesheets/content/_table.sass b/app/assets/stylesheets/content/_table.sass index 23bf46fec9..da2d8ea0ae 100644 --- a/app/assets/stylesheets/content/_table.sass +++ b/app/assets/stylesheets/content/_table.sass @@ -231,6 +231,10 @@ table.generic-table text-align: right overflow: visible min-width: 1em + visibility: hidden + + &:hover > .dropdown-indicator + visibility: visible .generic-table--cell-controls white-space: nowrap diff --git a/frontend/app/components/wp-create/wp-create.controller.ts b/frontend/app/components/wp-create/wp-create.controller.ts index e649be0608..c7aab765f2 100644 --- a/frontend/app/components/wp-create/wp-create.controller.ts +++ b/frontend/app/components/wp-create/wp-create.controller.ts @@ -1,3 +1,4 @@ +import {WorkPackageTableSelection} from '../wp-fast-table/state/wp-table-selection.service'; // -- copyright // OpenProject is a project management system. // Copyright (C) 2012-2015 the OpenProject Foundation (OPF) @@ -75,6 +76,7 @@ export class WorkPackageCreateController { protected loadingIndicator, protected wpCreate:WorkPackageCreateService, protected wpEditModeState:WorkPackageEditModeStateService, + protected wpTableSelection:WorkPackageTableSelection, protected wpCacheService:WorkPackageCacheService) { this.newWorkPackageFromParams($state.params) @@ -111,7 +113,7 @@ export class WorkPackageCreateController { public refreshAfterSave(wp, successState) { this.wpEditModeState.onSaved(); - this.states.focusedWorkPackage.put(wp.id); + this.wpTableSelection.focusOn(wp.id); this.loadingIndicator.mainPage = this.$state.go(successState, {workPackageId: wp.id}) .then(() => { this.$rootScope.$emit('workPackagesRefreshInBackground'); diff --git a/frontend/app/components/wp-display/field-types/wp-display-progress-field.directive.html b/frontend/app/components/wp-display/field-types/wp-display-progress-field.directive.html index 6a86668ff4..55ebacd20c 100644 --- a/frontend/app/components/wp-display/field-types/wp-display-progress-field.directive.html +++ b/frontend/app/components/wp-display/field-types/wp-display-progress-field.directive.html @@ -1,5 +1,5 @@ - - + diff --git a/frontend/app/components/wp-display/wp-display-field/wp-display-field.module.ts b/frontend/app/components/wp-display/wp-display-field/wp-display-field.module.ts index 084f0f9600..bcfc32cf3b 100644 --- a/frontend/app/components/wp-display/wp-display-field/wp-display-field.module.ts +++ b/frontend/app/components/wp-display/wp-display-field/wp-display-field.module.ts @@ -85,7 +85,11 @@ export class DisplayField extends Field { workPackage: this.resource, name: this.name, displayText: displayText, - field: this + field: this, + vm: { + displayText: displayText, + field: this + } }); } diff --git a/frontend/app/components/wp-fast-table/handlers/cell/edit-cell-handler.ts b/frontend/app/components/wp-fast-table/handlers/cell/edit-cell-handler.ts index 87201273e5..cffe156c0f 100644 --- a/frontend/app/components/wp-fast-table/handlers/cell/edit-cell-handler.ts +++ b/frontend/app/components/wp-fast-table/handlers/cell/edit-cell-handler.ts @@ -31,7 +31,7 @@ export class EditCellHandler extends ClickOrEnterHandler implements TableEventHa evt.preventDefault(); // Locate the cell from event - let target = jQuery(evt.target); + let target = jQuery(evt.target).closest(`.${cellClassName}`); // Get the target field name let fieldName = target.data('fieldName'); diff --git a/frontend/app/components/wp-fast-table/state/wp-table-columns.service.ts b/frontend/app/components/wp-fast-table/state/wp-table-columns.service.ts index e485f68c43..dad4aa6289 100644 --- a/frontend/app/components/wp-fast-table/state/wp-table-columns.service.ts +++ b/frontend/app/components/wp-fast-table/state/wp-table-columns.service.ts @@ -81,7 +81,7 @@ export class WorkPackageTableColumnsService { */ public setColumns(columns:string[]) { this.columnsState.put(columns); - this.QueryService.getQuery().setColumns(columns); + this.QueryService.getQuery().setColumns(this.getColumns()); } /** diff --git a/frontend/app/components/wp-fast-table/state/wp-table-selection.service.ts b/frontend/app/components/wp-fast-table/state/wp-table-selection.service.ts index 130d73cde8..3badddf872 100644 --- a/frontend/app/components/wp-fast-table/state/wp-table-selection.service.ts +++ b/frontend/app/components/wp-fast-table/state/wp-table-selection.service.ts @@ -75,6 +75,17 @@ export class WorkPackageTableSelection { return _.size(this.currentState.selected); } + /** + * Switch the current focused work package to the given id, + * setting selection and focus on this WP. + */ + public focusOn(workPackgeId:string) { + let newState = this._emptyState; + newState.selected[workPackgeId] = true; + this.selectionState.put(newState); + this.states.focusedWorkPackage.put(workPackgeId); + } + /** * Toggle a single row selection state and update the state. * @param workPackageId diff --git a/spec/features/work_packages/work_packages_page.rb b/spec/features/work_packages/work_packages_page.rb index 8818e473cd..e0c04a1d7e 100644 --- a/spec/features/work_packages/work_packages_page.rb +++ b/spec/features/work_packages/work_packages_page.rb @@ -69,6 +69,8 @@ class WorkPackagesPage search_column! name select_found_column! name click_on 'Apply' + + expect(page).to have_selector('.generic-table--sort-header a', text: name.upcase) end def search_column!(column)