Move common and file related components to app-common and file module

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/4/head
trivernis 3 years ago
parent 4c1c13d4cd
commit 86519f22a1

@ -23,6 +23,17 @@ import * as materialIcons from "@ng-icons/material-icons";
import {MatMenuModule} from "@angular/material/menu"; import {MatMenuModule} from "@angular/material/menu";
import {InputModule} from "../shared/input/input.module"; import {InputModule} from "../shared/input/input.module";
import {SidebarModule} from "../shared/sidebar/sidebar.module"; import {SidebarModule} from "../shared/sidebar/sidebar.module";
import {FileModule} from "../shared/file/file.module";
import {AppCommonModule} from "../shared/app-common/app-common.module";
import {MatFormFieldModule} from "@angular/material/form-field";
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
import {RepositoryCardComponent} from "./repositories-tab/repository-card/repository-card.component";
import {AddRepositoryDialogComponent} from "./repositories-tab/add-repository-dialog/add-repository-dialog.component";
import {MatCardModule} from "@angular/material/card";
import {MatListModule} from "@angular/material/list";
import {MatDialogModule} from "@angular/material/dialog";
import {MatTooltipModule} from "@angular/material/tooltip";
import {MatInputModule} from "@angular/material/input";
@NgModule({ @NgModule({
@ -34,6 +45,8 @@ import {SidebarModule} from "../shared/sidebar/sidebar.module";
ImportTabComponent, ImportTabComponent,
ImportTabSidebarComponent, ImportTabSidebarComponent,
FilesystemImportComponent, FilesystemImportComponent,
RepositoryCardComponent,
AddRepositoryDialogComponent,
], ],
exports: [ exports: [
CoreComponent CoreComponent
@ -56,6 +69,14 @@ import {SidebarModule} from "../shared/sidebar/sidebar.module";
MatRippleModule, MatRippleModule,
InputModule, InputModule,
SidebarModule, SidebarModule,
FileModule,
AppCommonModule,
ReactiveFormsModule,
MatCardModule,
MatListModule,
MatDialogModule,
MatTooltipModule,
MatInputModule,
] ]
}) })
export class CoreModule { export class CoreModule {

@ -4,8 +4,8 @@ import {RepositoryService} from "../../../../services/repository/repository.serv
import {Router} from "@angular/router"; import {Router} from "@angular/router";
import {ErrorBrokerService} from "../../../../services/error-broker/error-broker.service"; import {ErrorBrokerService} from "../../../../services/error-broker/error-broker.service";
import {MatDialog} from "@angular/material/dialog"; import {MatDialog} from "@angular/material/dialog";
import {ConfirmDialogComponent} from "../../../shared/confirm-dialog/confirm-dialog.component"; import {ConfirmDialogComponent} from "../../../shared/app-common/confirm-dialog/confirm-dialog.component";
import {BusyIndicatorComponent} from "../../../shared/busy-indicator/busy-indicator.component"; import {BusyIndicatorComponent} from "../../../shared/app-common/busy-indicator/busy-indicator.component";
@Component({ @Component({
selector: "app-repository-card", selector: "app-repository-card",

@ -0,0 +1,37 @@
import {NgModule} from "@angular/core";
import {ConfirmDialogComponent} from "./confirm-dialog/confirm-dialog.component";
import {BusyIndicatorComponent} from "./busy-indicator/busy-indicator.component";
import {ContextMenuComponent} from "./context-menu/context-menu.component";
import {CommonModule} from "@angular/common";
import {NgIconsModule} from "@ng-icons/core";
import {MatProgressSpinnerModule} from "@angular/material/progress-spinner";
import {MatButtonModule} from "@angular/material/button";
import {MatDialogModule} from "@angular/material/dialog";
import {MatMenuModule} from "@angular/material/menu";
import {ContentAwareImageComponent} from "./content-aware-image/content-aware-image.component";
@NgModule({
declarations: [
ConfirmDialogComponent,
BusyIndicatorComponent,
ContextMenuComponent,
ContentAwareImageComponent,
],
exports: [
ConfirmDialogComponent,
BusyIndicatorComponent,
ContextMenuComponent,
ContentAwareImageComponent,
],
imports: [
CommonModule,
NgIconsModule.withIcons({}),
MatProgressSpinnerModule,
MatButtonModule,
MatDialogModule,
MatMenuModule
]
})
export class AppCommonModule {
}

@ -8,11 +8,11 @@ import {
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";
import {FileHelper} from "../../../../../services/file/file.helper"; import {FileHelper} from "../../../../services/file/file.helper";
import {ErrorBrokerService} from "../../../../../services/error-broker/error-broker.service"; import {ErrorBrokerService} from "../../../../services/error-broker/error-broker.service";
import {BusyIndicatorComponent} from "../../../busy-indicator/busy-indicator.component"; import {BusyIndicatorComponent} from "../../app-common/busy-indicator/busy-indicator.component";
type ContentType = "image" | "video" | "audio" | "other"; type ContentType = "image" | "video" | "audio" | "other";

@ -1,6 +1,6 @@
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 "../../app-common/context-menu/context-menu.component";
import {clipboard} from "@tauri-apps/api"; import {clipboard} from "@tauri-apps/api";
import {FileService} from "../../../../services/file/file.service"; import {FileService} from "../../../../services/file/file.service";
import {ErrorBrokerService} from "../../../../services/error-broker/error-broker.service"; import {ErrorBrokerService} from "../../../../services/error-broker/error-broker.service";

@ -1,5 +1,5 @@
@use 'sass:map'; @use 'sass:map';
@use '../../../../../../../node_modules/@angular/material/index' as mat; @use '../../../../../../../../node_modules/@angular/material/index' as mat;
@mixin color($theme) { @mixin color($theme) {
$color-config: mat.get-color-config($theme); $color-config: mat.get-color-config($theme);

@ -1,4 +1,3 @@
<div (click)="fileSelectEvent.emit(this.file)" [class.selected]="this.file.selected" class="image-wrapper"> <div (click)="fileSelectEvent.emit(this.file)" [class.selected]="this.file.selected" class="image-wrapper">
<mat-progress-spinner *ngIf="!contentUrl"></mat-progress-spinner>
<app-file-thumbnail [file]="file.data"></app-file-thumbnail> <app-file-thumbnail [file]="file.data"></app-file-thumbnail>
</div> </div>

@ -8,11 +8,11 @@ import {
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";
import {ErrorBrokerService} from "../../../../../services/error-broker/error-broker.service"; import {ErrorBrokerService} from "../../../../../../services/error-broker/error-broker.service";
import {Selectable} from "../../../../../models/Selectable"; import {Selectable} from "../../../../../../models/Selectable";
@Component({ @Component({
selector: "app-file-gallery-entry", selector: "app-file-gallery-entry",

@ -9,12 +9,12 @@ import {
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";
import {Selectable} from "../../../../models/Selectable"; import {Selectable} from "../../../../../models/Selectable";
import {CdkVirtualScrollViewport} from "@angular/cdk/scrolling"; 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",

@ -1,4 +1,4 @@
import {File} from "../../../../../models/File"; import {File} from "../../../../../../models/File";
export type GridEntry = { export type GridEntry = {
file: File, file: File,

@ -1,5 +1,5 @@
@use 'sass:map'; @use 'sass:map';
@use '../../../../../../../node_modules/@angular/material/index' as mat; @use '../../../../../../../../node_modules/@angular/material/index' as mat;
@mixin color($theme) { @mixin color($theme) {
$color-config: mat.get-color-config($theme); $color-config: mat.get-color-config($theme);

@ -9,8 +9,8 @@ import {
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";
import {GridEntry} from "./GridEntry"; import {GridEntry} from "./GridEntry";

@ -10,12 +10,12 @@ import {
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";
import {CdkVirtualScrollViewport} from "@angular/cdk/scrolling"; import {CdkVirtualScrollViewport} from "@angular/cdk/scrolling";
import {TabService} from "../../../../services/tab/tab.service"; 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",

@ -1,5 +1,5 @@
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",

@ -5,9 +5,9 @@ import {
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({

@ -0,0 +1,68 @@
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import {FileMultiviewComponent} from "./file-multiview/file-multiview.component";
import {FileGridComponent} from "./file-multiview/file-grid/file-grid.component";
import {FileGalleryComponent} from "./file-multiview/file-gallery/file-gallery.component";
import {FileGalleryEntryComponent} from "./file-multiview/file-gallery/file-gallery-entry/file-gallery-entry.component";
import {FileGridEntryComponent} from "./file-multiview/file-grid/file-grid-entry/file-grid-entry.component";
import {FileContextMenuComponent} from "./file-context-menu/file-context-menu.component";
import {FileThumbnailComponent} from "./file-thumbnail/file-thumbnail.component";
import {ContentViewerComponent} from "./content-viewer/content-viewer.component";
import {AudioViewerComponent} from "./content-viewer/audio-viewer/audio-viewer.component";
import {ImageViewerComponent} from "./content-viewer/image-viewer/image-viewer.component";
import {VideoViewerComponent} from "./content-viewer/video-viewer/video-viewer.component";
import {AppCommonModule} from "../app-common/app-common.module";
import {MatSliderModule} from "@angular/material/slider";
import {NgIconsModule} from "@ng-icons/core";
import {MatRefresh, MatClose, MatImage, MatMovie, MatGif, MatAudiotrack, MatDescription} from "@ng-icons/material-icons";
import {DragDropModule} from "@angular/cdk/drag-drop";
import {MatButtonModule} from "@angular/material/button";
import {MatMenuModule} from "@angular/material/menu";
import {MatDividerModule} from "@angular/material/divider";
import {FlexModule} from "@angular/flex-layout";
import {ScrollingModule} from "@angular/cdk/scrolling";
import {MatProgressSpinnerModule} from "@angular/material/progress-spinner";
import {MatCardModule} from "@angular/material/card";
@NgModule({
declarations: [
FileMultiviewComponent,
FileGridComponent,
FileGalleryComponent,
FileGalleryEntryComponent,
FileGridEntryComponent,
FileContextMenuComponent,
FileThumbnailComponent,
ContentViewerComponent,
AudioViewerComponent,
ImageViewerComponent,
VideoViewerComponent,
],
exports: [
FileMultiviewComponent
],
imports: [
CommonModule,
AppCommonModule,
MatSliderModule,
NgIconsModule.withIcons({
MatRefresh,
MatClose,
MatImage,
MatMovie,
MatGif,
MatAudiotrack,
MatDescription
}),
DragDropModule,
MatButtonModule,
MatMenuModule,
MatDividerModule,
FlexModule,
ScrollingModule,
MatProgressSpinnerModule,
MatCardModule
]
})
export class FileModule { }

@ -1,28 +1,6 @@
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 {FileGridComponent} from "./file-multiview/file-grid/file-grid.component";
import {FileGridEntryComponent} from "./file-multiview/file-grid/file-grid-entry/file-grid-entry.component";
import {FileSearchComponent} from "./sidebar/file-search/file-search.component";
import {SortDialogComponent} from "./sidebar/file-search/sort-dialog/sort-dialog.component";
import {FileGalleryComponent} from "./file-multiview/file-gallery/file-gallery.component";
import {FileGalleryEntryComponent} from "./file-multiview/file-gallery/file-gallery-entry/file-gallery-entry.component";
import {ContentAwareImageComponent} from "./content-aware-image/content-aware-image.component";
import {AddRepositoryDialogComponent} from "../core/repositories-tab/add-repository-dialog/add-repository-dialog.component";
import {ConfirmDialogComponent} from "./confirm-dialog/confirm-dialog.component";
import {TagItemComponent} from "./tag-item/tag-item.component"; import {TagItemComponent} from "./tag-item/tag-item.component";
import {FileEditComponent} from "./sidebar/file-edit/file-edit.component";
import {FilterDialogComponent} from "./sidebar/file-search/filter-dialog/filter-dialog.component";
import {TagFilterListItemComponent} from "./sidebar/file-search/filter-dialog/tag-filter-list-item/tag-filter-list-item.component";
import {ContextMenuComponent} from "./context-menu/context-menu.component";
import {FileContextMenuComponent} from "./context-menu/file-context-menu/file-context-menu.component";
import {ContentViewerComponent} from "./file-multiview/file-gallery/content-viewer/content-viewer.component";
import {ImageViewerComponent} from "./file-multiview/file-gallery/content-viewer/image-viewer/image-viewer.component";
import {VideoViewerComponent} from "./file-multiview/file-gallery/content-viewer/video-viewer/video-viewer.component";
import {AudioViewerComponent} from "./file-multiview/file-gallery/content-viewer/audio-viewer/audio-viewer.component";
import {BusyIndicatorComponent} from "./busy-indicator/busy-indicator.component";
import {FileThumbnailComponent} from "./file-thumbnail/file-thumbnail.component";
import {FileMultiviewComponent} from "./file-multiview/file-multiview.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 {MatButtonModule} from "@angular/material/button"; import {MatButtonModule} from "@angular/material/button";
@ -56,38 +34,15 @@ import {AppRoutingModule} from "../../app-routing.module";
import {NgIconsModule} from "@ng-icons/core"; import {NgIconsModule} from "@ng-icons/core";
import * as materialIcons from "@ng-icons/material-icons"; import * as materialIcons from "@ng-icons/material-icons";
import {InputModule} from "./input/input.module"; import {InputModule} from "./input/input.module";
import {AppCommonModule} from "./app-common/app-common.module";
@NgModule({ @NgModule({
declarations: [ declarations: [
RepositoryCardComponent,
FileGridComponent,
FileGridEntryComponent,
SortDialogComponent,
FileGalleryComponent,
FileGalleryEntryComponent,
ContentAwareImageComponent,
AddRepositoryDialogComponent,
ConfirmDialogComponent,
TagItemComponent, TagItemComponent,
FilterDialogComponent,
TagFilterListItemComponent,
ContextMenuComponent,
FileContextMenuComponent,
ContentViewerComponent,
ImageViewerComponent,
VideoViewerComponent,
AudioViewerComponent,
BusyIndicatorComponent,
FileThumbnailComponent,
FileMultiviewComponent,
], ],
exports: [ exports: [
FileMultiviewComponent,
BusyIndicatorComponent,
TagItemComponent, TagItemComponent,
ContextMenuComponent,
RepositoryCardComponent
], ],
imports: [ imports: [
CommonModule, CommonModule,
@ -124,6 +79,7 @@ import {InputModule} from "./input/input.module";
AppRoutingModule, AppRoutingModule,
NgIconsModule.withIcons({...materialIcons}), NgIconsModule.withIcons({...materialIcons}),
InputModule, InputModule,
AppCommonModule,
] ]
}) })
export class SharedModule { export class SharedModule {

@ -14,12 +14,22 @@ import {MatDividerModule} from "@angular/material/divider";
import {FlexModule} from "@angular/flex-layout"; import {FlexModule} from "@angular/flex-layout";
import {MatSelectModule} from "@angular/material/select"; import {MatSelectModule} from "@angular/material/select";
import {MatInputModule} from "@angular/material/input"; import {MatInputModule} from "@angular/material/input";
import {TagFilterListItemComponent} from "./file-search/filter-dialog/tag-filter-list-item/tag-filter-list-item.component";
import {SortDialogComponent} from "./file-search/sort-dialog/sort-dialog.component";
import {FilterDialogComponent} from "./file-search/filter-dialog/filter-dialog.component";
import {MatListModule} from "@angular/material/list";
import {MatDialogModule} from "@angular/material/dialog";
import {AppCommonModule} from "../app-common/app-common.module";
import {DragDropModule} from "@angular/cdk/drag-drop";
@NgModule({ @NgModule({
declarations: [ declarations: [
FileEditComponent, FileEditComponent,
FileSearchComponent, FileSearchComponent,
TagFilterListItemComponent,
SortDialogComponent,
FilterDialogComponent,
], ],
exports: [ exports: [
FileEditComponent, FileEditComponent,
@ -45,6 +55,10 @@ import {MatInputModule} from "@angular/material/input";
FlexModule, FlexModule,
MatSelectModule, MatSelectModule,
MatInputModule, MatInputModule,
MatListModule,
MatDialogModule,
AppCommonModule,
DragDropModule,
] ]
}) })
export class SidebarModule { export class SidebarModule {

@ -1,9 +1,9 @@
@use 'sass:map'; @use 'sass:map';
@use "~@angular/material" as mat; @use "~@angular/material" as mat;
@use 'src/app/app.component-theme' as app; @use 'src/app/app.component-theme' as app;
@use 'app/components/shared/file-multiview/file-grid/file-grid-entry/file-grid-entry.component-theme' as file-grid-entry; @use 'app/components/shared/file/file-multiview/file-grid/file-grid-entry/file-grid-entry.component-theme' as file-grid-entry;
@use 'app/components/shared/sidebar/file-search/file-search.component-theme' as file-search; @use 'app/components/shared/sidebar/file-search/file-search.component-theme' as file-search;
@use "app/components/shared/file-multiview/file-gallery/file-gallery-entry/file-gallery-entry.component-theme" as gallery-entry; @use "app/components/shared/file/file-multiview/file-gallery/file-gallery-entry/file-gallery-entry.component-theme" as gallery-entry;
@include mat.core(); @include mat.core();

Loading…
Cancel
Save