Fix more tests

pull/5117/head
Oliver Günther 8 years ago
parent 300a4729b4
commit bc1f2738de
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 4
      app/assets/stylesheets/content/_table.sass
  2. 4
      frontend/app/components/wp-create/wp-create.controller.ts
  3. 4
      frontend/app/components/wp-display/field-types/wp-display-progress-field.directive.html
  4. 6
      frontend/app/components/wp-display/wp-display-field/wp-display-field.module.ts
  5. 2
      frontend/app/components/wp-fast-table/handlers/cell/edit-cell-handler.ts
  6. 2
      frontend/app/components/wp-fast-table/state/wp-table-columns.service.ts
  7. 11
      frontend/app/components/wp-fast-table/state/wp-table-selection.service.ts
  8. 2
      spec/features/work_packages/work_packages_page.rb

@ -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

@ -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');

@ -1,5 +1,5 @@
<span title="{{ $ctrl.displayText }}">
<progress-bar progress="$ctrl.displayText"
<span title="{{ vm.field.displayText }}">
<progress-bar progress="vm.field.value"
width="80px">
</progress-bar>
<span>

@ -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
}
});
}

@ -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');

@ -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());
}
/**

@ -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

@ -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)

Loading…
Cancel
Save