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-table/wp-table-refresh-request.se...

31 lines
870 B

import {InputState} from 'reactivestates';
import {opServicesModule} from '../../angular-modules';
import {States} from '../states.service';
export class WorkPackageTableRefreshService {
constructor(public states:States) {
}
/**
* Request a refresh to the work package table.
* @param visible Whether a loading indicator should be shown while changing
* @param reason a reason for logging purposes.
*/
public request(reason:string, visible:boolean = false, firstPage:boolean = false) {
this.state.putValue([visible, firstPage], reason);
}
/**
* Undo any potential pending refresh request
*/
public clear(reason:string) {
this.state.clear(reason);
}
public get state():InputState<boolean[]> {
return this.states.table.refreshRequired;
}
}
opServicesModule.service('wpTableRefresh', WorkPackageTableRefreshService);