forked from UKSOURCE/cms.lams
feat(cms): enhance content editors with dynamic UI configs and validation
Implement a more flexible, configuration-driven approach for CMS editors across accreditation, admissions, and partnerships modules. - Move UI labels, help texts, and field limits from hardcoded views to `editorUi` configurations in config files. - Add server-side and client-side validation to prevent duplicate category tabs in accreditation and partnerships editors. - Refactor partnership and admission views to dynamically render tabs and fields based on the provided configuration. - Update field length constraints and default values across multiple content editors to better align with frontend requirements. - Improve the admissions calculator editor with dynamic field configurations and default value fallbacks.
This commit is contained in:
@@ -30,6 +30,15 @@ module.exports = {
|
||||
previewPath: "/about/partnerships",
|
||||
dataFile: "partnerships",
|
||||
imageType: "partnerships",
|
||||
editorUi: {
|
||||
directory: {
|
||||
tabsFrontendHint: "The frontend shows up to 3 direct tabs. Additional tabs move into a More dropdown.",
|
||||
partnersHelpText: "Each partner card keeps its own open or closed state automatically.",
|
||||
},
|
||||
inquiryForm: {
|
||||
fieldsHelpText: "Manage labels, placeholders, type, width, and dropdown options.",
|
||||
},
|
||||
},
|
||||
tabs: [
|
||||
{
|
||||
key: "hero",
|
||||
@@ -115,7 +124,7 @@ module.exports = {
|
||||
label: "Inquiry Form",
|
||||
icon: "fas fa-envelope",
|
||||
schema: object("inquiryForm", "Inquiry form", [
|
||||
text("title", "Modal title", { maxLength: 60 }),
|
||||
text("title", "Modal title", { maxLength: 35 }),
|
||||
objectList(
|
||||
"fields",
|
||||
"Form fields",
|
||||
|
||||
Reference in New Issue
Block a user