Change indentation to 4 spaces (because why was it 2 anyway?)

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/4/head
trivernis 3 years ago
parent 6348f10981
commit e694645a78

@ -4,12 +4,12 @@ root = true
[*] [*]
charset = utf-8 charset = utf-8
indent_style = space indent_style = space
indent_size = 2 indent_size = 4
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
[*.ts] [*.ts]
quote_type = single quote_type = double
[*.md] [*.md]
max_line_length = off max_line_length = off

@ -34,7 +34,9 @@
"prefix": "app", "prefix": "app",
"style": "kebab-case" "style": "kebab-case"
} }
] ],
"quotes": ["warn", "double", {"avoidEscape": true}],
"indent": ["error", 4, {"SwitchCase": 1}]
} }
}, },
{ {

@ -1,5 +1,5 @@
import {NgModule} from '@angular/core'; import {NgModule} from "@angular/core";
import {RouterModule, Routes} from '@angular/router'; import {RouterModule, Routes} from "@angular/router";
import {CoreComponent} from "./components/core/core.component"; import {CoreComponent} from "./components/core/core.component";
const routes: Routes = [ const routes: Routes = [

@ -1,8 +1,8 @@
import {TestBed} from '@angular/core/testing'; import {TestBed} from "@angular/core/testing";
import {RouterTestingModule} from '@angular/router/testing'; import {RouterTestingModule} from "@angular/router/testing";
import {AppComponent} from './app.component'; import {AppComponent} from "./app.component";
describe('AppComponent', () => { describe("AppComponent", () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [ imports: [
@ -14,23 +14,23 @@ describe('AppComponent', () => {
}).compileComponents(); }).compileComponents();
}); });
it('should create the app', () => { it("should create the app", () => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance; const app = fixture.componentInstance;
expect(app).toBeTruthy(); expect(app).toBeTruthy();
}); });
it(`should have as title 'mediarepo-ui'`, () => { it("should have as title 'mediarepo-ui'", () => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance; const app = fixture.componentInstance;
expect(app.title).toEqual('mediarepo-ui'); expect(app.title).toEqual("mediarepo-ui");
}); });
it('should render title', () => { it("should render title", () => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges(); fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement; const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent) expect(compiled.querySelector(".content span")?.textContent)
.toContain('mediarepo-ui app is running!'); .toContain("mediarepo-ui app is running!");
}); });
}); });

@ -1,16 +1,16 @@
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from "@angular/core";
import {Router} from "@angular/router"; import {Router} from "@angular/router";
import {RepositoryService} from "./services/repository/repository.service"; import {RepositoryService} from "./services/repository/repository.service";
import {MatSnackBar} from "@angular/material/snack-bar"; import {MatSnackBar} from "@angular/material/snack-bar";
import {ErrorBrokerService} from "./services/error-broker/error-broker.service"; import {ErrorBrokerService} from "./services/error-broker/error-broker.service";
@Component({ @Component({
selector: 'app-root', selector: "app-root",
templateUrl: './app.component.html', templateUrl: "./app.component.html",
styleUrls: ['./app.component.scss'] styleUrls: ["./app.component.scss"]
}) })
export class AppComponent implements OnInit { export class AppComponent implements OnInit {
title = 'mediarepo-ui'; title = "mediarepo-ui";
constructor( constructor(
private router: Router, private router: Router,

@ -1,7 +1,7 @@
import {NgModule} from '@angular/core'; import {NgModule} from "@angular/core";
import {BrowserModule} from '@angular/platform-browser'; import {BrowserModule} from "@angular/platform-browser";
import {AppComponent} from './app.component'; import {AppComponent} from "./app.component";
import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {CoreModule} from "./components/core/core.module"; import {CoreModule} from "./components/core/core.module";
@NgModule({ @NgModule({

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {CoreComponent} from './core.component'; import {CoreComponent} from "./core.component";
describe('HomeComponent', () => { describe("HomeComponent", () => {
let component: CoreComponent; let component: CoreComponent;
let fixture: ComponentFixture<CoreComponent>; let fixture: ComponentFixture<CoreComponent>;
@ -19,7 +19,7 @@ describe('HomeComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,4 +1,4 @@
import {Component, OnInit, ViewChild} from '@angular/core'; import {Component, OnInit, ViewChild} from "@angular/core";
import {Repository} from "../../models/Repository"; import {Repository} from "../../models/Repository";
import {RepositoryService} from "../../services/repository/repository.service"; import {RepositoryService} from "../../services/repository/repository.service";
import {MatTabChangeEvent, MatTabGroup} from "@angular/material/tabs"; import {MatTabChangeEvent, MatTabGroup} from "@angular/material/tabs";
@ -6,9 +6,9 @@ import {TagService} from "../../services/tag/tag.service";
import {TabService} from "../../services/tab/tab.service"; import {TabService} from "../../services/tab/tab.service";
@Component({ @Component({
selector: 'app-core', selector: "app-core",
templateUrl: './core.component.html', templateUrl: "./core.component.html",
styleUrls: ['./core.component.scss'] styleUrls: ["./core.component.scss"]
}) })
export class CoreComponent implements OnInit { export class CoreComponent implements OnInit {

@ -1,5 +1,5 @@
import {NgModule} from '@angular/core'; import {NgModule} from "@angular/core";
import {CommonModule} from '@angular/common'; import {CommonModule} from "@angular/common";
import {CoreComponent} from "./core.component"; import {CoreComponent} from "./core.component";
import {RepositoriesTabComponent} from "./repositories-tab/repositories-tab.component"; import {RepositoriesTabComponent} from "./repositories-tab/repositories-tab.component";
import {FilesTabComponent} from "./files-tab/files-tab.component"; import {FilesTabComponent} from "./files-tab/files-tab.component";

@ -14,7 +14,9 @@
</div> </div>
<div class="file-tag-list" fxFlex fxFlexAlign="start" fxFlexFill> <div class="file-tag-list" fxFlex fxFlexAlign="start" fxFlexFill>
<cdk-virtual-scroll-viewport itemSize="50" maxBufferPx="4000" minBufferPx="500"> <cdk-virtual-scroll-viewport itemSize="50" maxBufferPx="4000" minBufferPx="500">
<div (click)="addSearchTag(tag)" (contextmenu)="contextMenuTag = tag; contextMenu.onContextMenu($event)" *cdkVirtualFor="let tag of tags" class="selectable-tag" <div (click)="addSearchTag(tag)"
(contextmenu)="contextMenuTag = tag; contextMenu.onContextMenu($event)"
*cdkVirtualFor="let tag of tags" class="selectable-tag"
matRipple> matRipple>
<app-tag-item [tag]="tag"></app-tag-item> <app-tag-item [tag]="tag"></app-tag-item>
</div> </div>

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {FilesTabSidebarComponent} from './files-tab-sidebar.component'; import {FilesTabSidebarComponent} from "./files-tab-sidebar.component";
describe('FilesTabSidebarComponent', () => { describe("FilesTabSidebarComponent", () => {
let component: FilesTabSidebarComponent; let component: FilesTabSidebarComponent;
let fixture: ComponentFixture<FilesTabSidebarComponent>; let fixture: ComponentFixture<FilesTabSidebarComponent>;
@ -19,7 +19,7 @@ describe('FilesTabSidebarComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -7,7 +7,7 @@ import {
Output, Output,
SimpleChanges, SimpleChanges,
ViewChild ViewChild
} from '@angular/core'; } from "@angular/core";
import {Tag} from "../../../../models/Tag"; import {Tag} from "../../../../models/Tag";
import {TagService} from "../../../../services/tag/tag.service"; import {TagService} from "../../../../services/tag/tag.service";
import {FileService} from "../../../../services/file/file.service"; import {FileService} from "../../../../services/file/file.service";
@ -18,9 +18,9 @@ import {FileEditComponent} from "../../../shared/file-edit/file-edit.component";
import {clipboard} from "@tauri-apps/api"; import {clipboard} from "@tauri-apps/api";
@Component({ @Component({
selector: 'app-files-tab-sidebar', selector: "app-files-tab-sidebar",
templateUrl: './files-tab-sidebar.component.html', templateUrl: "./files-tab-sidebar.component.html",
styleUrls: ['./files-tab-sidebar.component.scss'] styleUrls: ["./files-tab-sidebar.component.scss"]
}) })
export class FilesTabSidebarComponent implements OnInit, OnChanges { export class FilesTabSidebarComponent implements OnInit, OnChanges {
@ -28,7 +28,7 @@ export class FilesTabSidebarComponent implements OnInit, OnChanges {
@Output() searchStartEvent = new EventEmitter<void>(); @Output() searchStartEvent = new EventEmitter<void>();
@Output() searchEndEvent = new EventEmitter<void>(); @Output() searchEndEvent = new EventEmitter<void>();
@ViewChild('filesearch') fileSearch!: FileSearchComponent; @ViewChild("filesearch") fileSearch!: FileSearchComponent;
@ViewChild("fileedit") fileEdit: FileEditComponent | undefined; @ViewChild("fileedit") fileEdit: FileEditComponent | undefined;
public tagsOfFiles: Tag[] = []; public tagsOfFiles: Tag[] = [];
@ -78,7 +78,8 @@ export class FilesTabSidebarComponent implements OnInit, OnChanges {
this.tagsOfSelection = await this.tagService.getTagsForFiles( this.tagsOfSelection = await this.tagService.getTagsForFiles(
files.map(f => f.hash)) files.map(f => f.hash))
this.tagsOfSelection = this.tagsOfSelection.sort( this.tagsOfSelection = this.tagsOfSelection.sort(
(a, b) => a.getNormalizedOutput().localeCompare(b.getNormalizedOutput())); (a, b) => a.getNormalizedOutput()
.localeCompare(b.getNormalizedOutput()));
this.tags = this.tagsOfSelection; this.tags = this.tagsOfSelection;
} }

@ -1,16 +1,15 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {FilesTabComponent} from './files-tab.component'; import {FilesTabComponent} from "./files-tab.component";
describe('SearchPageComponent', () => { describe("SearchPageComponent", () => {
let component: FilesTabComponent; let component: FilesTabComponent;
let fixture: ComponentFixture<FilesTabComponent>; let fixture: ComponentFixture<FilesTabComponent>;
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [FilesTabComponent] declarations: [FilesTabComponent]
}) }).compileComponents();
.compileComponents();
}); });
beforeEach(() => { beforeEach(() => {
@ -19,7 +18,7 @@ describe('SearchPageComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,13 +1,13 @@
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from "@angular/core";
import {File} from "../../../models/File"; import {File} from "../../../models/File";
import {ErrorBrokerService} from "../../../services/error-broker/error-broker.service"; import {ErrorBrokerService} from "../../../services/error-broker/error-broker.service";
import {FileService} from "../../../services/file/file.service"; import {FileService} from "../../../services/file/file.service";
import {RepositoryService} from "../../../services/repository/repository.service"; import {RepositoryService} from "../../../services/repository/repository.service";
@Component({ @Component({
selector: 'app-files-tab', selector: "app-files-tab",
templateUrl: './files-tab.component.html', templateUrl: "./files-tab.component.html",
styleUrls: ['./files-tab.component.scss'] styleUrls: ["./files-tab.component.scss"]
}) })
export class FilesTabComponent implements OnInit { export class FilesTabComponent implements OnInit {

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {FilesystemImportComponent} from './filesystem-import.component'; import {FilesystemImportComponent} from "./filesystem-import.component";
describe('FilesystemImportComponent', () => { describe("FilesystemImportComponent", () => {
let component: FilesystemImportComponent; let component: FilesystemImportComponent;
let fixture: ComponentFixture<FilesystemImportComponent>; let fixture: ComponentFixture<FilesystemImportComponent>;
@ -19,7 +19,7 @@ describe('FilesystemImportComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,4 +1,4 @@
import {Component, EventEmitter, Output} from '@angular/core'; import {Component, EventEmitter, Output} from "@angular/core";
import {FileOsMetadata} from "../../../../../models/FileOsMetadata"; import {FileOsMetadata} from "../../../../../models/FileOsMetadata";
import {ImportService} from "../../../../../services/import/import.service"; import {ImportService} from "../../../../../services/import/import.service";
import {ErrorBrokerService} from "../../../../../services/error-broker/error-broker.service"; import {ErrorBrokerService} from "../../../../../services/error-broker/error-broker.service";
@ -7,9 +7,9 @@ import {File} from "../../../../../models/File";
import {DialogFilter} from "@tauri-apps/api/dialog"; import {DialogFilter} from "@tauri-apps/api/dialog";
@Component({ @Component({
selector: 'app-filesystem-import', selector: "app-filesystem-import",
templateUrl: './filesystem-import.component.html', templateUrl: "./filesystem-import.component.html",
styleUrls: ['./filesystem-import.component.scss'] styleUrls: ["./filesystem-import.component.scss"]
}) })
export class FilesystemImportComponent { export class FilesystemImportComponent {
@ -20,7 +20,10 @@ export class FilesystemImportComponent {
public files: FileOsMetadata[] = []; public files: FileOsMetadata[] = [];
public importOptions = new AddFileOptions(); public importOptions = new AddFileOptions();
public filters: DialogFilter[] = [ public filters: DialogFilter[] = [
{name: "Images", extensions: ["png", "jpg", "jpeg", "webp", "bmp", "gif"]}, {
name: "Images",
extensions: ["png", "jpg", "jpeg", "webp", "bmp", "gif"]
},
{name: "Videos", extensions: ["mp4", "mkv", "wmv", "avi", "webm"]}, {name: "Videos", extensions: ["mp4", "mkv", "wmv", "avi", "webm"]},
{name: "Audio", extensions: ["mp3", "ogg", "wav", "flac", "aac"]}, {name: "Audio", extensions: ["mp3", "ogg", "wav", "flac", "aac"]},
{name: "Documents", extensions: ["pdf", "doc", "docx", "odf"]}, {name: "Documents", extensions: ["pdf", "doc", "docx", "odf"]},

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {ImportTabSidebarComponent} from './import-tab-sidebar.component'; import {ImportTabSidebarComponent} from "./import-tab-sidebar.component";
describe('ImportTabSidebarComponent', () => { describe("ImportTabSidebarComponent", () => {
let component: ImportTabSidebarComponent; let component: ImportTabSidebarComponent;
let fixture: ComponentFixture<ImportTabSidebarComponent>; let fixture: ComponentFixture<ImportTabSidebarComponent>;
@ -19,7 +19,7 @@ describe('ImportTabSidebarComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,10 +1,10 @@
import {Component, EventEmitter, Output} from '@angular/core'; import {Component, EventEmitter, Output} from "@angular/core";
import {File} from "../../../../models/File"; import {File} from "../../../../models/File";
@Component({ @Component({
selector: 'app-import-tab-sidebar', selector: "app-import-tab-sidebar",
templateUrl: './import-tab-sidebar.component.html', templateUrl: "./import-tab-sidebar.component.html",
styleUrls: ['./import-tab-sidebar.component.scss'] styleUrls: ["./import-tab-sidebar.component.scss"]
}) })
export class ImportTabSidebarComponent { export class ImportTabSidebarComponent {

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {ImportTabComponent} from './import-tab.component'; import {ImportTabComponent} from "./import-tab.component";
describe('ImportTabComponent', () => { describe("ImportTabComponent", () => {
let component: ImportTabComponent; let component: ImportTabComponent;
let fixture: ComponentFixture<ImportTabComponent>; let fixture: ComponentFixture<ImportTabComponent>;
@ -19,7 +19,7 @@ describe('ImportTabComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,10 +1,10 @@
import {Component} from '@angular/core'; import {Component} from "@angular/core";
import {File} from "../../../models/File"; import {File} from "../../../models/File";
@Component({ @Component({
selector: 'app-import-tab', selector: "app-import-tab",
templateUrl: './import-tab.component.html', templateUrl: "./import-tab.component.html",
styleUrls: ['./import-tab.component.scss'] styleUrls: ["./import-tab.component.scss"]
}) })
export class ImportTabComponent { export class ImportTabComponent {

@ -4,7 +4,8 @@
<mat-form-field matTooltip="A unique name for the repository" matTooltipShowDelay="1000"> <mat-form-field matTooltip="A unique name for the repository" matTooltipShowDelay="1000">
<mat-label>Name</mat-label> <mat-label>Name</mat-label>
<input (blur)="validateName()" (change)="validateName()" (input)="validateName()" formControlName="name" matInput> <input (blur)="validateName()" (change)="validateName()" (input)="validateName()" formControlName="name"
matInput>
</mat-form-field> </mat-form-field>
<mat-form-field matTooltip="Type of repository if it's on the local system or somewhere else" <mat-form-field matTooltip="Type of repository if it's on the local system or somewhere else"
@ -27,7 +28,8 @@
<input (change)="this.checkLocalRepoExists()" formControlName="path" matInput> <input (change)="this.checkLocalRepoExists()" formControlName="path" matInput>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="repoTypeSelect.value === 'remote'" matTooltip="IP address and port of the remote repository" <mat-form-field *ngIf="repoTypeSelect.value === 'remote'"
matTooltip="IP address and port of the remote repository"
matTooltipShowDelay="1000"> matTooltipShowDelay="1000">
<mat-label>Address</mat-label> <mat-label>Address</mat-label>
<input formControlName="address" matInput> <input formControlName="address" matInput>

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {AddRepositoryDialogComponent} from './add-repository-dialog.component'; import {AddRepositoryDialogComponent} from "./add-repository-dialog.component";
describe('AddRepositoryDialogComponent', () => { describe("AddRepositoryDialogComponent", () => {
let component: AddRepositoryDialogComponent; let component: AddRepositoryDialogComponent;
let fixture: ComponentFixture<AddRepositoryDialogComponent>; let fixture: ComponentFixture<AddRepositoryDialogComponent>;
@ -19,7 +19,7 @@ describe('AddRepositoryDialogComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,4 +1,4 @@
import {Component, Inject, OnInit} from '@angular/core'; import {Component, Inject, OnInit} from "@angular/core";
import { import {
AbstractControl, AbstractControl,
FormControl, FormControl,
@ -13,9 +13,9 @@ import {dialog} from "@tauri-apps/api";
import {Repository} from "../../../../models/Repository"; import {Repository} from "../../../../models/Repository";
@Component({ @Component({
selector: 'app-add-repository-dialog', selector: "app-add-repository-dialog",
templateUrl: './add-repository-dialog.component.html', templateUrl: "./add-repository-dialog.component.html",
styleUrls: ['./add-repository-dialog.component.scss'] styleUrls: ["./add-repository-dialog.component.scss"]
}) })
export class AddRepositoryDialogComponent implements OnInit { export class AddRepositoryDialogComponent implements OnInit {

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {RepositoriesTabComponent} from './repositories-tab.component'; import {RepositoriesTabComponent} from "./repositories-tab.component";
describe('RepositoriesComponent', () => { describe("RepositoriesComponent", () => {
let component: RepositoriesTabComponent; let component: RepositoriesTabComponent;
let fixture: ComponentFixture<RepositoriesTabComponent>; let fixture: ComponentFixture<RepositoriesTabComponent>;
@ -19,7 +19,7 @@ describe('RepositoriesComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,13 +1,13 @@
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from "@angular/core";
import {Repository} from "../../../models/Repository"; import {Repository} from "../../../models/Repository";
import {RepositoryService} from "../../../services/repository/repository.service"; import {RepositoryService} from "../../../services/repository/repository.service";
import {MatDialog} from "@angular/material/dialog"; import {MatDialog} from "@angular/material/dialog";
import {AddRepositoryDialogComponent} from "./add-repository-dialog/add-repository-dialog.component"; import {AddRepositoryDialogComponent} from "./add-repository-dialog/add-repository-dialog.component";
@Component({ @Component({
selector: 'app-repositories-tab', selector: "app-repositories-tab",
templateUrl: './repositories-tab.component.html', templateUrl: "./repositories-tab.component.html",
styleUrls: ['./repositories-tab.component.scss'] styleUrls: ["./repositories-tab.component.scss"]
}) })
export class RepositoriesTabComponent implements OnInit { export class RepositoriesTabComponent implements OnInit {

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {RepositoryCardComponent} from './repository-card.component'; import {RepositoryCardComponent} from "./repository-card.component";
describe('RepositoryCardComponent', () => { describe("RepositoryCardComponent", () => {
let component: RepositoryCardComponent; let component: RepositoryCardComponent;
let fixture: ComponentFixture<RepositoryCardComponent>; let fixture: ComponentFixture<RepositoryCardComponent>;
@ -19,7 +19,7 @@ describe('RepositoryCardComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,4 +1,4 @@
import {Component, Input, OnDestroy, OnInit, ViewChild} from '@angular/core'; import {Component, Input, OnDestroy, OnInit, ViewChild} from "@angular/core";
import {Repository} from "../../../../models/Repository"; import {Repository} from "../../../../models/Repository";
import {RepositoryService} from "../../../../services/repository/repository.service"; import {RepositoryService} from "../../../../services/repository/repository.service";
import {Router} from "@angular/router"; import {Router} from "@angular/router";
@ -8,9 +8,9 @@ import {ConfirmDialogComponent} from "../../../shared/confirm-dialog/confirm-dia
import {BusyIndicatorComponent} from "../../../shared/busy-indicator/busy-indicator.component"; import {BusyIndicatorComponent} from "../../../shared/busy-indicator/busy-indicator.component";
@Component({ @Component({
selector: 'app-repository-card', selector: "app-repository-card",
templateUrl: './repository-card.component.html', templateUrl: "./repository-card.component.html",
styleUrls: ['./repository-card.component.scss'] styleUrls: ["./repository-card.component.scss"]
}) })
export class RepositoryCardComponent implements OnInit, OnDestroy { export class RepositoryCardComponent implements OnInit, OnDestroy {

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {BusyIndicatorComponent} from './busy-indicator.component'; import {BusyIndicatorComponent} from "./busy-indicator.component";
describe('BusyIndicatorComponent', () => { describe("BusyIndicatorComponent", () => {
let component: BusyIndicatorComponent; let component: BusyIndicatorComponent;
let fixture: ComponentFixture<BusyIndicatorComponent>; let fixture: ComponentFixture<BusyIndicatorComponent>;
@ -19,7 +19,7 @@ describe('BusyIndicatorComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,10 +1,10 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from "@angular/core";
import {ProgressSpinnerMode} from "@angular/material/progress-spinner"; import {ProgressSpinnerMode} from "@angular/material/progress-spinner";
@Component({ @Component({
selector: 'app-busy-indicator', selector: "app-busy-indicator",
templateUrl: './busy-indicator.component.html', templateUrl: "./busy-indicator.component.html",
styleUrls: ['./busy-indicator.component.scss'] styleUrls: ["./busy-indicator.component.scss"]
}) })
export class BusyIndicatorComponent { export class BusyIndicatorComponent {

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {ConfirmDialogComponent} from './confirm-dialog.component'; import {ConfirmDialogComponent} from "./confirm-dialog.component";
describe('ConfirmDialogComponent', () => { describe("ConfirmDialogComponent", () => {
let component: ConfirmDialogComponent; let component: ConfirmDialogComponent;
let fixture: ComponentFixture<ConfirmDialogComponent>; let fixture: ComponentFixture<ConfirmDialogComponent>;
@ -19,7 +19,7 @@ describe('ConfirmDialogComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,11 +1,11 @@
import {Component, Inject} from '@angular/core'; import {Component, Inject} from "@angular/core";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
import {ThemePalette} from "@angular/material/core"; import {ThemePalette} from "@angular/material/core";
@Component({ @Component({
selector: 'app-confirm-dialog', selector: "app-confirm-dialog",
templateUrl: './confirm-dialog.component.html', templateUrl: "./confirm-dialog.component.html",
styleUrls: ['./confirm-dialog.component.scss'] styleUrls: ["./confirm-dialog.component.scss"]
}) })
export class ConfirmDialogComponent { export class ConfirmDialogComponent {

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {ContentAwareImageComponent} from './content-aware-image.component'; import {ContentAwareImageComponent} from "./content-aware-image.component";
describe('ContentAwareImageComponent', () => { describe("ContentAwareImageComponent", () => {
let component: ContentAwareImageComponent; let component: ContentAwareImageComponent;
let fixture: ComponentFixture<ContentAwareImageComponent>; let fixture: ComponentFixture<ContentAwareImageComponent>;
@ -19,7 +19,7 @@ describe('ContentAwareImageComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,10 +1,10 @@
import {Component, ElementRef, Input, OnInit, ViewChild} from '@angular/core'; import {Component, ElementRef, Input, OnInit, ViewChild} from "@angular/core";
import {SafeResourceUrl} from "@angular/platform-browser"; import {SafeResourceUrl} from "@angular/platform-browser";
@Component({ @Component({
selector: 'app-content-aware-image', selector: "app-content-aware-image",
templateUrl: './content-aware-image.component.html', templateUrl: "./content-aware-image.component.html",
styleUrls: ['./content-aware-image.component.scss'] styleUrls: ["./content-aware-image.component.scss"]
}) })
export class ContentAwareImageComponent implements OnInit { export class ContentAwareImageComponent implements OnInit {

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {ContextMenuComponent} from './context-menu.component'; import {ContextMenuComponent} from "./context-menu.component";
describe('ContextMenuComponent', () => { describe("ContextMenuComponent", () => {
let component: ContextMenuComponent; let component: ContextMenuComponent;
let fixture: ComponentFixture<ContextMenuComponent>; let fixture: ComponentFixture<ContextMenuComponent>;
@ -19,7 +19,7 @@ describe('ContextMenuComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,10 +1,10 @@
import {Component, ViewChild,} from '@angular/core'; import {Component, ViewChild,} from "@angular/core";
import {MatMenuTrigger} from "@angular/material/menu"; import {MatMenuTrigger} from "@angular/material/menu";
@Component({ @Component({
selector: 'app-context-menu', selector: "app-context-menu",
templateUrl: './context-menu.component.html', templateUrl: "./context-menu.component.html",
styleUrls: ['./context-menu.component.scss'] styleUrls: ["./context-menu.component.scss"]
}) })
export class ContextMenuComponent { export class ContextMenuComponent {

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {FileContextMenuComponent} from './file-context-menu.component'; import {FileContextMenuComponent} from "./file-context-menu.component";
describe('FileContextMenuComponent', () => { describe("FileContextMenuComponent", () => {
let component: FileContextMenuComponent; let component: FileContextMenuComponent;
let fixture: ComponentFixture<FileContextMenuComponent>; let fixture: ComponentFixture<FileContextMenuComponent>;
@ -19,7 +19,7 @@ describe('FileContextMenuComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,4 +1,4 @@
import {Component, ViewChild} from '@angular/core'; import {Component, ViewChild} from "@angular/core";
import {File} from "../../../../models/File"; import {File} from "../../../../models/File";
import {ContextMenuComponent} from "../context-menu.component"; import {ContextMenuComponent} from "../context-menu.component";
import {clipboard} from "@tauri-apps/api"; import {clipboard} from "@tauri-apps/api";
@ -7,9 +7,9 @@ import {ErrorBrokerService} from "../../../../services/error-broker/error-broker
import {FileHelper} from "../../../../services/file/file.helper"; import {FileHelper} from "../../../../services/file/file.helper";
@Component({ @Component({
selector: 'app-file-context-menu', selector: "app-file-context-menu",
templateUrl: './file-context-menu.component.html', templateUrl: "./file-context-menu.component.html",
styleUrls: ['./file-context-menu.component.scss'] styleUrls: ["./file-context-menu.component.scss"]
}) })
export class FileContextMenuComponent { export class FileContextMenuComponent {

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {FileEditComponent} from './file-edit.component'; import {FileEditComponent} from "./file-edit.component";
describe('FileEditComponent', () => { describe("FileEditComponent", () => {
let component: FileEditComponent; let component: FileEditComponent;
let fixture: ComponentFixture<FileEditComponent>; let fixture: ComponentFixture<FileEditComponent>;
@ -19,7 +19,7 @@ describe('FileEditComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -6,7 +6,7 @@ import {
OnInit, OnInit,
SimpleChanges, SimpleChanges,
ViewChild ViewChild
} from '@angular/core'; } from "@angular/core";
import {File} from "../../../models/File"; import {File} from "../../../models/File";
import {Tag} from "../../../models/Tag"; import {Tag} from "../../../models/Tag";
import {CdkVirtualScrollViewport} from "@angular/cdk/scrolling"; import {CdkVirtualScrollViewport} from "@angular/cdk/scrolling";
@ -14,9 +14,9 @@ import {TagService} from "../../../services/tag/tag.service";
import {FileService} from "../../../services/file/file.service"; import {FileService} from "../../../services/file/file.service";
@Component({ @Component({
selector: 'app-file-edit', selector: "app-file-edit",
templateUrl: './file-edit.component.html', templateUrl: "./file-edit.component.html",
styleUrls: ['./file-edit.component.scss'] styleUrls: ["./file-edit.component.scss"]
}) })
export class FileEditComponent implements OnInit, OnChanges { export class FileEditComponent implements OnInit, OnChanges {
@ -55,7 +55,8 @@ export class FileEditComponent implements OnInit, OnChanges {
if (name.length > 0) { if (name.length > 0) {
const file = this.files[0]; const file = this.files[0];
console.log("Updating name to", name); console.log("Updating name to", name);
const responseFile = await this.fileService.updateFileName(file, name); const responseFile = await this.fileService.updateFileName(file,
name);
console.log("Updated name"); console.log("Updated name");
file.name = responseFile.name; file.name = responseFile.name;
this.resetFileNameInput(); this.resetFileNameInput();
@ -64,7 +65,8 @@ export class FileEditComponent implements OnInit, OnChanges {
public async editTag(tag: string): Promise<void> { public async editTag(tag: string): Promise<void> {
if (tag.length > 0) { if (tag.length > 0) {
let tagInstance = this.allTags.find(t => t.getNormalizedOutput() === tag); let tagInstance = this.allTags.find(
t => t.getNormalizedOutput() === tag);
if (!tagInstance) { if (!tagInstance) {
tagInstance = (await this.tagService.createTags([tag]))[0]; tagInstance = (await this.tagService.createTags([tag]))[0];
@ -94,7 +96,8 @@ export class FileEditComponent implements OnInit, OnChanges {
} else { } else {
removedTags.push(tag.id); removedTags.push(tag.id);
} }
this.fileTags[file.id] = await this.tagService.changeFileTags(file.id, this.fileTags[file.id] = await this.tagService.changeFileTags(
file.id,
addedTags, removedTags); addedTags, removedTags);
} }
this.mapFileTagsToTagList(); this.mapFileTagsToTagList();
@ -105,7 +108,8 @@ export class FileEditComponent implements OnInit, OnChanges {
async addTag(tag: Tag) { async addTag(tag: Tag) {
for (const file of this.files) { for (const file of this.files) {
if (this.fileTags[file.id].findIndex(t => t.id === tag.id) < 0) { if (this.fileTags[file.id].findIndex(t => t.id === tag.id) < 0) {
this.fileTags[file.id] = await this.tagService.changeFileTags(file.id, this.fileTags[file.id] = await this.tagService.changeFileTags(
file.id,
[tag.id], []); [tag.id], []);
} }
} }
@ -117,7 +121,8 @@ export class FileEditComponent implements OnInit, OnChanges {
public async removeTag(tag: Tag) { public async removeTag(tag: Tag) {
for (const file of this.files) { for (const file of this.files) {
if (this.fileTags[file.id].findIndex(t => t.id === tag.id) >= 0) { if (this.fileTags[file.id].findIndex(t => t.id === tag.id) >= 0) {
this.fileTags[file.id] = await this.tagService.changeFileTags(file.id, this.fileTags[file.id] = await this.tagService.changeFileTags(
file.id,
[], [tag.id]); [], [tag.id]);
} }
} }
@ -143,9 +148,11 @@ export class FileEditComponent implements OnInit, OnChanges {
for (const file of this.files) { for (const file of this.files) {
const fileTags = this.fileTags[file.id]; const fileTags = this.fileTags[file.id];
tags.push( tags.push(
...fileTags.filter(t => tags.findIndex(tag => tag.id === t.id) < 0)); ...fileTags.filter(
t => tags.findIndex(tag => tag.id === t.id) < 0));
} }
this.tags = tags.sort( this.tags = tags.sort(
(a, b) => a.getNormalizedOutput().localeCompare(b.getNormalizedOutput())); (a, b) => a.getNormalizedOutput()
.localeCompare(b.getNormalizedOutput()));
} }
} }

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {AudioViewerComponent} from './audio-viewer.component'; import {AudioViewerComponent} from "./audio-viewer.component";
describe('AudioViewerComponent', () => { describe("AudioViewerComponent", () => {
let component: AudioViewerComponent; let component: AudioViewerComponent;
let fixture: ComponentFixture<AudioViewerComponent>; let fixture: ComponentFixture<AudioViewerComponent>;
@ -19,7 +19,7 @@ describe('AudioViewerComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,10 +1,10 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from "@angular/core";
import {SafeResourceUrl} from "@angular/platform-browser"; import {SafeResourceUrl} from "@angular/platform-browser";
@Component({ @Component({
selector: 'app-audio-viewer', selector: "app-audio-viewer",
templateUrl: './audio-viewer.component.html', templateUrl: "./audio-viewer.component.html",
styleUrls: ['./audio-viewer.component.scss'] styleUrls: ["./audio-viewer.component.scss"]
}) })
export class AudioViewerComponent { export class AudioViewerComponent {

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {ContentViewerComponent} from './content-viewer.component'; import {ContentViewerComponent} from "./content-viewer.component";
describe('ContentViewerComponent', () => { describe("ContentViewerComponent", () => {
let component: ContentViewerComponent; let component: ContentViewerComponent;
let fixture: ComponentFixture<ContentViewerComponent>; let fixture: ComponentFixture<ContentViewerComponent>;
@ -19,7 +19,7 @@ describe('ContentViewerComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -6,7 +6,7 @@ import {
OnDestroy, OnDestroy,
SimpleChanges, SimpleChanges,
ViewChild ViewChild
} from '@angular/core'; } from "@angular/core";
import {SafeResourceUrl} from "@angular/platform-browser"; import {SafeResourceUrl} from "@angular/platform-browser";
import {File} from "../../../../../models/File"; import {File} from "../../../../../models/File";
import {FileService} from "../../../../../services/file/file.service"; import {FileService} from "../../../../../services/file/file.service";
@ -17,9 +17,9 @@ import {BusyIndicatorComponent} from "../../../busy-indicator/busy-indicator.com
type ContentType = "image" | "video" | "audio" | "other"; type ContentType = "image" | "video" | "audio" | "other";
@Component({ @Component({
selector: 'app-content-viewer', selector: "app-content-viewer",
templateUrl: './content-viewer.component.html', templateUrl: "./content-viewer.component.html",
styleUrls: ['./content-viewer.component.scss'] styleUrls: ["./content-viewer.component.scss"]
}) })
export class ContentViewerComponent implements AfterViewInit, OnChanges, OnDestroy { export class ContentViewerComponent implements AfterViewInit, OnChanges, OnDestroy {
@Input() file!: File; @Input() file!: File;

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {ImageViewerComponent} from './image-viewer.component'; import {ImageViewerComponent} from "./image-viewer.component";
describe('ImageViewerComponent', () => { describe("ImageViewerComponent", () => {
let component: ImageViewerComponent; let component: ImageViewerComponent;
let fixture: ComponentFixture<ImageViewerComponent>; let fixture: ComponentFixture<ImageViewerComponent>;
@ -19,7 +19,7 @@ describe('ImageViewerComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -4,14 +4,14 @@ import {
Input, Input,
OnChanges, OnChanges,
SimpleChanges SimpleChanges
} from '@angular/core'; } from "@angular/core";
import {CdkDragMove} from "@angular/cdk/drag-drop"; import {CdkDragMove} from "@angular/cdk/drag-drop";
import {SafeResourceUrl} from "@angular/platform-browser"; import {SafeResourceUrl} from "@angular/platform-browser";
@Component({ @Component({
selector: 'app-image-viewer', selector: "app-image-viewer",
templateUrl: './image-viewer.component.html', templateUrl: "./image-viewer.component.html",
styleUrls: ['./image-viewer.component.scss'] styleUrls: ["./image-viewer.component.scss"]
}) })
export class ImageViewerComponent implements OnChanges { export class ImageViewerComponent implements OnChanges {
@Input() imageUrl!: SafeResourceUrl | string; @Input() imageUrl!: SafeResourceUrl | string;

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {VideoViewerComponent} from './video-viewer.component'; import {VideoViewerComponent} from "./video-viewer.component";
describe('VideoViewerComponent', () => { describe("VideoViewerComponent", () => {
let component: VideoViewerComponent; let component: VideoViewerComponent;
let fixture: ComponentFixture<VideoViewerComponent>; let fixture: ComponentFixture<VideoViewerComponent>;
@ -19,7 +19,7 @@ describe('VideoViewerComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,10 +1,10 @@
import {Component, Input,} from '@angular/core'; import {Component, Input,} from "@angular/core";
import {SafeResourceUrl} from "@angular/platform-browser"; import {SafeResourceUrl} from "@angular/platform-browser";
@Component({ @Component({
selector: 'app-video-viewer', selector: "app-video-viewer",
templateUrl: './video-viewer.component.html', templateUrl: "./video-viewer.component.html",
styleUrls: ['./video-viewer.component.scss'] styleUrls: ["./video-viewer.component.scss"]
}) })
export class VideoViewerComponent { export class VideoViewerComponent {
@Input() blobUrl!: SafeResourceUrl; @Input() blobUrl!: SafeResourceUrl;

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {FileGalleryEntryComponent} from './file-gallery-entry.component'; import {FileGalleryEntryComponent} from "./file-gallery-entry.component";
describe('FileGalleryEntryComponent', () => { describe("FileGalleryEntryComponent", () => {
let component: FileGalleryEntryComponent; let component: FileGalleryEntryComponent;
let fixture: ComponentFixture<FileGalleryEntryComponent>; let fixture: ComponentFixture<FileGalleryEntryComponent>;
@ -19,7 +19,7 @@ describe('FileGalleryEntryComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -7,7 +7,7 @@ import {
OnInit, OnInit,
Output, Output,
SimpleChanges SimpleChanges
} from '@angular/core'; } from "@angular/core";
import {File} from "../../../../../models/File"; import {File} from "../../../../../models/File";
import {FileService} from "../../../../../services/file/file.service"; import {FileService} from "../../../../../services/file/file.service";
import {DomSanitizer, SafeResourceUrl} from "@angular/platform-browser"; import {DomSanitizer, SafeResourceUrl} from "@angular/platform-browser";
@ -15,9 +15,9 @@ import {ErrorBrokerService} from "../../../../../services/error-broker/error-bro
import {Selectable} from "../../../../../models/Selectable"; import {Selectable} from "../../../../../models/Selectable";
@Component({ @Component({
selector: 'app-file-gallery-entry', selector: "app-file-gallery-entry",
templateUrl: './file-gallery-entry.component.html', templateUrl: "./file-gallery-entry.component.html",
styleUrls: ['./file-gallery-entry.component.scss'] styleUrls: ["./file-gallery-entry.component.scss"]
}) })
export class FileGalleryEntryComponent implements OnInit, OnChanges { export class FileGalleryEntryComponent implements OnInit, OnChanges {
@ -48,7 +48,8 @@ export class FileGalleryEntryComponent implements OnInit, OnChanges {
this.contentUrl = undefined; this.contentUrl = undefined;
clearTimeout(this.urlSetTimeout); clearTimeout(this.urlSetTimeout);
this.urlSetTimeout = setTimeout( this.urlSetTimeout = setTimeout(
() => this.contentUrl = this.fileService.buildThumbnailUrl(this.file.data, () => this.contentUrl = this.fileService.buildThumbnailUrl(
this.file.data,
250, 250), 200); 250, 250), 200);
} }
} }

@ -2,7 +2,8 @@
<button (click)="this.closeEvent.emit(this)" class="close-button" mat-icon-button> <button (click)="this.closeEvent.emit(this)" class="close-button" mat-icon-button>
<ng-icon name="mat-close"></ng-icon> <ng-icon name="mat-close"></ng-icon>
</button> </button>
<div (dblclick)="this.selectedFile? this.fileDblClickEvent.emit(this.selectedFile.data) : null" class="file-full-view" <div (dblclick)="this.selectedFile? this.fileDblClickEvent.emit(this.selectedFile.data) : null"
class="file-full-view"
fxFlex="80%"> fxFlex="80%">
<app-content-viewer <app-content-viewer
(contextmenu)="this.selectedFile && fileContextMenu.onContextMenu($event, this.selectedFile!.data)" (contextmenu)="this.selectedFile && fileContextMenu.onContextMenu($event, this.selectedFile!.data)"
@ -13,7 +14,8 @@
<cdk-virtual-scroll-viewport #virtualScroll class="file-scroll-viewport" itemSize="260" maxBufferPx="3000" <cdk-virtual-scroll-viewport #virtualScroll class="file-scroll-viewport" itemSize="260" maxBufferPx="3000"
minBufferPx="1000" orientation="horizontal"> minBufferPx="1000" orientation="horizontal">
<div *cdkVirtualFor="let entry of entries" class="file-item"> <div *cdkVirtualFor="let entry of entries" class="file-item">
<app-file-gallery-entry (fileSelectEvent)="onEntrySelect($event)" [file]="entry"></app-file-gallery-entry> <app-file-gallery-entry (fileSelectEvent)="onEntrySelect($event)"
[file]="entry"></app-file-gallery-entry>
</div> </div>
</cdk-virtual-scroll-viewport> </cdk-virtual-scroll-viewport>
</div> </div>

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {FileGalleryComponent} from './file-gallery.component'; import {FileGalleryComponent} from "./file-gallery.component";
describe('FileGalleryComponent', () => { describe("FileGalleryComponent", () => {
let component: FileGalleryComponent; let component: FileGalleryComponent;
let fixture: ComponentFixture<FileGalleryComponent>; let fixture: ComponentFixture<FileGalleryComponent>;
@ -19,7 +19,7 @@ describe('FileGalleryComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -8,7 +8,7 @@ import {
Output, Output,
SimpleChanges, SimpleChanges,
ViewChild ViewChild
} from '@angular/core'; } from "@angular/core";
import {File} from "../../../../models/File"; import {File} from "../../../../models/File";
import {FileService} from "../../../../services/file/file.service"; import {FileService} from "../../../../services/file/file.service";
import {SafeResourceUrl} from "@angular/platform-browser"; import {SafeResourceUrl} from "@angular/platform-browser";
@ -17,9 +17,9 @@ import {CdkVirtualScrollViewport} from "@angular/cdk/scrolling";
import {TabService} from "../../../../services/tab/tab.service"; import {TabService} from "../../../../services/tab/tab.service";
@Component({ @Component({
selector: 'app-file-gallery', selector: "app-file-gallery",
templateUrl: './file-gallery.component.html', templateUrl: "./file-gallery.component.html",
styleUrls: ['./file-gallery.component.scss'] styleUrls: ["./file-gallery.component.scss"]
}) })
export class FileGalleryComponent implements OnChanges, OnInit { export class FileGalleryComponent implements OnChanges, OnInit {
@ -55,7 +55,8 @@ export class FileGalleryComponent implements OnChanges, OnInit {
if (this.virtualScroll) { if (this.virtualScroll) {
clearTimeout(this.scrollTimeout); clearTimeout(this.scrollTimeout);
this.scrollTimeout = setTimeout(() => this.scrollToSelection(), 0); // we need to make sure the viewport has rendered this.scrollTimeout = setTimeout(() => this.scrollToSelection(),
0); // we need to make sure the viewport has rendered
} }
this.fileSelectEvent.emit(this.selectedFile.data); this.fileSelectEvent.emit(this.selectedFile.data);
@ -74,8 +75,10 @@ export class FileGalleryComponent implements OnChanges, OnInit {
} }
async ngOnInit(): Promise<void> { async ngOnInit(): Promise<void> {
if (!this.selectedFile || this.files.indexOf(this.selectedFile.data) < 0) { if (!this.selectedFile || this.files.indexOf(
await this.onEntrySelect(this.getPreselectedEntry() ?? this.entries[0]) this.selectedFile.data) < 0) {
await this.onEntrySelect(
this.getPreselectedEntry() ?? this.entries[0])
} }
} }
@ -87,7 +90,8 @@ export class FileGalleryComponent implements OnChanges, OnInit {
f => f.hash === this.selectedFile?.data.hash); f => f.hash === this.selectedFile?.data.hash);
if (!this.selectedFile || selectedIndex < 0) { if (!this.selectedFile || selectedIndex < 0) {
await this.onEntrySelect(this.getPreselectedEntry() ?? this.entries[0]) await this.onEntrySelect(
this.getPreselectedEntry() ?? this.entries[0])
} else { } else {
await this.onEntrySelect(this.entries[selectedIndex]) await this.onEntrySelect(this.entries[selectedIndex])
} }
@ -143,7 +147,8 @@ export class FileGalleryComponent implements OnChanges, OnInit {
if (selectedIndex > indexAdjustment) { if (selectedIndex > indexAdjustment) {
this.virtualScroll.scrollToOffset( this.virtualScroll.scrollToOffset(
this.virtualScroll.measureScrollOffset("left") + 130, "smooth"); this.virtualScroll.measureScrollOffset("left") + 130,
"smooth");
} }
} }
} }

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {FileGridEntryComponent} from './file-grid-entry.component'; import {FileGridEntryComponent} from "./file-grid-entry.component";
describe('FileGridEntryComponent', () => { describe("FileGridEntryComponent", () => {
let component: FileGridEntryComponent; let component: FileGridEntryComponent;
let fixture: ComponentFixture<FileGridEntryComponent>; let fixture: ComponentFixture<FileGridEntryComponent>;
@ -19,7 +19,7 @@ describe('FileGridEntryComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -8,17 +8,16 @@ import {
Output, Output,
SimpleChanges, SimpleChanges,
ViewChild ViewChild
} from '@angular/core'; } from "@angular/core";
import {File} from "../../../../../models/File"; import {File} from "../../../../../models/File";
import {FileService} from "../../../../../services/file/file.service"; import {FileService} from "../../../../../services/file/file.service";
import {ErrorBrokerService} from "../../../../../services/error-broker/error-broker.service";
import {SafeResourceUrl} from "@angular/platform-browser"; import {SafeResourceUrl} from "@angular/platform-browser";
import {GridEntry} from "./GridEntry"; import {GridEntry} from "./GridEntry";
@Component({ @Component({
selector: 'app-file-grid-entry', selector: "app-file-grid-entry",
templateUrl: './file-grid-entry.component.html', templateUrl: "./file-grid-entry.component.html",
styleUrls: ['./file-grid-entry.component.scss'] styleUrls: ["./file-grid-entry.component.scss"]
}) })
export class FileGridEntryComponent implements OnInit, OnChanges { export class FileGridEntryComponent implements OnInit, OnChanges {

@ -4,7 +4,8 @@
<div *cdkVirtualFor="let rowEntry of partitionedGridEntries"> <div *cdkVirtualFor="let rowEntry of partitionedGridEntries">
<div class="file-row"> <div class="file-row">
<app-file-grid-entry <app-file-grid-entry
(clickEvent)="setSelectedFile($event.gridEntry)" (contextmenu)="fileContextMenu.onContextMenu($event, gridEntry.file)" (clickEvent)="setSelectedFile($event.gridEntry)"
(contextmenu)="fileContextMenu.onContextMenu($event, gridEntry.file)"
(dblClickEvent)="fileOpenEvent.emit($event.gridEntry.file)" (dblClickEvent)="fileOpenEvent.emit($event.gridEntry.file)"
*ngFor="let gridEntry of rowEntry" *ngFor="let gridEntry of rowEntry"
[gridEntry]="gridEntry"></app-file-grid-entry> [gridEntry]="gridEntry"></app-file-grid-entry>

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {FileGridComponent} from './file-grid.component'; import {FileGridComponent} from "./file-grid.component";
describe('FileGridComponent', () => { describe("FileGridComponent", () => {
let component: FileGridComponent; let component: FileGridComponent;
let fixture: ComponentFixture<FileGridComponent>; let fixture: ComponentFixture<FileGridComponent>;
@ -19,7 +19,7 @@ describe('FileGridComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -9,7 +9,7 @@ import {
Output, Output,
SimpleChanges, SimpleChanges,
ViewChild ViewChild
} from '@angular/core'; } from "@angular/core";
import {File} from "../../../../models/File"; import {File} from "../../../../models/File";
import {FileGridEntryComponent} from "./file-grid-entry/file-grid-entry.component"; import {FileGridEntryComponent} from "./file-grid-entry/file-grid-entry.component";
import {GridEntry} from "./file-grid-entry/GridEntry"; import {GridEntry} from "./file-grid-entry/GridEntry";
@ -18,9 +18,9 @@ import {TabService} from "../../../../services/tab/tab.service";
import {FileService} from "../../../../services/file/file.service"; import {FileService} from "../../../../services/file/file.service";
@Component({ @Component({
selector: 'app-file-grid', selector: "app-file-grid",
templateUrl: './file-grid.component.html', templateUrl: "./file-grid.component.html",
styleUrls: ['./file-grid.component.scss'] styleUrls: ["./file-grid.component.scss"]
}) })
export class FileGridComponent implements OnChanges, OnInit { export class FileGridComponent implements OnChanges, OnInit {

@ -1,5 +1,7 @@
<app-file-grid (fileOpenEvent)="this.onFileOpen($event)" (fileSelectEvent)="this.onFileSelect($event)" *ngIf="this.mode === 'grid'" <app-file-grid (fileOpenEvent)="this.onFileOpen($event)" (fileSelectEvent)="this.onFileSelect($event)"
*ngIf="this.mode === 'grid'"
[files]="this.files" [preselectedFile]="this.preselectedFile"></app-file-grid> [files]="this.files" [preselectedFile]="this.preselectedFile"></app-file-grid>
<app-file-gallery (closeEvent)="this.mode = 'grid'" (fileSelectEvent)="this.onSinglefileSelect($event)" *ngIf="this.mode === 'gallery'" <app-file-gallery (closeEvent)="this.mode = 'grid'" (fileSelectEvent)="this.onSinglefileSelect($event)"
*ngIf="this.mode === 'gallery'"
[files]="this.files" [files]="this.files"
[preselectedFile]="this.preselectedFile"></app-file-gallery> [preselectedFile]="this.preselectedFile"></app-file-gallery>

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {FileMultiviewComponent} from './file-multiview.component'; import {FileMultiviewComponent} from "./file-multiview.component";
describe('FileMultiviewComponent', () => { describe("FileMultiviewComponent", () => {
let component: FileMultiviewComponent; let component: FileMultiviewComponent;
let fixture: ComponentFixture<FileMultiviewComponent>; let fixture: ComponentFixture<FileMultiviewComponent>;
@ -19,7 +19,7 @@ describe('FileMultiviewComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,10 +1,10 @@
import {Component, EventEmitter, Input, Output} from '@angular/core'; import {Component, EventEmitter, Input, Output} from "@angular/core";
import {File} from "../../../models/File"; import {File} from "../../../models/File";
@Component({ @Component({
selector: 'app-file-multiview', selector: "app-file-multiview",
templateUrl: './file-multiview.component.html', templateUrl: "./file-multiview.component.html",
styleUrls: ['./file-multiview.component.scss'] styleUrls: ["./file-multiview.component.scss"]
}) })
export class FileMultiviewComponent { export class FileMultiviewComponent {

@ -9,7 +9,8 @@
<ng-icon name="mat-delete-sweep"></ng-icon> <ng-icon name="mat-delete-sweep"></ng-icon>
</button> </button>
</div> </div>
<app-tag-input (tagAdded)="addSearchTag($event); searchForFiles()" [allowNegation]="true" [availableTags]="getValidSearchTags()" <app-tag-input (tagAdded)="addSearchTag($event); searchForFiles()" [allowNegation]="true"
[availableTags]="getValidSearchTags()"
class="full-width"> class="full-width">
<button (click)="openFilterDialog()" class="filter-dialog-button" mat-button> <button (click)="openFilterDialog()" class="filter-dialog-button" mat-button>
<ng-icon name="mat-filter-alt"></ng-icon> <ng-icon name="mat-filter-alt"></ng-icon>

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {FileSearchComponent} from './file-search.component'; import {FileSearchComponent} from "./file-search.component";
describe('FileSearchComponent', () => { describe("FileSearchComponent", () => {
let component: FileSearchComponent; let component: FileSearchComponent;
let fixture: ComponentFixture<FileSearchComponent>; let fixture: ComponentFixture<FileSearchComponent>;
@ -19,7 +19,7 @@ describe('FileSearchComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -7,7 +7,7 @@ import {
OnInit, OnInit,
Output, Output,
ViewChild ViewChild
} from '@angular/core'; } from "@angular/core";
import {FileService} from "../../../services/file/file.service"; import {FileService} from "../../../services/file/file.service";
import {TagQuery} from "../../../models/TagQuery"; import {TagQuery} from "../../../models/TagQuery";
import {SortKey} from "../../../models/SortKey"; import {SortKey} from "../../../models/SortKey";
@ -23,9 +23,9 @@ import {Tag} from "../../../models/Tag";
@Component({ @Component({
selector: 'app-file-search', selector: "app-file-search",
templateUrl: './file-search.component.html', templateUrl: "./file-search.component.html",
styleUrls: ['./file-search.component.scss'] styleUrls: ["./file-search.component.scss"]
}) })
export class FileSearchComponent implements AfterViewChecked, OnInit { export class FileSearchComponent implements AfterViewChecked, OnInit {
public sortExpression: SortKey[] = [new SortKey("FileImportedTime", public sortExpression: SortKey[] = [new SortKey("FileImportedTime",
@ -66,7 +66,7 @@ export class FileSearchComponent implements AfterViewChecked, OnInit {
public addSearchTag(tag: string) { public addSearchTag(tag: string) {
this.filters.push(new SingleFilterExpression(TagQuery.fromString(tag))); this.filters.push(new SingleFilterExpression(TagQuery.fromString(tag)));
tag = tag.replace(/^-/g, ''); tag = tag.replace(/^-/g, "");
if (this.filters.filter(t => t.partiallyEq(tag)).length > 1) { if (this.filters.filter(t => t.partiallyEq(tag)).length > 1) {
const index = this.filters.findIndex(t => t.partiallyEq(tag)); const index = this.filters.findIndex(t => t.partiallyEq(tag));
@ -95,7 +95,8 @@ export class FileSearchComponent implements AfterViewChecked, OnInit {
public openSortDialog() { public openSortDialog() {
const sortEntries = this.sortExpression.map( const sortEntries = this.sortExpression.map(
key => JSON.parse(JSON.stringify(key))).map( key => JSON.parse(JSON.stringify(key))).map(
key => new SortKey(key.sortType, key.sortDirection, key.namespaceName)) key => new SortKey(key.sortType, key.sortDirection,
key.namespaceName))
const openedDialog = this.dialog.open(SortDialogComponent, { const openedDialog = this.dialog.open(SortDialogComponent, {
minWidth: "40vw", minWidth: "40vw",
data: { data: {

@ -2,7 +2,8 @@
<div class="filter-dialog-content" mat-dialog-content> <div class="filter-dialog-content" mat-dialog-content>
<div class="filter-dialog-list"> <div class="filter-dialog-list">
<mat-list class="mat-filter-dialog-list"> <mat-list class="mat-filter-dialog-list">
<mat-list-item *ngFor="let expression of filters" [class.selected]="expression.selected" class="filter-list-item"> <mat-list-item *ngFor="let expression of filters" [class.selected]="expression.selected"
class="filter-list-item">
<app-tag-filter-list-item (contextmenu)="contextMenu.onContextMenu($event)" <app-tag-filter-list-item (contextmenu)="contextMenu.onContextMenu($event)"
(querySelect)="this.addToSelection($event)" (querySelect)="this.addToSelection($event)"
(queryUnselect)="this.removeFromSelection($event)" (queryUnselect)="this.removeFromSelection($event)"

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {FilterDialogComponent} from './filter-dialog.component'; import {FilterDialogComponent} from "./filter-dialog.component";
describe('FilterDialogComponent', () => { describe("FilterDialogComponent", () => {
let component: FilterDialogComponent; let component: FilterDialogComponent;
let fixture: ComponentFixture<FilterDialogComponent>; let fixture: ComponentFixture<FilterDialogComponent>;
@ -19,7 +19,7 @@ describe('FilterDialogComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,4 +1,4 @@
import {Component, HostListener, Inject, ViewChildren} from '@angular/core'; import {Component, HostListener, Inject, ViewChildren} from "@angular/core";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
import {SortDialogComponent} from "../sort-dialog/sort-dialog.component"; import {SortDialogComponent} from "../sort-dialog/sort-dialog.component";
import { import {
@ -12,9 +12,9 @@ import {TagFilterListItemComponent} from "./tag-filter-list-item/tag-filter-list
import {Selectable} from "../../../../models/Selectable"; import {Selectable} from "../../../../models/Selectable";
@Component({ @Component({
selector: 'app-filter-dialog', selector: "app-filter-dialog",
templateUrl: './filter-dialog.component.html', templateUrl: "./filter-dialog.component.html",
styleUrls: ['./filter-dialog.component.scss'] styleUrls: ["./filter-dialog.component.scss"]
}) })
export class FilterDialogComponent { export class FilterDialogComponent {
@ -75,12 +75,14 @@ export class FilterDialogComponent {
if (this.mode === "AND" || this.filters.length === 0) { if (this.mode === "AND" || this.filters.length === 0) {
this.filters.push( this.filters.push(
new Selectable<FilterExpression>(new SingleFilterExpression(query), new Selectable<FilterExpression>(
new SingleFilterExpression(query),
false)); false));
tag = tag.replace(/^-/g, ''); tag = tag.replace(/^-/g, "");
if (this.filters.filter(t => t.data.partiallyEq(tag)).length > 1) { if (this.filters.filter(t => t.data.partiallyEq(tag)).length > 1) {
const index = this.filters.findIndex(t => t.data.partiallyEq(tag)); const index = this.filters.findIndex(
t => t.data.partiallyEq(tag));
this.filters.splice(index, 1); this.filters.splice(index, 1);
} }
} else { } else {
@ -116,7 +118,8 @@ export class FilterDialogComponent {
public convertSelectionToAndExpression(): void { public convertSelectionToAndExpression(): void {
for (const query of this.selectedQueries) { for (const query of this.selectedQueries) {
this.filters.push( this.filters.push(
new Selectable<FilterExpression>(new SingleFilterExpression(query), new Selectable<FilterExpression>(
new SingleFilterExpression(query),
false)); false));
} }
this.removeFilterDuplicates(); this.removeFilterDuplicates();

@ -6,12 +6,14 @@
</div> </div>
<div *ngIf="expression.data.filter_type === 'OrExpression'"> <div *ngIf="expression.data.filter_type === 'OrExpression'">
<mat-list> <mat-list>
<mat-list-item (mousedown)="$event.button === 0 && this.selectInnerIndex(entry[0])" *ngFor="let entry of enumerate(this.expression.data.queryList())" <mat-list-item (mousedown)="$event.button === 0 && this.selectInnerIndex(entry[0])"
*ngFor="let entry of enumerate(this.expression.data.queryList())"
[class.selected]="this.selectedIndices.includes(entry[0])" [class.selected]="this.selectedIndices.includes(entry[0])"
class="or-filter-list-item"> class="or-filter-list-item">
<span *ngIf="entry[0] > 0" class="or-span">OR</span> <span *ngIf="entry[0] > 0" class="or-span">OR</span>
{{entry[1].getNormalizedTag()}} {{entry[1].getNormalizedTag()}}
<button (mousedown)="$event.button === 0 && this.removeOrExpression(entry[0])" class="remove-button-inner-list" <button (mousedown)="$event.button === 0 && this.removeOrExpression(entry[0])"
class="remove-button-inner-list"
mat-button> mat-button>
<ng-icon name="mat-remove"></ng-icon> <ng-icon name="mat-remove"></ng-icon>
</button> </button>

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {TagFilterListItemComponent} from './tag-filter-list-item.component'; import {TagFilterListItemComponent} from "./tag-filter-list-item.component";
describe('TagFilterListItemComponent', () => { describe("TagFilterListItemComponent", () => {
let component: TagFilterListItemComponent; let component: TagFilterListItemComponent;
let fixture: ComponentFixture<TagFilterListItemComponent>; let fixture: ComponentFixture<TagFilterListItemComponent>;
@ -19,7 +19,7 @@ describe('TagFilterListItemComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,12 +1,11 @@
import { import {
ChangeDetectorRef,
Component, Component,
EventEmitter, EventEmitter,
Input, Input,
OnChanges, OnChanges,
Output, Output,
SimpleChanges SimpleChanges
} from '@angular/core'; } from "@angular/core";
import { import {
FilterExpression, FilterExpression,
OrFilterExpression, OrFilterExpression,
@ -16,9 +15,9 @@ import {TagQuery} from "../../../../../models/TagQuery";
import {Selectable} from "../../../../../models/Selectable"; import {Selectable} from "../../../../../models/Selectable";
@Component({ @Component({
selector: 'app-tag-filter-list-item', selector: "app-tag-filter-list-item",
templateUrl: './tag-filter-list-item.component.html', templateUrl: "./tag-filter-list-item.component.html",
styleUrls: ['./tag-filter-list-item.component.scss'] styleUrls: ["./tag-filter-list-item.component.scss"]
}) })
export class TagFilterListItemComponent implements OnChanges { export class TagFilterListItemComponent implements OnChanges {
@ -49,7 +48,8 @@ export class TagFilterListItemComponent implements OnChanges {
if (expression.filter.length == 0) { if (expression.filter.length == 0) {
this.removeClicked.emit(this); this.removeClicked.emit(this);
} else if (expression.filter.length == 1) { } else if (expression.filter.length == 1) {
this.expression.data = new SingleFilterExpression(expression.filter[0]); this.expression.data = new SingleFilterExpression(
expression.filter[0]);
} }
} }

@ -33,7 +33,8 @@
<mat-option value="Descending">Descending</mat-option> <mat-option value="Descending">Descending</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<button (click)="addNewSortKey()" *ngIf="sortEntries.indexOf(sortKey) === sortEntries.length -1" mat-flat-button> <button (click)="addNewSortKey()" *ngIf="sortEntries.indexOf(sortKey) === sortEntries.length -1"
mat-flat-button>
<ng-icon name="mat-add"></ng-icon> <ng-icon name="mat-add"></ng-icon>
</button> </button>
<button (click)="removeSortKey(sortKey)" *ngIf="sortEntries.indexOf(sortKey) !== sortEntries.length -1" <button (click)="removeSortKey(sortKey)" *ngIf="sortEntries.indexOf(sortKey) !== sortEntries.length -1"

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {SortDialogComponent} from './sort-dialog.component'; import {SortDialogComponent} from "./sort-dialog.component";
describe('FilterDialogComponent', () => { describe("FilterDialogComponent", () => {
let component: SortDialogComponent; let component: SortDialogComponent;
let fixture: ComponentFixture<SortDialogComponent>; let fixture: ComponentFixture<SortDialogComponent>;
@ -19,7 +19,7 @@ describe('FilterDialogComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,12 +1,12 @@
import {Component, Inject} from '@angular/core'; import {Component, Inject} from "@angular/core";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
import {SortKey} from "../../../../models/SortKey"; import {SortKey} from "../../../../models/SortKey";
import {CdkDragDrop, moveItemInArray} from "@angular/cdk/drag-drop"; import {CdkDragDrop, moveItemInArray} from "@angular/cdk/drag-drop";
@Component({ @Component({
selector: 'app-sort-dialog', selector: "app-sort-dialog",
templateUrl: './sort-dialog.component.html', templateUrl: "./sort-dialog.component.html",
styleUrls: ['./sort-dialog.component.scss'] styleUrls: ["./sort-dialog.component.scss"]
}) })
export class SortDialogComponent { export class SortDialogComponent {
@ -36,6 +36,7 @@ export class SortDialogComponent {
} }
public onSortEntryDrop(event: CdkDragDrop<SortKey[]>): void { public onSortEntryDrop(event: CdkDragDrop<SortKey[]>): void {
moveItemInArray(this.sortEntries, event.previousIndex, event.currentIndex); moveItemInArray(this.sortEntries, event.previousIndex,
event.currentIndex);
} }
} }

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {FileThumbnailComponent} from './file-thumbnail.component'; import {FileThumbnailComponent} from "./file-thumbnail.component";
describe('FileThumbnailComponent', () => { describe("FileThumbnailComponent", () => {
let component: FileThumbnailComponent; let component: FileThumbnailComponent;
let fixture: ComponentFixture<FileThumbnailComponent>; let fixture: ComponentFixture<FileThumbnailComponent>;
@ -19,7 +19,7 @@ describe('FileThumbnailComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -4,16 +4,16 @@ import {
OnChanges, OnChanges,
OnInit, OnInit,
SimpleChanges SimpleChanges
} from '@angular/core'; } from "@angular/core";
import {File} from "../../../models/File"; import {File} from "../../../models/File";
import {FileService} from "../../../services/file/file.service"; import {FileService} from "../../../services/file/file.service";
import {FileHelper} from "../../../services/file/file.helper"; import {FileHelper} from "../../../services/file/file.helper";
import {SafeResourceUrl} from "@angular/platform-browser"; import {SafeResourceUrl} from "@angular/platform-browser";
@Component({ @Component({
selector: 'app-file-thumbnail', selector: "app-file-thumbnail",
templateUrl: './file-thumbnail.component.html', templateUrl: "./file-thumbnail.component.html",
styleUrls: ['./file-thumbnail.component.scss'] styleUrls: ["./file-thumbnail.component.scss"]
}) })
export class FileThumbnailComponent implements OnInit, OnChanges { export class FileThumbnailComponent implements OnInit, OnChanges {
@ -32,14 +32,16 @@ export class FileThumbnailComponent implements OnInit, OnChanges {
public ngOnChanges(changes: SimpleChanges): void { public ngOnChanges(changes: SimpleChanges): void {
if (changes["file"]) { if (changes["file"]) {
this.thumbUrl = this.fileService.buildThumbnailUrl(this.file, 250, 250) this.thumbUrl = this.fileService.buildThumbnailUrl(this.file, 250,
250)
} }
} }
public getThumbnailSupported(): boolean { public getThumbnailSupported(): boolean {
const mimeParts = FileHelper.parseMime(this.file.mime_type); const mimeParts = FileHelper.parseMime(this.file.mime_type);
return !!mimeParts && this.supportedThumbnailTypes.includes(mimeParts[0]); return !!mimeParts && this.supportedThumbnailTypes.includes(
mimeParts[0]);
} }
public getFileType(): string { public getFileType(): string {

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {NativeFileSelectComponent} from './native-file-select.component'; import {NativeFileSelectComponent} from "./native-file-select.component";
describe('NativeFileSelectComponent', () => { describe("NativeFileSelectComponent", () => {
let component: NativeFileSelectComponent; let component: NativeFileSelectComponent;
let fixture: ComponentFixture<NativeFileSelectComponent>; let fixture: ComponentFixture<NativeFileSelectComponent>;
@ -19,7 +19,7 @@ describe('NativeFileSelectComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -6,15 +6,15 @@ import {
OnInit, OnInit,
Output, Output,
SimpleChanges SimpleChanges
} from '@angular/core'; } from "@angular/core";
import {FormControl} from "@angular/forms"; import {FormControl} from "@angular/forms";
import {dialog} from "@tauri-apps/api"; import {dialog} from "@tauri-apps/api";
import {DialogFilter} from "@tauri-apps/api/dialog"; import {DialogFilter} from "@tauri-apps/api/dialog";
@Component({ @Component({
selector: 'app-native-file-select', selector: "app-native-file-select",
templateUrl: './native-file-select.component.html', templateUrl: "./native-file-select.component.html",
styleUrls: ['./native-file-select.component.scss'] styleUrls: ["./native-file-select.component.scss"]
}) })
export class NativeFileSelectComponent implements OnInit, OnChanges { export class NativeFileSelectComponent implements OnInit, OnChanges {

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {TagInputComponent} from './tag-input.component'; import {TagInputComponent} from "./tag-input.component";
describe('TagInputComponent', () => { describe("TagInputComponent", () => {
let component: TagInputComponent; let component: TagInputComponent;
let fixture: ComponentFixture<TagInputComponent>; let fixture: ComponentFixture<TagInputComponent>;
@ -19,7 +19,7 @@ describe('TagInputComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -7,7 +7,7 @@ import {
Output, Output,
SimpleChanges, SimpleChanges,
ViewChild ViewChild
} from '@angular/core'; } from "@angular/core";
import {Tag} from "../../../../models/Tag"; import {Tag} from "../../../../models/Tag";
import {FormControl} from "@angular/forms"; import {FormControl} from "@angular/forms";
import {MatAutocompleteSelectedEvent} from "@angular/material/autocomplete"; import {MatAutocompleteSelectedEvent} from "@angular/material/autocomplete";
@ -15,9 +15,9 @@ import {Observable} from "rxjs";
import {debounceTime, map, startWith} from "rxjs/operators"; import {debounceTime, map, startWith} from "rxjs/operators";
@Component({ @Component({
selector: 'app-tag-input', selector: "app-tag-input",
templateUrl: './tag-input.component.html', templateUrl: "./tag-input.component.html",
styleUrls: ['./tag-input.component.scss'] styleUrls: ["./tag-input.component.scss"]
}) })
export class TagInputComponent implements OnChanges { export class TagInputComponent implements OnChanges {

@ -1,5 +1,5 @@
import {NgModule} from '@angular/core'; import {NgModule} from "@angular/core";
import {CommonModule} from '@angular/common'; import {CommonModule} from "@angular/common";
import {RepositoryCardComponent} from "../core/repositories-tab/repository-card/repository-card.component"; import {RepositoryCardComponent} from "../core/repositories-tab/repository-card/repository-card.component";
import {FileGridComponent} from "./file-multiview/file-grid/file-grid.component"; import {FileGridComponent} from "./file-multiview/file-grid/file-grid.component";
import {FileGridEntryComponent} from "./file-multiview/file-grid/file-grid-entry/file-grid-entry.component"; import {FileGridEntryComponent} from "./file-multiview/file-grid/file-grid-entry/file-grid-entry.component";

@ -1,8 +1,8 @@
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentFixture, TestBed} from "@angular/core/testing";
import {TagItemComponent} from './tag-item.component'; import {TagItemComponent} from "./tag-item.component";
describe('TagItemComponent', () => { describe("TagItemComponent", () => {
let component: TagItemComponent; let component: TagItemComponent;
let fixture: ComponentFixture<TagItemComponent>; let fixture: ComponentFixture<TagItemComponent>;
@ -19,7 +19,7 @@ describe('TagItemComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it("should create", () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

@ -1,10 +1,10 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from "@angular/core";
import {Tag} from "../../../models/Tag"; import {Tag} from "../../../models/Tag";
@Component({ @Component({
selector: 'app-tag-item', selector: "app-tag-item",
templateUrl: './tag-item.component.html', templateUrl: "./tag-item.component.html",
styleUrls: ['./tag-item.component.scss'] styleUrls: ["./tag-item.component.scss"]
}) })
export class TagItemComponent { export class TagItemComponent {

@ -36,7 +36,8 @@ export class OrFilterExpression implements FilterExpression {
} }
public clone(): OrFilterExpression { public clone(): OrFilterExpression {
let tags = this.filter.map((t: TagQuery) => new TagQuery(t.tag, t.negate)); let tags = this.filter.map(
(t: TagQuery) => new TagQuery(t.tag, t.negate));
return new OrFilterExpression(tags) return new OrFilterExpression(tags)
} }

@ -11,7 +11,7 @@ export class Tag {
public getNormalizedOutput(): string { public getNormalizedOutput(): string {
if (!this.normalizedTag) { if (!this.normalizedTag) {
this.normalizedTag = this.namespace ? this.namespace + ':' + this.name : this.name this.normalizedTag = this.namespace ? this.namespace + ":" + this.name : this.name
} }
return this.normalizedTag; return this.normalizedTag;
} }

@ -4,7 +4,7 @@ export class TagQuery {
public static fromString(tag: string): TagQuery { public static fromString(tag: string): TagQuery {
if (tag.startsWith("-")) { if (tag.startsWith("-")) {
return new TagQuery(tag.replace(/^-/g, ''), true); return new TagQuery(tag.replace(/^-/g, ""), true);
} else { } else {
return new TagQuery(tag, false); return new TagQuery(tag, false);
} }

@ -1,8 +1,8 @@
import {TestBed} from '@angular/core/testing'; import {TestBed} from "@angular/core/testing";
import {ErrorBrokerService} from './error-broker.service'; import {ErrorBrokerService} from "./error-broker.service";
describe('ErrorBrokerService', () => { describe("ErrorBrokerService", () => {
let service: ErrorBrokerService; let service: ErrorBrokerService;
beforeEach(() => { beforeEach(() => {
@ -10,7 +10,7 @@ describe('ErrorBrokerService', () => {
service = TestBed.inject(ErrorBrokerService); service = TestBed.inject(ErrorBrokerService);
}); });
it('should be created', () => { it("should be created", () => {
expect(service).toBeTruthy(); expect(service).toBeTruthy();
}); });
}); });

@ -1,8 +1,8 @@
import {Injectable} from '@angular/core'; import {Injectable} from "@angular/core";
import {listen} from "@tauri-apps/api/event"; import {listen} from "@tauri-apps/api/event";
@Injectable({ @Injectable({
providedIn: 'root' providedIn: "root"
}) })
export class ErrorBrokerService { export class ErrorBrokerService {

@ -1,8 +1,8 @@
import {TestBed} from '@angular/core/testing'; import {TestBed} from "@angular/core/testing";
import {FileService} from './file.service'; import {FileService} from "./file.service";
describe('FileService', () => { describe("FileService", () => {
let service: FileService; let service: FileService;
beforeEach(() => { beforeEach(() => {
@ -10,7 +10,7 @@ describe('FileService', () => {
service = TestBed.inject(FileService); service = TestBed.inject(FileService);
}); });
it('should be created', () => { it("should be created", () => {
expect(service).toBeTruthy(); expect(service).toBeTruthy();
}); });
}); });

@ -1,4 +1,4 @@
import {Inject, Injectable} from '@angular/core'; import {Inject, Injectable} from "@angular/core";
import {BehaviorSubject} from "rxjs"; import {BehaviorSubject} from "rxjs";
import {File} from "../../models/File"; import {File} from "../../models/File";
import {invoke} from "@tauri-apps/api/tauri"; import {invoke} from "@tauri-apps/api/tauri";
@ -10,7 +10,7 @@ import {FilterExpression} from "../../models/FilterExpression";
@Injectable({ @Injectable({
providedIn: 'root' providedIn: "root"
}) })
export class FileService { export class FileService {

@ -1,8 +1,8 @@
import {TestBed} from '@angular/core/testing'; import {TestBed} from "@angular/core/testing";
import {ImportService} from './import.service'; import {ImportService} from "./import.service";
describe('ImportService', () => { describe("ImportService", () => {
let service: ImportService; let service: ImportService;
beforeEach(() => { beforeEach(() => {
@ -10,7 +10,7 @@ describe('ImportService', () => {
service = TestBed.inject(ImportService); service = TestBed.inject(ImportService);
}); });
it('should be created', () => { it("should be created", () => {
expect(service).toBeTruthy(); expect(service).toBeTruthy();
}); });
}); });

@ -1,11 +1,11 @@
import {Injectable} from '@angular/core'; import {Injectable} from "@angular/core";
import {FileOsMetadata} from "../../models/FileOsMetadata"; import {FileOsMetadata} from "../../models/FileOsMetadata";
import {invoke} from "@tauri-apps/api/tauri"; import {invoke} from "@tauri-apps/api/tauri";
import {AddFileOptions} from "../../models/AddFileOptions"; import {AddFileOptions} from "../../models/AddFileOptions";
import {File} from "../../models/File"; import {File} from "../../models/File";
@Injectable({ @Injectable({
providedIn: 'root' providedIn: "root"
}) })
export class ImportService { export class ImportService {

@ -1,8 +1,8 @@
import {TestBed} from '@angular/core/testing'; import {TestBed} from "@angular/core/testing";
import {RepositoryService} from './repository.service'; import {RepositoryService} from "./repository.service";
describe('RepositoryService', () => { describe("RepositoryService", () => {
let service: RepositoryService; let service: RepositoryService;
beforeEach(() => { beforeEach(() => {
@ -10,7 +10,7 @@ describe('RepositoryService', () => {
service = TestBed.inject(RepositoryService); service = TestBed.inject(RepositoryService);
}); });
it('should be created', () => { it("should be created", () => {
expect(service).toBeTruthy(); expect(service).toBeTruthy();
}); });
}); });

@ -1,4 +1,4 @@
import {Injectable} from '@angular/core'; import {Injectable} from "@angular/core";
import {Repository} from "../../models/Repository"; import {Repository} from "../../models/Repository";
import {BehaviorSubject} from "rxjs"; import {BehaviorSubject} from "rxjs";
import {invoke} from "@tauri-apps/api/tauri"; import {invoke} from "@tauri-apps/api/tauri";
@ -7,7 +7,7 @@ import {Info} from "../../models/Info";
import {ErrorBrokerService} from "../error-broker/error-broker.service"; import {ErrorBrokerService} from "../error-broker/error-broker.service";
@Injectable({ @Injectable({
providedIn: 'root' providedIn: "root"
}) })
export class RepositoryService { export class RepositoryService {
repositories = new BehaviorSubject<Repository[]>([]); repositories = new BehaviorSubject<Repository[]>([]);
@ -32,7 +32,8 @@ export class RepositoryService {
*/ */
public async loadRepositories() { public async loadRepositories() {
await this.loadSelectedRepository(); await this.loadSelectedRepository();
let repos = await invoke<Repository[]>("plugin:mediarepo|get_repositories"); let repos = await invoke<Repository[]>(
"plugin:mediarepo|get_repositories");
this.repositories.next(repos); this.repositories.next(repos);
} }
@ -81,7 +82,8 @@ export class RepositoryService {
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
public async addRepository(name: string, path: string | undefined, address: string | undefined, local: boolean) { public async addRepository(name: string, path: string | undefined, address: string | undefined, local: boolean) {
let repos = await invoke<Repository[]>("plugin:mediarepo|add_repository", let repos = await invoke<Repository[]>(
"plugin:mediarepo|add_repository",
{name, path, address, local}); {name, path, address, local});
this.repositories.next(repos); this.repositories.next(repos);
} }

@ -1,8 +1,8 @@
import {TestBed} from '@angular/core/testing'; import {TestBed} from "@angular/core/testing";
import {TabService} from './tab.service'; import {TabService} from "./tab.service";
describe('TabService', () => { describe("TabService", () => {
let service: TabService; let service: TabService;
beforeEach(() => { beforeEach(() => {
@ -10,7 +10,7 @@ describe('TabService', () => {
service = TestBed.inject(TabService); service = TestBed.inject(TabService);
}); });
it('should be created', () => { it("should be created", () => {
expect(service).toBeTruthy(); expect(service).toBeTruthy();
}); });
}); });

@ -1,8 +1,8 @@
import {Injectable} from '@angular/core'; import {Injectable} from "@angular/core";
import {BehaviorSubject} from "rxjs"; import {BehaviorSubject} from "rxjs";
@Injectable({ @Injectable({
providedIn: 'root' providedIn: "root"
}) })
export class TabService { export class TabService {

@ -1,8 +1,8 @@
import {TestBed} from '@angular/core/testing'; import {TestBed} from "@angular/core/testing";
import {TagService} from './tag.service'; import {TagService} from "./tag.service";
describe('TagService', () => { describe("TagService", () => {
let service: TagService; let service: TagService;
beforeEach(() => { beforeEach(() => {
@ -10,7 +10,7 @@ describe('TagService', () => {
service = TestBed.inject(TagService); service = TestBed.inject(TagService);
}); });
it('should be created', () => { it("should be created", () => {
expect(service).toBeTruthy(); expect(service).toBeTruthy();
}); });
}); });

@ -1,10 +1,10 @@
import {Injectable} from '@angular/core'; import {Injectable} from "@angular/core";
import {invoke} from "@tauri-apps/api/tauri"; import {invoke} from "@tauri-apps/api/tauri";
import {Tag} from "../../models/Tag"; import {Tag} from "../../models/Tag";
import {BehaviorSubject} from "rxjs"; import {BehaviorSubject} from "rxjs";
@Injectable({ @Injectable({
providedIn: 'root' providedIn: "root"
}) })
export class TagService { export class TagService {

@ -1,8 +1,8 @@
import {enableProdMode} from '@angular/core'; import {enableProdMode} from "@angular/core";
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; import {platformBrowserDynamic} from "@angular/platform-browser-dynamic";
import {AppModule} from './app/app.module'; import {AppModule} from "./app/app.module";
import {environment} from './environments/environment'; import {environment} from "./environments/environment";
if (environment.production) { if (environment.production) {
enableProdMode(); enableProdMode();

@ -57,7 +57,7 @@
/*************************************************************************************************** /***************************************************************************************************
* Zone JS is required by default for Angular itself. * Zone JS is required by default for Angular itself.
*/ */
import 'zone.js'; // Included with Angular CLI. import "zone.js"; // Included with Angular CLI.
/*************************************************************************************************** /***************************************************************************************************

@ -1,11 +1,11 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files // This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/testing'; import "zone.js/testing";
import {getTestBed} from '@angular/core/testing'; import {getTestBed} from "@angular/core/testing";
import { import {
BrowserDynamicTestingModule, BrowserDynamicTestingModule,
platformBrowserDynamicTesting platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing'; } from "@angular/platform-browser-dynamic/testing";
declare const require: { declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): { context(path: string, deep?: boolean, filter?: RegExp): {
@ -22,6 +22,6 @@ getTestBed().initTestEnvironment(
); );
// Then we find all the tests. // Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/); const context = require.context("./", true, /\.spec\.ts$/);
// And load the modules. // And load the modules.
context.keys().map(context); context.keys().map(context);

Loading…
Cancel
Save