[AAE-6025] - Resolve linked dropdowns during runtime (#7289)

* Resolve linked dropdown during runtime, Draft commit

* Remove app from appconfig

* Make the link work for Saved and Completed tasks

* Call the new API to fetch dropdown options in case of rest type

* When widgetId is missing from restUrl

* Update unit tests

* Declare default option

* Rebase, remove appName example

* Maurizify the PR

* Fix lint error

Co-authored-by: Ardit Domi <arditdomi@apl-c02g64vpmd6t.home>
This commit is contained in:
arditdomi
2021-11-01 00:30:55 +00:00
committed by GitHub
parent f14d333281
commit 79d54ea4e4
9 changed files with 437 additions and 49 deletions

View File

@@ -0,0 +1,28 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { FormFieldOption } from './form-field-option';
export interface FormFieldRule {
ruleOn: string;
entries: RuleEntry[];
}
export interface RuleEntry {
key: string;
options: FormFieldOption[];
}

View File

@@ -26,6 +26,7 @@ import { FormFieldTypes } from './form-field-types';
import { NumberFieldValidator } from './form-field-validator';
import { FormWidgetModel } from './form-widget.model';
import { FormModel } from './form.model';
import { FormFieldRule } from './form-field-rule';
// Maps to FormFieldRepresentation
export class FormFieldModel extends FormWidgetModel {
@@ -72,6 +73,7 @@ export class FormFieldModel extends FormWidgetModel {
currency: string = null;
dateDisplayFormat: string = this.defaultDateFormat;
selectionType: 'single' | 'multiple' = null;
rule?: FormFieldRule;
// container model members
numberOfColumns: number = 1;
@@ -178,6 +180,7 @@ export class FormFieldModel extends FormWidgetModel {
this.validationSummary = new ErrorMessageModel();
this.tooltip = json.tooltip;
this.selectionType = json.selectionType;
this.rule = json.rule;
if (json.placeholder && json.placeholder !== '' && json.placeholder !== 'null') {
this.placeholder = json.placeholder;

View File

@@ -40,3 +40,4 @@ export * from './form-variable.model';
export * from './process-variable.model';
export * from './upload-widget-content-link.model';
export * from './form-field-file-source';
export * from './form-field-rule';