System smart tags

This commit is contained in:
Mo Bitar
2019-01-10 16:03:16 -06:00
parent ffc636ca48
commit e05580d597
9 changed files with 3515 additions and 86 deletions

View File

@@ -22,6 +22,8 @@ class ModelManager extends SFModelManager {
this.components = [];
this.storageManager = storageManager;
this.buildSystemSmartTags();
}
handleSignout() {
@@ -119,6 +121,21 @@ class ModelManager extends SFModelManager {
return this.itemsMatchingPredicates([contentTypePredicate, predicate]);
}
buildSystemSmartTags() {
this.systemSmartTags = SNSmartTag.systemSmartTags();
}
getSmartTagWithId(id) {
return this.getSmartTags().find((candidate) => candidate.uuid == id);
}
getSmartTags() {
let userTags = this.validItemsForContentType("SN|SmartTag").sort((a, b) => {
return a.content.title < b.content.title ? -1 : 1;
});
return this.systemSmartTags.concat(userTags);
}
/*
Misc
*/