Refactor project structure

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/4/head
trivernis 3 years ago
parent 62321ccebb
commit 9773444d7f

@ -1,9 +1,9 @@
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {HomeComponent} from "./pages/home/home.component";
import {CoreComponent} from "./components/core/core.component";
const routes: Routes = [
{path: "", component: HomeComponent}];
{path: "", component: CoreComponent}];
@NgModule({
imports: [RouterModule.forRoot(routes)],

@ -1 +1 @@
<router-outlet></router-outlet>
<app-core></app-core>

@ -4,143 +4,18 @@ import {BrowserModule} from '@angular/platform-browser';
import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {RepositoriesTabComponent} from './pages/home/repositories-tab/repositories-tab.component';
import {HomeComponent} from './pages/home/home.component';
import {RepositoryCardComponent} from './pages/home/repositories-tab/repository-card/repository-card.component';
import {MatCardModule} from "@angular/material/card";
import {MatListModule} from "@angular/material/list";
import {MatButtonModule} from "@angular/material/button";
import {MatToolbarModule} from "@angular/material/toolbar";
import {MatSnackBarModule} from "@angular/material/snack-bar";
import {MatFormFieldModule} from "@angular/material/form-field";
import {MatInputModule} from "@angular/material/input";
import {ReactiveFormsModule} from "@angular/forms";
import {FileGridComponent} from './components/file-multiview/file-grid/file-grid.component';
import {MatSidenavModule} from "@angular/material/sidenav";
import {MatGridListModule} from "@angular/material/grid-list";
import {FileGridEntryComponent} from './components/file-multiview/file-grid/file-grid-entry/file-grid-entry.component';
import {MatProgressBarModule} from "@angular/material/progress-bar";
import {MatPaginatorModule} from "@angular/material/paginator";
import {ScrollingModule} from "@angular/cdk/scrolling";
import {MatChipsModule} from "@angular/material/chips";
import {MatAutocompleteModule} from "@angular/material/autocomplete";
import {FileSearchComponent} from './components/file-search/file-search.component';
import {MatTabsModule} from "@angular/material/tabs";
import {FilesTabComponent} from './pages/home/files-tab/files-tab.component';
import {FlexModule, GridModule} from "@angular/flex-layout";
import {MatRippleModule} from "@angular/material/core";
import {SortDialogComponent} from './components/file-search/sort-dialog/sort-dialog.component';
import {MatDialogModule} from "@angular/material/dialog";
import {MatSelectModule} from "@angular/material/select";
import {FileGalleryComponent} from './components/file-multiview/file-gallery/file-gallery.component';
import {FileGalleryEntryComponent} from './components/file-multiview/file-gallery/file-gallery-entry/file-gallery-entry.component';
import {MatProgressSpinnerModule} from "@angular/material/progress-spinner";
import {BlockUIModule} from "primeng/blockui";
import {PanelModule} from "primeng/panel";
import {DragDropModule} from "@angular/cdk/drag-drop";
import {ContentAwareImageComponent} from './components/content-aware-image/content-aware-image.component';
import {MatSliderModule} from "@angular/material/slider";
import {AddRepositoryDialogComponent} from './pages/home/repositories-tab/add-repository-dialog/add-repository-dialog.component';
import {MatTooltipModule} from "@angular/material/tooltip";
import {MatMenuModule} from "@angular/material/menu";
import {ConfirmDialogComponent} from './components/confirm-dialog/confirm-dialog.component';
import {FilesTabSidebarComponent} from './pages/home/files-tab/files-tab-sidebar/files-tab-sidebar.component';
import {MatExpansionModule} from "@angular/material/expansion";
import {TagItemComponent} from './components/tag-item/tag-item.component';
import {FileEditComponent} from './components/file-edit/file-edit.component';
import {ImportTabComponent} from './pages/home/import-tab/import-tab.component';
import {ImportTabSidebarComponent} from './pages/home/import-tab/import-tab-sidebar/import-tab-sidebar.component';
import {NativeFileSelectComponent} from './components/inputs/native-file-select/native-file-select.component';
import {FilesystemImportComponent} from './pages/home/import-tab/import-tab-sidebar/filesystem-import/filesystem-import.component';
import {MatCheckboxModule} from "@angular/material/checkbox";
import {FilterDialogComponent} from './components/file-search/filter-dialog/filter-dialog.component';
import {TagFilterListItemComponent} from './components/file-search/filter-dialog/tag-filter-list-item/tag-filter-list-item.component';
import {TagInputComponent} from './components/inputs/tag-input/tag-input.component';
import {ContextMenuComponent} from './components/context-menu/context-menu.component';
import {FileContextMenuComponent} from './components/context-menu/file-context-menu/file-context-menu.component';
import {ContentViewerComponent} from './components/file-multiview/file-gallery/content-viewer/content-viewer.component';
import {ImageViewerComponent} from './components/file-multiview/file-gallery/content-viewer/image-viewer/image-viewer.component';
import {VideoViewerComponent} from './components/file-multiview/file-gallery/content-viewer/video-viewer/video-viewer.component';
import {HttpClientModule} from "@angular/common/http";
import { AudioViewerComponent } from './components/file-multiview/file-gallery/content-viewer/audio-viewer/audio-viewer.component';
import { BusyIndicatorComponent } from './components/busy-indicator/busy-indicator.component';
import { FileThumbnailComponent } from './components/file-thumbnail/file-thumbnail.component';
import {NgIconsModule} from "@ng-icons/core";
import * as materialIcons from "@ng-icons/material-icons";
import { FileMultiviewComponent } from './components/file-multiview/file-multiview.component';
import {CoreModule} from "./components/core/core.module";
@NgModule({
declarations: [
AppComponent,
RepositoriesTabComponent,
HomeComponent,
RepositoryCardComponent,
FileGridComponent,
FileGridEntryComponent,
FileSearchComponent,
FilesTabComponent,
SortDialogComponent,
FileGalleryComponent,
FileGalleryEntryComponent,
ContentAwareImageComponent,
AddRepositoryDialogComponent,
ConfirmDialogComponent,
FilesTabSidebarComponent,
TagItemComponent,
FileEditComponent,
ImportTabComponent,
ImportTabSidebarComponent,
NativeFileSelectComponent,
FilesystemImportComponent,
FilterDialogComponent,
TagFilterListItemComponent,
TagInputComponent,
ContextMenuComponent,
FileContextMenuComponent,
ContentViewerComponent,
ImageViewerComponent,
VideoViewerComponent,
AudioViewerComponent,
BusyIndicatorComponent,
FileThumbnailComponent,
FileMultiviewComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
MatCardModule,
MatListModule,
MatButtonModule,
MatToolbarModule,
MatSnackBarModule,
MatFormFieldModule,
MatInputModule,
ReactiveFormsModule,
MatSidenavModule,
MatGridListModule,
MatProgressBarModule,
MatPaginatorModule,
ScrollingModule,
MatChipsModule,
MatAutocompleteModule,
MatTabsModule,
FlexModule,
GridModule,
MatRippleModule,
MatDialogModule,
MatSelectModule,
MatProgressSpinnerModule,
BlockUIModule,
PanelModule,
DragDropModule,
MatSliderModule,
MatTooltipModule,
MatMenuModule,
MatExpansionModule,
MatCheckboxModule,
HttpClientModule,
NgIconsModule.withIcons({...materialIcons}),
CoreModule,
],
providers: [],
bootstrap: [AppComponent]

@ -1,20 +1,20 @@
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {HomeComponent} from './home.component';
import {CoreComponent} from './core.component';
describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;
let component: CoreComponent;
let fixture: ComponentFixture<CoreComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [HomeComponent]
declarations: [CoreComponent]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(HomeComponent);
fixture = TestBed.createComponent(CoreComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

@ -6,11 +6,11 @@ import {TagService} from "../../services/tag/tag.service";
import {TabService} from "../../services/tab/tab.service";
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
selector: 'app-core',
templateUrl: './core.component.html',
styleUrls: ['./core.component.scss']
})
export class HomeComponent implements OnInit {
export class CoreComponent implements OnInit {
public selectedRepository: Repository | undefined;

@ -0,0 +1,75 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {CoreComponent} from "./core.component";
import {RepositoriesTabComponent} from "./repositories-tab/repositories-tab.component";
import {FilesTabComponent} from "./files-tab/files-tab.component";
import {FilesTabSidebarComponent} from "./files-tab/files-tab-sidebar/files-tab-sidebar.component";
import {ImportTabComponent} from "./import-tab/import-tab.component";
import {ImportTabSidebarComponent} from "./import-tab/import-tab-sidebar/import-tab-sidebar.component";
import {FilesystemImportComponent} from "./import-tab/import-tab-sidebar/filesystem-import/filesystem-import.component";
import {MatCardModule} from "@angular/material/card";
import {MatListModule} from "@angular/material/list";
import {MatButtonModule} from "@angular/material/button";
import {MatToolbarModule} from "@angular/material/toolbar";
import {MatSnackBarModule} from "@angular/material/snack-bar";
import {MatFormFieldModule} from "@angular/material/form-field";
import {MatInputModule} from "@angular/material/input";
import {ReactiveFormsModule} from "@angular/forms";
import {MatSidenavModule} from "@angular/material/sidenav";
import {MatGridListModule} from "@angular/material/grid-list";
import {MatProgressBarModule} from "@angular/material/progress-bar";
import {MatPaginatorModule} from "@angular/material/paginator";
import {ScrollingModule} from "@angular/cdk/scrolling";
import {MatChipsModule} from "@angular/material/chips";
import {MatAutocompleteModule} from "@angular/material/autocomplete";
import {MatTabsModule} from "@angular/material/tabs";
import {FlexModule, GridModule} from "@angular/flex-layout";
import {MatOptionModule, MatRippleModule} from "@angular/material/core";
import {MatDialogModule} from "@angular/material/dialog";
import {MatSelectModule} from "@angular/material/select";
import {MatProgressSpinnerModule} from "@angular/material/progress-spinner";
import {BlockUIModule} from "primeng/blockui";
import {PanelModule} from "primeng/panel";
import {DragDropModule} from "@angular/cdk/drag-drop";
import {MatSliderModule} from "@angular/material/slider";
import {MatTooltipModule} from "@angular/material/tooltip";
import {MatMenuModule} from "@angular/material/menu";
import {MatExpansionModule} from "@angular/material/expansion";
import {MatCheckboxModule} from "@angular/material/checkbox";
import {SharedModule} from "../shared/shared.module";
import {MatDividerModule} from "@angular/material/divider";
import {NgIconsModule} from "@ng-icons/core";
import * as materialIcons from "@ng-icons/material-icons";
@NgModule({
declarations: [
RepositoriesTabComponent,
CoreComponent,
FilesTabComponent,
FilesTabSidebarComponent,
ImportTabComponent,
ImportTabSidebarComponent,
FilesystemImportComponent,
],
exports: [
CoreComponent
],
imports: [
CommonModule,
SharedModule,
MatTabsModule,
MatSidenavModule,
MatOptionModule,
MatSelectModule,
MatDividerModule,
MatProgressBarModule,
MatCheckboxModule,
ScrollingModule,
NgIconsModule.withIcons({...materialIcons}),
FlexModule,
MatButtonModule,
]
})
export class CoreModule {
}

@ -12,9 +12,9 @@ import {Tag} from "../../../../models/Tag";
import {TagService} from "../../../../services/tag/tag.service";
import {FileService} from "../../../../services/file/file.service";
import {File} from "../../../../models/File";
import {FileSearchComponent} from "../../../../components/file-search/file-search.component";
import {FileSearchComponent} from "../../../shared/file-search/file-search.component";
import {RepositoryService} from "../../../../services/repository/repository.service";
import {FileEditComponent} from "../../../../components/file-edit/file-edit.component";
import {FileEditComponent} from "../../../shared/file-edit/file-edit.component";
import {clipboard} from "@tauri-apps/api";
@Component({

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

@ -1,11 +1,11 @@
import {Component, ViewChild} from '@angular/core';
import {File} from "../../../models/File";
import {File} from "../../../../models/File";
import {ContextMenuComponent} from "../context-menu.component";
import {clipboard, dialog} from "@tauri-apps/api";
import {FileService} from "../../../services/file/file.service";
import {ErrorBrokerService} from "../../../services/error-broker/error-broker.service";
import {FileService} from "../../../../services/file/file.service";
import {ErrorBrokerService} from "../../../../services/error-broker/error-broker.service";
import {downloadDir} from "@tauri-apps/api/path";
import {FileHelper} from "../../../services/file/file.helper";
import {FileHelper} from "../../../../services/file/file.helper";
@Component({
selector: 'app-file-context-menu',

@ -6,11 +6,11 @@ import {
SimpleChanges,
ViewChild
} from '@angular/core';
import {File} from "../../models/File";
import {Tag} from "../../models/Tag";
import {File} from "../../../models/File";
import {Tag} from "../../../models/Tag";
import {CdkVirtualScrollViewport} from "@angular/cdk/scrolling";
import {TagService} from "../../services/tag/tag.service";
import {FileService} from "../../services/file/file.service";
import {TagService} from "../../../services/tag/tag.service";
import {FileService} from "../../../services/file/file.service";
@Component({
selector: 'app-file-edit',

@ -8,10 +8,10 @@ import {
SimpleChanges, ViewChild
} from '@angular/core';
import {SafeResourceUrl} from "@angular/platform-browser";
import {File} from "../../../../models/File";
import {FileService} from "../../../../services/file/file.service";
import {FileHelper} from "../../../../services/file/file.helper";
import {ErrorBrokerService} from "../../../../services/error-broker/error-broker.service";
import {File} from "../../../../../models/File";
import {FileService} from "../../../../../services/file/file.service";
import {FileHelper} from "../../../../../services/file/file.helper";
import {ErrorBrokerService} from "../../../../../services/error-broker/error-broker.service";
import {BusyIndicatorComponent} from "../../../busy-indicator/busy-indicator.component";
type ContentType = "image" | "video" | "audio" | "other";

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

@ -7,11 +7,11 @@ import {
Output,
SimpleChanges
} from '@angular/core';
import {File} from "../../../../models/File";
import {FileService} from "../../../../services/file/file.service";
import {File} from "../../../../../models/File";
import {FileService} from "../../../../../services/file/file.service";
import {DomSanitizer, SafeResourceUrl} from "@angular/platform-browser";
import {ErrorBrokerService} from "../../../../services/error-broker/error-broker.service";
import {Selectable} from "../../../../models/Selectable";
import {ErrorBrokerService} from "../../../../../services/error-broker/error-broker.service";
import {Selectable} from "../../../../../models/Selectable";
@Component({
selector: 'app-file-gallery-entry',

@ -9,12 +9,12 @@ import {
SimpleChanges,
ViewChild
} from '@angular/core';
import {File} from "../../../models/File";
import {FileService} from "../../../services/file/file.service";
import {File} from "../../../../models/File";
import {FileService} from "../../../../services/file/file.service";
import {SafeResourceUrl} from "@angular/platform-browser";
import {Selectable} from "../../../models/Selectable";
import {Selectable} from "../../../../models/Selectable";
import {CdkVirtualScrollViewport} from "@angular/cdk/scrolling";
import {TabService} from "../../../services/tab/tab.service";
import {TabService} from "../../../../services/tab/tab.service";
@Component({
selector: 'app-file-gallery',

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

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

@ -9,9 +9,9 @@ import {
SimpleChanges,
ViewChild
} from '@angular/core';
import {File} from "../../../../models/File";
import {FileService} from "../../../../services/file/file.service";
import {ErrorBrokerService} from "../../../../services/error-broker/error-broker.service";
import {File} from "../../../../../models/File";
import {FileService} from "../../../../../services/file/file.service";
import {ErrorBrokerService} from "../../../../../services/error-broker/error-broker.service";
import {SafeResourceUrl} from "@angular/platform-browser";
import {GridEntry} from "./GridEntry";

@ -10,12 +10,12 @@ import {
SimpleChanges,
ViewChild
} from '@angular/core';
import {File} from "../../../models/File";
import {File} from "../../../../models/File";
import {FileGridEntryComponent} from "./file-grid-entry/file-grid-entry.component";
import {GridEntry} from "./file-grid-entry/GridEntry";
import {CdkVirtualScrollViewport} from "@angular/cdk/scrolling";
import {TabService} from "../../../services/tab/tab.service";
import {FileService} from "../../../services/file/file.service";
import {TabService} from "../../../../services/tab/tab.service";
import {FileService} from "../../../../services/file/file.service";
@Component({
selector: 'app-file-grid',

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save