From b1a0115e8b4f1b1bb4b3e6f94b29f43ecb423e10 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 12 Mar 2023 04:55:04 +0100 Subject: [PATCH] Fixed db set date & show only changed fields in history view #246 --- .../migration/db_history_scripts/api_keys.sql | 5 +--- .../auth_user_users_relation.sql | 5 +--- .../db_history_scripts/auth_users.sql | 5 +--- .../db_history_scripts/auto_role_rules.sql | 5 +--- .../db_history_scripts/auto_roles.sql | 5 +--- .../migration/db_history_scripts/clients.sql | 5 +--- .../db_history_scripts/game_servers.sql | 5 +--- .../db_history_scripts/known_users.sql | 5 +--- .../migration/db_history_scripts/levels.sql | 5 +--- .../migration/db_history_scripts/servers.sql | 5 +--- .../db_history_scripts/user_game_idents.sql | 5 +--- .../user_joined_game_servers.sql | 5 +--- .../user_joined_servers.sql | 5 +--- .../user_joined_voice_channel.sql | 5 +--- .../user_message_count_per_hour.sql | 5 +--- .../db_history_scripts/user_warnings.sql | 5 +--- .../migration/db_history_scripts/users.sql | 5 +--- kdb-bot/src/bot_graphql/model/user.gql | 1 - .../bot_graphql/queries/user_history_query.py | 5 ---- kdb-web/package.json | 2 +- .../src/app/models/graphql/queries.model.ts | 1 - .../history-btn/history-btn.component.ts | 14 ++++++++++- .../components/history/history.component.html | 1 - .../components/history/history.component.scss | 0 .../history/history.component.spec.ts | 23 ------------------- .../components/history/history.component.ts | 10 -------- .../src/app/modules/shared/shared.module.ts | 2 -- kdb-web/src/assets/config.json | 2 +- kdb-web/update-version.ts | 6 ++--- 29 files changed, 35 insertions(+), 117 deletions(-) delete mode 100644 kdb-web/src/app/modules/shared/components/history/history.component.html delete mode 100644 kdb-web/src/app/modules/shared/components/history/history.component.scss delete mode 100644 kdb-web/src/app/modules/shared/components/history/history.component.spec.ts delete mode 100644 kdb-web/src/app/modules/shared/components/history/history.component.ts diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/api_keys.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/api_keys.sql index a9e687da..10285da4 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/api_keys.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/api_keys.sql @@ -1,11 +1,8 @@ -ALTER TABLE `ApiKeys` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `ApiKeys` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `ApiKeys` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `ApiKeysHistory` ( diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/auth_user_users_relation.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/auth_user_users_relation.sql index a0189b55..2ce0d762 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/auth_user_users_relation.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/auth_user_users_relation.sql @@ -1,11 +1,8 @@ -ALTER TABLE `AuthUserUsersRelations` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `AuthUserUsersRelations` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `AuthUserUsersRelations` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `AuthUserUsersRelationsHistory` diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/auth_users.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/auth_users.sql index 511501c4..ab22cc65 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/auth_users.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/auth_users.sql @@ -1,11 +1,8 @@ -ALTER TABLE `AuthUsers` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `AuthUsers` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `AuthUsers` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `AuthUsersHistory` ( diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/auto_role_rules.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/auto_role_rules.sql index 20d57001..bcfa5f77 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/auto_role_rules.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/auto_role_rules.sql @@ -1,11 +1,8 @@ -ALTER TABLE `AutoRoleRules` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `AutoRoleRules` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `AutoRoleRules` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `AutoRoleRulesHistory` ( diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/auto_roles.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/auto_roles.sql index 3201c6a2..7b78ea02 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/auto_roles.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/auto_roles.sql @@ -1,11 +1,8 @@ -ALTER TABLE `AutoRoles` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `AutoRoles` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `AutoRoles` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `AutoRolesHistory` ( diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/clients.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/clients.sql index 1cb75dea..b1048785 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/clients.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/clients.sql @@ -1,11 +1,8 @@ -ALTER TABLE `Clients` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `Clients` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `Clients` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `ClientsHistory` ( diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/game_servers.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/game_servers.sql index 551313dc..091cbf51 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/game_servers.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/game_servers.sql @@ -1,11 +1,8 @@ -ALTER TABLE `GameServers` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `GameServers` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `GameServers` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `GameServersHistory` ( diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/known_users.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/known_users.sql index 61e711d4..5263aa8d 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/known_users.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/known_users.sql @@ -1,11 +1,8 @@ -ALTER TABLE `KnownUsers` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `KnownUsers` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `KnownUsers` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `KnownUsersHistory` ( diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/levels.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/levels.sql index 6effc571..6ba534e2 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/levels.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/levels.sql @@ -1,11 +1,8 @@ -ALTER TABLE `Levels` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `Levels` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `Levels` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `LevelsHistory` ( diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/servers.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/servers.sql index 79187425..2d9d6c49 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/servers.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/servers.sql @@ -1,11 +1,8 @@ -ALTER TABLE `Servers` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `Servers` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `Servers` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `ServersHistory` ( diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/user_game_idents.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/user_game_idents.sql index 551957a7..fab7a21b 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/user_game_idents.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/user_game_idents.sql @@ -1,11 +1,8 @@ -ALTER TABLE `UserGameIdents` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `UserGameIdents` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `UserGameIdents` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `UserGameIdentsHistory` ( diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/user_joined_game_servers.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/user_joined_game_servers.sql index 0b96242a..203df921 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/user_joined_game_servers.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/user_joined_game_servers.sql @@ -1,11 +1,8 @@ -ALTER TABLE `UserJoinedGameServer` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `UserJoinedGameServer` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `UserJoinedGameServer` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `UserJoinedGameServerHistory` ( diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/user_joined_servers.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/user_joined_servers.sql index acffda69..45bc7d1e 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/user_joined_servers.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/user_joined_servers.sql @@ -1,11 +1,8 @@ -ALTER TABLE `UserJoinedServers` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `UserJoinedServers` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `UserJoinedServers` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `UserJoinedServersHistory` ( diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/user_joined_voice_channel.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/user_joined_voice_channel.sql index 7b50a780..8d439f7b 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/user_joined_voice_channel.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/user_joined_voice_channel.sql @@ -1,11 +1,8 @@ -ALTER TABLE `UserJoinedVoiceChannel` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `UserJoinedVoiceChannel` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `UserJoinedVoiceChannel` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `UserJoinedVoiceChannelHistory` ( diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/user_message_count_per_hour.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/user_message_count_per_hour.sql index 270ead64..a86841b8 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/user_message_count_per_hour.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/user_message_count_per_hour.sql @@ -1,11 +1,8 @@ -ALTER TABLE `UserMessageCountPerHour` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `UserMessageCountPerHour` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `UserMessageCountPerHour` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `UserMessageCountPerHourHistory` ( diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/user_warnings.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/user_warnings.sql index f2b55905..4371b207 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/user_warnings.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/user_warnings.sql @@ -1,11 +1,8 @@ -ALTER TABLE `UserWarnings` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `UserWarnings` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `UserWarnings` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `UserWarningsHistory` ( diff --git a/kdb-bot/src/bot_data/migration/db_history_scripts/users.sql b/kdb-bot/src/bot_data/migration/db_history_scripts/users.sql index 644f8b4f..8dfebf63 100644 --- a/kdb-bot/src/bot_data/migration/db_history_scripts/users.sql +++ b/kdb-bot/src/bot_data/migration/db_history_scripts/users.sql @@ -1,11 +1,8 @@ -ALTER TABLE `Users` - MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6); - ALTER TABLE `Users` CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); ALTER TABLE `Users` - CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6); + CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6); CREATE TABLE IF NOT EXISTS `UsersHistory` ( diff --git a/kdb-bot/src/bot_graphql/model/user.gql b/kdb-bot/src/bot_graphql/model/user.gql index 2c0f66d0..e7f03f38 100644 --- a/kdb-bot/src/bot_graphql/model/user.gql +++ b/kdb-bot/src/bot_graphql/model/user.gql @@ -30,7 +30,6 @@ type UserHistory implements HistoryTableQuery { xp: Int server: ID - leftServer: Boolean deleted: Boolean dateFrom: String diff --git a/kdb-bot/src/bot_graphql/queries/user_history_query.py b/kdb-bot/src/bot_graphql/queries/user_history_query.py index b081472e..14d3867b 100644 --- a/kdb-bot/src/bot_graphql/queries/user_history_query.py +++ b/kdb-bot/src/bot_graphql/queries/user_history_query.py @@ -10,7 +10,6 @@ class UserHistoryQuery(HistoryQueryABC): self.set_field("discordId", self.resolve_discord_id) self.set_field("xp", self.resolve_xp) self.set_field("server", self.resolve_server) - self.set_field("leftServer", self.resolve_left_server) @staticmethod def resolve_id(user: User, *_): @@ -27,7 +26,3 @@ class UserHistoryQuery(HistoryQueryABC): @staticmethod def resolve_server(user: User, *_): return user.server - - @staticmethod - def resolve_left_server(user: User, *_): - return user.left_server diff --git a/kdb-web/package.json b/kdb-web/package.json index 96210562..b4bb8e1f 100644 --- a/kdb-web/package.json +++ b/kdb-web/package.json @@ -50,4 +50,4 @@ "tslib": "^2.4.1", "typescript": "~4.9.5" } -} +} \ No newline at end of file diff --git a/kdb-web/src/app/models/graphql/queries.model.ts b/kdb-web/src/app/models/graphql/queries.model.ts index e9941f26..29b8dbcf 100644 --- a/kdb-web/src/app/models/graphql/queries.model.ts +++ b/kdb-web/src/app/models/graphql/queries.model.ts @@ -133,7 +133,6 @@ export class Queries { discordId xp server - leftServer deleted dateFrom dateTo diff --git a/kdb-web/src/app/modules/shared/components/history-btn/history-btn.component.ts b/kdb-web/src/app/modules/shared/components/history-btn/history-btn.component.ts index fdd90f7f..60fd98bf 100644 --- a/kdb-web/src/app/modules/shared/components/history-btn/history-btn.component.ts +++ b/kdb-web/src/app/modules/shared/components/history-btn/history-btn.component.ts @@ -20,8 +20,20 @@ export class HistoryBtnComponent implements OnInit { } openHistory(): void { - console.log("history", this.history); this.showSidebar = true; + let oldHistory: Partial = {}; + 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) { diff --git a/kdb-web/src/app/modules/shared/components/history/history.component.html b/kdb-web/src/app/modules/shared/components/history/history.component.html deleted file mode 100644 index e91e10e3..00000000 --- a/kdb-web/src/app/modules/shared/components/history/history.component.html +++ /dev/null @@ -1 +0,0 @@ -

history works!

diff --git a/kdb-web/src/app/modules/shared/components/history/history.component.scss b/kdb-web/src/app/modules/shared/components/history/history.component.scss deleted file mode 100644 index e69de29b..00000000 diff --git a/kdb-web/src/app/modules/shared/components/history/history.component.spec.ts b/kdb-web/src/app/modules/shared/components/history/history.component.spec.ts deleted file mode 100644 index bc4a9c3a..00000000 --- a/kdb-web/src/app/modules/shared/components/history/history.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { HistoryComponent } from './history.component'; - -describe('HistoryComponent', () => { - let component: HistoryComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ HistoryComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(HistoryComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/kdb-web/src/app/modules/shared/components/history/history.component.ts b/kdb-web/src/app/modules/shared/components/history/history.component.ts deleted file mode 100644 index 2bb02565..00000000 --- a/kdb-web/src/app/modules/shared/components/history/history.component.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-history', - templateUrl: './history.component.html', - styleUrls: ['./history.component.scss'] -}) -export class HistoryComponent { - -} diff --git a/kdb-web/src/app/modules/shared/shared.module.ts b/kdb-web/src/app/modules/shared/shared.module.ts index b4c61b3e..e2d14884 100644 --- a/kdb-web/src/app/modules/shared/shared.module.ts +++ b/kdb-web/src/app/modules/shared/shared.module.ts @@ -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: [ diff --git a/kdb-web/src/assets/config.json b/kdb-web/src/assets/config.json index 15187fad..672a91a5 100644 --- a/kdb-web/src/assets/config.json +++ b/kdb-web/src/assets/config.json @@ -23,4 +23,4 @@ "Name": "sh-edraft-dark-theme" } ] -} +} \ No newline at end of file diff --git a/kdb-web/update-version.ts b/kdb-web/update-version.ts index 6fa488e7..e81b3376 100644 --- a/kdb-web/update-version.ts +++ b/kdb-web/update-version.ts @@ -9,7 +9,7 @@ function Main(): void { setVersion(version); }) .catch(err => { - throwError(() => err); + throw err; }); } @@ -50,7 +50,7 @@ async function setVersion(version: SoftwareVersion) { const fs = require("fs"); fs.readFile(jsonFilePath, "utf8", (err: Error, data: string) => { if (err) { - throwError(() => err); + throw err; } const settings: Appsettings = JSON.parse(data); settings.WebVersion = version; @@ -59,7 +59,7 @@ async function setVersion(version: SoftwareVersion) { }); fs.readFile('./package.json', "utf8", (err: Error, data: string) => { if (err) { - throwError(() => err); + throw err; } const settings = JSON.parse(data); settings.version = version.getVersionString();