forked from UKSOURCE/cms.lams
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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user