Show initial tag sidebar

This commit is contained in:
Johannes Zellner
2019-04-12 11:06:56 +02:00
parent 9f8dcdf8ea
commit f89f201764
4 changed files with 66 additions and 0 deletions
+15
View File
@@ -165,6 +165,7 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
};
this._installedApps = [];
this._installedAppsById = {};
this._appTags = [];
this._clientId = '<%= oauth.clientId %>';
this._clientSecret = '<%= oauth.clientSecret %>';
// window.location fallback for websocket connections which do not have relative uris
@@ -281,6 +282,10 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
return this._installedApps;
};
Client.prototype.getAppTags = function () {
return this._appTags;
};
Client.prototype.getUserInfo = function () {
return this._userInfo;
};
@@ -1459,6 +1464,16 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
}
this._installedAppsById[app.id] = this._installedApps[found];
// TODO this not very elegant
// update app tags
tmp = this._installedApps
.map(function (app) { return app.tags || []; }) // return array of arrays
.reduce(function (a, i) { return a.concat(i); }, []) // merge all arrays into one
.filter(function (v, i, self) { return self.indexOf(v) === i; }); // filter duplicates
// keep tag array references
angular.copy(tmp, this._appTags);
};
// this requires app:manage permissions