diff --git a/src/app/changelog/changelog.component.html b/src/app/changelog/changelog.component.html
index 9d59d0c..d2c64d8 100644
--- a/src/app/changelog/changelog.component.html
+++ b/src/app/changelog/changelog.component.html
@@ -27,9 +27,22 @@
Action |
Data |
-
+
{{entry.date}} |
{{entry.action}} |
{{entry.data | json}} |
+
+
+ Date
+ {{changelog[modalDetail].date}}
+ Action
+ {{changelog[modalDetail].action}}
+ Collection
+ {{changelog[modalDetail].collection}}
+ Conditions
+ {{changelog[modalDetail].conditions | json}}
+ Data
+ {{changelog[modalDetail].data | json}}
+
diff --git a/src/app/changelog/changelog.component.scss b/src/app/changelog/changelog.component.scss
index c36c6b1..aec193a 100644
--- a/src/app/changelog/changelog.component.scss
+++ b/src/app/changelog/changelog.component.scss
@@ -1,3 +1,5 @@
+@import "~@inst-iot/bosch-angular-ui-components/styles/variables/colors";
+
.header {
& > * {
@@ -8,3 +10,12 @@
float: right;
}
}
+
+tr.clickable {
+ background: none;
+ transition: background-color 0.5s;
+
+ &:hover {
+ background: $color-gray-mercury;
+ }
+}
diff --git a/src/app/changelog/changelog.component.ts b/src/app/changelog/changelog.component.ts
index 55da828..5efa4d0 100644
--- a/src/app/changelog/changelog.component.ts
+++ b/src/app/changelog/changelog.component.ts
@@ -1,6 +1,7 @@
-import { Component, OnInit } from '@angular/core';
+import {Component, OnInit, TemplateRef} from '@angular/core';
import {ChangelogModel} from '../models/changelog.model';
import {ApiService} from '../services/api.service';
+import {ModalService} from '@inst-iot/bosch-angular-ui-components';
@Component({
selector: 'app-changelog',
@@ -12,9 +13,11 @@ export class ChangelogComponent implements OnInit {
timestamp = new Date();
pageSize = 25;
changelog: ChangelogModel[] = [];
+ modalDetail = 0;
constructor(
- private api: ApiService
+ private api: ApiService,
+ private modal: ModalService
) { }
ngOnInit(): void {
@@ -22,11 +25,19 @@ export class ChangelogComponent implements OnInit {
}
loadChangelog(page = 0) {
- this.api.get(`/changelog/${this.timestamp.toISOString()}/${page}/${this.pageSize}`, data => {
+ this.api.get(`/changelog/${
+ new Date(new Date(this.timestamp).getTime() - new Date(this.timestamp).getTimezoneOffset() * 60000).toISOString()
+ }/${page}/${this.pageSize}`, data => {
this.changelog = data.map(e => new ChangelogModel().deserialize(e));
- this.timestamp = new Date(this.changelog[0].date);
- console.log(this.changelog);
+ if (page) {
+ this.timestamp = new Date(this.changelog[0].date);
+ }
});
}
+ showDetails(i: number, modal: TemplateRef) {
+ this.modalDetail = i;
+ this.modal.open(modal).then(() => {});
+ }
+
}