Fixed db set date & show only changed fields in history view #246

This commit is contained in:
2023-03-12 04:55:04 +01:00
parent ad00dce5d9
commit b1a0115e8b
29 changed files with 35 additions and 117 deletions

View File

@@ -133,7 +133,6 @@ export class Queries {
discordId
xp
server
leftServer
deleted
dateFrom
dateTo

View File

@@ -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) {

View File

@@ -1 +0,0 @@
<p>history works!</p>

View File

@@ -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();
});
});

View File

@@ -1,10 +0,0 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-history',
templateUrl: './history.component.html',
styleUrls: ['./history.component.scss']
})
export class HistoryComponent {
}

View File

@@ -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: [

View File

@@ -23,4 +23,4 @@
"Name": "sh-edraft-dark-theme"
}
]
}
}