Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
showPossibleRolls(i: InventoryItem) {
const dc = new MatDialogConfig();
dc.disableClose = false;
// dc.autoFocus = true;
// dc.width = '1000px';
dc.data = {
parent: this,
item: i
};
this.dialog.open(PossibleRollsDialogComponent, dc);
}
public openTriumphDialog(triumph: ClanSearchableTriumph): void {
const dc = new MatDialogConfig();
dc.disableClose = false;
dc.autoFocus = true;
dc.data = triumph;
this.dialog.open(ClanTriumphItemDialogComponent, dc);
}
public openStepDialog(faction: Progression): void {
const dc = new MatDialogConfig();
dc.disableClose = false;
dc.autoFocus = true;
dc.data = faction;
dc.maxWidth = '500px';
this.dialog.open(ProgressStepDialogComponent, dc);
}
openAddUserModal(user?: User): void {
const config = new MatDialogConfig();
if (user) {
config.data = user;
}
let dialogRef = this.dialog.open(AddUserComponent, config);
dialogRef.afterClosed().subscribe((result: CommonResult) => {
if (result && result.success) {
this.disabledAnimation = false;
this.getUsers();
setTimeout(() => this.disabledAnimation = true, 0);
}
});
}
public deleteSelectedItems() {
let config = new MatDialogConfig();
const dialogRef = this.dialog.open(DeleteSelectedItemsDialogComponent, config);
dialogRef.componentInstance.items = this.list.selectedItems;
dialogRef.afterClosed().subscribe((proceed) => {
if (proceed) {
this.list.deleteSelected();
this.list.clearSelection();
}
});
}
dropFiles(): Observable {
return this.dialog.open(DropFilesDialogComponent, new MatDialogConfig()).afterClosed();
}
}
public openBadgeDialog(badge: ClanBadge): void {
const dc = new MatDialogConfig();
dc.disableClose = false;
dc.autoFocus = true;
dc.data = badge;
this.dialog.open(ClanCollectionBadgeDialogComponent, dc);
}
select(resource) {
const dialogConfig = new MatDialogConfig();
dialogConfig.disableClose = true;
dialogConfig.autoFocus = true;
dialogConfig.data = {
id: 1,
resource: resource
};
const resourceDialog: MatDialogRef = this.dialog.open( ResourceDialogComponent, dialogConfig);
}
select(resource) {
const dialogConfig = new MatDialogConfig();
dialogConfig.disableClose = true;
dialogConfig.autoFocus = true;
dialogConfig.data = {
id: 1,
resource: resource
};
const resourceDialog: MatDialogRef = this.dialog.open( ResourceDialogComponent, dialogConfig);
}
filter(column: ColumnConfig) {
const filter = this.columnFilterService.getFilter(column.type);
if (filter) {
const dialogConfig = new MatDialogConfig();
const columnFilter = new ColumnFilter();
columnFilter.column = column;
if (this.appliedFilters[column.name]) {
columnFilter.filter = Object.create(this.appliedFilters[column.name]);
}
dialogConfig.data = columnFilter;
const dialogRef = this.dialog.open(filter, dialogConfig);
dialogRef.afterClosed().subscribe(result => {
if (result) {
this.appliedFilters[column.name] = result;
} else if (result === '') {
delete this.appliedFilters[column.name];