Improved achievement component #268_achievements

This commit is contained in:
Sven Heidemann 2023-07-12 22:33:43 +02:00
parent b99dd1bded
commit 3507623c92
5 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "kdb-web",
"version": "1.0.7",
"version": "1.0.dev268_achievements",
"scripts": {
"ng": "ng",
"update-version": "ts-node-esm update-version.ts",

View File

@ -10,6 +10,8 @@ export interface User extends DataWithHistory {
discordId?: number;
name?: string;
xp?: number;
message_count?: number;
reaction_count?: number;
ontime?: number;
level?: Level;
server?: Server;

View File

@ -132,7 +132,7 @@
<td>
<p-cellEditor>
<ng-template pTemplate="input">
<input class="table-edit-input" pInputText type="text" [(ngModel)]="achievement.attribute">
<p-dropdown [options]="attributes" [(ngModel)]="achievement.attribute" placeholder="{{'view.server.achievements.headers.attribute' | translate}}"></p-dropdown>
</ng-template>
<ng-template pTemplate="output">
{{achievement.attribute}}
@ -143,7 +143,7 @@
<td>
<p-cellEditor>
<ng-template pTemplate="input">
<input class="table-edit-input" pInputText type="text" [(ngModel)]="achievement.operator">
<p-dropdown [options]="operators" [(ngModel)]="achievement.operator" placeholder="{{'view.server.achievements.headers.operator' | translate}}"></p-dropdown>
</ng-template>
<ng-template pTemplate="output">
{{achievement.operator}}

View File

@ -60,6 +60,9 @@ export class AchievementComponent implements OnInit, OnDestroy {
private server: Server = {};
public user: UserDTO | null = null;
public operators = ["==", "!=", "<=", ">=", "<", ">"];
public attributes = ["xp", "message_count", "reaction_count", "ontime", "level"]
query: string = Queries.achievementWithHistoryQuery;
public constructor(

View File

@ -5,7 +5,7 @@
"WebVersion": {
"Major": "1",
"Minor": "0",
"Micro": "7"
"Micro": "dev268_achievements"
},
"Themes": [
{