feat(cms): implement structured tuition data normalization and editor

Refactor tuition data from a simple numeric array to a structured object
containing time labels and values. This allows for more flexible
charting and precise data entry in the CMS.
- Add `normalizeTuition`, `normalizeTuitionSeries`, and `normalizeTuitionPoint` to `admissionsController.js`
- Update `admissionsConfig.js` to use `objectList` for tuition data points instead of `stringList`
- Migrate existing tuition data in `admissions.json` to the new structured format
- Fix duplicate text in `admissions.json` grant amounts and descriptions
This commit is contained in:
Tống Thành Đạt
2026-04-22 03:48:02 +07:00
parent 5d0fae6d51
commit f26b072954
3 changed files with 112 additions and 19 deletions
+24 -6
View File
@@ -114,12 +114,30 @@ module.exports = {
[
text("label", "Series label", { maxLength: 40 }),
{ key: "color", label: "Series color", type: "color" },
stringList("values", "Data points", {
itemLabel: "Point",
fieldType: "number",
min: 0,
sortable: true,
}),
objectList(
"points",
"Data points",
[
text("time", "Time label", {
maxLength: 30,
placeholder: "Year 1",
}),
{
key: "value",
label: "Value",
type: "number",
min: 0,
},
],
{
itemLabel: "Point",
sortable: true,
itemTitleKey: "time",
itemSubtitleKey: "value",
helpText: "Each chart point requires both a time label and a numeric value.",
emptyText: "No data points yet.",
},
),
],
{
itemLabel: "Series",