diff --git a/mediarepo-ui/src/app/app.module.ts b/mediarepo-ui/src/app/app.module.ts index 62057b4..042f63c 100644 --- a/mediarepo-ui/src/app/app.module.ts +++ b/mediarepo-ui/src/app/app.module.ts @@ -1,12 +1,12 @@ -import { NgModule } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; +import {NgModule} from '@angular/core'; +import {BrowserModule} from '@angular/platform-browser'; -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { RepositoriesComponent } from './pages/repositories/repositories.component'; -import { HomeComponent } from './pages/home/home.component'; -import { RepositoryCardComponent } from './pages/repositories/repository-card/repository-card.component'; +import {AppRoutingModule} from './app-routing.module'; +import {AppComponent} from './app.component'; +import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; +import {RepositoriesComponent} from './pages/repositories/repositories.component'; +import {HomeComponent} from './pages/home/home.component'; +import {RepositoryCardComponent} from './pages/repositories/repository-card/repository-card.component'; import {MatCardModule} from "@angular/material/card"; import {MatListModule} from "@angular/material/list"; import {MatButtonModule} from "@angular/material/button"; @@ -15,11 +15,11 @@ import {MatSnackBarModule} from "@angular/material/snack-bar"; import {MatFormFieldModule} from "@angular/material/form-field"; import {MatInputModule} from "@angular/material/input"; import {ReactiveFormsModule} from "@angular/forms"; -import { RepoFormComponent } from './pages/repositories/repo-form/repo-form.component'; -import { FileGridComponent } from './components/file-grid/file-grid.component'; +import {RepoFormComponent} from './pages/repositories/repo-form/repo-form.component'; +import {FileGridComponent} from './components/file-grid/file-grid.component'; import {MatSidenavModule} from "@angular/material/sidenav"; import {MatGridListModule} from "@angular/material/grid-list"; -import { FileGridEntryComponent } from './components/file-grid/file-grid-entry/file-grid-entry.component'; +import {FileGridEntryComponent} from './components/file-grid/file-grid-entry/file-grid-entry.component'; import {MatProgressBarModule} from "@angular/material/progress-bar"; import {MatPaginatorModule} from "@angular/material/paginator"; import {ScrollingModule} from "@angular/cdk/scrolling"; @@ -27,11 +27,14 @@ import {LightboxModule} from "ngx-lightbox"; import {MatChipsModule} from "@angular/material/chips"; import {MatIconModule} from "@angular/material/icon"; import {MatAutocompleteModule} from "@angular/material/autocomplete"; -import { FileSearchComponent } from './components/file-search/file-search.component'; +import {FileSearchComponent} from './components/file-search/file-search.component'; import {MatTabsModule} from "@angular/material/tabs"; -import { SearchPageComponent } from './pages/home/search-page/search-page.component'; +import {SearchPageComponent} from './pages/home/search-page/search-page.component'; import {FlexModule, GridModule} from "@angular/flex-layout"; import {MatRippleModule} from "@angular/material/core"; +import {FilterDialogComponent} from './components/file-search/filter-dialog/filter-dialog.component'; +import {MatDialogModule} from "@angular/material/dialog"; +import {MatSelectModule} from "@angular/material/select"; @NgModule({ declarations: [ @@ -44,6 +47,7 @@ import {MatRippleModule} from "@angular/material/core"; FileGridEntryComponent, FileSearchComponent, SearchPageComponent, + FilterDialogComponent, ], imports: [ BrowserModule, @@ -69,9 +73,12 @@ import {MatRippleModule} from "@angular/material/core"; MatTabsModule, FlexModule, GridModule, - MatRippleModule + MatRippleModule, + MatDialogModule, + MatSelectModule, ], providers: [], bootstrap: [AppComponent] }) -export class AppModule { } +export class AppModule { +} diff --git a/mediarepo-ui/src/app/components/file-grid/file-grid-entry/file-grid-entry.component.ts b/mediarepo-ui/src/app/components/file-grid/file-grid-entry/file-grid-entry.component.ts index 0dc7d5b..76c568c 100644 --- a/mediarepo-ui/src/app/components/file-grid/file-grid-entry/file-grid-entry.component.ts +++ b/mediarepo-ui/src/app/components/file-grid/file-grid-entry/file-grid-entry.component.ts @@ -45,7 +45,7 @@ export class FileGridEntryComponent implements OnInit, OnDestroy { try { const thumbnails = await this.fileService.getThumbnails(this.gridEntry.file.hash); let thumbnail = thumbnails.find(t => (t.height > 250 || t.width > 250) && (t.height < 500 && t.width < 500)); - this.selectedThumbnail = thumbnail; + this.selectedThumbnail = thumbnail ?? thumbnails[0]; if (!thumbnail) { console.log("Thumbnail is empty?!", thumbnails); diff --git a/mediarepo-ui/src/app/components/file-search/file-search.component-theme.scss b/mediarepo-ui/src/app/components/file-search/file-search.component-theme.scss index 7f06ba8..7afff2e 100644 --- a/mediarepo-ui/src/app/components/file-search/file-search.component-theme.scss +++ b/mediarepo-ui/src/app/components/file-search/file-search.component-theme.scss @@ -14,6 +14,10 @@ $warn-palette: map.get($color-config, 'warn'); mat-form-field:focus { background-color: dimgrey; } + + #sort-button { + background-color: darken(dimgrey, 5); + } } @mixin typography($theme) { diff --git a/mediarepo-ui/src/app/components/file-search/file-search.component.html b/mediarepo-ui/src/app/components/file-search/file-search.component.html index e76577f..fbb4360 100644 --- a/mediarepo-ui/src/app/components/file-search/file-search.component.html +++ b/mediarepo-ui/src/app/components/file-search/file-search.component.html @@ -1,7 +1,8 @@