diff --git a/mediarepo-ui/src/app/components/core/files-tab/files-tab-sidebar/files-tab-sidebar.component.html b/mediarepo-ui/src/app/components/core/files-tab/files-tab-sidebar/files-tab-sidebar.component.html index f7983f9..839f9aa 100644 --- a/mediarepo-ui/src/app/components/core/files-tab/files-tab-sidebar/files-tab-sidebar.component.html +++ b/mediarepo-ui/src/app/components/core/files-tab/files-tab-sidebar/files-tab-sidebar.component.html @@ -8,5 +8,8 @@ + + + diff --git a/mediarepo-ui/src/app/components/core/files-tab/files-tab-sidebar/files-tab-sidebar.component.scss b/mediarepo-ui/src/app/components/core/files-tab/files-tab-sidebar/files-tab-sidebar.component.scss index 02185a4..d0d06a3 100644 --- a/mediarepo-ui/src/app/components/core/files-tab/files-tab-sidebar/files-tab-sidebar.component.scss +++ b/mediarepo-ui/src/app/components/core/files-tab/files-tab-sidebar/files-tab-sidebar.component.scss @@ -1,4 +1,4 @@ -mat-tab-group, mat-tab, .file-tag-list, app-tag-edit, app-file-search { +mat-tab-group, mat-tab, .file-tag-list, app-tag-edit, app-file-search, app-file-metadata { height: 100%; width: 100%; } diff --git a/mediarepo-ui/src/app/components/core/import-tab/import-tab-sidebar/import-tab-sidebar.component.html b/mediarepo-ui/src/app/components/core/import-tab/import-tab-sidebar/import-tab-sidebar.component.html index a5ba422..3e558d0 100644 --- a/mediarepo-ui/src/app/components/core/import-tab/import-tab-sidebar/import-tab-sidebar.component.html +++ b/mediarepo-ui/src/app/components/core/import-tab/import-tab-sidebar/import-tab-sidebar.component.html @@ -6,5 +6,8 @@ + + + diff --git a/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/file-metadata.component.html b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/file-metadata.component.html new file mode 100644 index 0000000..a3e5a5a --- /dev/null +++ b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/file-metadata.component.html @@ -0,0 +1,19 @@ +
+
+

File Metadata

+ +
+
+ +
+
diff --git a/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/file-metadata.component.scss b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/file-metadata.component.scss new file mode 100644 index 0000000..6352981 --- /dev/null +++ b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/file-metadata.component.scss @@ -0,0 +1,38 @@ +.file-metadata-inner { + height: 100%; + width: 100%; + display: block; + overflow: hidden; +} + +.file-metadata-entries-scroll-container { + height: 100%; + overflow-y: auto; +} + +.file-metadata-entries { + padding: 0 0.5em; + user-select: none; + height: auto; + + app-metadata-entry { + margin: 0.5em 0; + width: 100%; + display: block; + } + :first-child { + margin-top: 0; + } + :last-child { + margin-bottom: 0; + } +} + +.file-metadata-header { + text-align: center; + height: 100px; + width: 100%; + h1 { + margin-top: 20px; + } +} diff --git a/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/file-metadata.component.spec.ts b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/file-metadata.component.spec.ts new file mode 100644 index 0000000..2ea664a --- /dev/null +++ b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/file-metadata.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FileMetadataComponent } from './file-metadata.component'; + +describe('FileMetadataComponent', () => { + let component: FileMetadataComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ FileMetadataComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(FileMetadataComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/file-metadata.component.ts b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/file-metadata.component.ts new file mode 100644 index 0000000..66746e1 --- /dev/null +++ b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/file-metadata.component.ts @@ -0,0 +1,35 @@ +import { + Component, + Input, + OnChanges, + OnInit, + SimpleChanges +} from "@angular/core"; +import {File} from "../../../../models/File"; + +@Component({ + selector: "app-file-metadata", + templateUrl: "./file-metadata.component.html", + styleUrls: ["./file-metadata.component.scss"] +}) +export class FileMetadataComponent implements OnInit, OnChanges { + + @Input() file!: File; + + constructor() { + } + + public async ngOnInit(): Promise { + await this.loadFileInformation(); + } + + public async ngOnChanges(changes: SimpleChanges): Promise { + if (changes["file"]) { + await this.loadFileInformation(); + } + } + + private async loadFileInformation() { + + } +} diff --git a/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/metadata-entry/metadata-entry.component.html b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/metadata-entry/metadata-entry.component.html new file mode 100644 index 0000000..39c7cee --- /dev/null +++ b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/metadata-entry/metadata-entry.component.html @@ -0,0 +1,4 @@ + diff --git a/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/metadata-entry/metadata-entry.component.scss b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/metadata-entry/metadata-entry.component.scss new file mode 100644 index 0000000..eb64cef --- /dev/null +++ b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/metadata-entry/metadata-entry.component.scss @@ -0,0 +1,17 @@ +.metadata-entry-inner { + width: 100%; + display: flex; + flex-direction: column; +} + +.metadata-attribute { + opacity: 0.8; + text-overflow: ellipsis; + user-select: text; +} + +.metadata-value { + margin-left: 0.5em; + word-break: break-all; + user-select: text; +} diff --git a/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/metadata-entry/metadata-entry.component.spec.ts b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/metadata-entry/metadata-entry.component.spec.ts new file mode 100644 index 0000000..c66b354 --- /dev/null +++ b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/metadata-entry/metadata-entry.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MetadataEntryComponent } from './metadata-entry.component'; + +describe('MetadataEntryComponent', () => { + let component: MetadataEntryComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ MetadataEntryComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(MetadataEntryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/metadata-entry/metadata-entry.component.ts b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/metadata-entry/metadata-entry.component.ts new file mode 100644 index 0000000..66bc84d --- /dev/null +++ b/mediarepo-ui/src/app/components/shared/sidebar/file-metadata/metadata-entry/metadata-entry.component.ts @@ -0,0 +1,15 @@ +import {Component, Input} from "@angular/core"; + +@Component({ + selector: "app-metadata-entry", + templateUrl: "./metadata-entry.component.html", + styleUrls: ["./metadata-entry.component.scss"] +}) +export class MetadataEntryComponent { + + @Input() attributeName!: string; + @Input() value!: string; + + constructor() { + } +} diff --git a/mediarepo-ui/src/app/components/shared/sidebar/sidebar.module.ts b/mediarepo-ui/src/app/components/shared/sidebar/sidebar.module.ts index 0152f0b..cd01914 100644 --- a/mediarepo-ui/src/app/components/shared/sidebar/sidebar.module.ts +++ b/mediarepo-ui/src/app/components/shared/sidebar/sidebar.module.ts @@ -26,6 +26,8 @@ import {FilesystemImportComponent} from "./file-import/filesystem-import/filesys import {MatCheckboxModule} from "@angular/material/checkbox"; import {MatProgressBarModule} from "@angular/material/progress-bar"; import {MatMenuModule} from "@angular/material/menu"; +import { FileMetadataComponent } from "./file-metadata/file-metadata.component"; +import { MetadataEntryComponent } from './file-metadata/metadata-entry/metadata-entry.component'; @NgModule({ @@ -37,11 +39,14 @@ import {MatMenuModule} from "@angular/material/menu"; FilterDialogComponent, FileImportComponent, FilesystemImportComponent, + FileMetadataComponent, + MetadataEntryComponent, ], exports: [ TagEditComponent, FileSearchComponent, - FileImportComponent + FileImportComponent, + FileMetadataComponent ], imports: [ CommonModule,