Skip to content

Commit

Permalink
Merge pull request #21 from DSACMS/nat/user-testing-feedback
Browse files Browse the repository at this point in the history
Form: v0.1.0 schema + user testing feedback
  • Loading branch information
natalialuzuriaga authored Feb 10, 2025
2 parents e415316 + 9c13aa6 commit 6cb1d93
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 28 deletions.
2 changes: 1 addition & 1 deletion js/formDataToJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function populateObject(data, schema) {
}

async function populateCodeJson(data) {
const filePath = "schemas/schema-0.0.0.json";
const filePath = "schemas/schema.json";

// Retrieves schema with fields in correct order
const schema = await retrieveFile(filePath);
Expand Down
38 changes: 27 additions & 11 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 @@ -272,7 +288,7 @@ function createAllComponents(schema, prefix = ""){
async function createFormComponents() {
let components = [];

const filePath = "schemas/schema-0.0.0.json";
const filePath = "schemas/schema.json";
const jsonData = await retrieveFile(filePath);
console.log("JSON Data:", jsonData);

Expand All @@ -285,7 +301,7 @@ async function createFormComponents() {
type: "button",
label: "Submit",
key: "submit",
disableOnInvalid: true,
disableOnInvalid: false,
input: true,
tableView: false,
});
Expand Down
86 changes: 70 additions & 16 deletions schemas/schema-0.0.0.json → schemas/schema.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 @@ -115,6 +116,22 @@
"format": "uri",
"description": "The URL of the public release repository for open source repositories. This field is not required for repositories that are only available as government-wide reuse or are closed (pursuant to one of the exemptions)."
},
"repositoryHost": {
"type": "string",
"description": "Location where source code is hosted",
"enum": [
"github.com/CMSgov",
"github.com/CMS-Enterprise",
"github.com/DSACMS",
"github.cms.gov",
"CCSQ GitHub"
]
},
"repositoryVisibility": {
"type": "string",
"enum": ["public", "private"],
"description": "Visibility of repository"
},
"vcs": {
"type": "string",
"description": "Version control system used",
Expand All @@ -128,7 +145,17 @@
},
"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"
},
"reuseFrequency": {
"type": "object",
"description": "Measures frequency of code reuse in various forms. (e.g. forks, downloads, clones)",
"properties": {
"forks": {
"type": "integer"
}
},
"additionalProperties": true
},
"platforms": {
"type": "array",
Expand Down Expand Up @@ -185,14 +212,18 @@
"none"
]
},
"contractNumber": {
"type": "integer",
"description": "Contract number"
},
"date": {
"type": "object",
"description": "A date object describing the release",
"properties": {
"created": {
"type": "string",
"format": "date-time",
"description": "Creation date of the project"
"description": "Creation date of project."
},
"lastModified": {
"type": "string",
Expand Down Expand Up @@ -228,6 +259,13 @@
}
}
},
"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"
}
},
"localisation": {
"type": "boolean",
"description": "Indicates if the project supports multiple languages"
Expand All @@ -252,7 +290,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 All @@ -263,6 +301,27 @@
"type": "string",
"description": "Home Department / Org / Group associated with the project"
},
"projects": {
"type": "array",
"description": "Maps the repository to associated projects",
"items": {
"type": "string"
}
},
"systems": {
"type": "array",
"description": "Maps the repository to CMS systems used",
"items": {
"type": "string"
}
},
"upstream": {
"type": "array",
"description": "List of upstream repositories and dependencies used",
"items": {
"type": "string"
}
},
"subsetInHealthcare": {
"type": "array",
"items": {
Expand All @@ -288,16 +347,6 @@
},
"description": "Types of users who interact with the software"
},
"repositoryHost": {
"type": "string",
"description": "Location where source code is hosted",
"enum": [
"github.com/CMSgov",
"github.com/CMS-Enterprise",
"github.cms.gov",
"CCSQ GitHub"
]
},
"maturityModelTier": {
"type": "integer",
"enum": [
Expand All @@ -306,7 +355,7 @@
3,
4
],
"description": "Maturity model tier"
"description": "Maturity model tier according to the CMS Open Source Repository Maturity Model Framework: https://github.com/DSACMS/repo-scaffolder/blob/main/maturity-model-tiers.md"
}
}
},
Expand All @@ -318,24 +367,29 @@
"permissions",
"organization",
"repositoryURL",
"repositoryHost",
"repositoryVisibility",
"vcs",
"laborHours",
"reuseFrequency",
"platforms",
"categories",
"softwareType",
"languages",
"maintenance",
"contractNumber",
"date",
"tags",
"contact",
"feedbackMechanisms",
"localisation",
"repositoryType",
"userInput",
"fismaLevel",
"group",
"projects",
"subsetInHealthcare",
"userType",
"repositoryHost",
"maturityModelTier"
],
"additionalProperties": false
Expand Down

0 comments on commit 6cb1d93

Please sign in to comment.