Skip to content

Commit 6cb1d93

Browse files
Merge pull request #21 from DSACMS/nat/user-testing-feedback
Form: v0.1.0 schema + user testing feedback
2 parents e415316 + 9c13aa6 commit 6cb1d93

3 files changed

Lines changed: 98 additions & 28 deletions

File tree

js/formDataToJson.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function populateObject(data, schema) {
5757
}
5858

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

6262
// Retrieves schema with fields in correct order
6363
const schema = await retrieveFile(filePath);

js/generateFormComponents.js

Lines changed: 27 additions & 11 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":
@@ -272,7 +288,7 @@ function createAllComponents(schema, prefix = ""){
272288
async function createFormComponents() {
273289
let components = [];
274290

275-
const filePath = "schemas/schema-0.0.0.json";
291+
const filePath = "schemas/schema.json";
276292
const jsonData = await retrieveFile(filePath);
277293
console.log("JSON Data:", jsonData);
278294

@@ -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
});
Lines changed: 70 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"properties": {
4040
"licenses": {
4141
"type": "array",
42+
"description": "License(s) for the release",
4243
"items": {
4344
"type": "object",
4445
"properties": {
@@ -65,7 +66,7 @@
6566
"URL": {
6667
"type": "string",
6768
"format": "uri",
68-
"description": "The URL of the release license"
69+
"description": "The URL of the release license in the repository"
6970
}
7071
},
7172
"required": [
@@ -115,6 +116,22 @@
115116
"format": "uri",
116117
"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)."
117118
},
119+
"repositoryHost": {
120+
"type": "string",
121+
"description": "Location where source code is hosted",
122+
"enum": [
123+
"github.com/CMSgov",
124+
"github.com/CMS-Enterprise",
125+
"github.com/DSACMS",
126+
"github.cms.gov",
127+
"CCSQ GitHub"
128+
]
129+
},
130+
"repositoryVisibility": {
131+
"type": "string",
132+
"enum": ["public", "private"],
133+
"description": "Visibility of repository"
134+
},
118135
"vcs": {
119136
"type": "string",
120137
"description": "Version control system used",
@@ -128,7 +145,17 @@
128145
},
129146
"laborHours": {
130147
"type": "number",
131-
"description": "Labor hours invested in the project"
148+
"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"
149+
},
150+
"reuseFrequency": {
151+
"type": "object",
152+
"description": "Measures frequency of code reuse in various forms. (e.g. forks, downloads, clones)",
153+
"properties": {
154+
"forks": {
155+
"type": "integer"
156+
}
157+
},
158+
"additionalProperties": true
132159
},
133160
"platforms": {
134161
"type": "array",
@@ -185,14 +212,18 @@
185212
"none"
186213
]
187214
},
215+
"contractNumber": {
216+
"type": "integer",
217+
"description": "Contract number"
218+
},
188219
"date": {
189220
"type": "object",
190221
"description": "A date object describing the release",
191222
"properties": {
192223
"created": {
193224
"type": "string",
194225
"format": "date-time",
195-
"description": "Creation date of the project"
226+
"description": "Creation date of project."
196227
},
197228
"lastModified": {
198229
"type": "string",
@@ -228,6 +259,13 @@
228259
}
229260
}
230261
},
262+
"feedbackMechanisms": {
263+
"type": "array",
264+
"description": "Methods a repository receives feedback from the community. Default value is the URL to GitHub repository issues page.",
265+
"items": {
266+
"type": "string"
267+
}
268+
},
231269
"localisation": {
232270
"type": "boolean",
233271
"description": "Indicates if the project supports multiple languages"
@@ -252,7 +290,7 @@
252290
},
253291
"fismaLevel": {
254292
"type": "string",
255-
"description": "FISMA security level",
293+
"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",
256294
"enum": [
257295
"Low",
258296
"Moderate",
@@ -263,6 +301,27 @@
263301
"type": "string",
264302
"description": "Home Department / Org / Group associated with the project"
265303
},
304+
"projects": {
305+
"type": "array",
306+
"description": "Maps the repository to associated projects",
307+
"items": {
308+
"type": "string"
309+
}
310+
},
311+
"systems": {
312+
"type": "array",
313+
"description": "Maps the repository to CMS systems used",
314+
"items": {
315+
"type": "string"
316+
}
317+
},
318+
"upstream": {
319+
"type": "array",
320+
"description": "List of upstream repositories and dependencies used",
321+
"items": {
322+
"type": "string"
323+
}
324+
},
266325
"subsetInHealthcare": {
267326
"type": "array",
268327
"items": {
@@ -288,16 +347,6 @@
288347
},
289348
"description": "Types of users who interact with the software"
290349
},
291-
"repositoryHost": {
292-
"type": "string",
293-
"description": "Location where source code is hosted",
294-
"enum": [
295-
"github.com/CMSgov",
296-
"github.com/CMS-Enterprise",
297-
"github.cms.gov",
298-
"CCSQ GitHub"
299-
]
300-
},
301350
"maturityModelTier": {
302351
"type": "integer",
303352
"enum": [
@@ -306,7 +355,7 @@
306355
3,
307356
4
308357
],
309-
"description": "Maturity model tier"
358+
"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"
310359
}
311360
}
312361
},
@@ -318,24 +367,29 @@
318367
"permissions",
319368
"organization",
320369
"repositoryURL",
370+
"repositoryHost",
371+
"repositoryVisibility",
321372
"vcs",
322373
"laborHours",
374+
"reuseFrequency",
323375
"platforms",
324376
"categories",
325377
"softwareType",
326378
"languages",
327379
"maintenance",
380+
"contractNumber",
328381
"date",
329382
"tags",
330383
"contact",
384+
"feedbackMechanisms",
331385
"localisation",
332386
"repositoryType",
333387
"userInput",
334388
"fismaLevel",
335389
"group",
390+
"projects",
336391
"subsetInHealthcare",
337392
"userType",
338-
"repositoryHost",
339393
"maturityModelTier"
340394
],
341395
"additionalProperties": false

0 commit comments

Comments
 (0)