Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form: v0.1.0 schema + user testing feedback #21

Merged
merged 3 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions js/generateFormComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ function determineType(field) {
return "radio";
} else if (field.type === "number") {
return "number";
}
else if (field.type === "integer") {
return "integer";
} else if (field.type === "boolean") {
return "select-boolean";
} else if (field.type === "string" || field.type.includes("string")) {
Expand Down Expand Up @@ -102,6 +105,24 @@ function createComponent(fieldName, fieldObject, requiredArray) {
description: fieldObject["description"],
validate
};
case "integer":
return {
label: fieldName,
applyMaskOn: "change",
mask: false,
tableView: false,
delimiter: false,
requireDecimal: false,
decimalLimit: 0,
inputFormat: "plain",
truncateMultipleSpaces: false,
validateWhenHidden: false,
key: fieldName,
type: "number",
input: true,
description: fieldObject["description"],
validate
};
case "radio":
var options = transformArrayToOptions(fieldObject.enum);
console.log("checking options here:", options);
Expand Down Expand Up @@ -142,8 +163,7 @@ function createComponent(fieldName, fieldObject, requiredArray) {
disableWeekends: false,
disableWeekdays: false
},
enableMinDateInput: false,
enableMaxDateInput: false,
enableTime: false,
validateWhenHidden: false,
key: fieldName,
type: "datetime",
Expand All @@ -155,16 +175,10 @@ function createComponent(fieldName, fieldObject, requiredArray) {
useLocaleSettings: false,
allowInput: true,
mode: "single",
enableTime: true,
noCalendar: false,
format: "yyyy-MM-dd hh:mm a",
hourIncrement: 1,
minuteIncrement: 1,
time_24hr: false,
minDate: null,
format: "yyyy-MM-dd",
disableWeekends: false,
disableWeekdays: false,
maxDate: null
},
description: fieldObject["description"],
validate
Expand Down Expand Up @@ -196,12 +210,14 @@ function createComponent(fieldName, fieldObject, requiredArray) {
case "container":
return {
label: fieldName,
hideLabel: false,
tableView: false,
validateWhenHidden: false,
key: fieldName,
type: "container",
input: true,
components: [],
description: fieldObject["description"],
validate
};
case "datagrid":
Expand Down Expand Up @@ -285,7 +301,7 @@ async function createFormComponents() {
type: "button",
label: "Submit",
key: "submit",
disableOnInvalid: true,
disableOnInvalid: false,
input: true,
tableView: false,
});
Expand Down
66 changes: 60 additions & 6 deletions schemas/schema-0.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"properties": {
"licenses": {
"type": "array",
"description": "License(s) for the release",
"items": {
"type": "object",
"properties": {
Expand All @@ -65,7 +66,7 @@
"URL": {
"type": "string",
"format": "uri",
"description": "The URL of the release license"
"description": "The URL of the release license in the repository"
}
},
"required": [
Expand Down Expand Up @@ -128,7 +129,7 @@
},
"laborHours": {
"type": "number",
"description": "Labor hours invested in the project"
"description": "Labor hours invested in the project. Calculated using COCOMO measured by the SCC tool: https://github.com/boyter/scc?tab=readme-ov-file#cocomo"
},
"platforms": {
"type": "array",
Expand Down Expand Up @@ -192,7 +193,7 @@
"created": {
"type": "string",
"format": "date-time",
"description": "Creation date of the project"
"description": "Creation date of project."
},
"lastModified": {
"type": "string",
Expand Down Expand Up @@ -252,7 +253,7 @@
},
"fismaLevel": {
"type": "string",
"description": "FISMA security level",
"description": "Level of security categorization assigned to an information system under the Federal Information Security Modernization Act (FISMA): https://security.cms.gov/learn/federal-information-security-modernization-act-fisma",
"enum": [
"Low",
"Moderate",
Expand Down Expand Up @@ -294,6 +295,7 @@
"enum": [
"github.com/CMSgov",
"github.com/CMS-Enterprise",
"github.com/DSACMS",
"github.cms.gov",
"CCSQ GitHub"
]
Expand All @@ -306,7 +308,54 @@
3,
4
],
"description": "Maturity model tier"
"description": "Maturity model tier according to the CMS OSPO's framework: https://github.com/DSACMS/repo-scaffolder/blob/main/maturity-model-tiers.md"
},
"contractNumber": {
"type": "integer",
"description": "Contract number"
},
"repositoryVisibility": {
"type": "string",
"enum": ["public", "private"],
"description": "Visibility of repository"
},
"reuseFrequency": {
"type": "object",
"description": "Measures frequency of code reuse in various forms. (e.g. forks, downloads, clones)",
"properties": {
"forks": {
"type": "integer"
}
},
"additionalProperties": true
},
"feedbackMechanisms": {
"type": "array",
"description": "Methods a repository receives feedback from the community. Default value is the URL to GitHub repository issues page.",
"items": {
"type": "string"
}
},
"project": {
"type": "array",
"description": "Maps repositories to projects",
"items": {
"type": "string"
}
},
"systems": {
"type": "array",
"description": "Maps repositories to CMS systems",
"items": {
"type": "string"
}
},
"upstream": {
"type": "array",
"description": "List of upstream repositories and dependencies used",
"items": {
"type": "string"
}
}
}
},
Expand Down Expand Up @@ -336,7 +385,12 @@
"subsetInHealthcare",
"userType",
"repositoryHost",
"maturityModelTier"
"maturityModelTier",
"contractNumber",
"repositoryVisibility",
"reuseFrequency",
"feedbackMechanisms",
"project"
],
"additionalProperties": false
}
Loading