confirm delete, extension load actions

This commit is contained in:
Mo Bitar
2017-01-29 16:59:06 -06:00
parent 2274e6835d
commit 72afcd7da4
8 changed files with 36 additions and 22 deletions

View File

@@ -1,18 +1,20 @@
class Action {
constructor(json) {
_.merge(this, json);
this.running = false; // in case running=true was synced with server since model is uploaded nondiscriminatory
this.error = false;
if(this.lastExecuted) {
// is string
this.lastExecuted = new Date(this.lastExecuted);
}
_.merge(this, json);
this.running = false; // in case running=true was synced with server since model is uploaded nondiscriminatory
this.error = false;
if(this.lastExecuted) {
// is string
this.lastExecuted = new Date(this.lastExecuted);
}
}
get permissionsString() {
permissionsString() {
console.log("permissions", this.permissions);
if(!this.permissions) {
return "";
}
var permission = this.permissions.charAt(0).toUpperCase() + this.permissions.slice(1); // capitalize first letter
permission += ": ";
for(var contentType of this.content_types) {
@@ -28,7 +30,7 @@ class Action {
return permission;
}
get encryptionModeString() {
encryptionModeString() {
if(this.verb != "post") {
return null;
}
@@ -54,6 +56,12 @@ class Extension extends Item {
this.encrypted = true;
this.content_type = "Extension";
if(json.actions) {
this.actions = json.actions.map(function(action){
return new Action(action);
})
}
}
actionsInGlobalContext() {