mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
28
lib/core/form/components/widgets/core/form-field-rule.ts
Normal file
28
lib/core/form/components/widgets/core/form-field-rule.ts
Normal 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[];
|
||||
}
|
@@ -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;
|
||||
|
@@ -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';
|
||||
|
Reference in New Issue
Block a user