@iapps/ng-dhis2-ui 1.2.162 → 1.2.164
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.
|
@@ -7403,7 +7403,7 @@ function getNumericLevelForSemanticLevel(level, keywordToLevel = DEFAULT_KEYWORD
|
|
|
7403
7403
|
return keyword ? keywordToLevel[keyword] : undefined;
|
|
7404
7404
|
}
|
|
7405
7405
|
const OrgUnitFormField = (props) => {
|
|
7406
|
-
const { onSelectOrgUnit, label, required, selected, disabled, key, field, customOrgUnitRoots, } = props;
|
|
7406
|
+
const { onSelectOrgUnit, label, required, selected, disabled, key, field, customOrgUnitRoots, orgUnitRoots, } = props;
|
|
7407
7407
|
const d2 = window?.d2Web;
|
|
7408
7408
|
const classes = useDynamicStyles$2(orgUnitFieldStyles);
|
|
7409
7409
|
const config = useMemo(() => d2.systemInfo?.toInitObject(), []);
|
|
@@ -7673,11 +7673,15 @@ const OrgUnitFormField = (props) => {
|
|
|
7673
7673
|
}
|
|
7674
7674
|
return configuredRootInfo;
|
|
7675
7675
|
}
|
|
7676
|
+
if (orgUnitRoots?.length) {
|
|
7677
|
+
return orgUnitRoots.map((id) => ({ id }));
|
|
7678
|
+
}
|
|
7676
7679
|
return d2.currentUser?.organisationUnits || [];
|
|
7677
7680
|
}, [
|
|
7678
7681
|
useCustomRoots,
|
|
7679
7682
|
configuredRootsLoading,
|
|
7680
7683
|
configuredRootInfo,
|
|
7684
|
+
orgUnitRoots,
|
|
7681
7685
|
d2.currentUser,
|
|
7682
7686
|
]);
|
|
7683
7687
|
const getExpandedItems = () => {
|
|
@@ -8956,10 +8960,16 @@ class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
8956
8960
|
const [checkingUniqueness, setCheckingUniqueness] = useState(false);
|
|
8957
8961
|
useEffect(() => {
|
|
8958
8962
|
const sub = this.programRuleOptions$.subscribe((options) => {
|
|
8963
|
+
if (!options)
|
|
8964
|
+
return;
|
|
8965
|
+
if (field.controlType !== 'dropdown' &&
|
|
8966
|
+
field.controlType !== 'multi-dropdown') {
|
|
8967
|
+
return;
|
|
8968
|
+
}
|
|
8959
8969
|
const cascade = this.#resolveCascadeForCurrentField();
|
|
8960
8970
|
if (cascade?.kind === 'OPTIONS_PATH')
|
|
8961
8971
|
return;
|
|
8962
|
-
const nextOptions = options
|
|
8972
|
+
const nextOptions = options;
|
|
8963
8973
|
setFilteredOptions(nextOptions);
|
|
8964
8974
|
const currentCtrl = this.#getCurrentFieldControl(fg);
|
|
8965
8975
|
const currentValue = String(currentCtrl?.value ?? '').trim();
|
|
@@ -9151,7 +9161,7 @@ class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
9151
9161
|
case 'textarea':
|
|
9152
9162
|
return (React__default.createElement(TextAreaField, { error: hasError, validationText: validationError, inputWidth: this.fieldConfig()?.inputWidth, required: f.required, name: f.id, disabled: disabled, label: this.label(), rows: 5, placeholder: this.placeholder(), value: value, onChange: (event) => onValueChange(event.value), onBlur: () => checkValueUniqueness() }));
|
|
9153
9163
|
case 'org-unit':
|
|
9154
|
-
return (React__default.createElement(OrgUnitFormField, { label: this.label(), key: f.id, field: f.id, required: f.required, disabled: disabled, customOrgUnitRoots: this.customOrgUnitRoots(), onSelectOrgUnit: (selectedOrgUnit) => onValueChange(selectedOrgUnit), selected: value }));
|
|
9164
|
+
return (React__default.createElement(OrgUnitFormField, { label: this.label(), key: f.id, field: f.id, required: f.required, disabled: disabled, customOrgUnitRoots: this.customOrgUnitRoots(), orgUnitRoots: f.extension?.orgUnitRoots, onSelectOrgUnit: (selectedOrgUnit) => onValueChange(selectedOrgUnit), selected: value }));
|
|
9155
9165
|
case 'transfer':
|
|
9156
9166
|
return (React__default.createElement(Transfer, { filterable: true, filterPlaceholder: "Search", selected: selected, leftHeader: React__default.createElement("div", { style: { fontSize: 14, padding: '8px 4px' } }, f.availableOptionsLabel), rightHeader: React__default.createElement("div", { style: { fontSize: 14, padding: '8px 4px' } }, f.selectedOptionsLabel), options: f.options, onChange: (event) => onValueChange(event.selected) }));
|
|
9157
9167
|
case 'checkbox':
|