@alfresco/aca-content 7.5.0-26580764564 → 7.5.0-26635454327
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NotificationService, CardViewUpdateService,
|
|
1
|
+
import { NotificationService, CardViewUpdateService, CardViewBoolItemModel, CardViewTextItemModel, CardViewSelectItemModel, CardViewComponent, EmptyContentComponent, ConfirmDialogComponent, provideTranslations } from '@alfresco/adf-core';
|
|
2
2
|
import { provideExtensionConfig, provideExtensions } from '@alfresco/adf-extensions';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { inject, Injectable, forwardRef, Input, ViewEncapsulation, Component, DestroyRef, ElementRef, ViewChildren, HostBinding, EventEmitter, Output, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
@@ -1092,71 +1092,76 @@ class RuleActionUiComponent {
|
|
|
1092
1092
|
const disabledTags = !this.tagService.areTagsEnabled();
|
|
1093
1093
|
const disabledCategories = !this.categoryService.areCategoriesEnabled();
|
|
1094
1094
|
this.cardViewItems = (this.selectedActionDefinition?.parameterDefinitions ?? []).map((paramDef) => {
|
|
1095
|
-
const constraintsForDropdownBox = paramDef
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1095
|
+
const constraintsForDropdownBox = this.getConstraintsForParameter(paramDef, securityMarkOptions);
|
|
1096
|
+
const cardViewPropertiesModel = this.buildBaseCardViewModel(paramDef);
|
|
1097
|
+
return this.createCardViewItemByType(paramDef, cardViewPropertiesModel, constraintsForDropdownBox, disabledTags, disabledCategories);
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
getConstraintsForParameter(paramDef, securityMarkOptions) {
|
|
1101
|
+
return paramDef.name === 'securityMarkId'
|
|
1102
|
+
? { name: paramDef.name, constraints: securityMarkOptions || [] }
|
|
1103
|
+
: this._parameterConstraints.find((obj) => obj.name === paramDef.name);
|
|
1104
|
+
}
|
|
1105
|
+
buildBaseCardViewModel(paramDef) {
|
|
1106
|
+
return {
|
|
1107
|
+
label: paramDef.displayLabel + (paramDef.mandatory ? ' *' : ''),
|
|
1108
|
+
key: paramDef.name,
|
|
1109
|
+
editable: true,
|
|
1110
|
+
multivalued: paramDef.multiValued,
|
|
1111
|
+
...(paramDef.mandatory
|
|
1112
|
+
? {
|
|
1113
|
+
validators: [
|
|
1114
|
+
{
|
|
1115
|
+
message: 'ACA_FOLDER_RULES.RULE_DETAILS.ERROR.REQUIRED',
|
|
1116
|
+
isValid: (value) => !!value
|
|
1117
|
+
}
|
|
1118
|
+
]
|
|
1119
|
+
}
|
|
1120
|
+
: {})
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
createCardViewItemByType(paramDef, cardViewPropertiesModel, constraintsForDropdownBox, disabledTags, disabledCategories) {
|
|
1124
|
+
if (paramDef.type === 'd:boolean') {
|
|
1125
|
+
return new CardViewBoolItemModel({
|
|
1126
|
+
...cardViewPropertiesModel,
|
|
1127
|
+
value: this.parameters[paramDef.name] ?? false
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
if (paramDef.type === 'd:noderef' && !constraintsForDropdownBox && !this.readOnly && paramDef.name !== 'category-value') {
|
|
1131
|
+
return new CardViewTextItemModel({
|
|
1132
|
+
...cardViewPropertiesModel,
|
|
1133
|
+
icon: 'folder',
|
|
1134
|
+
default: '',
|
|
1135
|
+
clickable: true,
|
|
1136
|
+
clickCallBack: this.openSelectorDialog.bind(this, paramDef.name),
|
|
1137
|
+
value: this.parameters[paramDef.name]
|
|
1138
|
+
});
|
|
1139
|
+
}
|
|
1140
|
+
if (paramDef.type === 'd:noderef' && paramDef.name === 'category-value' && !this.readOnly) {
|
|
1141
|
+
return new CardViewTextItemModel({
|
|
1142
|
+
...cardViewPropertiesModel,
|
|
1143
|
+
icon: 'library_add',
|
|
1144
|
+
default: '',
|
|
1145
|
+
clickable: true,
|
|
1146
|
+
clickCallBack: this.openCatDialog.bind(this, paramDef.name),
|
|
1147
|
+
value: this.parameters[paramDef.name]
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
if (constraintsForDropdownBox) {
|
|
1151
|
+
return new CardViewSelectItemModel({
|
|
1152
|
+
...cardViewPropertiesModel,
|
|
1153
|
+
value: this.parameters[paramDef.name] ?? (paramDef.multiValued ? [''] : ''),
|
|
1154
|
+
options$: of(constraintsForDropdownBox.constraints).pipe(map((options) => options.filter((option) => !((disabledTags && this.tagsRelatedPropertiesAndAspects.includes(option.key)) ||
|
|
1155
|
+
(disabledCategories && this.categoriesRelatedPropertiesAndAspects.includes(option.key))))))
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
const shouldFormatValue = constraintsForDropdownBox && this.readOnly && this.paramsToFormatDisplayedValue.includes(paramDef.name);
|
|
1159
|
+
const formattedValue = shouldFormatValue
|
|
1160
|
+
? (constraintsForDropdownBox.constraints.find((constraint) => constraint.key === this.parameters[paramDef.name])?.label ?? '')
|
|
1161
|
+
: (this.parameters[paramDef.name] ?? '');
|
|
1162
|
+
return new CardViewTextItemModel({
|
|
1163
|
+
...cardViewPropertiesModel,
|
|
1164
|
+
value: formattedValue
|
|
1160
1165
|
});
|
|
1161
1166
|
}
|
|
1162
1167
|
openSelectorDialog(paramDefName) {
|