Fixed changes of rebase #133
This commit is contained in:
parent
e463b19a73
commit
f3024d2ea5
@ -33,9 +33,9 @@ class AutoRoleMutation(QueryABC):
|
|||||||
|
|
||||||
def get_new(x: AutoRole):
|
def get_new(x: AutoRole):
|
||||||
return (
|
return (
|
||||||
x.server.id == input["serverId"]
|
x.server.id == int(input["serverId"])
|
||||||
and x.discord_channel_id == input["channelId"]
|
and x.discord_channel_id == int(input["channelId"])
|
||||||
and x.discord_message_id == input["messageId"]
|
and x.discord_message_id == int(input["messageId"])
|
||||||
)
|
)
|
||||||
|
|
||||||
return self._auto_roles.get_auto_roles_by_server_id(auto_role.server.id).where(get_new).last()
|
return self._auto_roles.get_auto_roles_by_server_id(auto_role.server.id).where(get_new).last()
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "kdb-web",
|
"name": "kdb-web",
|
||||||
"version": "1.0.0",
|
"version": "1.0.dev133",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"update-version": "ts-node-esm update-version.ts",
|
"update-version": "ts-node-esm update-version.ts",
|
||||||
|
@ -121,7 +121,7 @@ export class AutoRolesRulesComponent implements OnInit {
|
|||||||
public loadNextPage(): void {
|
public loadNextPage(): void {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.data.query<AutoRoleRuleQuery>(Queries.autoRoleRulesQuery, {
|
this.data.query<AutoRoleRuleQuery>(Queries.autoRoleRulesQuery, {
|
||||||
id: this.sidebar.server$.value?.id, filter: this.filter, page: this.page, sort: this.sort
|
serverId: this.sidebar.server$.value?.id, autoRoleId: this.autoRoleId, filter: this.filter, page: this.page, sort: this.sort
|
||||||
},
|
},
|
||||||
(x: { servers: Server[] }) => {
|
(x: { servers: Server[] }) => {
|
||||||
if (!x.servers[0].autoRoles || x.servers[0].autoRoles?.length == 0) {
|
if (!x.servers[0].autoRoles || x.servers[0].autoRoles?.length == 0) {
|
||||||
@ -212,13 +212,14 @@ export class AutoRolesRulesComponent implements OnInit {
|
|||||||
roleId: newAutoRoleRule.roleId
|
roleId: newAutoRoleRule.roleId
|
||||||
}
|
}
|
||||||
).pipe(catchError(err => {
|
).pipe(catchError(err => {
|
||||||
|
this.isEditingNew = false;
|
||||||
this.spinner.hideSpinner();
|
this.spinner.hideSpinner();
|
||||||
this.toastService.error(this.translate.instant("view.server.auto_roles.rules.message.auto_role_rule_create_failed"), this.translate.instant("view.server.auto_roles.rules.message.auto_role_rule_create_failed_d"));
|
this.toastService.error(this.translate.instant("view.server.auto_roles.rules.message.auto_role_rule_create_failed"), this.translate.instant("view.server.auto_roles.rules.message.auto_role_rule_create_failed_d"));
|
||||||
return throwError(err);
|
return throwError(err);
|
||||||
})).subscribe(result => {
|
})).subscribe(result => {
|
||||||
|
this.isEditingNew = false;
|
||||||
this.spinner.hideSpinner();
|
this.spinner.hideSpinner();
|
||||||
this.toastService.success(this.translate.instant("view.server.auto_roles.rules.message.auto_role_rule_created"), this.translate.instant("view.server.auto_roles.rules.message.auto_role_rule_create_d", { id: result.autoRoleRule.createAutoRoleRule?.id }));
|
this.toastService.success(this.translate.instant("view.server.auto_roles.rules.message.auto_role_rule_created"), this.translate.instant("view.server.auto_roles.rules.message.auto_role_rule_create_d", { id: result.autoRoleRule.createAutoRoleRule?.id }));
|
||||||
this.isEditingNew = false;
|
|
||||||
this.loadNextPage();
|
this.loadNextPage();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
@ -195,10 +195,12 @@ export class AutoRolesComponent implements OnInit {
|
|||||||
messageId: newAutoRole.messageId
|
messageId: newAutoRole.messageId
|
||||||
}
|
}
|
||||||
).pipe(catchError(err => {
|
).pipe(catchError(err => {
|
||||||
|
this.isEditingNew = false;
|
||||||
this.spinner.hideSpinner();
|
this.spinner.hideSpinner();
|
||||||
this.toastService.error(this.translate.instant("view.server.auto_roles.message.auto_role_create_failed"), this.translate.instant("view.server.auto_roles.message.auto_role_create_failed_d"));
|
this.toastService.error(this.translate.instant("view.server.auto_roles.message.auto_role_create_failed"), this.translate.instant("view.server.auto_roles.message.auto_role_create_failed_d"));
|
||||||
return throwError(err);
|
return throwError(err);
|
||||||
})).subscribe(result => {
|
})).subscribe(result => {
|
||||||
|
this.isEditingNew = false;
|
||||||
this.spinner.hideSpinner();
|
this.spinner.hideSpinner();
|
||||||
this.toastService.success(this.translate.instant("view.server.auto_roles.message.auto_role_created"), this.translate.instant("view.server.auto_roles.message.auto_role_create_d", { id: result.autoRole.createAutoRole?.id }));
|
this.toastService.success(this.translate.instant("view.server.auto_roles.message.auto_role_created"), this.translate.instant("view.server.auto_roles.message.auto_role_create_d", { id: result.autoRole.createAutoRole?.id }));
|
||||||
this.loadNextPage();
|
this.loadNextPage();
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
import {Component} from '@angular/core';
|
import { Component } from "@angular/core";
|
||||||
import {AuthService} from "../../../../../../services/auth/auth.service";
|
import { AuthService } from "../../../../../../services/auth/auth.service";
|
||||||
import {SpinnerService} from "../../../../../../services/spinner/spinner.service";
|
import { SpinnerService } from "../../../../../../services/spinner/spinner.service";
|
||||||
import {ToastService} from "../../../../../../services/toast/toast.service";
|
import { ToastService } from "../../../../../../services/toast/toast.service";
|
||||||
import {ConfirmationDialogService} from "../../../../../../services/confirmation-dialog/confirmation-dialog.service";
|
import { ConfirmationDialogService } from "../../../../../../services/confirmation-dialog/confirmation-dialog.service";
|
||||||
import {FormBuilder, FormControl, FormGroup} from "@angular/forms";
|
import { FormBuilder, FormControl, FormGroup } from "@angular/forms";
|
||||||
import {TranslateService} from "@ngx-translate/core";
|
import { TranslateService } from "@ngx-translate/core";
|
||||||
import {DataService} from "../../../../../../services/data/data.service";
|
import { DataService } from "../../../../../../services/data/data.service";
|
||||||
import {SidebarService} from "../../../../../../services/sidebar/sidebar.service";
|
import { SidebarService } from "../../../../../../services/sidebar/sidebar.service";
|
||||||
import {ActivatedRoute} from "@angular/router";
|
import { ActivatedRoute } from "@angular/router";
|
||||||
import {Page} from "../../../../../../models/graphql/filter/page.model";
|
import { Page } from "../../../../../../models/graphql/filter/page.model";
|
||||||
import {Sort, SortDirection} from "../../../../../../models/graphql/filter/sort.model";
|
import { Sort, SortDirection } from "../../../../../../models/graphql/filter/sort.model";
|
||||||
import {Level, LevelFilter} from "../../../../../../models/data/level.model";
|
import { Level, LevelFilter } from "../../../../../../models/data/level.model";
|
||||||
import {LevelListQuery} from "../../../../../../models/graphql/query.model";
|
import { LevelListQuery } from "../../../../../../models/graphql/query.model";
|
||||||
import {Queries} from "../../../../../../models/graphql/queries.model";
|
import { Queries } from "../../../../../../models/graphql/queries.model";
|
||||||
import {catchError, debounceTime} from "rxjs/operators";
|
import { catchError, debounceTime } from "rxjs/operators";
|
||||||
import {LazyLoadEvent} from "primeng/api";
|
import { LazyLoadEvent } from "primeng/api";
|
||||||
import {Table} from "primeng/table";
|
import { Table } from "primeng/table";
|
||||||
import {User} from "../../../../../../models/data/user.model";
|
import { User } from "../../../../../../models/data/user.model";
|
||||||
import {LevelMutationResult, UpdateUserMutationResult} from "../../../../../../models/graphql/result.model";
|
import { LevelMutationResult, UpdateUserMutationResult } from "../../../../../../models/graphql/result.model";
|
||||||
import {Mutations} from "../../../../../../models/graphql/mutations.model";
|
import { Mutations } from "../../../../../../models/graphql/mutations.model";
|
||||||
import {throwError} from "rxjs";
|
import { throwError } from "rxjs";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-levels',
|
selector: "app-levels",
|
||||||
templateUrl: './levels.component.html',
|
templateUrl: "./levels.component.html",
|
||||||
styleUrls: ['./levels.component.scss']
|
styleUrls: ["./levels.component.scss"]
|
||||||
})
|
})
|
||||||
export class LevelsComponent {
|
export class LevelsComponent {
|
||||||
|
|
||||||
@ -68,10 +68,10 @@ export class LevelsComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ngOnInit(): void {
|
public ngOnInit(): void {
|
||||||
this.data.getServerFromRoute(this.route);
|
this.data.getServerFromRoute(this.route).then(server => {
|
||||||
|
|
||||||
this.setFilterForm();
|
this.setFilterForm();
|
||||||
this.loadNextPage();
|
this.loadNextPage();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public loadNextPage(): void {
|
public loadNextPage(): void {
|
||||||
@ -93,7 +93,7 @@ export class LevelsComponent {
|
|||||||
name: new FormControl<string | null>(null),
|
name: new FormControl<string | null>(null),
|
||||||
color: new FormControl<string | null>(null),
|
color: new FormControl<string | null>(null),
|
||||||
min_xp: new FormControl<number | null>(null),
|
min_xp: new FormControl<number | null>(null),
|
||||||
permissions: new FormControl<number | null>(null),
|
permissions: new FormControl<number | null>(null)
|
||||||
});
|
});
|
||||||
|
|
||||||
this.filterForm.valueChanges.pipe(
|
this.filterForm.valueChanges.pipe(
|
||||||
@ -142,7 +142,7 @@ export class LevelsComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public onRowEditInit(table: Table, user: User, index: number): void {
|
public onRowEditInit(table: Table, user: User, index: number): void {
|
||||||
this.clonedLevels[index] = {...user};
|
this.clonedLevels[index] = { ...user };
|
||||||
}
|
}
|
||||||
|
|
||||||
public onRowEditSave(table: Table, newLevel: Level, index: number): void {
|
public onRowEditSave(table: Table, newLevel: Level, index: number): void {
|
||||||
@ -174,13 +174,14 @@ export class LevelsComponent {
|
|||||||
serverId: this.sidebar.server$.value?.id
|
serverId: this.sidebar.server$.value?.id
|
||||||
}
|
}
|
||||||
).pipe(catchError(err => {
|
).pipe(catchError(err => {
|
||||||
|
this.isEditingNew = false;
|
||||||
this.spinner.hideSpinner();
|
this.spinner.hideSpinner();
|
||||||
this.toastService.error(this.translate.instant("view.server.levels.message.level_create_failed"), this.translate.instant("view.server.levels.message.level_create_failed_d"));
|
this.toastService.error(this.translate.instant("view.server.levels.message.level_create_failed"), this.translate.instant("view.server.levels.message.level_create_failed_d"));
|
||||||
return throwError(err);
|
return throwError(err);
|
||||||
})).subscribe(result => {
|
})).subscribe(result => {
|
||||||
this.isEditingNew = false;
|
this.isEditingNew = false;
|
||||||
this.spinner.hideSpinner();
|
this.spinner.hideSpinner();
|
||||||
this.toastService.success(this.translate.instant("view.server.levels.message.level_create"), this.translate.instant("view.server.levels.message.level_create_d", {name: result.level.createLevel?.name}));
|
this.toastService.success(this.translate.instant("view.server.levels.message.level_create"), this.translate.instant("view.server.levels.message.level_create_d", { name: result.level.createLevel?.name }));
|
||||||
this.loadNextPage();
|
this.loadNextPage();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@ -192,15 +193,15 @@ export class LevelsComponent {
|
|||||||
name: newLevel.name,
|
name: newLevel.name,
|
||||||
color: newLevel.color,
|
color: newLevel.color,
|
||||||
minXp: newLevel.minXp,
|
minXp: newLevel.minXp,
|
||||||
permissions: newLevel.permissions,
|
permissions: newLevel.permissions
|
||||||
}
|
}
|
||||||
).pipe(catchError(err => {
|
).pipe(catchError(err => {
|
||||||
this.spinner.hideSpinner();
|
this.spinner.hideSpinner();
|
||||||
this.toastService.error(this.translate.instant("view.server.levels.message.level_update_failed"), this.translate.instant("view.server.levels.message.level_update_failed_d", {name: newLevel.name}));
|
this.toastService.error(this.translate.instant("view.server.levels.message.level_update_failed"), this.translate.instant("view.server.levels.message.level_update_failed_d", { name: newLevel.name }));
|
||||||
return throwError(err);
|
return throwError(err);
|
||||||
})).subscribe(_ => {
|
})).subscribe(_ => {
|
||||||
this.spinner.hideSpinner();
|
this.spinner.hideSpinner();
|
||||||
this.toastService.success(this.translate.instant("view.server.levels.message.level_update"), this.translate.instant("view.server.levels.message.level_update_d", {name: newLevel.name}));
|
this.toastService.success(this.translate.instant("view.server.levels.message.level_update"), this.translate.instant("view.server.levels.message.level_update_d", { name: newLevel.name }));
|
||||||
this.loadNextPage();
|
this.loadNextPage();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -220,7 +221,7 @@ export class LevelsComponent {
|
|||||||
|
|
||||||
public deleteLevel(level: Level): void {
|
public deleteLevel(level: Level): void {
|
||||||
this.confirmDialog.confirmDialog(
|
this.confirmDialog.confirmDialog(
|
||||||
this.translate.instant("view.server.levels.message.level_delete"), this.translate.instant("view.server.levels.message.level_delete_q", {name: level.name}),
|
this.translate.instant("view.server.levels.message.level_delete"), this.translate.instant("view.server.levels.message.level_delete_q", { name: level.name }),
|
||||||
() => {
|
() => {
|
||||||
this.spinner.showSpinner();
|
this.spinner.showSpinner();
|
||||||
this.data.mutation<LevelMutationResult>(Mutations.deleteLevel, {
|
this.data.mutation<LevelMutationResult>(Mutations.deleteLevel, {
|
||||||
@ -228,11 +229,11 @@ export class LevelsComponent {
|
|||||||
}
|
}
|
||||||
).pipe(catchError(err => {
|
).pipe(catchError(err => {
|
||||||
this.spinner.hideSpinner();
|
this.spinner.hideSpinner();
|
||||||
this.toastService.error(this.translate.instant("view.server.levels.message.level_delete_failed"), this.translate.instant("view.server.levels.message.level_delete_failedd", {name: level.name}));
|
this.toastService.error(this.translate.instant("view.server.levels.message.level_delete_failed"), this.translate.instant("view.server.levels.message.level_delete_failedd", { name: level.name }));
|
||||||
return throwError(err);
|
return throwError(err);
|
||||||
})).subscribe(l => {
|
})).subscribe(l => {
|
||||||
this.spinner.hideSpinner();
|
this.spinner.hideSpinner();
|
||||||
this.toastService.success(this.translate.instant("view.server.levels.message.level_deleted"), this.translate.instant("view.server.levels.message.level_deleted_d", {name: level.name}));
|
this.toastService.success(this.translate.instant("view.server.levels.message.level_deleted"), this.translate.instant("view.server.levels.message.level_deleted_d", { name: level.name }));
|
||||||
this.loadNextPage();
|
this.loadNextPage();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -88,7 +88,6 @@ export class MembersComponent implements OnInit {
|
|||||||
private fb: FormBuilder,
|
private fb: FormBuilder,
|
||||||
private translate: TranslateService,
|
private translate: TranslateService,
|
||||||
private data: DataService,
|
private data: DataService,
|
||||||
private sidebar: SidebarService,
|
|
||||||
private route: ActivatedRoute
|
private route: ActivatedRoute
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"WebVersion": {
|
"WebVersion": {
|
||||||
"Major": "1",
|
"Major": "1",
|
||||||
"Minor": "0",
|
"Minor": "0",
|
||||||
"Micro": "0"
|
"Micro": "dev133"
|
||||||
},
|
},
|
||||||
"Themes": [
|
"Themes": [
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user