mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-15839] Fix file object input in viewers (#8804)
* [AAE-15839] Fix file object input in viewers * [AAE-15839] Attend review comments * [AAE-15839] Remove duplication * [AAE-15839] Fix package-lock.json * [AAE-15839] Fix package.json * [AAE-15839] Remove duplication * [AAE-15839] Remove duplication
This commit is contained in:
committed by
GitHub
parent
1f96c3452c
commit
04803c1815
@@ -15,10 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { FormService, WidgetComponent } from '@alfresco/adf-core';
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { BaseViewerWidgetComponent, FormService } from '@alfresco/adf-core';
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
@Component({
|
||||
selector: 'file-viewer-widget',
|
||||
@@ -37,18 +37,8 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
},
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class FileViewerWidgetComponent extends WidgetComponent implements OnInit {
|
||||
export class FileViewerWidgetComponent extends BaseViewerWidgetComponent {
|
||||
constructor(formService: FormService) {
|
||||
super(formService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.field &&
|
||||
this.field.value &&
|
||||
Array.isArray(this.field.value) &&
|
||||
this.field.value.length) {
|
||||
const file = this.field.value[0];
|
||||
this.field.value = file.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user