@appcorp/fusion-storybook 0.1.83 → 0.1.85
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.
|
@@ -13,5 +13,5 @@ export const CampusForm = () => {
|
|
|
13
13
|
const { state, handleChange } = useCampusModule();
|
|
14
14
|
const { address, city, code, country, enabled, errors, name, phone, state: campusState, } = state;
|
|
15
15
|
const t = useTranslations("campus");
|
|
16
|
-
return (
|
|
16
|
+
return (_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: errors.name, id: "name", info: t("campusNameInfo"), label: t("campusName"), onChange: (e) => handleChange("name", e.target.value), placeholder: t("campusNamePlaceholder"), required: true, value: name }), _jsx(EnhancedInput, { error: errors.code, id: "code", info: t("campusCodeInfo"), label: t("campusCode"), onChange: (e) => handleChange("code", e.target.value), placeholder: t("campusCodePlaceholder"), required: true, value: code }), _jsx(EnhancedInput, { error: errors.address, id: "address", info: t("addressInfo"), label: t("address"), onChange: (e) => handleChange("address", e.target.value), placeholder: t("addressPlaceholder"), value: address || "" }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsx(EnhancedInput, { error: errors.city, id: "city", info: t("cityInfo"), label: t("city"), onChange: (e) => handleChange("city", e.target.value), placeholder: t("cityPlaceholder"), value: city || "" }), _jsx(EnhancedInput, { error: errors.state, id: "state", info: t("stateInfo"), label: t("state"), onChange: (e) => handleChange("state", e.target.value), placeholder: t("statePlaceholder"), value: campusState || "" })] }), _jsx(EnhancedInput, { error: errors.country, id: "country", info: t("countryInfo"), label: t("country"), onChange: (e) => handleChange("country", e.target.value), placeholder: t("countryPlaceholder"), value: country || "" }), _jsx(EnhancedInput, { error: errors.phone, id: "phone", info: t("phoneInfo"), label: t("phone"), onChange: (e) => handleChange("phone", e.target.value), placeholder: t("phonePlaceholder"), value: phone || "" }), _jsx(EnhancedCheckbox, { info: t("activeCampusInfo"), label: t("activeCampus"), defaultChecked: enabled, onCheckedChange: (checked) => handleChange("enabled", checked) })] }));
|
|
17
17
|
};
|
|
@@ -170,6 +170,7 @@ export const useSubjectModule = () => {
|
|
|
170
170
|
}
|
|
171
171
|
}, [resetFormAndCloseDrawer, showToast, t]);
|
|
172
172
|
const byIdCallback = useCallback(({ data, error }) => {
|
|
173
|
+
var _a;
|
|
173
174
|
if (error) {
|
|
174
175
|
showToast(t("messagesDetailsFetchFailed"), TOAST_VARIANT.ERROR);
|
|
175
176
|
return;
|
|
@@ -177,7 +178,9 @@ export const useSubjectModule = () => {
|
|
|
177
178
|
if (data) {
|
|
178
179
|
dispatch({
|
|
179
180
|
type: SUBJECT_ACTION_TYPES.SET_FORM_DATA,
|
|
180
|
-
payload: {
|
|
181
|
+
payload: {
|
|
182
|
+
form: Object.assign(Object.assign({}, data), { description: (_a = data.description) !== null && _a !== void 0 ? _a : "", filterEnabled: undefined }),
|
|
183
|
+
},
|
|
181
184
|
});
|
|
182
185
|
}
|
|
183
186
|
}, [dispatch, showToast, t]);
|
|
@@ -14,5 +14,5 @@ export const SubjectForm = () => {
|
|
|
14
14
|
const { state, handleChange } = useSubjectModule();
|
|
15
15
|
const { code, description, enabled, errors, name } = state;
|
|
16
16
|
const t = useTranslations("subject");
|
|
17
|
-
return (_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: errors.name, id: "name", info: t("subjectNameInfo"), label: t("subjectName"), onChange: (e) => handleChange("name", e.target.value), placeholder: t("subjectNamePlaceholder"), required: true, value: name }), _jsx(EnhancedInput, { error: errors.code, id: "code", info: t("codeInfo"), label: t("subjectCode"), onChange: (e) => handleChange("code", e.target.value), placeholder: t("codePlaceholder"), required: true, value: code }), _jsx(EnhancedTextarea, { error: errors.description, id: "description", info: t("descriptionInfo"), label: t("description"), onChange: (e) => handleChange("description", e.target.value
|
|
17
|
+
return (_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: errors.name, id: "name", info: t("subjectNameInfo"), label: t("subjectName"), onChange: (e) => handleChange("name", e.target.value), placeholder: t("subjectNamePlaceholder"), required: true, value: name }), _jsx(EnhancedInput, { error: errors.code, id: "code", info: t("codeInfo"), label: t("subjectCode"), onChange: (e) => handleChange("code", e.target.value), placeholder: t("codePlaceholder"), required: true, value: code }), _jsx(EnhancedTextarea, { error: errors.description, id: "description", info: t("descriptionInfo"), label: t("description"), onChange: (e) => handleChange("description", e.target.value), placeholder: t("descriptionPlaceholder"), value: description !== null && description !== void 0 ? description : "" }), _jsx(EnhancedCheckbox, { label: t("activeSubject"), defaultChecked: enabled, onCheckedChange: (checked) => handleChange("enabled", checked), info: t("toggleToEnableOrDisableSubject") })] }));
|
|
18
18
|
};
|
|
@@ -37,16 +37,8 @@ const tableBodyCols = [
|
|
|
37
37
|
componentType: COMPONENT_TYPE.TEXT,
|
|
38
38
|
key: "name",
|
|
39
39
|
textFormatter: (_, row) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
componentType: COMPONENT_TYPE.TEXT,
|
|
46
|
-
key: "email",
|
|
47
|
-
textFormatter: (_, row) => {
|
|
48
|
-
var _a;
|
|
49
|
-
return ((_a = row === null || row === void 0 ? void 0 : row.user) === null || _a === void 0 ? void 0 : _a.email) || "N/A";
|
|
40
|
+
return ((row === null || row === void 0 ? void 0 : row.firstName) + " " + (row === null || row === void 0 ? void 0 : row.lastName) ||
|
|
41
|
+
"N/A");
|
|
50
42
|
},
|
|
51
43
|
},
|
|
52
44
|
{ componentType: COMPONENT_TYPE.TEXT, key: "phone" },
|
|
@@ -69,13 +61,12 @@ const createTeacherConfig = ({ cancelLabel, dispatch, drawerTitle, labelActions,
|
|
|
69
61
|
moduleName: "teacher",
|
|
70
62
|
tableColumns: [
|
|
71
63
|
{ label: labelId, width: "5%" },
|
|
72
|
-
{ label: labelTeacherCode, width: "
|
|
73
|
-
{ label: labelName, width: "
|
|
74
|
-
{ label:
|
|
75
|
-
{ label:
|
|
76
|
-
{ label:
|
|
77
|
-
{ label:
|
|
78
|
-
{ label: labelActions, width: "7%" },
|
|
64
|
+
{ label: labelTeacherCode, width: "10%" },
|
|
65
|
+
{ label: labelName, width: "30%" },
|
|
66
|
+
{ label: labelPhone, width: "25%" },
|
|
67
|
+
{ label: labelSpecialization, width: "20%" },
|
|
68
|
+
{ label: labelEnabled, width: "5%" },
|
|
69
|
+
{ label: labelActions, width: "5%" },
|
|
79
70
|
],
|
|
80
71
|
cancelLabel,
|
|
81
72
|
drawerTitle,
|