Skip to content

Nat/exemption section #76

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
27 changes: 17 additions & 10 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,33 @@ textarea {
margin-bottom: 10px;
}

#auto-generation {
#auto-generation,
#exemptions {
border-radius: 15px;
padding: 20px;
padding-bottom: 25px;
margin-top: 20px;
margin-bottom: 20px;
background: lightgray;
width: 100%;
max-width: 800px;
box-sizing: border-box;
width: 100%;
max-width: 800px;
box-sizing: border-box;
}

#exemptions {
max-width: 1300px;
}

#github-url-form {
#github-url-form,
#exemptions-checklist {
margin-top: 25px;
width: 100%;
}

#repo-url {
width: 100%;
max-width: 750px;
box-sizing: border-box;
width: 100%;
max-width: 750px;
box-sizing: border-box;
}

#repo-url-button {
Expand All @@ -51,11 +57,12 @@ textarea {
}

@keyframes slideDown {
from {
from {
opacity: 0;
transform: translateY(-10px);
}
to {

to {
opacity: 1;
transform: translateY(0);
}
Expand Down
246 changes: 172 additions & 74 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,85 +1,183 @@
<html>
<head>
<meta charset="utf-8">
<!-- USWDS not working -->
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> -->
<!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> -->
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uswds/2.11.2/css/uswds.min.css"> -->
<!-- <link rel="stylesheet" href="https://cdn.form.io/formiojs/formio.form.min.css"> -->
<!-- <link rel="stylesheet" href="https://cdn.form.io/uswds/uswds.min.css"> -->
<!-- <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/formio.full.min.css"> -->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/uswds/2.11.2/js/uswds.min.js"></script> -->
<!-- <script src="https://cdn.form.io/formiojs/formio.form.min.js"></script> -->
<!-- <script src="https://cdn.form.io/uswds/uswds.min.js"></script> -->
<!-- <script src="https://cdn.form.io/formiojs/formio.full.js"></script> -->
<!-- <script src="https://cdn.form.io/js/formio.embed.js"></script> -->

<link rel="icon" type="image/x-icon" href="favicon.ico">

<!-- Uses bootstrap for now -->
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'>
<link rel="stylesheet" href="css/styles.css">
<head>
<meta charset="utf-8">
<!-- USWDS not working -->
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> -->
<!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> -->
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uswds/2.11.2/css/uswds.min.css"> -->
<!-- <link rel="stylesheet" href="https://cdn.form.io/formiojs/formio.form.min.css"> -->
<!-- <link rel="stylesheet" href="https://cdn.form.io/uswds/uswds.min.css"> -->
<!-- <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/formio.full.min.css"> -->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/uswds/2.11.2/js/uswds.min.js"></script> -->
<!-- <script src="https://cdn.form.io/formiojs/formio.form.min.js"></script> -->
<!-- <script src="https://cdn.form.io/uswds/uswds.min.js"></script> -->
<!-- <script src="https://cdn.form.io/formiojs/formio.full.js"></script> -->
<!-- <script src="https://cdn.form.io/js/formio.embed.js"></script> -->

<!-- Working Form.io CDN -->
<script src="https://unpkg.com/[email protected]/dist/formio.full.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/formio.full.min.css" rel="stylesheet">
<link rel="icon" type="image/x-icon" href="favicon.ico">

<!-- Render the form -->
<script src="js/generateFormComponents.js"></script>
<script src="js/formDataToJson.js"></script>
<script src="js/autoGenerateFields.js"></script>
<script type="text/javascript">
createFormComponents()
.then((components) => {
Formio.createForm(document.getElementById("formio"), {
display: "form",
theme: "primary",
settings: {
pdf: {
id: "1ec0f8ee-6685-5d98-a847-26f67b67d6f0",
src: "https://files.form.io/pdf/5692b91fd1028f01000407e3/file/1ec0f8ee-6685-5d98-a847-26f67b67d6f0",
},
<!-- Uses bootstrap for now -->
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'>
<link rel="stylesheet" href="css/styles.css">

<!-- Working Form.io CDN -->
<script src="https://unpkg.com/[email protected]/dist/formio.full.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/formio.full.min.css" rel="stylesheet">

<!-- Render the form -->
<script src="js/generateFormComponents.js"></script>
<script src="js/formDataToJson.js"></script>
<script src="js/autoGenerateFields.js"></script>
<script type="text/javascript">
createFormComponents()
.then((components) => {
Formio.createForm(document.getElementById("formio"), {
display: "form",
theme: "primary",
settings: {
pdf: {
id: "1ec0f8ee-6685-5d98-a847-26f67b67d6f0",
src: "https://files.form.io/pdf/5692b91fd1028f01000407e3/file/1ec0f8ee-6685-5d98-a847-26f67b67d6f0",
},
components: components,
}).then(function (form) {
window.formIOInstance = form;
form.on("submit", function (submission) {
console.log("form submission here:", submission);
createCodeJson(submission.data);
});
},
components: components,
}).then(function (form) {
window.formIOInstance = form;
form.on("submit", function (submission) {
console.log("form submission here:", submission);
createCodeJson(submission.data);
});
})
.catch((error) => {
console.error("Error creating components:", error);
});
</script>
</head>
<body>
<div id="form-header"></div>
})
.catch((error) => {
console.error("Error creating components:", error);
});
</script>
</head>

<body>
<div id="form-header"></div>

<div id="exemptions">
<p id="exemptions-header"></p>
<form id="exemptions-checklist">
<fieldset class="usa-fieldset">
<!-- <legend class="usa-legend">Answer the series of questions below to determine the maturity model tier of
your project:</legend> -->
<h5>Security & Privacy</h5>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
<label class="form-check-label" for="flexCheckDefault">
Is the source code classified or developed primarily for use in a national security system?
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
<label class="form-check-label" for="flexCheckDefault">
Is the source code created by an agency or part of an agency that is an element of the
intelligence community, as defined in section 3(4) of the National Security Act of 1947.</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
<label class="form-check-label" for="flexCheckDefault">
Is the source code exempt under section 552(b) of title 5, USC (commonly known as the "Freedom
of Information Act").
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
<label class="form-check-label" for="flexCheckDefault">
Does the source code create an identifiable risk to the privacy of an individual?</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
<label class="form-check-label" for="flexCheckDefault">
Is the source code exempted by the CIO?</label>
</div>
<h5>National Security and Intelligence</h5>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
<label class="form-check-label" for="flexCheckDefault">
Is the source code primarily for use in national security systems, as defined in Section 11103
of title 40, USC?
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
<label class="form-check-label" for="flexCheckDefault">
Is the source code created by an agency or part of an agency that is an element of the
intelligence community, as defined in section 3(4) of the National Security Act of 1947?
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
<label class="form-check-label" for="flexCheckDefault">
Is the source code exempt under section 552(b) of title 5, USC (commonly known as the
"Freedom of Information Act")?
</label>
</div>
<h5>Export and Regulatory Compliance</h5>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
<label class="form-check-label" for="flexCheckDefault">
Is the project prohibited under Export Administration Regulations?
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
<label class="form-check-label" for="flexCheckDefault">
Is the project prohibited under International Traffic in Arms Regulations (ITAR)?
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
<label class="form-check-label" for="flexCheckDefault">
Is the project prohibited under Regulations of the Transportation Security Administration
related to the protection of sensitive
information?
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
<label class="form-check-label" for="flexCheckDefault">
Is the project prohibited under Federal laws and regulations governing the sharing of
classified
information?
</label>
</div>
</fieldset>
<button type="submit" class="usa-button">
Submit
</button>
</form>
</div>

<div id="notification" style="display: none;">
<p id="notification-message"></p>
</div>

<div id="auto-generation">
<p id="auto-generation-header"></p>
<form id="github-url-form">
<label for="repo-url">GitHub Repository URL</label><br>
<input type="text" id="repo-url" name="repo-url"><br>
<input type="submit" id="repo-url-button" value="Submit">
</form>
</div>

<div id="notification" style="display: none;">
<p id="notification-message"></p>
</div>

<div id="auto-generation">
<p id="auto-generation-header"></p>
<form id="github-url-form">
<label for="repo-url">GitHub Repository URL</label><br>
<input type="text" id="repo-url" name="repo-url"><br>
<input type="submit" id="repo-url-button" value="Submit">
</form>
</div>
<div id="formio"></div>

<div id="formio"></div>
<div id="output">
<label for="json-result">Your JSON Metadata </label>
<textarea class="form-control" rows="10" id="json-result" readonly></textarea>
<button type="button" class="btn btn-outline" href="#" onclick="copyToClipboard(event)">Copy</button>
<button type="button" class="btn btn-outline" href="#" onclick="downloadFile(event)">Download</button>
<button type="button" class="btn btn-outline" href="#" onclick="createProjectPR(event)">Create Pull
Request</button>
<button type="button" class="btn btn-outline" href="#" onclick="emailFile(event)">Email</button>
</div>

<div id="output">
<label for="json-result">Your JSON Metadata </label>
<textarea class="form-control" rows="10" id="json-result" readonly></textarea>
<button type="button" class="btn btn-outline" href="#" onclick="copyToClipboard(event)">Copy</button>
<button type="button" class="btn btn-outline" href="#" onclick="downloadFile(event)">Download</button>
<button type="button" class="btn btn-outline" href="#" onclick="createProjectPR(event)">Create Pull Request</button>
<button type="button" class="btn btn-outline" href="#" onclick="emailFile(event)">Email</button>
</div>
</body>

</body>
</html>
</html>
18 changes: 12 additions & 6 deletions js/autoGenerateFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,13 @@ async function preFillFields(repoData, languages) {

// Updating URL
if (repoData.html_url) {
form.getComponent('repositoryURL').setValue(repoData.html_url)
if (repoData.private) {
// Private repositories must have "private" as their repositoryURL value
form.getComponent('repositoryURL').setValue("private")
}
else {
form.getComponent('repositoryURL').setValue(repoData.html_url)
}
}

// Updating forks
Expand Down Expand Up @@ -306,11 +312,11 @@ async function preFillFields(repoData, languages) {
}

// fields to potentially automate
// clones, but this is only tracked for every 14 days
// status, by checking if its public, we can assume its production and check if its archival
// laborHours, by running a script? this might be harder since we need SCC
// maturityModel, we could check to see if certain files / sections live within a repo and make a guess like that
// usageType, by assuming that if its public = openSource and if private = governmnetWideReuse
// clones, but this is only tracked for every 14 days
// status, by checking if its public, we can assume its production and check if its archival
// laborHours, by running a script? this might be harder since we need SCC
// maturityModel, we could check to see if certain files / sections live within a repo and make a guess like that
// usageType, by assuming that if its public = openSource and if private = governmnetWideReuse

notificationSystem.success("Repository data loaded successfully!")

Expand Down
Loading
Loading