Fix style issues

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/12/head
trivernis 3 years ago
parent 6d6a17bac5
commit 6507809bcc
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -22,11 +22,11 @@ export class File {
return this.basicData.status; return this.basicData.status;
} }
public get mimeType(): string {
return this.basicData.mime_type;
}
public set status(value: FileStatus) { public set status(value: FileStatus) {
this.basicData.status = value; this.basicData.status = value;
} }
public get mimeType(): string {
return this.basicData.mime_type;
}
} }

@ -36,6 +36,7 @@ mat-tab-group {
right: 0; right: 0;
top: 0; top: 0;
height: 100%; height: 100%;
ng-icon { ng-icon {
font-size: 1.5em; font-size: 1.5em;
margin-top: calc(-50%); margin-top: calc(-50%);

@ -1,17 +1,11 @@
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 { import {RepositoriesTabComponent} from "./repositories-tab/repositories-tab.component";
RepositoriesTabComponent
} from "./repositories-tab/repositories-tab.component";
import {FilesTabComponent} from "./files-tab/files-tab.component"; import {FilesTabComponent} from "./files-tab/files-tab.component";
import { import {FilesTabSidebarComponent} from "./files-tab/files-tab-sidebar/files-tab-sidebar.component";
FilesTabSidebarComponent
} from "./files-tab/files-tab-sidebar/files-tab-sidebar.component";
import {ImportTabComponent} from "./import-tab/import-tab.component"; import {ImportTabComponent} from "./import-tab/import-tab.component";
import { import {ImportTabSidebarComponent} from "./import-tab/import-tab-sidebar/import-tab-sidebar.component";
ImportTabSidebarComponent
} from "./import-tab/import-tab-sidebar/import-tab-sidebar.component";
import {MatButtonModule} from "@angular/material/button"; import {MatButtonModule} from "@angular/material/button";
import {MatSidenavModule} from "@angular/material/sidenav"; import {MatSidenavModule} from "@angular/material/sidenav";
import {MatProgressBarModule} from "@angular/material/progress-bar"; import {MatProgressBarModule} from "@angular/material/progress-bar";
@ -30,9 +24,7 @@ import {SidebarModule} from "../shared/sidebar/sidebar.module";
import {FileModule} from "../shared/file/file.module"; import {FileModule} from "../shared/file/file.module";
import {AppCommonModule} from "../shared/app-common/app-common.module"; import {AppCommonModule} from "../shared/app-common/app-common.module";
import {ReactiveFormsModule} from "@angular/forms"; import {ReactiveFormsModule} from "@angular/forms";
import { import {RepositoryCardComponent} from "./repositories-tab/repository-card/repository-card.component";
RepositoryCardComponent
} from "./repositories-tab/repository-card/repository-card.component";
import {MatCardModule} from "@angular/material/card"; import {MatCardModule} from "@angular/material/card";
import {MatListModule} from "@angular/material/list"; import {MatListModule} from "@angular/material/list";
import {MatDialogModule} from "@angular/material/dialog"; import {MatDialogModule} from "@angular/material/dialog";
@ -42,9 +34,7 @@ import {TagModule} from "../shared/tag/tag.module";
import { import {
DownloadDaemonDialogComponent DownloadDaemonDialogComponent
} from "./repositories-tab/download-daemon-dialog/download-daemon-dialog.component"; } from "./repositories-tab/download-daemon-dialog/download-daemon-dialog.component";
import { import {RepositoryModule} from "../shared/repository/repository/repository.module";
RepositoryModule
} from "../shared/repository/repository/repository.module";
import {MatToolbarModule} from "@angular/material/toolbar"; import {MatToolbarModule} from "@angular/material/toolbar";
import { import {
RepositoryDetailsViewComponent RepositoryDetailsViewComponent

@ -1,9 +1,12 @@
<div class="sidebar-inner"> <div class="sidebar-inner">
<mat-tab-group headerPosition="below"> <mat-tab-group headerPosition="below">
<mat-tab label="Search"> <mat-tab label="Search">
<app-file-search [state]="this.state" [availableTags]="this.allTags" [contextTags]="this.tags" <app-file-search (searchEndEvent)="this.onDisplayedFilesChange(); this.searchEndEvent.emit($event);"
(searchStartEvent)="this.searchStartEvent.emit($event)" (searchStartEvent)="this.searchStartEvent.emit($event)"
(searchEndEvent)="this.onDisplayedFilesChange(); this.searchEndEvent.emit($event);" [tagsLoading]="this.tagsLoading"></app-file-search> [availableTags]="this.allTags"
[contextTags]="this.tags"
[state]="this.state"
[tagsLoading]="this.tagsLoading"></app-file-search>
</mat-tab> </mat-tab>
<mat-tab *ngIf="this.selectedFiles.length > 0" label="Edit Tags"> <mat-tab *ngIf="this.selectedFiles.length > 0" label="Edit Tags">
<app-tag-edit #fileedit [files]="this.selectedFiles"></app-tag-edit> <app-tag-edit #fileedit [files]="this.selectedFiles"></app-tag-edit>

@ -1,25 +1,10 @@
import { import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild} from "@angular/core";
Component,
EventEmitter,
Input,
OnChanges,
OnInit,
Output,
SimpleChanges,
ViewChild
} from "@angular/core";
import {Tag} from "../../../../../api/models/Tag"; import {Tag} from "../../../../../api/models/Tag";
import {TagService} from "../../../../services/tag/tag.service"; import {TagService} from "../../../../services/tag/tag.service";
import {File} from "../../../../../api/models/File"; import {File} from "../../../../../api/models/File";
import { import {FileSearchComponent} from "../../../shared/sidebar/file-search/file-search.component";
FileSearchComponent import {RepositoryService} from "../../../../services/repository/repository.service";
} from "../../../shared/sidebar/file-search/file-search.component"; import {TagEditComponent} from "../../../shared/sidebar/tag-edit/tag-edit.component";
import {
RepositoryService
} from "../../../../services/repository/repository.service";
import {
TagEditComponent
} from "../../../shared/sidebar/tag-edit/tag-edit.component";
import {TabState} from "../../../../models/TabState"; import {TabState} from "../../../../models/TabState";
@Component({ @Component({

@ -1,6 +1,7 @@
<mat-drawer-container (keyDownEvent)="this.onKeydown($event)" appInputReceiver autosize> <mat-drawer-container (keyDownEvent)="this.onKeydown($event)" appInputReceiver autosize>
<mat-drawer disableClose mode="side" opened> <mat-drawer disableClose mode="side" opened>
<app-files-tab-sidebar (searchEndEvent)="this.contentLoading = false;" (searchStartEvent)="this.contentLoading = true;" <app-files-tab-sidebar (searchEndEvent)="this.contentLoading = false;"
(searchStartEvent)="this.contentLoading = true;"
[selectedFiles]="this.selectedFiles" [selectedFiles]="this.selectedFiles"
[state]="this.state"></app-files-tab-sidebar> [state]="this.state"></app-files-tab-sidebar>
</mat-drawer> </mat-drawer>

@ -1,12 +1,13 @@
<div class="import-tab-inner"> <div class="import-tab-inner">
<mat-tab-group headerPosition="below"> <mat-tab-group headerPosition="below">
<mat-tab label="Import"> <mat-tab label="Import">
<app-file-import (importFinished)="importFinished.emit($event)" (fileImported)="fileImported.emit($event)"></app-file-import> <app-file-import (fileImported)="fileImported.emit($event)"
(importFinished)="importFinished.emit($event)"></app-file-import>
</mat-tab> </mat-tab>
<mat-tab label="Edit Tags" *ngIf="selectedFiles.length > 0"> <mat-tab *ngIf="selectedFiles.length > 0" label="Edit Tags">
<app-tag-edit [files]="selectedFiles"></app-tag-edit> <app-tag-edit [files]="selectedFiles"></app-tag-edit>
</mat-tab> </mat-tab>
<mat-tab label="File Metadata" *ngIf="selectedFiles.length === 1"> <mat-tab *ngIf="selectedFiles.length === 1" label="File Metadata">
<app-file-metadata [file]="selectedFiles[0]"></app-file-metadata> <app-file-metadata [file]="selectedFiles[0]"></app-file-metadata>
</mat-tab> </mat-tab>
</mat-tab-group> </mat-tab-group>

@ -1,11 +1,14 @@
<mat-drawer-container autosize> <mat-drawer-container autosize>
<mat-drawer disableClose="true" mode="side" opened> <mat-drawer disableClose="true" mode="side" opened>
<app-import-tab-sidebar [selectedFiles]="selectedFiles" (fileImported)="this.addFileFromImport($event)" <app-import-tab-sidebar (fileImported)="this.addFileFromImport($event)"
(importFinished)="this.refreshFileView()"></app-import-tab-sidebar> (importFinished)="this.refreshFileView()"
[selectedFiles]="selectedFiles"></app-import-tab-sidebar>
</mat-drawer> </mat-drawer>
<mat-drawer-content> <mat-drawer-content>
<app-file-multiview [mode]="this.state.mode.value" (modeChangeEvent)="this.state.mode.next($event)" <app-file-multiview (fileSelectEvent)="this.onFileSelect($event)"
[preselectedFile]="this.getSelectedFileFromState()" (modeChangeEvent)="this.state.mode.next($event)"
(fileSelectEvent)="this.onFileSelect($event)" [files]="this.files"></app-file-multiview> [files]="this.files"
[mode]="this.state.mode.value"
[preselectedFile]="this.getSelectedFileFromState()"></app-file-multiview>
</mat-drawer-content> </mat-drawer-content>
</mat-drawer-container> </mat-drawer-container>

@ -4,7 +4,8 @@
<div mat-dialog-content> <div mat-dialog-content>
No daemon could be found on the system. Please download and install a daemon executable. No daemon could be found on the system. Please download and install a daemon executable.
<br> <br>
<button class="download-button" mat-flat-button color="primary" (click)="this.onClickDownloadDaemon()">Download</button> <button (click)="this.onClickDownloadDaemon()" class="download-button" color="primary" mat-flat-button>Download
</button>
</div> </div>
<div class="download-dialog-actions" mat-dialog-actions> <div class="download-dialog-actions" mat-dialog-actions>
<button (click)="closeDialog(false)" color="accent" mat-stroked-button>Cancel</button> <button (click)="closeDialog(false)" color="accent" mat-stroked-button>Cancel</button>

@ -1,8 +1,6 @@
import {ComponentFixture, TestBed} from "@angular/core/testing"; import {ComponentFixture, TestBed} from "@angular/core/testing";
import { import {DownloadDaemonDialogComponent} from "./download-daemon-dialog.component";
DownloadDaemonDialogComponent
} from "./download-daemon-dialog.component";
describe("DownloadDaemonDialogComponent", () => { describe("DownloadDaemonDialogComponent", () => {
let component: DownloadDaemonDialogComponent; let component: DownloadDaemonDialogComponent;

@ -9,9 +9,11 @@ import {shell} from "@tauri-apps/api";
}) })
export class DownloadDaemonDialogComponent { export class DownloadDaemonDialogComponent {
constructor(public dialogRef: MatDialogRef<DownloadDaemonDialogComponent>, constructor(
public dialogRef: MatDialogRef<DownloadDaemonDialogComponent>,
@Inject( @Inject(
MAT_DIALOG_DATA) data: any) { MAT_DIALOG_DATA) data: any
) {
} }

@ -1,13 +1,14 @@
<div class="repo-page-content" *ngIf="!selectedRepository"> <div *ngIf="!selectedRepository" class="repo-page-content">
<div class="add-repo-tools"> <div class="add-repo-tools">
<button (click)="openAddRepositoryDialog()" color="primary" mat-flat-button>Add Repository</button> <button (click)="openAddRepositoryDialog()" color="primary" mat-flat-button>Add Repository</button>
</div> </div>
<div class="repository-list"> <div class="repository-list">
<div *ngFor="let repository of repositories" class="repository-container"> <div *ngFor="let repository of repositories" class="repository-container">
<app-repository-card [repository]="repository" (openEvent)="this.onOpenRepository($event)"></app-repository-card> <app-repository-card (openEvent)="this.onOpenRepository($event)"
[repository]="repository"></app-repository-card>
</div> </div>
</div> </div>
</div> </div>
<div class="repo-details" *ngIf="selectedRepository"> <div *ngIf="selectedRepository" class="repo-details">
<app-repository-details-view [repository]="selectedRepository"></app-repository-details-view> <app-repository-details-view [repository]="selectedRepository"></app-repository-details-view>
</div> </div>

@ -1,22 +1,9 @@
import { import {Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild} from "@angular/core";
Component, EventEmitter,
Input,
OnDestroy,
OnInit,
Output,
ViewChild
} from "@angular/core";
import {Repository} from "../../../../../api/models/Repository"; import {Repository} from "../../../../../api/models/Repository";
import { import {RepositoryService} from "../../../../services/repository/repository.service";
RepositoryService
} from "../../../../services/repository/repository.service";
import {MatDialog} from "@angular/material/dialog"; import {MatDialog} from "@angular/material/dialog";
import { import {ConfirmDialogComponent} from "../../../shared/app-common/confirm-dialog/confirm-dialog.component";
ConfirmDialogComponent import {BusyIndicatorComponent} from "../../../shared/app-common/busy-indicator/busy-indicator.component";
} from "../../../shared/app-common/confirm-dialog/confirm-dialog.component";
import {
BusyIndicatorComponent
} from "../../../shared/app-common/busy-indicator/busy-indicator.component";
import { import {
EditRepositoryDialogComponent EditRepositoryDialogComponent
} from "../../../shared/repository/repository/edit-repository-dialog/edit-repository-dialog.component"; } from "../../../shared/repository/repository/edit-repository-dialog/edit-repository-dialog.component";
@ -39,7 +26,8 @@ export class RepositoryCardComponent implements OnInit, OnDestroy {
constructor( constructor(
public repoService: RepositoryService, public repoService: RepositoryService,
public dialog: MatDialog) { public dialog: MatDialog
) {
} }
public async ngOnInit() { public async ngOnInit() {
@ -81,28 +69,6 @@ export class RepositoryCardComponent implements OnInit, OnDestroy {
} }
} }
private async promtDeleteRepository() {
if (this.repository.local) {
const deleteContents = await this.dialog.open(
ConfirmDialogComponent, {
data: {
title: "Delete repository content",
message: "Do you want to remove the contents of the repository as well?",
confirmAction: "Delete",
confirmColor: "warn",
denyAction: "No",
}
}).afterClosed().toPromise();
if (deleteContents) {
await this.repoService.deleteRepository(this.repository.name);
} else {
await this.repoService.removeRepository(this.repository.name);
}
} else {
await this.repoService.removeRepository(this.repository.name);
}
}
public getDaemonStatusText(): string { public getDaemonStatusText(): string {
if (this.repository.local) { if (this.repository.local) {
return "Local"; return "Local";
@ -138,4 +104,26 @@ export class RepositoryCardComponent implements OnInit, OnDestroy {
} }
}); });
} }
private async promtDeleteRepository() {
if (this.repository.local) {
const deleteContents = await this.dialog.open(
ConfirmDialogComponent, {
data: {
title: "Delete repository content",
message: "Do you want to remove the contents of the repository as well?",
confirmAction: "Delete",
confirmColor: "warn",
denyAction: "No",
}
}).afterClosed().toPromise();
if (deleteContents) {
await this.repoService.deleteRepository(this.repository.name);
} else {
await this.repoService.removeRepository(this.repository.name);
}
} else {
await this.repoService.removeRepository(this.repository.name);
}
}
} }

@ -1,13 +1,14 @@
<mat-toolbar> <mat-toolbar>
<span class="repository-name">{{repository.name}}</span> <span class="repository-name">{{repository.name}}</span>
<button class="button-close-repository" mat-flat-button color="primary" (click)="this.closeRepository()">Close <button (click)="this.closeRepository()" class="button-close-repository" color="primary" mat-flat-button>Close
</button> </button>
</mat-toolbar> </mat-toolbar>
<div class="details-content" fxLayout="row"> <div class="details-content" fxLayout="row">
<div class="repository-metadata" fxFlex="100%"> <div class="repository-metadata" fxFlex="100%">
<h1>Stats</h1> <h1>Stats</h1>
<app-metadata-entry *ngIf="repository.path" attributeName="Path">{{repository.path}}</app-metadata-entry> <app-metadata-entry *ngIf="repository.path" attributeName="Path">{{repository.path}}</app-metadata-entry>
<app-metadata-entry *ngIf="repository.address" attributeName="Address">{{repository.address}}</app-metadata-entry> <app-metadata-entry *ngIf="repository.address"
attributeName="Address">{{repository.address}}</app-metadata-entry>
<app-metadata-entry attributeName="File Count"> <app-metadata-entry attributeName="File Count">
<mat-progress-bar *ngIf="!metadata"></mat-progress-bar> <mat-progress-bar *ngIf="!metadata"></mat-progress-bar>
{{metadata ? metadata!.file_count.toString() : ''}} {{metadata ? metadata!.file_count.toString() : ''}}
@ -29,15 +30,18 @@
{{this.totalSize | async}} {{this.totalSize | async}}
</app-metadata-entry> </app-metadata-entry>
<app-metadata-entry attributeName="File Folder Size"> <app-metadata-entry attributeName="File Folder Size">
<mat-progress-bar *ngIf="(this.fileFolderSize | async) === undefined" mode="indeterminate"></mat-progress-bar> <mat-progress-bar *ngIf="(this.fileFolderSize | async) === undefined"
mode="indeterminate"></mat-progress-bar>
{{this.fileFolderSize | async}} {{this.fileFolderSize | async}}
</app-metadata-entry> </app-metadata-entry>
<app-metadata-entry attributeName="Thumbnail Folder Size"> <app-metadata-entry attributeName="Thumbnail Folder Size">
<mat-progress-bar *ngIf="(this.thumbFolderSize | async) === undefined" mode="indeterminate"></mat-progress-bar> <mat-progress-bar *ngIf="(this.thumbFolderSize | async) === undefined"
mode="indeterminate"></mat-progress-bar>
{{this.thumbFolderSize | async}} {{this.thumbFolderSize | async}}
</app-metadata-entry> </app-metadata-entry>
<app-metadata-entry attributeName="Database File Size"> <app-metadata-entry attributeName="Database File Size">
<mat-progress-bar *ngIf="(this.databaseFileSize | async) === undefined" mode="indeterminate"></mat-progress-bar> <mat-progress-bar *ngIf="(this.databaseFileSize | async) === undefined"
mode="indeterminate"></mat-progress-bar>
{{this.databaseFileSize | async}} {{this.databaseFileSize | async}}
</app-metadata-entry> </app-metadata-entry>
</div> </div>

@ -1,8 +1,6 @@
import {ComponentFixture, TestBed} from "@angular/core/testing"; import {ComponentFixture, TestBed} from "@angular/core/testing";
import { import {RepositoryDetailsViewComponent} from "./repository-details-view.component";
RepositoryDetailsViewComponent
} from "./repository-details-view.component";
describe("RepositoryDetailsViewComponent", () => { describe("RepositoryDetailsViewComponent", () => {
let component: RepositoryDetailsViewComponent; let component: RepositoryDetailsViewComponent;

@ -1,21 +1,10 @@
import { import {Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges} from "@angular/core";
Component,
Input,
OnChanges,
OnDestroy,
OnInit,
SimpleChanges
} from "@angular/core";
import {Repository} from "../../../../../api/models/Repository"; import {Repository} from "../../../../../api/models/Repository";
import { import {RepositoryService} from "../../../../services/repository/repository.service";
RepositoryService
} from "../../../../services/repository/repository.service";
import {RepositoryMetadata} from "../../../../models/RepositoryMetadata"; import {RepositoryMetadata} from "../../../../models/RepositoryMetadata";
import {BehaviorSubject} from "rxjs"; import {BehaviorSubject} from "rxjs";
import {MatDialog} from "@angular/material/dialog"; import {MatDialog} from "@angular/material/dialog";
import { import {BusyDialogComponent} from "../../../shared/app-common/busy-dialog/busy-dialog.component";
BusyDialogComponent
} from "../../../shared/app-common/busy-dialog/busy-dialog.component";
@Component({ @Component({
selector: "app-repository-details-view", selector: "app-repository-details-view",
@ -26,12 +15,11 @@ export class RepositoryDetailsViewComponent implements OnInit, OnChanges, OnDest
@Input() repository!: Repository; @Input() repository!: Repository;
public metadata?: RepositoryMetadata; public metadata?: RepositoryMetadata;
private refreshMetadataInterval?: number;
public totalSize = new BehaviorSubject<string | undefined>(undefined); public totalSize = new BehaviorSubject<string | undefined>(undefined);
public fileFolderSize = new BehaviorSubject<string | undefined>(undefined); public fileFolderSize = new BehaviorSubject<string | undefined>(undefined);
public thumbFolderSize = new BehaviorSubject<string | undefined>(undefined); public thumbFolderSize = new BehaviorSubject<string | undefined>(undefined);
public databaseFileSize = new BehaviorSubject<string | undefined>(undefined); public databaseFileSize = new BehaviorSubject<string | undefined>(undefined);
private refreshMetadataInterval?: number;
constructor(private repoService: RepositoryService, public dialog: MatDialog) { constructor(private repoService: RepositoryService, public dialog: MatDialog) {
} }

@ -1,24 +1,17 @@
import { import {Directive, EventEmitter, HostBinding, HostListener, Output} from "@angular/core";
Directive,
EventEmitter,
HostBinding,
HostListener,
Output
} from "@angular/core";
@Directive({ @Directive({
selector: "[appInputReceiver]" selector: "[appInputReceiver]"
}) })
export class InputReceiverDirective { export class InputReceiverDirective {
constructor() {
}
@Output() keyDownEvent = new EventEmitter<KeyboardEvent>(); @Output() keyDownEvent = new EventEmitter<KeyboardEvent>();
@Output() keyUpEvent = new EventEmitter<KeyboardEvent>(); @Output() keyUpEvent = new EventEmitter<KeyboardEvent>();
@HostBinding("tabindex") tabIndex = 1; @HostBinding("tabindex") tabIndex = 1;
constructor() {
}
@HostListener("keydown", ["$event"]) @HostListener("keydown", ["$event"])
onKeyDown(event: KeyboardEvent) { onKeyDown(event: KeyboardEvent) {
this.keyDownEvent.emit(event); this.keyDownEvent.emit(event);

@ -1,10 +1,4 @@
import { import {Component, HostListener, Input, OnChanges, SimpleChanges} from "@angular/core";
Component,
HostListener,
Input,
OnChanges,
SimpleChanges
} 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";

@ -1,12 +1,4 @@
import { import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges} from "@angular/core";
Component,
EventEmitter,
Input,
OnChanges,
OnInit,
Output,
SimpleChanges
} 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";

@ -4,16 +4,24 @@
</div> </div>
<div class="dialog-buttons" mat-dialog-actions> <div class="dialog-buttons" mat-dialog-actions>
<button (click)="closeDialog()" color="accent" mat-stroked-button>Cancel</button> <button (click)="closeDialog()" color="accent" mat-stroked-button>Cancel</button>
<button (click)="addRepository()" *ngIf="repoForm.formGroup.get('repositoryType')?.value === 'remote' || repoForm.localRepoExists" <button (click)="addRepository()"
[disabled]="!repoForm.formGroup.valid" color="primary" mat-flat-button *ngIf="repoForm.formGroup.get('repositoryType')?.value === 'remote' || repoForm.localRepoExists"
[disabled]="!repoForm.formGroup.valid"
color="primary"
mat-flat-button
matTooltip="Add the existing repository">Add matTooltip="Add the existing repository">Add
</button> </button>
<button (click)="this.initLocalRepository()" *ngIf="repoForm.formGroup.get('repositoryType')?.value === 'local' && !repoForm.localRepoExists" <button (click)="this.initLocalRepository()"
*ngIf="repoForm.formGroup.get('repositoryType')?.value === 'local' && !repoForm.localRepoExists"
[disabled]="!repoForm.formGroup.valid" [disabled]="!repoForm.formGroup.valid"
color="accent" mat-flat-button color="accent"
mat-flat-button
matTooltip="Initialize the repository in the specified path">Init matTooltip="Initialize the repository in the specified path">Init
</button> </button>
<button (click)="repoForm.checkRepositoryStatus()" *ngIf="repoForm.formGroup.get('repositoryType')?.value === 'remote'" [disabled]="!repoForm.formGroup.valid" <button (click)="repoForm.checkRepositoryStatus()"
class="check-connection-button" mat-stroked-button>Check Connection *ngIf="repoForm.formGroup.get('repositoryType')?.value === 'remote'"
[disabled]="!repoForm.formGroup.valid"
class="check-connection-button"
mat-stroked-button>Check Connection
</button> </button>
</div> </div>

@ -1,8 +1,11 @@
<h1 mat-dialog-title>Edit {{this.selectedRepository.name}}</h1> <h1 mat-dialog-title>Edit {{this.selectedRepository.name}}</h1>
<div mat-dialog-content> <div mat-dialog-content>
<app-repository-form #repoForm [name]="selectedRepository.name" [address]="selectedRepository.address ?? ''" <app-repository-form #repoForm
[address]="selectedRepository.address ?? ''"
[name]="selectedRepository.name"
[path]="selectedRepository.path ?? ''"
[repositoryType]="selectedRepository.local? 'local' : 'remote'" [repositoryType]="selectedRepository.local? 'local' : 'remote'"
[path]="selectedRepository.path ?? ''" [validateNameDuplicate]="false"></app-repository-form> [validateNameDuplicate]="false"></app-repository-form>
</div> </div>
<div class="dialog-buttons" mat-dialog-actions> <div class="dialog-buttons" mat-dialog-actions>
<button (click)="closeDialog()" color="accent" mat-stroked-button>Cancel</button> <button (click)="closeDialog()" color="accent" mat-stroked-button>Cancel</button>

@ -1,8 +1,6 @@
import {ComponentFixture, TestBed} from "@angular/core/testing"; import {ComponentFixture, TestBed} from "@angular/core/testing";
import { import {EditRepositoryDialogComponent} from "./edit-repository-dialog.component";
EditRepositoryDialogComponent
} from "./edit-repository-dialog.component";
describe("EditRepositoryDialogComponent", () => { describe("EditRepositoryDialogComponent", () => {
let component: EditRepositoryDialogComponent; let component: EditRepositoryDialogComponent;

@ -1,15 +1,7 @@
import {Component, Input, OnInit, Output} from "@angular/core"; import {Component, Input, OnInit, Output} from "@angular/core";
import { import {AbstractControl, FormControl, FormGroup, ValidationErrors, Validators} from "@angular/forms";
AbstractControl,
FormControl,
FormGroup,
ValidationErrors,
Validators
} from "@angular/forms";
import {Repository} from "../../../../../../api/models/Repository"; import {Repository} from "../../../../../../api/models/Repository";
import { import {RepositoryService} from "../../../../../services/repository/repository.service";
RepositoryService
} from "../../../../../services/repository/repository.service";
import {dialog} from "@tauri-apps/api"; import {dialog} from "@tauri-apps/api";
import {MatDialog} from "@angular/material/dialog"; import {MatDialog} from "@angular/material/dialog";

@ -1,14 +1,8 @@
import {NgModule} from "@angular/core"; import {NgModule} from "@angular/core";
import {CommonModule} from "@angular/common"; import {CommonModule} from "@angular/common";
import { import {AddRepositoryDialogComponent} from "./add-repository-dialog/add-repository-dialog.component";
AddRepositoryDialogComponent import {RepositoryFormComponent} from "./repository-form/repository-form.component";
} from "./add-repository-dialog/add-repository-dialog.component"; import {EditRepositoryDialogComponent} from "./edit-repository-dialog/edit-repository-dialog.component";
import {
RepositoryFormComponent
} from "./repository-form/repository-form.component";
import {
EditRepositoryDialogComponent
} from "./edit-repository-dialog/edit-repository-dialog.component";
import {MatDialogModule} from "@angular/material/dialog"; import {MatDialogModule} from "@angular/material/dialog";
import {MatButtonModule} from "@angular/material/button"; import {MatButtonModule} from "@angular/material/button";
import {MatTooltipModule} from "@angular/material/tooltip"; import {MatTooltipModule} from "@angular/material/tooltip";

@ -2,12 +2,12 @@
<app-metadata-entry *ngIf="mode === 'read'" [attributeName]="attributeName">{{value}}</app-metadata-entry> <app-metadata-entry *ngIf="mode === 'read'" [attributeName]="attributeName">{{value}}</app-metadata-entry>
<mat-form-field *ngIf="mode === 'write'"> <mat-form-field *ngIf="mode === 'write'">
<mat-label>{{attributeName}}</mat-label> <mat-label>{{attributeName}}</mat-label>
<input [formControl]="formControl" type="text" matInput [value]="value.toString()"> <input [formControl]="formControl" [value]="value.toString()" matInput type="text">
</mat-form-field> </mat-form-field>
<button *ngIf="mode === 'write'" mat-button (click)="this.onSave()"> <button (click)="this.onSave()" *ngIf="mode === 'write'" mat-button>
<ng-icon name="mat-save"></ng-icon> <ng-icon name="mat-save"></ng-icon>
</button> </button>
<button *ngIf="mode === 'read'" mat-button (click)="mode = 'write'"> <button (click)="mode = 'write'" *ngIf="mode === 'read'" mat-button>
<ng-icon name="mat-edit"></ng-icon> <ng-icon name="mat-edit"></ng-icon>
</button> </button>
</div> </div>

@ -1,8 +1,6 @@
import {ComponentFixture, TestBed} from "@angular/core/testing"; import {ComponentFixture, TestBed} from "@angular/core/testing";
import { import {EditableMetadataEntryComponent} from "./editable-metadata-entry.component";
EditableMetadataEntryComponent
} from "./editable-metadata-entry.component";
describe("EditableMetadataEntryComponent", () => { describe("EditableMetadataEntryComponent", () => {
let component: EditableMetadataEntryComponent; let component: EditableMetadataEntryComponent;

@ -1,12 +1,4 @@
import { import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges} from "@angular/core";
Component,
EventEmitter,
Input,
OnChanges,
OnInit,
Output,
SimpleChanges
} from "@angular/core";
import {FormControl} from "@angular/forms"; import {FormControl} from "@angular/forms";
@Component({ @Component({

@ -20,9 +20,11 @@
width: 100%; width: 100%;
display: block; display: block;
} }
:first-child { :first-child {
margin-top: 0; margin-top: 0;
} }
:last-child { :last-child {
margin-bottom: 0; margin-bottom: 0;
} }
@ -32,6 +34,7 @@
text-align: center; text-align: center;
height: 100px; height: 100px;
width: 100%; width: 100%;
h1 { h1 {
margin-top: 20px; margin-top: 20px;
} }

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

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

@ -52,7 +52,7 @@ import {GetTagQueryPipe} from "./file-search/filter-pipes/get-tag-query.pipe";
import {GetPropertyQueryPipe} from "./file-search/filter-pipes/get-property-query.pipe"; import {GetPropertyQueryPipe} from "./file-search/filter-pipes/get-property-query.pipe";
import {SortButtonComponent} from "./file-search/sort-button/sort-button.component"; import {SortButtonComponent} from "./file-search/sort-button/sort-button.component";
import {MatTooltipModule} from "@angular/material/tooltip"; import {MatTooltipModule} from "@angular/material/tooltip";
import { SortPresetItemComponent } from './file-search/sort-preset-item/sort-preset-item.component'; import {SortPresetItemComponent} from "./file-search/sort-preset-item/sort-preset-item.component";
@NgModule({ @NgModule({

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

@ -2,81 +2,81 @@
<!-- Created with Inkscape (http://www.inkscape.org/) --> <!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg <svg
width="120"
height="120" height="120"
viewBox="0 0 120 120"
version="1.1"
id="svg5" id="svg5"
sodipodi:docname="mediarepo-icon.svg"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20, custom)"
inkscape:export-filename="/home/trivernis/Pictures/mediarepo-icon_32x32.png" inkscape:export-filename="/home/trivernis/Pictures/mediarepo-icon_32x32.png"
inkscape:export-xdpi="25.6" inkscape:export-xdpi="25.6"
inkscape:export-ydpi="25.6" inkscape:export-ydpi="25.6"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20, custom)"
sodipodi:docname="mediarepo-icon.svg"
version="1.1"
viewBox="0 0 120 120"
width="120"
xmlns="http://www.w3.org/2000/svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
> >
<sodipodi:namedview <sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666" bordercolor="#666666"
borderopacity="1.0" borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="px"
showgrid="true"
inkscape:lockguides="true"
objecttolerance="20"
guidetolerance="10000" guidetolerance="10000"
inkscape:zoom="5.6833333" id="namedview7"
inkscape:current-layer="layer1"
inkscape:cx="32.199413" inkscape:cx="32.199413"
inkscape:cy="77.859238" inkscape:cy="77.859238"
inkscape:window-width="2560" inkscape:document-units="px"
inkscape:lockguides="true"
inkscape:pagecheckerboard="0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:window-height="1359" inkscape:window-height="1359"
inkscape:window-maximized="1"
inkscape:window-width="2560"
inkscape:window-x="1200" inkscape:window-x="1200"
inkscape:window-y="240" inkscape:window-y="240"
inkscape:window-maximized="1" inkscape:zoom="5.6833333"
inkscape:current-layer="layer1"> objecttolerance="20"
pagecolor="#ffffff"
showgrid="true">
<inkscape:grid <inkscape:grid
type="xygrid"
id="grid13779"
dotted="false" dotted="false"
id="grid13779"
spacingx="0.5" spacingx="0.5"
spacingy="0.5" /> spacingy="0.5"
type="xygrid"/>
</sodipodi:namedview> </sodipodi:namedview>
<defs <defs
id="defs2"/> id="defs2"/>
<g <g
inkscape:groupmode="layer"
id="layer3" id="layer3"
inkscape:groupmode="layer"
inkscape:label="Background" inkscape:label="Background"
style="display:none"> style="display:none">
<rect <rect
style="fill:#010001;fill-opacity:1;stroke:none;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" height="142.5"
id="rect40027" id="rect40027"
style="fill:#010001;fill-opacity:1;stroke:none;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
width="170" width="170"
height="142.5"
x="-20" x="-20"
y="-10"/> y="-10"/>
</g> </g>
<g <g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1" id="layer1"
inkscape:groupmode="layer"
inkscape:label="Layer 1"
style="display:inline"> style="display:inline">
<g <g
aria-label="M" aria-label="M"
id="text13769" id="text13769"
style="font-size:120px;font-family:'DejaVu Sans', 'Bitstream Vera Sans';fill:#b300df;fill-opacity:1;stroke:none;stroke-opacity:1"
inkscape:export-filename="/home/trivernis/Pictures/mediarepo-icon_128x128.png" inkscape:export-filename="/home/trivernis/Pictures/mediarepo-icon_128x128.png"
inkscape:export-xdpi="102.4" inkscape:export-xdpi="102.4"
inkscape:export-ydpi="102.4"> inkscape:export-ydpi="102.4"
style="font-size:120px;font-family:'DejaVu Sans', 'Bitstream Vera Sans';fill:#b300df;fill-opacity:1;stroke:none;stroke-opacity:1">
<path <path
id="path14062"
style="fill:#b300df;fill-opacity:1;stroke:none;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 91.853516,14.957031 C 87.625624,14.940758 82.986173,16.079346 80,17.5 69.344922,22.56909 60,45 60,45 60,45 50.680027,22.566415 40,17.5 34.688445,14.980293 24.157014,13.342986 20,17.5 -0.61934311,38.119343 15,80 5,105 3.5782709,108.55432 17.01074,102.39141 20,100 32.5,90 33.253324,58.268354 32.5,47.5 33.314651,57.148409 35.039944,78.87714 50,90 c 5.349969,3.977723 14.654765,3.984082 20,0 10.464133,-7.799463 15.084189,-27.639159 17.5,-42.5 -1.296836,17.464817 0,42.5 12.5,52.5 3.00451,2.40361 16.42898,8.57246 15,5 -10,-25 5.61934,-66.880657 -15,-87.5 -1.818694,-1.818694 -4.858124,-2.530312 -8.146484,-2.542969 z M 60,50 c 8.28427,0 15,6.715729 15,15 0,8.28427 -6.71573,15 -15,15 -8.284271,0 -15,-6.71573 -15,-15 0,-8.284271 6.715729,-15 15,-15 z m 0,5.615234 c -5.182976,0 -9.384766,4.201791 -9.384766,9.384766 0,5.182975 4.20179,9.384766 9.384766,9.384766 5.182975,0 9.384766,-4.201791 9.384766,-9.384766 0,-5.182975 -4.201791,-9.384766 -9.384766,-9.384766 z" d="M 91.853516,14.957031 C 87.625624,14.940758 82.986173,16.079346 80,17.5 69.344922,22.56909 60,45 60,45 60,45 50.680027,22.566415 40,17.5 34.688445,14.980293 24.157014,13.342986 20,17.5 -0.61934311,38.119343 15,80 5,105 3.5782709,108.55432 17.01074,102.39141 20,100 32.5,90 33.253324,58.268354 32.5,47.5 33.314651,57.148409 35.039944,78.87714 50,90 c 5.349969,3.977723 14.654765,3.984082 20,0 10.464133,-7.799463 15.084189,-27.639159 17.5,-42.5 -1.296836,17.464817 0,42.5 12.5,52.5 3.00451,2.40361 16.42898,8.57246 15,5 -10,-25 5.61934,-66.880657 -15,-87.5 -1.818694,-1.818694 -4.858124,-2.530312 -8.146484,-2.542969 z M 60,50 c 8.28427,0 15,6.715729 15,15 0,8.28427 -6.71573,15 -15,15 -8.284271,0 -15,-6.71573 -15,-15 0,-8.284271 6.715729,-15 15,-15 z m 0,5.615234 c -5.182976,0 -9.384766,4.201791 -9.384766,9.384766 0,5.182975 4.20179,9.384766 9.384766,9.384766 5.182975,0 9.384766,-4.201791 9.384766,-9.384766 0,-5.182975 -4.201791,-9.384766 -9.384766,-9.384766 z"
sodipodi:nodetypes="sscsssscsscssssssssssssss" /> id="path14062"
sodipodi:nodetypes="sscsssscsscssssssssssssss"
style="fill:#b300df;fill-opacity:1;stroke:none;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
</g> </g>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

@ -2,10 +2,7 @@
import "zone.js/testing"; import "zone.js/testing";
import {getTestBed} from "@angular/core/testing"; import {getTestBed} from "@angular/core/testing";
import { import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from "@angular/platform-browser-dynamic/testing";
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} 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): {

Loading…
Cancel
Save