Vue Attract: Sort/filterable table based on Vue

Initial commit implementing sortable and filterable tables for attract
using Vue.
This commit is contained in:
2019-02-12 09:08:37 +01:00
parent 66212ec5fa
commit 5e73720d91
51 changed files with 1375 additions and 485 deletions

View File

@@ -0,0 +1,41 @@
class ProjectAuth {
constructor() {
this.canCreateTask = false;
this.canCreateAsset = false;
}
}
class Auth {
constructor() {
this.perProjectAuth = {}
}
canUserCreateTask(projectId) {
let projectAuth = this.getProjectAuth(projectId);
return projectAuth.canCreateTask;
}
canUserCreateAsset(projectId) {
let projectAuth = this.getProjectAuth(projectId);
return projectAuth.canCreateAsset;
}
setUserCanCreateTask(projectId, canCreateTask) {
let projectAuth = this.getProjectAuth(projectId);
projectAuth.canCreateTask = canCreateTask;
}
setUserCanCreateAsset(projectId, canCreateAsset) {
let projectAuth = this.getProjectAuth(projectId);
projectAuth.canCreateAsset = canCreateAsset;
}
getProjectAuth(projectId) {
this.perProjectAuth[projectId] = this.perProjectAuth[projectId] || new ProjectAuth();
return this.perProjectAuth[projectId];
}
}
let AttractAuth = new Auth();
export {AttractAuth}