-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edit non-image multimedia, brings up multimedia dialog
Fixes #780 * Change multimedia-button to multimedia-add-button * Create multimedia-edit-button * Fix some problems with handling format and source type
- Loading branch information
1 parent
f1412de
commit 8f2d340
Showing
18 changed files
with
127 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
gedbrowserng-frontend/src/app/components/multimedia-add-button/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './multimedia-add-button.component'; |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...utton/multimedia-button.component.spec.ts → ...n/multimedia-add-button.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
gedbrowserng-frontend/src/app/components/multimedia-button/index.ts
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
gedbrowserng-frontend/src/app/components/multimedia-edit-button/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './multimedia-edit-button.component'; |
1 change: 1 addition & 0 deletions
1
...g-frontend/src/app/components/multimedia-edit-button/multimedia-edit-button.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
7 changes: 7 additions & 0 deletions
7
...-frontend/src/app/components/multimedia-edit-button/multimedia-edit-button.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<p-button (onClick)="edit()" | ||
icon="fa fa-fw fa-pencil" pTooltip="Edit multimedia attribute"></p-button> | ||
<app-multimedia-dialog | ||
*ngIf="displayDialog" [p]="this" | ||
(emitClose)="onDialogClose()" (emitOpen)="onDialogOpen($event)" | ||
(emitOK)="update($event)" | ||
[(display)]="displayDialog"></app-multimedia-dialog> |
25 changes: 25 additions & 0 deletions
25
...ontend/src/app/components/multimedia-edit-button/multimedia-edit-button.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { MultimediaEditButtonComponent } from './multimedia-edit-button.component'; | ||
|
||
describe('MultimediaEditButtonComponent', () => { | ||
let component: MultimediaEditButtonComponent; | ||
let fixture: ComponentFixture<MultimediaEditButtonComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ MultimediaEditButtonComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(MultimediaEditButtonComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
40 changes: 40 additions & 0 deletions
40
...ng-frontend/src/app/components/multimedia-edit-button/multimedia-edit-button.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
import { Saveable } from '../../interfaces'; | ||
import { ApiAttribute, MultimediaDialogData } from '../../models'; | ||
import { MultimediaDialogHelper } from '../../utils'; | ||
import { MultimediaDialogComponent } from '../multimedia-dialog'; | ||
|
||
@Component({ | ||
selector: 'app-multimedia-edit-button', | ||
templateUrl: './multimedia-edit-button.component.html', | ||
styleUrls: ['./multimedia-edit-button.component.css'] | ||
}) | ||
export class MultimediaEditButtonComponent { | ||
@Input() dataset: string; | ||
@Input() parent: Saveable; | ||
@Input() attributes: Array<ApiAttribute>; | ||
@Input() index; | ||
displayDialog = false; | ||
|
||
constructor() { } | ||
|
||
edit(): void { | ||
this.displayDialog = true; | ||
} | ||
|
||
onDialogOpen(data: MultimediaDialogComponent) { | ||
if (data !== undefined) { | ||
data._data = MultimediaDialogHelper.buildMultimediaDialogData(this.attributes, this.index); | ||
} | ||
} | ||
|
||
onDialogClose(): void { | ||
this.displayDialog = false; | ||
} | ||
|
||
update(data: MultimediaDialogData): void { | ||
this.attributes.splice(this.index, 1, MultimediaDialogHelper.buildMultimediaAttribute(data)); | ||
this.parent.save(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...rowserng-frontend/src/app/components/multimedia-gallery/multimedia-gallery.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters