Fixed db set date & show only changed fields in history view #246
This commit is contained in:
@@ -133,7 +133,6 @@ export class Queries {
|
||||
discordId
|
||||
xp
|
||||
server
|
||||
leftServer
|
||||
deleted
|
||||
dateFrom
|
||||
dateTo
|
||||
|
@@ -20,8 +20,20 @@ export class HistoryBtnComponent implements OnInit {
|
||||
}
|
||||
|
||||
openHistory(): void {
|
||||
console.log("history", this.history);
|
||||
this.showSidebar = true;
|
||||
let oldHistory: Partial<History> = {};
|
||||
for (const history of this.history) {
|
||||
const attributes = Object.keys(history).map((key) => {
|
||||
return key;
|
||||
});
|
||||
for (const attribute of attributes) {
|
||||
if (history[attribute] === oldHistory[attribute]) {
|
||||
delete oldHistory[attribute];
|
||||
}
|
||||
}
|
||||
|
||||
oldHistory = history;
|
||||
}
|
||||
}
|
||||
|
||||
getAttributeTranslationKey(key: string) {
|
||||
|
@@ -1 +0,0 @@
|
||||
<p>history works!</p>
|
@@ -1,23 +0,0 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HistoryComponent } from './history.component';
|
||||
|
||||
describe('HistoryComponent', () => {
|
||||
let component: HistoryComponent;
|
||||
let fixture: ComponentFixture<HistoryComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ HistoryComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(HistoryComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -1,10 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-history',
|
||||
templateUrl: './history.component.html',
|
||||
styleUrls: ['./history.component.scss']
|
||||
})
|
||||
export class HistoryComponent {
|
||||
|
||||
}
|
@@ -23,7 +23,6 @@ import { PanelModule } from "primeng/panel";
|
||||
import { InputNumberModule } from "primeng/inputnumber";
|
||||
import { ImageModule } from "primeng/image";
|
||||
import { SidebarModule } from "primeng/sidebar";
|
||||
import { HistoryComponent } from "./components/history/history.component";
|
||||
import { HistoryBtnComponent } from './components/history-btn/history-btn.component';
|
||||
|
||||
|
||||
@@ -32,7 +31,6 @@ import { HistoryBtnComponent } from './components/history-btn/history-btn.compon
|
||||
AuthRolePipe,
|
||||
IpAddressPipe,
|
||||
BoolPipe,
|
||||
HistoryComponent,
|
||||
HistoryBtnComponent,
|
||||
],
|
||||
imports: [
|
||||
|
@@ -23,4 +23,4 @@
|
||||
"Name": "sh-edraft-dark-theme"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user