diff --git a/frontend/app/index.html b/frontend/app/index.html index 3dba14c63f..d3d1b3c24b 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -266,6 +266,7 @@ + diff --git a/frontend/app/scripts/components/organisation/OrgCustomTagsListCmp.js b/frontend/app/scripts/components/organisation/OrgCustomTagsListCmp.js index 30ac39a66f..3cd8116668 100644 --- a/frontend/app/scripts/components/organisation/OrgCustomTagsListCmp.js +++ b/frontend/app/scripts/components/organisation/OrgCustomTagsListCmp.js @@ -87,6 +87,16 @@ }) } + self.updateTag = function(id, value) { + TagSrv.updateTag(id, {predicate: value}) + .then(function(/*response*/) { + NotificationSrv.success('Tag value updated successfully'); + }) + .catch(function(err) { + NotificationSrv.error('Tag list', err.data, err.status); + }) + } + // Filtering this.toggleFilters = function () { this.filtering.toggleFilters(); diff --git a/frontend/app/scripts/directives/tag-item.js b/frontend/app/scripts/directives/tag-item.js index c868207b61..0d060ec5c0 100644 --- a/frontend/app/scripts/directives/tag-item.js +++ b/frontend/app/scripts/directives/tag-item.js @@ -18,7 +18,7 @@ scope.bgColor = scope.colour || TaxonomyCacheSrv.getColour(scope.value) || TaxonomyCacheSrv.getColour('_freetags_:' + scope.value) || - '#3c8dbc'; + '#000000'; } else { scope.tag = _.without([ scope.value.namespace, @@ -26,7 +26,7 @@ scope.value.predicate, scope.value.value ? ("=\"" + scope.value.value + "\"") : null ], null).join(''); - scope.bgColor = scope.value.colour || scope.colour || '#3c8dbc'; + scope.bgColor = scope.value.colour || scope.colour || '#000000'; } scope.$watch('colour', function(value) { @@ -35,6 +35,23 @@ } scope.bgColor = value; }); + + scope.$watch('value', function(value) { + if(!value) { + return; + } + + if(_.isString(value)) { + scope.tag = value; + } else { + scope.tag = _.without([ + value.namespace, + ':', + value.predicate, + value.value ? ("=\"" + value.value + "\"") : null + ], null).join(''); + } + }); } }; }); diff --git a/frontend/app/scripts/directives/updatableTag.js b/frontend/app/scripts/directives/updatableTag.js new file mode 100644 index 0000000000..419462dd92 --- /dev/null +++ b/frontend/app/scripts/directives/updatableTag.js @@ -0,0 +1,16 @@ +(function() { + 'use strict'; + angular.module('theHiveDirectives') + .directive('updatableTag', function(UtilsSrv) { + return { + 'restrict': 'E', + 'link': UtilsSrv.updatableLink, + 'templateUrl': 'views/directives/updatable-tag.html', + 'scope': { + 'value': '=?', + 'colour': '
- +
+ + diff --git a/frontend/app/views/directives/updatable-tag.html b/frontend/app/views/directives/updatable-tag.html new file mode 100644 index 0000000000..4dc9d724c6 --- /dev/null +++ b/frontend/app/views/directives/updatable-tag.html @@ -0,0 +1,26 @@ +
+ + + Not Specified + + + + + + +
+
+ + + + + + + +
+ +
@@ -43,6 +43,7 @@

Cases Alerts ObservablesTemplates By Dates @@ -67,7 +68,8 @@

- + + @@ -75,6 +77,7 @@

{{tag.extraData.usage.case}} {{tag.extraData.usage.alert}} {{tag.extraData.usage.observable}}{{tag.extraData.usage.templates}}