extension sync

This commit is contained in:
Mo Bitar
2017-01-05 15:42:35 -06:00
parent 117d6fca4e
commit 54ac4ffd15
10 changed files with 542 additions and 174 deletions

View File

@@ -1,14 +1,3 @@
class Extension extends Item {
constructor(json) {
super(json);
_.merge(this, json);
this.actions = this.actions.map(function(action){
return new Action(action);
})
}
}
class Action {
constructor(json) {
_.merge(this, json);
@@ -22,3 +11,44 @@ class Action {
}
}
}
class Extension extends Item {
constructor(json) {
super(json);
_.merge(this, json);
this.content_type = "Extension";
}
mapContentToLocalProperties(contentObject) {
super.mapContentToLocalProperties(contentObject)
this.name = contentObject.name;
this.url = contentObject.url;
this.actions = contentObject.actions.map(function(action){
return new Action(action);
})
}
updateFromExternalResponseItem(externalResponseItem) {
_.merge(this, externalResponseItem);
this.actions = externalResponseItem.actions.map(function(action){
return new Action(action);
})
}
referenceParams() {
return null;
}
structureParams() {
var params = {
name: this.name,
url: this.url,
actions: this.actions
};
_.merge(params, super.structureParams());
return params;
}
}