udp-react-enterprise-component-library 25.18.1-beta.65 → 25.18.1-beta.66
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.
- package/dist/{AmbientToggleButtonGroup-Bi9yW5gC.js → AmbientToggleButtonGroup-DgFod3VK.js} +1 -1
- package/dist/{AmbientToggleButtonGroup-Bi9yW5gC.js.map → AmbientToggleButtonGroup-DgFod3VK.js.map} +1 -1
- package/dist/{AmbientVisualizationCard-BmTQR121.js → AmbientVisualizationCard-CAxx4QWe.js} +2 -2
- package/dist/{AmbientVisualizationCard-BmTQR121.js.map → AmbientVisualizationCard-CAxx4QWe.js.map} +1 -1
- package/dist/{Notes-YAF2dipI.js → Notes-BPaEmexk.js} +2 -2
- package/dist/{Notes-YAF2dipI.js.map → Notes-BPaEmexk.js.map} +1 -1
- package/dist/{PaymentForm-DFJrSIy8.js → PaymentForm-Dum5p1mf.js} +2 -2
- package/dist/{PaymentForm-DFJrSIy8.js.map → PaymentForm-Dum5p1mf.js.map} +1 -1
- package/dist/{TrimForAvatar-BmM2bU6E.js → TrimForAvatar-BP1gZWd5.js} +1 -1
- package/dist/{TrimForAvatar-BmM2bU6E.js.map → TrimForAvatar-BP1gZWd5.js.map} +1 -1
- package/dist/UI/dataDisplay/notes/index.js +1 -1
- package/dist/UI/inputs/buttons/UdpActionCard/index.js +1 -1
- package/dist/UI/inputs/buttons/index.js +3 -3
- package/dist/UI/surfaces/cards/chartDisplayCards/index.js +1 -1
- package/dist/{UdpActionCard-D-YAYE-C.js → UdpActionCard-VtAacuCM.js} +1 -1
- package/dist/{UdpActionCard-D-YAYE-C.js.map → UdpActionCard-VtAacuCM.js.map} +1 -1
- package/dist/{UdpTransactionTypesPage-CWA-n7y0.js → UdpTransactionTypesPage-DgFxT4pz.js} +138 -32
- package/dist/UdpTransactionTypesPage-DgFxT4pz.js.map +1 -0
- package/dist/{UdpTransactionsPage-B1Ia9x62.js → UdpTransactionsPage-KgkwaNGG.js} +17 -19
- package/dist/UdpTransactionsPage-KgkwaNGG.js.map +1 -0
- package/dist/{buttons-CuLiERQe.js → buttons-DyKpA2qY.js} +1 -1
- package/dist/{buttons-CuLiERQe.js.map → buttons-DyKpA2qY.js.map} +1 -1
- package/dist/index.js +7 -7
- package/dist/{stringUtils-B2JFmevx.js → stringUtils-CLVoXAz_.js} +1 -1
- package/dist/{stringUtils-B2JFmevx.js.map → stringUtils-CLVoXAz_.js.map} +1 -1
- package/dist/types/src/udp/pages/UdpTransactionTypesPage/UdpTransactionTypesPage.d.ts.map +1 -1
- package/dist/types/src/udp/pages/UdpTransactionTypesPage/forms/UdpTransactionTypeForm.d.ts.map +1 -1
- package/dist/types/src/udp/pages/UdpTransactionTypesPage/sidesheets/UdpTransactionTypeSidesheet.d.ts.map +1 -1
- package/dist/types/src/udp/pages/UdpTransactionsPage/UdpTransactionGrid.d.ts.map +1 -1
- package/dist/types/src/utilities/transactions/useTransactionEngine.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/udp/pages/UdpPages/index.js +2 -2
- package/dist/udp/pages/UdpTransactionTypesPage/index.js +1 -1
- package/dist/udp/pages/UdpTransactionsPage/index.js +1 -1
- package/dist/utilities/form/paymentForm/index.js +1 -1
- package/dist/utilities/index.js +2 -2
- package/export-map.json +1 -1
- package/package.json +1 -1
- package/dist/UdpTransactionTypesPage-CWA-n7y0.js.map +0 -1
- package/dist/UdpTransactionsPage-B1Ia9x62.js.map +0 -1
- /package/dist/{iconLibrary-Bw7pnkIf.js → iconLibrary-CMA3TPMW.js} +0 -0
- /package/dist/{utilities-C1bpHZ4f.js → utilities-WN7twALD.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrimForAvatar-
|
|
1
|
+
{"version":3,"file":"TrimForAvatar-BP1gZWd5.js","names":[],"sources":["../src/utilities/TrimForAvatar.js"],"sourcesContent":["export const TrimForAvatar = (avatar) => {\n return avatar?.trim()?.charAt(0) || '?'\n}\n"],"mappings":";AAAA,MAAa,iBAAiB,WAAW;AACvC,QAAO,QAAQ,MAAM,EAAE,OAAO,EAAE,IAAI"}
|
|
@@ -8,8 +8,8 @@ import { t as AmbientToggleButton } from "../../../AmbientToggleButton-BjyjXj8S.
|
|
|
8
8
|
import { n as styles } from "../../../AmbientToggleButtonGroupDefault-CngfAplM.js";
|
|
9
9
|
import { t as AmbientChipButton } from "../../../AmbientChipButton-DYAYXuKp.js";
|
|
10
10
|
import { t as IconButtonWithTooltip } from "../../../IconButtonWithToolTip-DswviiJB.js";
|
|
11
|
-
import { a as FluentMenuListItem, i as FluentMenuListButton, n as FluentCompoundButton, r as FluentUploadButton, t as FluentUploadIconButton } from "../../../buttons-
|
|
12
|
-
import { t as AmbientToggleButtonGroup } from "../../../AmbientToggleButtonGroup-
|
|
13
|
-
import { t as UdpActionCard } from "../../../UdpActionCard-
|
|
11
|
+
import { a as FluentMenuListItem, i as FluentMenuListButton, n as FluentCompoundButton, r as FluentUploadButton, t as FluentUploadIconButton } from "../../../buttons-DyKpA2qY.js";
|
|
12
|
+
import { t as AmbientToggleButtonGroup } from "../../../AmbientToggleButtonGroup-DgFod3VK.js";
|
|
13
|
+
import { t as UdpActionCard } from "../../../UdpActionCard-VtAacuCM.js";
|
|
14
14
|
|
|
15
15
|
export { AmbientCardButton, AmbientChipButton, AmbientPopoverMenuItem, AmbientToggleButton, AmbientToggleButtonGroup, AmbientTokenButton, FluentButton, FluentCompoundButton, FluentIconButton, FluentMenuListButton, FluentMenuListItem, FluentUploadButton, FluentUploadIconButton, IconButtonWithTooltip, PrimaryActionButton, ToolBarButton, UdpActionCard, styles };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as AmbientSplitStatCard, t as AmbientVisualizationCard } from "../../../../AmbientVisualizationCard-
|
|
1
|
+
import { n as AmbientSplitStatCard, t as AmbientVisualizationCard } from "../../../../AmbientVisualizationCard-CAxx4QWe.js";
|
|
2
2
|
|
|
3
3
|
export { AmbientSplitStatCard, AmbientVisualizationCard };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UdpActionCard-
|
|
1
|
+
{"version":3,"file":"UdpActionCard-VtAacuCM.js","names":[],"sources":["../src/UI/inputs/buttons/UdpActionCard/UdpActionCard.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router-dom';\nimport { FluentIcon } from '../../../../utilities/iconLibrary';\nimport './UdpActionCard.css';\n\n/**\n * UdpActionCard - An accessible workflow card component\n *\n * @param {Object} props\n * @param {React.Component} props.icon - Fluent UI icon component\n * @param {string} props.iconColor - Icon color (CSS var, hex, or system color: info, warning, error, success, note)\n * @param {string} props.primaryText - Main heading text\n * @param {string} props.secondaryText - Description text\n * @param {string} [props.href] - External link URL\n * @param {string} [props.to] - React Router link path\n * @param {function} [props.onClick] - Click handler\n * @param {string} [props.className] - Additional CSS classes\n */\nexport const UdpActionCard = ({\n icon,\n iconColor = 'info',\n primaryText,\n secondaryText,\n href,\n to,\n onClick,\n className = '',\n ...rest\n}) => {\n // Resolve icon color to CSS variable or direct value\n const getIconColor = () => {\n const systemColors = {\n info: 'var(--info-color-main)',\n warning: 'var(--warning-color-main)',\n error: 'var(--error-color-main)',\n success: 'var(--success-color-main)',\n note: 'var(--note-color-main)',\n primary: 'var(--primary-color-main)',\n secondary: 'var(--secondary-color-main)',\n };\n\n // Check if it's a system color\n if (systemColors[iconColor]) {\n return systemColors[iconColor];\n }\n\n // Check if it's already a CSS variable\n if (iconColor.startsWith('var(--')) {\n return iconColor;\n }\n\n // Otherwise, treat as hex or named color\n return iconColor;\n };\n\n const resolvedIconColor = getIconColor();\n\n // Safety check: ensure icon prop is provided\n if (!icon) {\n console.error('UdpActionCard: icon prop is required');\n return null;\n }\n\n // Card content\n const cardContent = (\n <>\n <div\n className=\"udp-action-card__icon\"\n style={{ color: resolvedIconColor }}\n >\n <FluentIcon component={icon} size={48} customSize />\n </div>\n <div className=\"udp-action-card__content\">\n <div className=\"udp-action-card__primary-text\">{primaryText}</div>\n <div className=\"udp-action-card__secondary-text\">{secondaryText}</div>\n </div>\n </>\n );\n\n // Determine which element to render\n const commonProps = {\n className: `udp-action-card ${className}`,\n style: { '--card-border-color': resolvedIconColor },\n ...rest,\n };\n\n // External link\n if (href) {\n return (\n <a {...commonProps} href={href} rel=\"noopener noreferrer\">\n {cardContent}\n </a>\n );\n }\n\n // Router link\n if (to) {\n return (\n <Link {...commonProps} to={to}>\n {cardContent}\n </Link>\n );\n }\n\n // Button with onClick\n if (onClick) {\n return (\n <button {...commonProps} onClick={onClick} type=\"button\">\n {cardContent}\n </button>\n );\n }\n\n // Default: non-interactive div\n return (\n <div {...commonProps} role=\"article\">\n {cardContent}\n </div>\n );\n};\n\nUdpActionCard.propTypes = {\n icon: PropTypes.elementType.isRequired,\n iconColor: PropTypes.string,\n primaryText: PropTypes.string.isRequired,\n secondaryText: PropTypes.string.isRequired,\n href: PropTypes.string,\n to: PropTypes.string,\n onClick: PropTypes.func,\n className: PropTypes.string,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,MAAa,iBAAiB,EAC5B,MACA,YAAY,QACZ,aACA,eACA,MACA,IACA,SACA,YAAY,IACZ,GAAG,WACC;CAEJ,MAAM,qBAAqB;EACzB,MAAM,eAAe;GACnB,MAAM;GACN,SAAS;GACT,OAAO;GACP,SAAS;GACT,MAAM;GACN,SAAS;GACT,WAAW;GACZ;AAGD,MAAI,aAAa,WACf,QAAO,aAAa;AAItB,MAAI,UAAU,WAAW,SAAS,CAChC,QAAO;AAIT,SAAO;;CAGT,MAAM,oBAAoB,cAAc;AAGxC,KAAI,CAAC,MAAM;AACT,UAAQ,MAAM,uCAAuC;AACrD,SAAO;;CAIT,MAAM,cACJ,0DACE,oCAAC;EACC,WAAU;EACV,OAAO,EAAE,OAAO,mBAAmB;IAEnC,oCAAC;EAAW,WAAW;EAAM,MAAM;EAAI;GAAa,CAChD,EACN,oCAAC,SAAI,WAAU,8BACb,oCAAC,SAAI,WAAU,mCAAiC,YAAkB,EAClE,oCAAC,SAAI,WAAU,qCAAmC,cAAoB,CAClE,CACL;CAIL,MAAM,cAAc;EAClB,WAAW,mBAAmB;EAC9B,OAAO,EAAE,uBAAuB,mBAAmB;EACnD,GAAG;EACJ;AAGD,KAAI,KACF,QACE,oCAAC;EAAE,GAAI;EAAmB;EAAM,KAAI;IACjC,YACC;AAKR,KAAI,GACF,QACE,oCAAC;EAAK,GAAI;EAAiB;IACxB,YACI;AAKX,KAAI,QACF,QACE,oCAAC;EAAO,GAAI;EAAsB;EAAS,MAAK;IAC7C,YACM;AAKb,QACE,oCAAC;EAAI,GAAI;EAAa,MAAK;IACxB,YACG;;AAIV,cAAc,YAAY;CACxB,MAAM,UAAU,YAAY;CAC5B,WAAW,UAAU;CACrB,aAAa,UAAU,OAAO;CAC9B,eAAe,UAAU,OAAO;CAChC,MAAM,UAAU;CAChB,IAAI,UAAU;CACd,SAAS,UAAU;CACnB,WAAW,UAAU;CACtB"}
|
|
@@ -27,10 +27,53 @@ import { useTranslation } from "react-i18next";
|
|
|
27
27
|
import { FieldArray } from "react-final-form-arrays";
|
|
28
28
|
|
|
29
29
|
//#region src/udp/pages/UdpTransactionTypesPage/forms/UdpTransactionTypeForm.jsx
|
|
30
|
+
const useStyles$3 = makeStyles((theme) => ({
|
|
31
|
+
domainFields: {
|
|
32
|
+
display: "flex",
|
|
33
|
+
flexDirection: "row",
|
|
34
|
+
alignItems: "flex-end",
|
|
35
|
+
justifyContent: "flex-start",
|
|
36
|
+
"& > *": { marginRight: theme.spacing(2) }
|
|
37
|
+
},
|
|
38
|
+
domainValueField: { minWidth: "200px" },
|
|
39
|
+
addRemoveButtons: {
|
|
40
|
+
display: "flex",
|
|
41
|
+
flexDirection: "row",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
justifyContent: "flex-start",
|
|
44
|
+
margin: `${theme.spacing(2)}px 0 0 ${-theme.spacing(2)}px`,
|
|
45
|
+
"& > *": { margin: `0 ${theme.spacing(2)}px` }
|
|
46
|
+
},
|
|
47
|
+
removeIcon: {
|
|
48
|
+
fontSize: theme.spacing(3.5),
|
|
49
|
+
marginTop: theme.spacing(1)
|
|
50
|
+
}
|
|
51
|
+
}));
|
|
30
52
|
const UdpTransactionTypeForm = (props, ref) => {
|
|
31
|
-
const { onSubmit, initialData, disableSubTypeFields, domainNameOptions, onSelectDomainName, domainFieldOptions } = props;
|
|
53
|
+
const { onSubmit, initialData, disableSubTypeFields, domainNameOptions, onSelectDomainName, domainFieldOptions, selectedDomainName } = props;
|
|
32
54
|
const handleSubmitRef = useRef();
|
|
33
55
|
const { t } = useTranslation();
|
|
56
|
+
const classes = useStyles$3();
|
|
57
|
+
const formInitialValues = useMemo(() => {
|
|
58
|
+
let formattedData;
|
|
59
|
+
if (!initialData) return;
|
|
60
|
+
formattedData = {
|
|
61
|
+
...initialData,
|
|
62
|
+
domainName: domainNameOptions?.find((domainName) => domainName === selectedDomainName || ""),
|
|
63
|
+
domainFieldType: domainFieldOptions?.find((domainField) => domainField === initialData?.domainFieldType),
|
|
64
|
+
domainFieldLabel: domainFieldOptions?.find((domainField) => domainField === initialData?.domainFieldLabel),
|
|
65
|
+
revisionField: domainFieldOptions?.find((domainField) => domainField === initialData?.revisionField),
|
|
66
|
+
domainFields: selectedDomainName === initialData?.domainName && initialData?.domainFields ? Object.entries(initialData?.domainFields).map(([fieldKey, fieldConfig]) => {
|
|
67
|
+
return [fieldKey, { ...fieldConfig && typeof fieldConfig === "object" ? fieldConfig : { value: fieldConfig } }];
|
|
68
|
+
}) : [[]]
|
|
69
|
+
};
|
|
70
|
+
return formattedData;
|
|
71
|
+
}, [
|
|
72
|
+
initialData,
|
|
73
|
+
domainNameOptions,
|
|
74
|
+
domainFieldOptions,
|
|
75
|
+
selectedDomainName
|
|
76
|
+
]);
|
|
34
77
|
useImperativeHandle(ref, () => ({ submit: () => {
|
|
35
78
|
handleSubmitRef?.current();
|
|
36
79
|
} }));
|
|
@@ -39,8 +82,11 @@ const UdpTransactionTypeForm = (props, ref) => {
|
|
|
39
82
|
}, [initialData, onSubmit]);
|
|
40
83
|
return /* @__PURE__ */ React.createElement(Form$1, {
|
|
41
84
|
onSubmit: handleSubmit,
|
|
85
|
+
mutators: { ...arrayMutators },
|
|
86
|
+
initialValues: { ...formInitialValues },
|
|
42
87
|
render: ({ handleSubmit: handleSubmit$1, form }) => {
|
|
43
88
|
handleSubmitRef.current = handleSubmit$1;
|
|
89
|
+
const push = form?.mutators?.push ?? (() => {});
|
|
44
90
|
const handleDomainNameChange = (value) => {
|
|
45
91
|
const nextDomainName = value || "";
|
|
46
92
|
if ((form.getState().values?.domainName || "") !== nextDomainName) {
|
|
@@ -67,8 +113,7 @@ const UdpTransactionTypeForm = (props, ref) => {
|
|
|
67
113
|
variant: "outlined",
|
|
68
114
|
margin: "normal",
|
|
69
115
|
size: "small",
|
|
70
|
-
required: true
|
|
71
|
-
initialValue: initialData?.name || ""
|
|
116
|
+
required: true
|
|
72
117
|
}), /* @__PURE__ */ React.createElement(Field$1, {
|
|
73
118
|
component: AmbientAutoComplete,
|
|
74
119
|
label: t("Domain"),
|
|
@@ -77,7 +122,6 @@ const UdpTransactionTypeForm = (props, ref) => {
|
|
|
77
122
|
variant: "outlined",
|
|
78
123
|
isMultiple: false,
|
|
79
124
|
disableCloseOnSelect: false,
|
|
80
|
-
initialValue: initialData?.domainName,
|
|
81
125
|
options: domainNameOptions || [],
|
|
82
126
|
getOptionLabelFunction: (option) => option,
|
|
83
127
|
additionalOnChangeAction: handleDomainNameChange
|
|
@@ -89,7 +133,6 @@ const UdpTransactionTypeForm = (props, ref) => {
|
|
|
89
133
|
variant: "outlined",
|
|
90
134
|
isMultiple: false,
|
|
91
135
|
disableCloseOnSelect: false,
|
|
92
|
-
initialValue: initialData?.domainFieldType,
|
|
93
136
|
options: domainFieldOptions || [],
|
|
94
137
|
getOptionLabelFunction: (option) => option,
|
|
95
138
|
additionalOnChangeAction: handleDomainFieldTypeChange,
|
|
@@ -103,20 +146,7 @@ const UdpTransactionTypeForm = (props, ref) => {
|
|
|
103
146
|
variant: "outlined",
|
|
104
147
|
margin: "normal",
|
|
105
148
|
size: "small",
|
|
106
|
-
initialValue: initialData?.domainFieldValue || "",
|
|
107
149
|
disabled: disableSubTypeFields
|
|
108
|
-
}), /* @__PURE__ */ React.createElement(Field$1, {
|
|
109
|
-
component: AmbientAutoComplete,
|
|
110
|
-
label: "Grid Columns",
|
|
111
|
-
id: "domainFields",
|
|
112
|
-
name: "domainFields",
|
|
113
|
-
variant: "outlined",
|
|
114
|
-
isMultiple: true,
|
|
115
|
-
disableCloseOnSelect: true,
|
|
116
|
-
initialValue: initialData?.domainFields,
|
|
117
|
-
options: domainFieldOptions || [],
|
|
118
|
-
getOptionLabelFunction: (option) => option,
|
|
119
|
-
helperText: t("Field properties to be displayed as columns in the transaction grid")
|
|
120
150
|
}), /* @__PURE__ */ React.createElement(Field$1, {
|
|
121
151
|
component: AmbientAutoComplete,
|
|
122
152
|
label: t("Field Label"),
|
|
@@ -125,7 +155,6 @@ const UdpTransactionTypeForm = (props, ref) => {
|
|
|
125
155
|
variant: "outlined",
|
|
126
156
|
isMultiple: false,
|
|
127
157
|
disableCloseOnSelect: false,
|
|
128
|
-
initialValue: initialData?.domainFieldLabel,
|
|
129
158
|
options: domainFieldOptions || [],
|
|
130
159
|
getOptionLabelFunction: (option) => option,
|
|
131
160
|
helperText: t("Field property to be used in transaction page labels")
|
|
@@ -134,8 +163,7 @@ const UdpTransactionTypeForm = (props, ref) => {
|
|
|
134
163
|
component: Switch,
|
|
135
164
|
id: "enabled",
|
|
136
165
|
name: "enabled",
|
|
137
|
-
type: "checkbox"
|
|
138
|
-
initialValue: !!initialData?.enabled
|
|
166
|
+
type: "checkbox"
|
|
139
167
|
}),
|
|
140
168
|
label: t("Enabled")
|
|
141
169
|
}), /* @__PURE__ */ React.createElement(LayoutUnit, { unit: "nudge" }), /* @__PURE__ */ React.createElement(FormControlLabel, {
|
|
@@ -144,7 +172,6 @@ const UdpTransactionTypeForm = (props, ref) => {
|
|
|
144
172
|
id: "hasRevision",
|
|
145
173
|
name: "hasRevision",
|
|
146
174
|
type: "checkbox",
|
|
147
|
-
initialValue: !!initialData?.hasRevision,
|
|
148
175
|
parse: parseHasRevision
|
|
149
176
|
}),
|
|
150
177
|
label: t("Allow Revisions")
|
|
@@ -156,10 +183,51 @@ const UdpTransactionTypeForm = (props, ref) => {
|
|
|
156
183
|
variant: "outlined",
|
|
157
184
|
isMultiple: false,
|
|
158
185
|
disableCloseOnSelect: false,
|
|
159
|
-
initialValue: initialData?.revisionField,
|
|
160
186
|
options: domainFieldOptions || [],
|
|
161
187
|
getOptionLabelFunction: (option) => option
|
|
162
|
-
})
|
|
188
|
+
}), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: classes.addRemoveButtons }, /* @__PURE__ */ React.createElement(FluentButton, {
|
|
189
|
+
variant: "contained",
|
|
190
|
+
color: "primary",
|
|
191
|
+
onClick: () => push("domainFields", void 0)
|
|
192
|
+
}, t("Add a Domain Field"))), /* @__PURE__ */ React.createElement(FieldArray, { name: "domainFields" }, ({ fields }) => fields.map((name, index) => /* @__PURE__ */ React.createElement("div", {
|
|
193
|
+
key: `${name}${index}`,
|
|
194
|
+
className: classes.domainFields
|
|
195
|
+
}, /* @__PURE__ */ React.createElement(Field$1, {
|
|
196
|
+
component: AmbientAutoComplete,
|
|
197
|
+
label: index === 0 && t("Field"),
|
|
198
|
+
name: `${name}[0]`,
|
|
199
|
+
variant: "outlined",
|
|
200
|
+
isMultiple: false,
|
|
201
|
+
disableCloseOnSelect: false,
|
|
202
|
+
options: domainFieldOptions || [],
|
|
203
|
+
getOptionLabelFunction: (option) => option,
|
|
204
|
+
onChange: () => {}
|
|
205
|
+
}), /* @__PURE__ */ React.createElement(Field$1, {
|
|
206
|
+
component: FluentTextField,
|
|
207
|
+
label: index === 0 && t("Display Name"),
|
|
208
|
+
name: `${name}[1].displayName`,
|
|
209
|
+
fullWidth: true,
|
|
210
|
+
variant: "outlined",
|
|
211
|
+
margin: "normal",
|
|
212
|
+
size: "small",
|
|
213
|
+
onChange: () => {},
|
|
214
|
+
className: classes.domainValueField
|
|
215
|
+
}), /* @__PURE__ */ React.createElement(Field$1, {
|
|
216
|
+
component: FluentTextField,
|
|
217
|
+
label: index === 0 && t("Order"),
|
|
218
|
+
name: `${name}[1].order`,
|
|
219
|
+
fullWidth: true,
|
|
220
|
+
variant: "outlined",
|
|
221
|
+
margin: "normal",
|
|
222
|
+
size: "small",
|
|
223
|
+
type: "number",
|
|
224
|
+
onChange: () => {},
|
|
225
|
+
className: classes.domainValueField
|
|
226
|
+
}), /* @__PURE__ */ React.createElement("span", {
|
|
227
|
+
onClick: () => fields.remove(index),
|
|
228
|
+
style: { cursor: "pointer" },
|
|
229
|
+
className: classes.removeIcon
|
|
230
|
+
}, /* @__PURE__ */ React.createElement(StatusCircleErrorXIcon, null)))))));
|
|
163
231
|
}
|
|
164
232
|
});
|
|
165
233
|
};
|
|
@@ -168,7 +236,7 @@ var UdpTransactionTypeForm_default = forwardRef(UdpTransactionTypeForm);
|
|
|
168
236
|
//#endregion
|
|
169
237
|
//#region src/udp/pages/UdpTransactionTypesPage/sidesheets/UdpTransactionTypeSidesheet.jsx
|
|
170
238
|
const UdpTransactionTypeSidesheet = (props) => {
|
|
171
|
-
const { initialTransactionType, isSideSheetOpen, handleSideSheet, setSelectedDomainName, handleCreateTransactionType, handleUpdateTransactionType, catalogObjects, catalogObjectProperties } = props;
|
|
239
|
+
const { initialTransactionType, isSideSheetOpen, handleSideSheet, setSelectedDomainName, selectedDomainName, handleCreateTransactionType, handleUpdateTransactionType, catalogObjects, catalogObjectProperties } = props;
|
|
172
240
|
const isEditing = !!initialTransactionType;
|
|
173
241
|
const formRef = useRef();
|
|
174
242
|
const { t } = useTranslation();
|
|
@@ -195,6 +263,9 @@ const UdpTransactionTypeSidesheet = (props) => {
|
|
|
195
263
|
return t$1.entityBusinessObject?.[initialTransactionType.domainFieldType] === targetValue;
|
|
196
264
|
});
|
|
197
265
|
}, [transactions, initialTransactionType]);
|
|
266
|
+
useEffect(() => {
|
|
267
|
+
if (initialTransactionType) setSelectedDomainName(initialTransactionType?.domainName);
|
|
268
|
+
}, [initialTransactionType, setSelectedDomainName]);
|
|
198
269
|
useEffect(() => {
|
|
199
270
|
let isMounted = true;
|
|
200
271
|
const fetchTransactions = async () => {
|
|
@@ -228,7 +299,7 @@ const UdpTransactionTypeSidesheet = (props) => {
|
|
|
228
299
|
]);
|
|
229
300
|
return /* @__PURE__ */ React.createElement(SideSheet, {
|
|
230
301
|
open: isSideSheetOpen,
|
|
231
|
-
width:
|
|
302
|
+
width: 800,
|
|
232
303
|
title: isEditing ? t("Edit Transaction Type") : t("Create Transaction Type"),
|
|
233
304
|
onClose: () => handleCloseSidesheet(false),
|
|
234
305
|
buttonLabel: isEditing ? t("Save") : t("Create"),
|
|
@@ -242,7 +313,8 @@ const UdpTransactionTypeSidesheet = (props) => {
|
|
|
242
313
|
disableSubTypeFields: shouldDisableSubTypes,
|
|
243
314
|
domainNameOptions: catalogObjectNames,
|
|
244
315
|
onSelectDomainName: setSelectedDomainName,
|
|
245
|
-
domainFieldOptions: catalogObjectProperties
|
|
316
|
+
domainFieldOptions: catalogObjectProperties,
|
|
317
|
+
selectedDomainName
|
|
246
318
|
}));
|
|
247
319
|
};
|
|
248
320
|
var UdpTransactionTypeSidesheet_default = UdpTransactionTypeSidesheet;
|
|
@@ -2264,7 +2336,11 @@ const UdpTransactionTypesPage = () => {
|
|
|
2264
2336
|
const catalogObjectProperties = useMemo(() => {
|
|
2265
2337
|
const catalogObjectList = catalogObjects?.ctlg?.catalogObjectList;
|
|
2266
2338
|
if (!catalogObjectList) return [];
|
|
2267
|
-
const catalogObject = catalogObjectList?.find((obj) =>
|
|
2339
|
+
const catalogObject = catalogObjectList?.find((obj) => {
|
|
2340
|
+
if (obj.apiCatalogId !== currentApiCatalogId) return false;
|
|
2341
|
+
if (selectedDomainName || selectedTransactionType && !selectedDomainName) return obj.catalogObjectName === selectedDomainName;
|
|
2342
|
+
return obj.catalogObjectName === selectedTransactionType?.domainName;
|
|
2343
|
+
});
|
|
2268
2344
|
if (!catalogObject) return [];
|
|
2269
2345
|
return catalogObject?.properties.filter((property) => property.name !== "businessObjectKey" && property.name !== null).map((property) => property.name);
|
|
2270
2346
|
}, [
|
|
@@ -2328,7 +2404,22 @@ const UdpTransactionTypesPage = () => {
|
|
|
2328
2404
|
}, []);
|
|
2329
2405
|
/** TransactionType */
|
|
2330
2406
|
const handleCreateTransactionType = useCallback(async (formValues) => {
|
|
2331
|
-
const
|
|
2407
|
+
const { domainFields, ...restValues } = formValues;
|
|
2408
|
+
const domainFieldsDictionary = (Array.isArray(domainFields) ? domainFields : []).reduce((accumulator, entry) => {
|
|
2409
|
+
if (!entry) return accumulator;
|
|
2410
|
+
const field = entry[0];
|
|
2411
|
+
const displayName = entry[1]?.displayName || field;
|
|
2412
|
+
const order = entry[1]?.order || 0;
|
|
2413
|
+
if (field) accumulator[field] = {
|
|
2414
|
+
displayName,
|
|
2415
|
+
order
|
|
2416
|
+
};
|
|
2417
|
+
return accumulator;
|
|
2418
|
+
}, {});
|
|
2419
|
+
const newTransactionType = {
|
|
2420
|
+
...restValues,
|
|
2421
|
+
domainFields: domainFieldsDictionary
|
|
2422
|
+
};
|
|
2332
2423
|
try {
|
|
2333
2424
|
if ((await postCreateTransactionType(newTransactionType))?.status === 201) enqueueSnackbar(t("TransactionType created successfully"), {
|
|
2334
2425
|
anchorOrigin: {
|
|
@@ -2358,10 +2449,23 @@ const UdpTransactionTypesPage = () => {
|
|
|
2358
2449
|
t
|
|
2359
2450
|
]);
|
|
2360
2451
|
const handleUpdateTransactionType = useCallback(async (formValues, initialValues) => {
|
|
2452
|
+
const { domainFields, ...restValues } = formValues;
|
|
2361
2453
|
const transactionTypeId = initialValues.transactionTypeId;
|
|
2454
|
+
const domainFieldsDictionary = (Array.isArray(domainFields) ? domainFields : []).reduce((accumulator, entry) => {
|
|
2455
|
+
if (!entry) return accumulator;
|
|
2456
|
+
const field = entry[0];
|
|
2457
|
+
const displayName = entry[1]?.displayName || field;
|
|
2458
|
+
const order = entry[1]?.order || 0;
|
|
2459
|
+
if (field) accumulator[field] = {
|
|
2460
|
+
displayName,
|
|
2461
|
+
order
|
|
2462
|
+
};
|
|
2463
|
+
return accumulator;
|
|
2464
|
+
}, {});
|
|
2362
2465
|
const updatedTransactionType = {
|
|
2363
2466
|
...initialValues,
|
|
2364
|
-
...formValues
|
|
2467
|
+
...formValues,
|
|
2468
|
+
domainFields: domainFieldsDictionary
|
|
2365
2469
|
};
|
|
2366
2470
|
try {
|
|
2367
2471
|
if ((await putUpdateTransactionType(transactionTypeId, updatedTransactionType)).status === 204) enqueueSnackbar(t("TransactionType updated successfully"), {
|
|
@@ -3293,7 +3397,8 @@ const UdpTransactionTypesPage = () => {
|
|
|
3293
3397
|
headerName: t("Domain Fields"),
|
|
3294
3398
|
field: "domainFields",
|
|
3295
3399
|
resizable: true,
|
|
3296
|
-
sortable: false
|
|
3400
|
+
sortable: false,
|
|
3401
|
+
hide: true
|
|
3297
3402
|
},
|
|
3298
3403
|
{
|
|
3299
3404
|
headerName: t("Allow Revisions"),
|
|
@@ -3451,6 +3556,7 @@ const UdpTransactionTypesPage = () => {
|
|
|
3451
3556
|
}), /* @__PURE__ */ React.createElement(UdpTransactionTypeSidesheet_default, {
|
|
3452
3557
|
key: selectedTransactionType?.transactionTypeId,
|
|
3453
3558
|
initialTransactionType: selectedTransactionType,
|
|
3559
|
+
selectedDomainName,
|
|
3454
3560
|
isSideSheetOpen: isTransactionTypeSideSheetOpen,
|
|
3455
3561
|
handleSideSheet,
|
|
3456
3562
|
setSelectedDomainName,
|
|
@@ -3612,4 +3718,4 @@ var UdpTransactionTypesPage_exports = /* @__PURE__ */ __exportAll({ default: ()
|
|
|
3612
3718
|
|
|
3613
3719
|
//#endregion
|
|
3614
3720
|
export { UdpTransactionTypesPage_default as n, UdpTransactionTypesPage_exports as t };
|
|
3615
|
-
//# sourceMappingURL=UdpTransactionTypesPage-
|
|
3721
|
+
//# sourceMappingURL=UdpTransactionTypesPage-DgFxT4pz.js.map
|