Improved achievement component #268_achievements

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

View File

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

View File

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

View File

@ -132,7 +132,7 @@
<td> <td>
<p-cellEditor> <p-cellEditor>
<ng-template pTemplate="input"> <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>
<ng-template pTemplate="output"> <ng-template pTemplate="output">
{{achievement.attribute}} {{achievement.attribute}}
@ -143,7 +143,7 @@
<td> <td>
<p-cellEditor> <p-cellEditor>
<ng-template pTemplate="input"> <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>
<ng-template pTemplate="output"> <ng-template pTemplate="output">
{{achievement.operator}} {{achievement.operator}}

View File

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

View File

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