mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-12318] Adjustments for HxP Attach-File widget (#8425)
This commit is contained in:
@@ -91,7 +91,13 @@ export class FormModel implements ProcessFormModel {
|
|||||||
processVariables: ProcessVariableModel[] = [];
|
processVariables: ProcessVariableModel[] = [];
|
||||||
variables: FormVariableModel[] = [];
|
variables: FormVariableModel[] = [];
|
||||||
|
|
||||||
constructor(json?: any, formValues?: FormValues, readOnly: boolean = false, protected formService?: FormValidationService, enableFixedSpace?: boolean) {
|
constructor(
|
||||||
|
json?: any,
|
||||||
|
formValues?: FormValues,
|
||||||
|
readOnly: boolean = false,
|
||||||
|
protected formService?: FormValidationService,
|
||||||
|
enableFixedSpace?: boolean
|
||||||
|
) {
|
||||||
this.readOnly = readOnly;
|
this.readOnly = readOnly;
|
||||||
this.json = json;
|
this.json = json;
|
||||||
|
|
||||||
@@ -415,8 +421,10 @@ export class FormModel implements ProcessFormModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setNodeIdValueForViewersLinkedToUploadWidget(linkedUploadWidgetContentSelected: UploadWidgetContentLinkModel) {
|
setNodeIdValueForViewersLinkedToUploadWidget(linkedUploadWidgetContentSelected: UploadWidgetContentLinkModel) {
|
||||||
|
const linkedWidgetType = linkedUploadWidgetContentSelected?.options?.linkedWidgetType ?? 'uploadWidget';
|
||||||
|
|
||||||
const subscribedViewers = this.fieldsCache.filter(field =>
|
const subscribedViewers = this.fieldsCache.filter(field =>
|
||||||
linkedUploadWidgetContentSelected.uploadWidgetId === field.params['uploadWidget']
|
linkedUploadWidgetContentSelected.uploadWidgetId === field.params[linkedWidgetType]
|
||||||
);
|
);
|
||||||
|
|
||||||
subscribedViewers.forEach(viewer => {
|
subscribedViewers.forEach(viewer => {
|
||||||
|
@@ -16,11 +16,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ContentLinkModel } from './content-link.model';
|
import { ContentLinkModel } from './content-link.model';
|
||||||
|
export class UploadWidgetContentLinkModelOptions {
|
||||||
|
linkedWidgetType: string;
|
||||||
|
}
|
||||||
export class UploadWidgetContentLinkModel extends ContentLinkModel {
|
export class UploadWidgetContentLinkModel extends ContentLinkModel {
|
||||||
uploadWidgetId: string;
|
uploadWidgetId: string;
|
||||||
|
|
||||||
constructor(obj?: any, uploadWidgetId?: string) {
|
constructor(obj?: any, uploadWidgetId?: string, public options?: UploadWidgetContentLinkModelOptions) {
|
||||||
super(obj);
|
super(obj);
|
||||||
this.uploadWidgetId = uploadWidgetId;
|
this.uploadWidgetId = uploadWidgetId;
|
||||||
}
|
}
|
||||||
|
@@ -33,7 +33,8 @@ import {
|
|||||||
FormValues,
|
FormValues,
|
||||||
FormModel,
|
FormModel,
|
||||||
ContentLinkModel,
|
ContentLinkModel,
|
||||||
UploadWidgetContentLinkModel
|
UploadWidgetContentLinkModel,
|
||||||
|
FormEvent
|
||||||
} from '@alfresco/adf-core';
|
} from '@alfresco/adf-core';
|
||||||
import { FormCloudService } from '../services/form-cloud.service';
|
import { FormCloudService } from '../services/form-cloud.service';
|
||||||
import { TaskVariableCloud } from '../models/task-variable-cloud.model';
|
import { TaskVariableCloud } from '../models/task-variable-cloud.model';
|
||||||
@@ -119,6 +120,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
|
|||||||
if (content instanceof UploadWidgetContentLinkModel) {
|
if (content instanceof UploadWidgetContentLinkModel) {
|
||||||
this.form.setNodeIdValueForViewersLinkedToUploadWidget(content);
|
this.form.setNodeIdValueForViewersLinkedToUploadWidget(content);
|
||||||
this.onFormDataRefreshed(this.form);
|
this.onFormDataRefreshed(this.form);
|
||||||
|
this.formService.formDataRefreshed.next(new FormEvent(this.form));
|
||||||
} else {
|
} else {
|
||||||
this.formContentClicked.emit(content);
|
this.formContentClicked.emit(content);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user