@asaleh37/ui-base 25.9.6 → 25.9.16
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/index.d.ts +1 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/administration/dev/AttachmentConfigGrid.tsx +1 -1
- package/src/components/templates/DataEntryTemplates/DataEntryTypes.ts +1 -0
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/ComboBox.tsx +2 -0
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/TemplateTextField.tsx +1 -0
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/TemplateForm.tsx +15 -8
- package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid.tsx +2 -1
- package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGridTopBar.tsx +12 -7
- package/src/components/templates/attachment/AttachmentImageViewer.tsx +4 -2
- package/src/components/templates/attachment/AttachmentPanel.tsx +2 -2
- package/src/components/templates/workflow/WorkflowDocumentPanel.tsx +3 -3
- package/src/components/templates/workflow/WorkflowDocumentTimeLine.tsx +7 -2
package/package.json
CHANGED
|
@@ -127,6 +127,7 @@ export type TemplateGridProps = {
|
|
|
127
127
|
enableExport?: boolean;
|
|
128
128
|
enableDensitySelector?: boolean;
|
|
129
129
|
hideInfoBar?: boolean;
|
|
130
|
+
hideCreateBtn?: boolean;
|
|
130
131
|
hideBackButton?: boolean;
|
|
131
132
|
apiActions: ApiActions;
|
|
132
133
|
rowSelectionModel?: GridRowSelectionModel;
|
|
@@ -11,6 +11,7 @@ const TemplateTextField: React.FC<Omit<TextFieldProps, "outlined">> = (
|
|
|
11
11
|
hidden={true}
|
|
12
12
|
slotProps={{ inputLabel: { shrink: true, sx: { fontWeight: "bold" } } }}
|
|
13
13
|
label={<>{props?.label ? t(props.label) : ""}</>}
|
|
14
|
+
error={props?.error}
|
|
14
15
|
helperText={props?.helperText ? t(props.helperText) : undefined}
|
|
15
16
|
/>
|
|
16
17
|
);
|
|
@@ -33,14 +33,7 @@ const TemplateForm: React.FC<TemplateFormProps> = (
|
|
|
33
33
|
minHeight: 500,
|
|
34
34
|
minWidth: 400,
|
|
35
35
|
});
|
|
36
|
-
|
|
37
|
-
useWindow({
|
|
38
|
-
windowTitle: "Approvals",
|
|
39
|
-
windowIcon: "stamp",
|
|
40
|
-
height: "fit-content",
|
|
41
|
-
minHeight: 500,
|
|
42
|
-
width: 800,
|
|
43
|
-
});
|
|
36
|
+
|
|
44
37
|
const [attachmentPanelEnabledForRecord, setAttachmentPanelEnabledForRecord] =
|
|
45
38
|
useState<boolean>(true);
|
|
46
39
|
const { t } = useTranslation();
|
|
@@ -142,6 +135,19 @@ const TemplateForm: React.FC<TemplateFormProps> = (
|
|
|
142
135
|
}
|
|
143
136
|
};
|
|
144
137
|
|
|
138
|
+
const { Window: WorkflowWindow, setWindowState: setWorkflowWindowState } =
|
|
139
|
+
useWindow({
|
|
140
|
+
windowTitle: "Approvals",
|
|
141
|
+
windowIcon: "stamp",
|
|
142
|
+
height: "fit-content",
|
|
143
|
+
minHeight: 500,
|
|
144
|
+
width: "fit-content",
|
|
145
|
+
// width: 1100,
|
|
146
|
+
onCloseCallBack: async () => {
|
|
147
|
+
await loadRecord();
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
|
|
145
151
|
const formActions = {
|
|
146
152
|
setFieldValue: (fieldName: string, fieldValue: any) => {
|
|
147
153
|
formManager.setValue(fieldName, fieldValue);
|
|
@@ -223,6 +229,7 @@ const TemplateForm: React.FC<TemplateFormProps> = (
|
|
|
223
229
|
}}
|
|
224
230
|
cancelActionCallBk={() => {
|
|
225
231
|
setWorkflowWindowState(false);
|
|
232
|
+
loadRecord();
|
|
226
233
|
}}
|
|
227
234
|
/>
|
|
228
235
|
</WorkflowWindow>
|
|
@@ -104,7 +104,8 @@ const TemplateGrid: React.FC<TemplateGridProps> = (props) => {
|
|
|
104
104
|
windowIcon: "stamp",
|
|
105
105
|
height: "fit-content",
|
|
106
106
|
minHeight: 500,
|
|
107
|
-
width:
|
|
107
|
+
width: "fit-content",
|
|
108
|
+
// width:1100,
|
|
108
109
|
onCloseCallBack: () => {
|
|
109
110
|
props?.apiActions?.reloadData(props.gridLoadParametersValues);
|
|
110
111
|
},
|
|
@@ -83,13 +83,18 @@ const TemplateGridTopBar: React.FC<TemplateGridTopBarProps> = (
|
|
|
83
83
|
{isCreationEnabled &&
|
|
84
84
|
isCreationAuthorized &&
|
|
85
85
|
props?.templateProps?.editMode?.editMode != "none" ? (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
props?.templateProps?.hideCreateBtn === undefined ||
|
|
87
|
+
props?.templateProps?.hideCreateBtn === false ? (
|
|
88
|
+
<Button onClick={props?.handleCreateNewRecord}>
|
|
89
|
+
<FontAwesomeIcon
|
|
90
|
+
icon="add"
|
|
91
|
+
style={{ marginRight: 5, marginLeft: 5 }}
|
|
92
|
+
/>
|
|
93
|
+
{t("ADD_BTN_LABEL")}
|
|
94
|
+
</Button>
|
|
95
|
+
) : (
|
|
96
|
+
<></>
|
|
97
|
+
)
|
|
93
98
|
) : (
|
|
94
99
|
<></>
|
|
95
100
|
)}
|
|
@@ -30,8 +30,10 @@ const AttachmentImageViewer: React.FC<AttachmentImageViewerProps> = (props) => {
|
|
|
30
30
|
setImgSrc(imagePath);
|
|
31
31
|
};
|
|
32
32
|
useEffect(() => {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
if (props?.refKey) {
|
|
34
|
+
handleImageSrc();
|
|
35
|
+
}
|
|
36
|
+
}, [props.refKey]);
|
|
35
37
|
{
|
|
36
38
|
/* </Avatar>
|
|
37
39
|
src={imgSrc}
|
|
@@ -93,8 +93,7 @@ const AttachmentPanel: React.FC<AttachmentPanelProps> = (props) => {
|
|
|
93
93
|
if (!files) {
|
|
94
94
|
toast.error("You must add files to upload");
|
|
95
95
|
return;
|
|
96
|
-
}
|
|
97
|
-
debugger;
|
|
96
|
+
}
|
|
98
97
|
for (const file of files) {
|
|
99
98
|
if (file.type.startsWith("image/")) {
|
|
100
99
|
const MAX_SIZE_KB = 600;
|
|
@@ -176,6 +175,7 @@ const AttachmentPanel: React.FC<AttachmentPanelProps> = (props) => {
|
|
|
176
175
|
display: "flex",
|
|
177
176
|
flexDirection: "column",
|
|
178
177
|
width: "100%",
|
|
178
|
+
minHeight:400,
|
|
179
179
|
alignItems: "center",
|
|
180
180
|
justifyContent: "flex-start",
|
|
181
181
|
overflow: "hidden",
|
|
@@ -123,7 +123,7 @@ const WorkflowDocumentPanel: React.FC<WorkflowDocumentPanelProps> = (props) => {
|
|
|
123
123
|
refDocumentId: props.refDocumentId,
|
|
124
124
|
},
|
|
125
125
|
successCallBkFn: (response: any) => {
|
|
126
|
-
setWorkflowDocumentInfo(response.data);
|
|
126
|
+
setWorkflowDocumentInfo(structuredClone(response.data));
|
|
127
127
|
},
|
|
128
128
|
failureCallBkFn: () => {
|
|
129
129
|
setWorkflowDocumentInfo({
|
|
@@ -358,7 +358,7 @@ const WorkflowDocumentPanel: React.FC<WorkflowDocumentPanelProps> = (props) => {
|
|
|
358
358
|
sx={{
|
|
359
359
|
padding: 2,
|
|
360
360
|
display: "flex",
|
|
361
|
-
flex: 1,
|
|
361
|
+
// flex: 1,
|
|
362
362
|
margin: 1,
|
|
363
363
|
flexDirection: "column",
|
|
364
364
|
alignItems: "center",
|
|
@@ -563,7 +563,7 @@ const WorkflowDocumentPanel: React.FC<WorkflowDocumentPanelProps> = (props) => {
|
|
|
563
563
|
sx={{
|
|
564
564
|
display: "flex",
|
|
565
565
|
flexDirection: "column",
|
|
566
|
-
|
|
566
|
+
width: 600,
|
|
567
567
|
padding: 2,
|
|
568
568
|
margin: 1,
|
|
569
569
|
alignItems: "center",
|
|
@@ -20,7 +20,8 @@ const WorkflowDocumentTimeLine: React.FC<WorkflowDocumentTimeLineProp> = (
|
|
|
20
20
|
sx={{
|
|
21
21
|
display: "flex",
|
|
22
22
|
flexDirection: "column",
|
|
23
|
-
flexGrow: 1,
|
|
23
|
+
// flexGrow: 1,
|
|
24
|
+
width: 600,
|
|
24
25
|
padding: 1,
|
|
25
26
|
margin: 1,
|
|
26
27
|
alignItems: "center",
|
|
@@ -96,7 +97,11 @@ const WorkflowDocumentTimeLine: React.FC<WorkflowDocumentTimeLineProp> = (
|
|
|
96
97
|
<AttachmentImageViewer
|
|
97
98
|
showAsAvatar={true}
|
|
98
99
|
attachmentCode="EMPLOYEE_PHOTOS"
|
|
99
|
-
refKey={
|
|
100
|
+
refKey={
|
|
101
|
+
actionHistoryRecord?.personId
|
|
102
|
+
? actionHistoryRecord?.personId + ""
|
|
103
|
+
: undefined
|
|
104
|
+
}
|
|
100
105
|
style={{ m: 1, width: 70, height: 70 }}
|
|
101
106
|
/>
|
|
102
107
|
{index !== props.actionHistory.length - 1 ? (
|