@appcorp/fusion-storybook 0.2.58 → 0.2.59

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.
@@ -48,20 +48,24 @@ export const EnrollmentForm = () => {
48
48
  info: t("formStudentInfo"),
49
49
  label: t("formStudentLabel"),
50
50
  onValueChange: (value) => handleChange("studentProfileId", value),
51
- options: ((studentProfileData === null || studentProfileData === void 0 ? void 0 : studentProfileData.items) || []).map((s) => ({
52
- value: s.id,
53
- label: s.studentCode,
54
- })),
51
+ options: ((studentProfileData === null || studentProfileData === void 0 ? void 0 : studentProfileData.items) || []).map((s) => {
52
+ var _a, _b;
53
+ return ({
54
+ value: s.id,
55
+ label: `${(_a = s.familyMember) === null || _a === void 0 ? void 0 : _a.firstName} ${(_b = s.familyMember) === null || _b === void 0 ? void 0 : _b.lastName} - ${s.computerNumber}`,
56
+ });
57
+ }),
55
58
  placeholder: t("formStudentPlaceholder"),
56
59
  required: true,
57
60
  searchEndpoint: STUDENT_PROFILE_API_ROUTES.UNIT,
58
61
  searchPlaceholder: t("formSearchStudentsPlaceholder"),
59
62
  formatSearchResult: (item) => {
60
63
  var _a, _b;
61
- return ({
62
- label: String((_a = item.label) !== null && _a !== void 0 ? _a : ""),
63
- value: String((_b = item.value) !== null && _b !== void 0 ? _b : ""),
64
- });
64
+ const studentProfile = Object.assign({}, item);
65
+ return {
66
+ label: `${(_a = studentProfile === null || studentProfile === void 0 ? void 0 : studentProfile.familyMember) === null || _a === void 0 ? void 0 : _a.firstName} ${(_b = studentProfile.familyMember) === null || _b === void 0 ? void 0 : _b.lastName} - ${studentProfile.computerNumber}`,
67
+ value: studentProfile.id,
68
+ };
65
69
  },
66
70
  value: studentProfileId || "",
67
71
  });
@@ -75,7 +79,7 @@ export const EnrollmentForm = () => {
75
79
  var _a;
76
80
  return ({
77
81
  value: s.id,
78
- label: ((_a = s.class) === null || _a === void 0 ? void 0 : _a.code) ? `${s.class.code}-${s.name}` : s.name,
82
+ label: `${(_a = s === null || s === void 0 ? void 0 : s.class) === null || _a === void 0 ? void 0 : _a.code}-${s.name}`,
79
83
  });
80
84
  }),
81
85
  placeholder: t("sectionPlaceholder"),
@@ -83,11 +87,12 @@ export const EnrollmentForm = () => {
83
87
  searchEndpoint: SECTION_API_ROUTES.UNIT,
84
88
  searchPlaceholder: t("formSearchSectionsPlaceholder"),
85
89
  formatSearchResult: (item) => {
86
- var _a, _b;
87
- return ({
88
- label: String((_a = item.label) !== null && _a !== void 0 ? _a : ""),
89
- value: String((_b = item.value) !== null && _b !== void 0 ? _b : ""),
90
- });
90
+ var _a;
91
+ const section = Object.assign({}, item);
92
+ return {
93
+ label: `${(_a = section === null || section === void 0 ? void 0 : section.class) === null || _a === void 0 ? void 0 : _a.code}-${section.name}`,
94
+ value: section.id,
95
+ };
91
96
  },
92
97
  value: sectionId || "",
93
98
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.2.58",
3
+ "version": "0.2.59",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",