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):
|
||||
return (
|
||||
x.server.id == input["serverId"]
|
||||
and x.discord_channel_id == input["channelId"]
|
||||
and x.discord_message_id == input["messageId"]
|
||||
x.server.id == int(input["serverId"])
|
||||
and x.discord_channel_id == int(input["channelId"])
|
||||
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()
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "kdb-web",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.dev133",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"update-version": "ts-node-esm update-version.ts",
|
||||
|
@ -121,7 +121,7 @@ export class AutoRolesRulesComponent implements OnInit {
|
||||
public loadNextPage(): void {
|
||||
this.loading = true;
|
||||
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[] }) => {
|
||||
if (!x.servers[0].autoRoles || x.servers[0].autoRoles?.length == 0) {
|
||||
@ -212,13 +212,14 @@ export class AutoRolesRulesComponent implements OnInit {
|
||||
roleId: newAutoRoleRule.roleId
|
||||
}
|
||||
).pipe(catchError(err => {
|
||||
this.isEditingNew = false;
|
||||
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"));
|
||||
return throwError(err);
|
||||
})).subscribe(result => {
|
||||
this.isEditingNew = false;
|
||||
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.isEditingNew = false;
|
||||
this.loadNextPage();
|
||||
});
|
||||
return;
|
||||
|
@ -195,10 +195,12 @@ export class AutoRolesComponent implements OnInit {
|
||||
messageId: newAutoRole.messageId
|
||||
}
|
||||
).pipe(catchError(err => {
|
||||
this.isEditingNew = false;
|
||||
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"));
|
||||
return throwError(err);
|
||||
})).subscribe(result => {
|
||||
this.isEditingNew = false;
|
||||
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.loadNextPage();
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Component} from '@angular/core';
|
||||
import { Component } from "@angular/core";
|
||||
import { AuthService } from "../../../../../../services/auth/auth.service";
|
||||
import { SpinnerService } from "../../../../../../services/spinner/spinner.service";
|
||||
import { ToastService } from "../../../../../../services/toast/toast.service";
|
||||
@ -22,9 +22,9 @@ import {Mutations} from "../../../../../../models/graphql/mutations.model";
|
||||
import { throwError } from "rxjs";
|
||||
|
||||
@Component({
|
||||
selector: 'app-levels',
|
||||
templateUrl: './levels.component.html',
|
||||
styleUrls: ['./levels.component.scss']
|
||||
selector: "app-levels",
|
||||
templateUrl: "./levels.component.html",
|
||||
styleUrls: ["./levels.component.scss"]
|
||||
})
|
||||
export class LevelsComponent {
|
||||
|
||||
@ -68,10 +68,10 @@ export class LevelsComponent {
|
||||
}
|
||||
|
||||
public ngOnInit(): void {
|
||||
this.data.getServerFromRoute(this.route);
|
||||
|
||||
this.data.getServerFromRoute(this.route).then(server => {
|
||||
this.setFilterForm();
|
||||
this.loadNextPage();
|
||||
});
|
||||
}
|
||||
|
||||
public loadNextPage(): void {
|
||||
@ -93,7 +93,7 @@ export class LevelsComponent {
|
||||
name: new FormControl<string | null>(null),
|
||||
color: new FormControl<string | 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(
|
||||
@ -174,6 +174,7 @@ export class LevelsComponent {
|
||||
serverId: this.sidebar.server$.value?.id
|
||||
}
|
||||
).pipe(catchError(err => {
|
||||
this.isEditingNew = false;
|
||||
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"));
|
||||
return throwError(err);
|
||||
@ -192,7 +193,7 @@ export class LevelsComponent {
|
||||
name: newLevel.name,
|
||||
color: newLevel.color,
|
||||
minXp: newLevel.minXp,
|
||||
permissions: newLevel.permissions,
|
||||
permissions: newLevel.permissions
|
||||
}
|
||||
).pipe(catchError(err => {
|
||||
this.spinner.hideSpinner();
|
||||
|
@ -88,7 +88,6 @@ export class MembersComponent implements OnInit {
|
||||
private fb: FormBuilder,
|
||||
private translate: TranslateService,
|
||||
private data: DataService,
|
||||
private sidebar: SidebarService,
|
||||
private route: ActivatedRoute
|
||||
) {
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
"WebVersion": {
|
||||
"Major": "1",
|
||||
"Minor": "0",
|
||||
"Micro": "0"
|
||||
"Micro": "dev133"
|
||||
},
|
||||
"Themes": [
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user