@appcorp/fusion-storybook 0.2.64 → 0.2.65

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.
@@ -24,7 +24,7 @@ import { getCachedWorkspaceSync } from "../workspace/cache";
24
24
  // COMPONENT
25
25
  // ============================================================================
26
26
  export const EnrollmentForm = () => {
27
- const { state: { classId, enabled, enrollmentDate, errors, sectionId, studentProfileId }, handleChange, } = useEnrollmentModule();
27
+ const { state: { classId, enabled, enrollmentDate, errors, sectionId, studentProfileId, }, handleChange, } = useEnrollmentModule();
28
28
  const workspace = getCachedWorkspaceSync();
29
29
  const t = useTranslations("enrollment");
30
30
  const { fetchNow: studentProfileFetchNow, data: studentProfileData } = useFetch(STUDENT_PROFILE_API_ROUTES.UNIT, {
@@ -103,22 +103,18 @@ export const EnrollmentForm = () => {
103
103
  info: t("sectionInfo"),
104
104
  label: t("section"),
105
105
  onValueChange: (value) => handleChange("sectionId", value),
106
- options: ((sectionData === null || sectionData === void 0 ? void 0 : sectionData.items) || []).map((s) => {
107
- var _a;
108
- return ({
109
- value: s.id,
110
- label: `${(_a = s === null || s === void 0 ? void 0 : s.class) === null || _a === void 0 ? void 0 : _a.code}-${s.name}`,
111
- });
112
- }),
106
+ options: ((sectionData === null || sectionData === void 0 ? void 0 : sectionData.items) || []).map((s) => ({
107
+ value: s.id,
108
+ label: s.name,
109
+ })),
113
110
  placeholder: t("sectionPlaceholder"),
114
111
  required: true,
115
112
  searchEndpoint: SECTION_API_ROUTES.UNIT,
116
113
  searchPlaceholder: t("formSearchSectionsPlaceholder"),
117
114
  formatSearchResult: (item) => {
118
- var _a;
119
115
  const section = Object.assign({}, item);
120
116
  return {
121
- label: `${(_a = section === null || section === void 0 ? void 0 : section.class) === null || _a === void 0 ? void 0 : _a.code}-${section.name}`,
117
+ label: section.name,
122
118
  value: section.id,
123
119
  };
124
120
  },
@@ -32,7 +32,11 @@ const tableBodyCols = [
32
32
  {
33
33
  componentType: COMPONENT_TYPE.TEXT,
34
34
  key: "studentProfile",
35
- textFormatter: (_, row) => { var _a, _b; return (_b = (_a = row.studentProfile) === null || _a === void 0 ? void 0 : _a.studentCode) !== null && _b !== void 0 ? _b : "N/A"; },
35
+ textFormatter: (_, row) => {
36
+ var _a, _b, _c, _d, _e;
37
+ return `${(_b = (_a = row.studentProfile) === null || _a === void 0 ? void 0 : _a.familyMember) === null || _b === void 0 ? void 0 : _b.firstName} ${(_d = (_c = row.studentProfile) === null || _c === void 0 ? void 0 : _c.familyMember) === null || _d === void 0 ? void 0 : _d.lastName} - ${(_e = row.studentProfile) === null || _e === void 0 ? void 0 : _e.computerNumber}` ||
38
+ "N/A";
39
+ },
36
40
  },
37
41
  {
38
42
  componentType: COMPONENT_TYPE.TEXT,
@@ -55,11 +59,6 @@ const tableBodyCols = [
55
59
  return val ? formatDate(val, DATE_FORMATS.LOCALE_DATE) : "N/A";
56
60
  },
57
61
  },
58
- {
59
- componentType: COMPONENT_TYPE.TEXT,
60
- key: "status",
61
- textFormatter: (_, row) => row.enabled ? "Active" : "Inactive",
62
- },
63
62
  { componentType: COMPONENT_TYPE.BOOLEAN, key: "enabled" },
64
63
  { componentType: COMPONENT_TYPE.ACTIONS },
65
64
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.2.64",
3
+ "version": "0.2.65",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",