diff --git a/frontend/app/index.html b/frontend/app/index.html index ec9828b2ee..38cfce297a 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -129,6 +129,7 @@ + diff --git a/frontend/app/scripts/components/common/custom-field-input.component.js b/frontend/app/scripts/components/common/custom-field-input.component.js new file mode 100644 index 0000000000..159fcfdfca --- /dev/null +++ b/frontend/app/scripts/components/common/custom-field-input.component.js @@ -0,0 +1,23 @@ +(function() { + 'use strict'; + + angular.module('theHiveComponents') + .component('customFieldInput', { + controller: function() { + this.updateField = function(newValue) { + this.onUpdate({ + fieldName: ['customFields', this.field.reference, this.field.type].join('.'), + value: newValue + }); + }; + }, + controllerAs: '$ctrl', + templateUrl: 'views/components/common/custom-field-input.component.html', + bindings: { + field: '<', + value: '=', + onUpdate: '&', + editable: '<' + } + }); +})(); diff --git a/frontend/app/views/components/common/custom-field-input.component.html b/frontend/app/views/components/common/custom-field-input.component.html new file mode 100644 index 0000000000..cde52043e6 --- /dev/null +++ b/frontend/app/views/components/common/custom-field-input.component.html @@ -0,0 +1,39 @@ +
+
{{$ctrl.field.name}}
+
+ +
+
+ + + + + + + + + + + Not Editable +
+
+ {{$ctrl.value | shortDate}} + + {{$ctrl.value}} + Not Specified + +
+
diff --git a/frontend/app/views/partials/alert/custom.fields.html b/frontend/app/views/partials/alert/custom.fields.html index 0b314ad0b3..8b775c9375 100644 --- a/frontend/app/views/partials/alert/custom.fields.html +++ b/frontend/app/views/partials/alert/custom.fields.html @@ -3,68 +3,16 @@ No aditional information have been specified -
+
-
-
{{fieldDef.name}}
-
- -
- -
- - - - - - - - - - - Not Editable -
-
+
- -
-
-
-
-
-
{{fieldDef.name}}
-
- {{dialog.event.customFields[fieldDef.reference][fieldDef.type] | shortDate}} - - {{dialog.event.customFields[fieldDef.reference][fieldDef.type]}} - Not Specified - -
-
-
-
-
- -
diff --git a/frontend/app/views/partials/case/details/custom.fields.html b/frontend/app/views/partials/case/details/custom.fields.html index 1791150b0e..f199cd54f3 100644 --- a/frontend/app/views/partials/case/details/custom.fields.html +++ b/frontend/app/views/partials/case/details/custom.fields.html @@ -17,62 +17,14 @@

No additional information have been specified -
-
+
+
-
-
{{fieldDef.name}}
-
- -
-
- - - - - - Not Editable -
-
+
- -
-
-
-
-
-
{{fieldDef.name}}
-
- {{caze.customFields[fieldDef.reference][fieldDef.type] | shortDate}} - - {{caze.customFields[fieldDef.reference][fieldDef.type]}} - Not Specified - -
-
-
-
- -
-