diff --git a/client/src/app/isari-data.service.ts b/client/src/app/isari-data.service.ts index 168e7e9c..f598cf06 100644 --- a/client/src/app/isari-data.service.ts +++ b/client/src/app/isari-data.service.ts @@ -315,7 +315,7 @@ export class IsariDataService { return Observable.of([]); } - const url = `${this.dataUrl}/${mongoSchema2Api[feature]}/${values.join(',')}/string`; + const url = `${this.dataUrl}/${mongoSchema2Api[feature] || feature}/${values.join(',')}/string`; return this.http.get(url, this.getHttpOptions()) .map(response => response.json()); // .map(item => item.value); diff --git a/client/src/app/log-table/log-table.component.css b/client/src/app/log-table/log-table.component.css index c84bb04d..8fa27243 100644 --- a/client/src/app/log-table/log-table.component.css +++ b/client/src/app/log-table/log-table.component.css @@ -1,6 +1,7 @@ table { width: 100%; display: table; + margin-top: 1em; } table { @@ -14,10 +15,6 @@ th { font-family: Roboto, "Helvetica Neue", sans-serif; } -table tbody tr { - cursor: pointer; -} - table.bordered > thead > tr, table.bordered > tbody > tr { border-bottom: 1px solid #d0d0d0; @@ -36,7 +33,7 @@ table.striped > tbody > tr > td { vertical-align: top; } -table.striped > tbody > tr > td > p { +table.striped > tbody > tr > td p { margin: 0; } @@ -54,7 +51,7 @@ thead { } td, th { - padding: 15px 5px; + padding: 5px; display: table-cell; text-align: left; vertical-align: middle; diff --git a/client/src/app/log-table/log-table.component.html b/client/src/app/log-table/log-table.component.html index de06a4a3..f8c356d9 100644 --- a/client/src/app/log-table/log-table.component.html +++ b/client/src/app/log-table/log-table.component.html @@ -3,7 +3,16 @@ {{ 'editLogs.date' | translate }} - {{ 'editLogs.object.' + feature | translate }} + + + {{ 'editLogs.actions.all' | translate }} @@ -11,20 +20,24 @@ - - + {{ 'editLogs.fields' | translate }} + + +
+ +
{{ 'editLogs.lab' | translate }}
+
{{ 'editLogs.role' | translate }}
+
- {{ 'editLogs.lab' | translate }} - {{ 'editLogs.role' | translate }} - {{ 'editLogs.fields' | translate }} @@ -36,19 +49,24 @@ {{ 'editLogs.actions.' + log.action | translate }} - {{ log.who.name }} -

- {{ labs[role.lab]?.value }} -

+

{{ label.join(' : ') }}

- -

{{ role._label }}

- - -

{{ label.join(' : ') }}

+ +
+
{{ log.who.name }}
+
+

+ {{ labs[role.lab]?.value }} +

+
+
+

{{ role._label }}

+
+
+ diff --git a/client/src/app/log-table/log-table.component.ts b/client/src/app/log-table/log-table.component.ts index 0ed8f161..60f45882 100644 --- a/client/src/app/log-table/log-table.component.ts +++ b/client/src/app/log-table/log-table.component.ts @@ -11,19 +11,15 @@ import { Component, Input, OnInit, Output, EventEmitter, OnChanges } from '@angu export class LogTableComponent implements OnInit { actions = ['create', 'update', 'delete']; - // { value: '', label: 'all' }, - // { value: 'create', label: 'create' }, - // { value: 'update', label: 'update' }, - // { value: 'delete', label: 'delete' } - // ]; - field: { api: any, src: any, stringValue: any } = { api: null, src: null, stringValue: null }; + whoSettings: { api: any, src: any, stringValue: any } = { api: null, src: null, stringValue: null }; + itemSettings: { api: any, src: any, stringValue: any } = { api: null, src: null, stringValue: null }; filterForm: FormGroup; @Input() logs: any[]; @Input() labs: any[]; @Input() feature: string; - @Input() options: { id?: string, skip?: number, limit?: number, action?: string, whoID: string }; + @Input() options: { itemID?: string, skip?: number, limit?: number, action?: string, whoID: string }; @Output() onOptionsChange = new EventEmitter(); constructor( @@ -36,6 +32,7 @@ export class LogTableComponent implements OnInit { [ 'action', 'whoID', + 'itemID', ].forEach(key => { this.filterForm.addControl(key, new FormControl(this.options[key] || '')); }); @@ -45,9 +42,14 @@ export class LogTableComponent implements OnInit { }); // people autocomplete (whoID) - this.field.api = this.isariDataService.getSchemaApi('people'); - this.field.src = this.isariDataService.srcForeignBuilder('people'); - this.field.stringValue = this.isariDataService.getForeignLabel('People', this.options.whoID); + this.whoSettings.api = this.isariDataService.getSchemaApi('people'); + this.whoSettings.src = this.isariDataService.srcForeignBuilder('people'); + this.whoSettings.stringValue = this.isariDataService.getForeignLabel('People', this.options.whoID); + + // item autocomplete (itemID) + this.itemSettings.api = this.isariDataService.getSchemaApi(this.feature); + this.itemSettings.src = this.isariDataService.srcForeignBuilder(this.feature); + this.itemSettings.stringValue = this.isariDataService.getForeignLabel(this.feature, this.options.itemID); } navigatePrev() {