diff --git a/client/client/src/log/index.html b/client/client/src/log/index.html index b3f6bf429..c61dc4cc3 100644 --- a/client/client/src/log/index.html +++ b/client/client/src/log/index.html @@ -7,83 +7,4 @@ data="$ctrl.logs"> - - - - History - - - - Date - Changed by - Model - Action - Instance - Before - After - - - - - - {{::clientLog.creationDate | date:'dd/MM/yyyy HH:mm'}} -
-
- Changed by: - {{::clientLog.user.name}} -
-
- Model: - {{::clientLog.changedModel}} -
-
- Action: - {{::clientLog.action}} -
-
- Instance: - {{::clientLog.changedModelValue}} -
-
-
- - {{::clientLog.user.name}} - - - {{::clientLog.changedModel}} - - - {{::clientLog.action}} - - - {{::clientLog.changedModelValue}} - - - -
- {{::old.key}}: - {{::old.value}} -
-
-
- - -
- {{::new.key}}: - {{::new.value}} -
-
-
-
-
- - No results - -
-
- - -
-
+ \ No newline at end of file diff --git a/client/client/src/log/index.js b/client/client/src/log/index.js index c0ee42009..18cc42a07 100644 --- a/client/client/src/log/index.js +++ b/client/client/src/log/index.js @@ -1,5 +1,4 @@ import ngModule from '../module'; -import './style.scss'; class Controller { constructor($scope, $stateParams) { @@ -22,18 +21,17 @@ class Controller { set logs(value) { this._logs = value; - if (this.logs) { - this.logs.forEach((log) => { + if (this.logs) + this.logs.forEach(log => { log.oldProperties = this.getInstance(log.oldInstance); log.newProperties = this.getInstance(log.newInstance); }); - } } getInstance(instance) { const properties = []; - Object.keys(instance).forEach((property) => { + Object.keys(instance).forEach(property => { properties.push({key: property, value: instance[property]}); }); diff --git a/client/core/src/components/index.js b/client/core/src/components/index.js index 3914fc656..ab2cea5e9 100644 --- a/client/core/src/components/index.js +++ b/client/core/src/components/index.js @@ -42,3 +42,4 @@ import './chip'; import './input-number'; import './input-time'; import './fetched-tags'; +import './log'; diff --git a/client/core/src/components/log/index.html b/client/core/src/components/log/index.html new file mode 100644 index 000000000..1f19a49cf --- /dev/null +++ b/client/core/src/components/log/index.html @@ -0,0 +1,80 @@ + + + + History + + + + Date + Changed by + Model + Action + Instance + Before + After + + + + + + {{::log.creationDate | date:'dd/MM/yyyy HH:mm'}} +
+
+ Changed by: + {{::log.user.name}} +
+
+ Model: + {{::log.changedModel}} +
+
+ Action: + {{::log.action}} +
+
+ Instance: + {{::log.changedModelValue}} +
+
+
+ + {{::log.user.name}} + + + {{::log.changedModel}} + + + {{::log.action}} + + + {{::log.changedModelValue}} + + + +
+ {{::old.key}}: + {{::old.value}} +
+
+
+ + +
+ {{::new.key}}: + {{::new.value}} +
+
+
+
+
+ + No results + +
+
+ + +
+
diff --git a/client/core/src/components/log/index.js b/client/core/src/components/log/index.js new file mode 100644 index 000000000..7e5a8bd89 --- /dev/null +++ b/client/core/src/components/log/index.js @@ -0,0 +1,9 @@ +import ngModule from '../../module'; +import './style.scss'; + +ngModule.component('vnLog', { + template: require('./index.html'), + bindings: { + model: '<' + } +}); diff --git a/client/client/src/log/locale/es.yml b/client/core/src/components/log/locale/es.yml similarity index 100% rename from client/client/src/log/locale/es.yml rename to client/core/src/components/log/locale/es.yml diff --git a/client/client/src/log/style.scss b/client/core/src/components/log/style.scss similarity index 96% rename from client/client/src/log/style.scss rename to client/core/src/components/log/style.scss index a11cf5933..1a6dacf8a 100644 --- a/client/client/src/log/style.scss +++ b/client/core/src/components/log/style.scss @@ -1,6 +1,6 @@ @import 'colors'; -vn-client-log { +vn-log { vn-td { vertical-align: initial !important; }