From aa563830c16263ace18d2f00003f4bc314b94ead Mon Sep 17 00:00:00 2001 From: trivernis Date: Thu, 25 Nov 2021 20:40:40 +0100 Subject: [PATCH] Fix issues caused by refactoring Signed-off-by: trivernis --- mediarepo-ui/src/app/components/core/core.module.ts | 5 ++++- .../app/components/shared/file-edit/file-edit.component.html | 2 +- .../file-grid/file-grid-entry/file-grid-entry.component.ts | 2 +- .../shared/file-multiview/file-grid/file-grid.component.ts | 2 -- .../tag-filter-list-item/tag-filter-list-item.component.ts | 2 +- mediarepo-ui/src/app/models/Selectable.ts | 4 ---- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/mediarepo-ui/src/app/components/core/core.module.ts b/mediarepo-ui/src/app/components/core/core.module.ts index d7b8933..daecd0a 100644 --- a/mediarepo-ui/src/app/components/core/core.module.ts +++ b/mediarepo-ui/src/app/components/core/core.module.ts @@ -13,13 +13,14 @@ import {MatProgressBarModule} from "@angular/material/progress-bar"; import {ScrollingModule} from "@angular/cdk/scrolling"; import {MatTabsModule} from "@angular/material/tabs"; import {FlexModule} from "@angular/flex-layout"; -import {MatOptionModule} from "@angular/material/core"; +import {MatOptionModule, MatRippleModule} from "@angular/material/core"; import {MatSelectModule} from "@angular/material/select"; import {MatCheckboxModule} from "@angular/material/checkbox"; import {SharedModule} from "../shared/shared.module"; import {MatDividerModule} from "@angular/material/divider"; import {NgIconsModule} from "@ng-icons/core"; import * as materialIcons from "@ng-icons/material-icons"; +import {MatMenuModule} from "@angular/material/menu"; @NgModule({ @@ -49,6 +50,8 @@ import * as materialIcons from "@ng-icons/material-icons"; NgIconsModule.withIcons({...materialIcons}), FlexModule, MatButtonModule, + MatMenuModule, + MatRippleModule, ] }) export class CoreModule { diff --git a/mediarepo-ui/src/app/components/shared/file-edit/file-edit.component.html b/mediarepo-ui/src/app/components/shared/file-edit/file-edit.component.html index 17ab6ea..6b5d899 100644 --- a/mediarepo-ui/src/app/components/shared/file-edit/file-edit.component.html +++ b/mediarepo-ui/src/app/components/shared/file-edit/file-edit.component.html @@ -29,7 +29,7 @@ Mode - + Toggle Add Remove diff --git a/mediarepo-ui/src/app/components/shared/file-multiview/file-grid/file-grid-entry/file-grid-entry.component.ts b/mediarepo-ui/src/app/components/shared/file-multiview/file-grid/file-grid-entry/file-grid-entry.component.ts index 92743db..2c7ee3d 100644 --- a/mediarepo-ui/src/app/components/shared/file-multiview/file-grid/file-grid-entry/file-grid-entry.component.ts +++ b/mediarepo-ui/src/app/components/shared/file-multiview/file-grid/file-grid-entry/file-grid-entry.component.ts @@ -31,7 +31,7 @@ export class FileGridEntryComponent implements OnInit, OnChanges { private cachedFile: File | undefined; private urlSetTimeout: number | undefined; - constructor(private fileService: FileService, private errorBroker: ErrorBrokerService) { + constructor(private fileService: FileService) { } async ngOnInit() { diff --git a/mediarepo-ui/src/app/components/shared/file-multiview/file-grid/file-grid.component.ts b/mediarepo-ui/src/app/components/shared/file-multiview/file-grid/file-grid.component.ts index 0309e6f..ba3fe12 100644 --- a/mediarepo-ui/src/app/components/shared/file-multiview/file-grid/file-grid.component.ts +++ b/mediarepo-ui/src/app/components/shared/file-multiview/file-grid/file-grid.component.ts @@ -68,8 +68,6 @@ export class FileGridComponent implements OnChanges, OnInit { * @param {FileGridEntryComponent} clickedEntry */ setSelectedFile(clickedEntry: GridEntry) { - const previousSelectionSize = this.selectedEntries.length; - if (!(this.shiftClicked || this.ctrlClicked) && this.selectedEntries.length > 0) { this.selectedEntries.forEach(entry => { if (entry !== clickedEntry) entry.selected = false diff --git a/mediarepo-ui/src/app/components/shared/file-search/filter-dialog/tag-filter-list-item/tag-filter-list-item.component.ts b/mediarepo-ui/src/app/components/shared/file-search/filter-dialog/tag-filter-list-item/tag-filter-list-item.component.ts index 68d644d..7954735 100644 --- a/mediarepo-ui/src/app/components/shared/file-search/filter-dialog/tag-filter-list-item/tag-filter-list-item.component.ts +++ b/mediarepo-ui/src/app/components/shared/file-search/filter-dialog/tag-filter-list-item/tag-filter-list-item.component.ts @@ -29,7 +29,7 @@ export class TagFilterListItemComponent implements OnChanges { public selectedIndices: number[] = []; - constructor(private changeDetector: ChangeDetectorRef) { + constructor() { } public ngOnChanges(changes: SimpleChanges): void { diff --git a/mediarepo-ui/src/app/models/Selectable.ts b/mediarepo-ui/src/app/models/Selectable.ts index f522b18..198964e 100644 --- a/mediarepo-ui/src/app/models/Selectable.ts +++ b/mediarepo-ui/src/app/models/Selectable.ts @@ -9,8 +9,4 @@ export class Selectable { public unselect() { this.selected = false; } - - public toggle() { - this.selected = !this.selected; - } }