Skip to content

Commit 37692a4

Browse files
Added new fields from schema v0.1.0 and updated form accordingly
Signed-off-by: Natalia Luzuriaga <natalia.luzuriaga@cms.hhs.gov>
1 parent e415316 commit 37692a4

2 files changed

Lines changed: 85 additions & 16 deletions

File tree

js/generateFormComponents.js

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ function determineType(field) {
4949
return "radio";
5050
} else if (field.type === "number") {
5151
return "number";
52+
}
53+
else if (field.type === "integer") {
54+
return "integer";
5255
} else if (field.type === "boolean") {
5356
return "select-boolean";
5457
} else if (field.type === "string" || field.type.includes("string")) {
@@ -102,6 +105,24 @@ function createComponent(fieldName, fieldObject, requiredArray) {
102105
description: fieldObject["description"],
103106
validate
104107
};
108+
case "integer":
109+
return {
110+
label: fieldName,
111+
applyMaskOn: "change",
112+
mask: false,
113+
tableView: false,
114+
delimiter: false,
115+
requireDecimal: false,
116+
decimalLimit: 0,
117+
inputFormat: "plain",
118+
truncateMultipleSpaces: false,
119+
validateWhenHidden: false,
120+
key: fieldName,
121+
type: "number",
122+
input: true,
123+
description: fieldObject["description"],
124+
validate
125+
};
105126
case "radio":
106127
var options = transformArrayToOptions(fieldObject.enum);
107128
console.log("checking options here:", options);
@@ -142,8 +163,7 @@ function createComponent(fieldName, fieldObject, requiredArray) {
142163
disableWeekends: false,
143164
disableWeekdays: false
144165
},
145-
enableMinDateInput: false,
146-
enableMaxDateInput: false,
166+
enableTime: false,
147167
validateWhenHidden: false,
148168
key: fieldName,
149169
type: "datetime",
@@ -155,16 +175,10 @@ function createComponent(fieldName, fieldObject, requiredArray) {
155175
useLocaleSettings: false,
156176
allowInput: true,
157177
mode: "single",
158-
enableTime: true,
159178
noCalendar: false,
160-
format: "yyyy-MM-dd hh:mm a",
161-
hourIncrement: 1,
162-
minuteIncrement: 1,
163-
time_24hr: false,
164-
minDate: null,
179+
format: "yyyy-MM-dd",
165180
disableWeekends: false,
166181
disableWeekdays: false,
167-
maxDate: null
168182
},
169183
description: fieldObject["description"],
170184
validate
@@ -196,12 +210,14 @@ function createComponent(fieldName, fieldObject, requiredArray) {
196210
case "container":
197211
return {
198212
label: fieldName,
213+
hideLabel: false,
199214
tableView: false,
200215
validateWhenHidden: false,
201216
key: fieldName,
202217
type: "container",
203218
input: true,
204219
components: [],
220+
description: fieldObject["description"],
205221
validate
206222
};
207223
case "datagrid":
@@ -285,7 +301,7 @@ async function createFormComponents() {
285301
type: "button",
286302
label: "Submit",
287303
key: "submit",
288-
disableOnInvalid: true,
304+
disableOnInvalid: false,
289305
input: true,
290306
tableView: false,
291307
});

schemas/schema-0.0.0.json

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"URL": {
6666
"type": "string",
6767
"format": "uri",
68-
"description": "The URL of the release license"
68+
"description": "The URL of the release license in the repository"
6969
}
7070
},
7171
"required": [
@@ -128,7 +128,7 @@
128128
},
129129
"laborHours": {
130130
"type": "number",
131-
"description": "Labor hours invested in the project"
131+
"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"
132132
},
133133
"platforms": {
134134
"type": "array",
@@ -192,7 +192,7 @@
192192
"created": {
193193
"type": "string",
194194
"format": "date-time",
195-
"description": "Creation date of the project"
195+
"description": "Creation date of project."
196196
},
197197
"lastModified": {
198198
"type": "string",
@@ -252,7 +252,7 @@
252252
},
253253
"fismaLevel": {
254254
"type": "string",
255-
"description": "FISMA security level",
255+
"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",
256256
"enum": [
257257
"Low",
258258
"Moderate",
@@ -294,6 +294,7 @@
294294
"enum": [
295295
"github.com/CMSgov",
296296
"github.com/CMS-Enterprise",
297+
"github.com/DSACMS",
297298
"github.cms.gov",
298299
"CCSQ GitHub"
299300
]
@@ -306,7 +307,54 @@
306307
3,
307308
4
308309
],
309-
"description": "Maturity model tier"
310+
"description": "Maturity model tier according to the CMS OSPO's framework: https://github.com/DSACMS/repo-scaffolder/blob/main/maturity-model-tiers.md"
311+
},
312+
"contractNumber": {
313+
"type": "integer",
314+
"description": "Contract number"
315+
},
316+
"repositoryVisibility": {
317+
"type": "string",
318+
"enum": ["public", "private"],
319+
"description": "Visibility of repository"
320+
},
321+
"reuseFrequency": {
322+
"type": "object",
323+
"description": "Measures frequency of code reuse in various forms. (e.g. forks, downloads, clones)",
324+
"properties": {
325+
"forks": {
326+
"type": "integer"
327+
}
328+
},
329+
"additionalProperties": true
330+
},
331+
"feedbackMechanisms": {
332+
"type": "array",
333+
"description": "Methods a repository receives feedback from the community. Default value is the URL to GitHub repository issues page.",
334+
"items": {
335+
"type": "string"
336+
}
337+
},
338+
"project": {
339+
"type": "array",
340+
"description": "Maps repositories to projects",
341+
"items": {
342+
"type": "string"
343+
}
344+
},
345+
"systems": {
346+
"type": "array",
347+
"description": "Maps repositories to CMS systems",
348+
"items": {
349+
"type": "string"
350+
}
351+
},
352+
"upstream": {
353+
"type": "array",
354+
"description": "List of upstream repositories and dependencies used",
355+
"items": {
356+
"type": "string"
357+
}
310358
}
311359
}
312360
},
@@ -336,7 +384,12 @@
336384
"subsetInHealthcare",
337385
"userType",
338386
"repositoryHost",
339-
"maturityModelTier"
387+
"maturityModelTier",
388+
"contractNumber",
389+
"repositoryVisibility",
390+
"reuseFrequency",
391+
"feedbackMechanisms",
392+
"project"
340393
],
341394
"additionalProperties": false
342395
}

0 commit comments

Comments
 (0)