Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 8a211bb

Browse files
authored
Merge pull request #249 from GSA/ftonato-feature-improvements
Adding possible improvements w/ fix merge
2 parents 907be67 + 03a3ce5 commit 8a211bb

74 files changed

Lines changed: 1223 additions & 478 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@
2626
}
2727
],
2828
"getter-return": 0,
29+
"global-require": "warn",
2930
"guard-for-in": "warn",
3031
"import/extensions": "ignorePackages",
3132
"import/imports-first": [
3233
"absolute-first",
3334
"error"
3435
],
3536
"import/newline-after-import": "error",
37+
"import/no-dynamic-require": "warn",
3638
"import/no-unresolved": 0,
3739
"import/prefer-default-export": false,
3840
"jsx-a11y/anchor-is-valid": "warn",

config/site/examples/docs/privacy-policy.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Web Policies
2-
## PROTECTING PRIVACY AND SECURITY
32

3+
## PROTECTING PRIVACY AND SECURITY
44

55
Protecting the privacy and security of individuals’ personal information is very important to us. We do not collect any information that directly identifies you when you visit Code.gov unless you choose to provide that information by contacting us. However, the website may collect a limited amount of information about your visit for the purposes of website analytics and customization. Please read this notice to understand what we do with the limited amount of information about your visit that we may collect.
66

77
### Information Collected and Stored Automatically
8+
89
We collect limited information about visits to Code.gov. This information is used to measure the number of visitors to the various sections of our website and to identify performance or problem areas. We also use this information to help us develop the site, analyze patterns of usage, and to make the site more useful. We do not share or sell visitor data for the purposes of advertising, marketing, or any other commercial purpose. This information is not used for associating search terms or patterns of site navigation with individual users. The information that is automatically collected and stored concerning your visit includes:
910

1011
- The domain from which you access the Internet (i.e., HHS.gov if you are connecting from a HHS account, or GMU.edu if you are connecting from George Mason University’s domain);
@@ -17,15 +18,18 @@ We collect limited information about visits to Code.gov. This information is use
1718
- Any search terms that you may enter when searching Code.gov.
1819

1920
### How Code.gov uses Cookies
21+
2022
When you visit a website, its server may generate a piece of text known as a “cookie” to place on your device. The cookie, which is unique to your browser, allows the server to “remember” specific information about your visit while you are connected.
2123

2224
There are two types of cookies – single session (temporary) and multi-session (persistent). Single session cookies last only as long as your Web browser is open. Once you close your browser, the session cookie disappears. Persistent cookies are stored on your device for longer periods. Both types of cookies create an identifier that is unique to your device. The Office of Management and Budget Memorandum M-10-22, Guidance for Online Use of Web Measurement and Customization Technologies, allows Federal entities to use both session and persistent cookies to improve the delivery of services.
25+
2326
- Session Cookies: We may use session cookies for technical purposes, such as to allow better navigation through our site. These cookies let our server know that you are continuing a visit to our site. Our use of session cookies qualifies as “Usage Tier 1–Single Session,” as defined in the OMB M-10-22 guidance.
2427
- Persistent Cookies: We may use persistent cookies to understand the differences between new and returning visitors to Code.gov. Persistent cookies remain on your device between visits to our site until they expire or are removed by the user. Our use of persistent cookies qualifies as “Usage Tier 2–Multi-session without personally identifiable information,” as defined in the OMB M-10-22 guidance. The policy states, “This tier encompasses any use of multi-session Web measurement and customization technologies when no [personally identifiable information] is collected.” We do not use persistent cookies to collect personally identifiable information.
2528

2629
If you do not want to accept cookies, you can edit your browser’s options to stop accepting persistent cookies or to prompt you before accepting a cookie from the websites you visit. Here are instructions for how you can disable cookies and/or Google Demographic and Interests reports.
2730

2831
### Google Analytics
32+
2933
Code.gov participates in the U.S. Digital Analytics Program, (DAP) which utilizes a unified Google Analytics account for Federal agencies. This program helps Federal agencies understand how people find, access, and use government services online.
3034

3135
The DAP is a hosted shared service provided by the General Services Administration’s (GSA’s) Office of Citizen Services and Innovative Technologies, and the protocol and information collected are the same for all websites participating in the DAP. As a participant in GSA’s DAP program, this website’s Google Analytics traffic data is automatically reported to GSA.
@@ -42,23 +46,24 @@ Visitors who choose to disable this web measurement tool will still have full ac
4246

4347
You can view web metrics information at [https://analytics.usa.gov](https://analytics.usa.gov/).
4448

45-
4649
### Contacting the Office of the Federal Chief Information Officer about Code.gov
47-
Users of this website may send the Office of the Federal Chief Information Officer feedback or report an issue by sending an email to code@gsa.gov. If you choose to send us your personally identifiable information, we will only use that information to respond to your message. We only share the information you give us with another government agency if your question relates to that agency, or as otherwise required by law. Code.gov never collects information or creates individual profiles for the purposes of advertising, marketing, or any other commercial purpose. When you contact us, any personally identifiable information you provide is voluntary. Please do not include sensitive personally identifiable information or other sensitive information in the content of your email.
4850

51+
Users of this website may send the Office of the Federal Chief Information Officer feedback or report an issue by sending an email to code@gsa.gov. If you choose to send us your personally identifiable information, we will only use that information to respond to your message. We only share the information you give us with another government agency if your question relates to that agency, or as otherwise required by law. Code.gov never collects information or creates individual profiles for the purposes of advertising, marketing, or any other commercial purpose. When you contact us, any personally identifiable information you provide is voluntary. Please do not include sensitive personally identifiable information or other sensitive information in the content of your email.
4952

5053
### Children and Privacy on Code.gov
54+
5155
We believe in the importance of protecting the privacy of children online. The Children’s Online Privacy Protection Act (COPPA) governs information gathered online from or about children under the age of 13. This site is not intended to solicit or collection information of any kind from children under age 13. If you believe that we have received information from a child under age 13, please contact us at code@gsa.gov.
5256

5357
### Security
58+
5459
This website was built using GitHub Pages, a service provided by GitHub, Inc. [GitHub](https://help.github.com/articles/github-terms-of-service/) designed to enable the rapid deployment of government websites in a secure and readily accessible environment.
5560

56-
The terms of service applicable to Federal users of [GitHub](https://help.github.com/articles/github-terms-of-service/) states that it “will, in good faith, exercise due diligence using generally accepted commercial business practices for IT security, to ensure that systems are operated and maintained in a secure manner, and that management, operational and technical controls will be employed to ensure security of systems and data. Recognizing the changing nature of the Web, [GitHub](https://help.github.com/articles/github-terms-of-service/) will continuously work with users to ensure that its products and services are operated and maintained in a secure manner. [GitHub](https://help.github.com/articles/github-terms-of-service/) agrees to discuss implementing additional security controls as deemed necessary by the Agency to conform to the Federal Information Security Management Act (FISMA), 44 U.S.C. 3541 et seq.”
61+
The terms of service applicable to Federal users of [GitHub](https://help.github.com/articles/github-terms-of-service/) states that it “will, in good faith, exercise due diligence using generally accepted commercial business practices for IT security, to ensure that systems are operated and maintained in a secure manner, and that management, operational and technical controls will be employed to ensure security of systems and data. Recognizing the changing nature of the Web, [GitHub](https://help.github.com/articles/github-terms-of-service/) will continuously work with users to ensure that its products and services are operated and maintained in a secure manner. [GitHub](https://help.github.com/articles/github-terms-of-service/) agrees to discuss implementing additional security controls as deemed necessary by the Agency to conform to the Federal Information Security Management Act (FISMA), 44 U.S.C. 3541 et seq.”
5762

5863
We encourage you to visit [GitHub](https://help.github.com/articles/github-terms-of-service/) if you have additional questions about the service.
5964

60-
6165
### Linking Policy
66+
6267
The pages on code.gov may include hypertext links or pointers to information created and maintained by other public and private organizations. GSA provides these links and pointers solely for our visitors' information and convenience. When visitors select a link to an outside website, they are leaving the code.gov site and are subject to the privacy and security policies of the owners/sponsors of the outside website.
6368

6469
The inclusion of links and pointers to websites is not intended to assign importance to those sites or to the information contained on those sites. It is also not intended to endorse or recommend any views expressed or products or services offered on these sites.
@@ -73,6 +78,6 @@ GSA is not responsible for transmissions visitors receive from linked websites.
7378

7479
GSA does not guarantee that outside websites comply with Section 508 (Accessibility Requirements) of the Rehabilitation Act.
7580

76-
7781
### Questions about these policies
82+
7883
Write to the Code.gov team at: [code@gsa.gov](mailto:code@gsa.gov)

config/webpack/webpack.prod.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
const merge = require('webpack-merge');
2-
const shared = require('./webpack.shared');
3-
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
4-
5-
const PUBLIC_PATH = process.env.PUBLIC_PATH || '/';
1+
const merge = require('webpack-merge')
2+
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
3+
const shared = require('./webpack.shared')
64

75
const plugins = [
86
new MiniCssExtractPlugin({
97
// Options similar to the same options in webpackOptions.output
108
// both options are optional
11-
filename: "[name].css",
12-
chunkFilename: "[id].css"
9+
filename: '[name].css',
10+
chunkFilename: '[id].css'
1311
})
1412
]
1513

1614
const prod = {
1715
mode: 'production',
1816
module: {
19-
rules: [{
20-
test: /\.scss$/,
21-
use: [
22-
// fallback to style-loader in development
23-
MiniCssExtractPlugin.loader,
24-
"css-loader",
25-
{
26-
loader: "sass-loader", // compiles Sass to CSS
27-
options: {
28-
implementation: require('sass')
17+
rules: [
18+
{
19+
test: /\.scss$/,
20+
use: [
21+
// fallback to style-loader in development
22+
MiniCssExtractPlugin.loader,
23+
'css-loader',
24+
{
25+
loader: 'sass-loader', // compiles Sass to CSS
26+
options: {
27+
implementation: require('sass')
28+
}
2929
}
30-
}
31-
]
32-
}]
30+
]
31+
}
32+
]
3333
},
3434
plugins
35-
};
36-
module.exports = merge(shared, prod);
35+
}
36+
module.exports = merge(shared, prod)

dependency_licenses.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6296,10 +6296,7 @@
62966296
"licenseFile": "/Users/courtneyrbrousseau/Desktop/code-gov-front-end/node_modules/json-schema-traverse/LICENSE"
62976297
},
62986298
"json-schema@0.2.3": {
6299-
"licenses": [
6300-
"AFLv2.1",
6301-
"BSD"
6302-
],
6299+
"licenses": ["AFLv2.1", "BSD"],
63036300
"repository": "https://github.com/kriszyp/json-schema",
63046301
"publisher": "Kris Zyp",
63056302
"path": "/Users/courtneyrbrousseau/Desktop/code-gov-front-end/node_modules/json-schema",
@@ -12041,4 +12038,3 @@
1204112038
"licenseFile": "/Users/courtneyrbrousseau/Desktop/code-gov-front-end/node_modules/yup/LICENSE.md"
1204212039
}
1204312040
}
12044-

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"lodash.get": "^4.4.2",
8181
"lodash.intersection": "^4.4.0",
8282
"lodash.set": "^4.3.2",
83+
"mini-css-extract-plugin": "^0.4.4",
8384
"offline-plugin": "^5.0.7",
8485
"prop-types": "^15.7.2",
8586
"react": "^16.8.6",

src/build-store.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { applyMiddleware, compose, createStore } from 'redux'
22
import { connectRouter, routerMiddleware } from 'connected-react-router'
33
import history from 'browser-history'
44
import thunk from 'redux-thunk'
5-
import { getCurrentTime } from 'utils/other'
6-
import { clone, forEach, last, map, some, trimUndefined } from '@code.gov/cautious'
75
import rootReducer from './reducers/root'
86
import { hydrate } from './hydrator'
97

src/components/about-page/about-page.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ jest.mock('utils/other')
1313
jest.spyOn(window.customElements, 'get')
1414

1515
// helper for testing the component does not make changes if it is `loading`
16-
const testLoading = (component) => {
16+
const testLoading = component => {
1717
jest.spyOn(component, 'setState')
1818
component.loading = true
1919
component.componentDidMount()
2020
expect(component.setState).not.toBeCalled()
2121
}
2222

2323
// helper for testing the webcomponent loads if it does not exist
24-
const testWebcomponentLoads = (component) => {
24+
const testWebcomponentLoads = component => {
2525
window.customElements.get.mockImplementation(() => undefined)
2626
loadScript.mockReset()
2727
component.loading = false
@@ -30,7 +30,7 @@ const testWebcomponentLoads = (component) => {
3030
}
3131

3232
// helper for testing the webcomponent does not load if it already exists
33-
const testWebcomponentExists = (component) => {
33+
const testWebcomponentExists = component => {
3434
window.customElements.get.mockImplementation(() => 'component-exists')
3535
loadScript.mockReset()
3636
component.loading = false
@@ -41,7 +41,7 @@ const testWebcomponentExists = (component) => {
4141
const compliances = [
4242
{ name: 'agency-1-name', acronym: 'DOD', img: 'agency-1-img' },
4343
{ name: 'agency-2-name', acronym: 'DOE', img: 'agency-2-img' },
44-
{ name: 'agency-3-name', acronym: 'agency-3-acronym', img: 'agency-3-img' }, // not on dashboard list
44+
{ name: 'agency-3-name', acronym: 'agency-3-acronym', img: 'agency-3-img' } // not on dashboard list
4545
]
4646

4747
const props = {}
@@ -107,7 +107,7 @@ describe('components - AboutPage - ComplianceDashboard', () => {
107107
it('should load the compliances into local state', () => {
108108
const expected = [
109109
expect.objectContaining({ acronym: 'DOD' }),
110-
expect.objectContaining({ acronym: 'DOE' }),
110+
expect.objectContaining({ acronym: 'DOE' })
111111
]
112112
expect(wrapper.state('compliance')).toEqual(expected)
113113
})

src/components/about-page/compliance-dashboard.component.js

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,50 @@ import { loadScript } from 'utils/other'
33
import LazyHTML from 'components/lazy-html'
44
import client from 'api-client'
55

6-
const onDashboard = ['DHS', 'DOC', 'DOD', 'DOE', 'DOI', 'DOJ', 'DOL', 'DOS', 'DOT', 'ED', 'EPA', 'GSA', 'HHS', 'HUD', 'NASA', 'NRC', 'NSF', 'OPM', 'SBA', 'SSA', 'TREASURY', 'USAID', 'USDA', 'VA']
6+
const onDashboard = [
7+
'DHS',
8+
'DOC',
9+
'DOD',
10+
'DOE',
11+
'DOI',
12+
'DOJ',
13+
'DOL',
14+
'DOS',
15+
'DOT',
16+
'ED',
17+
'EPA',
18+
'GSA',
19+
'HHS',
20+
'HUD',
21+
'NASA',
22+
'NRC',
23+
'NSF',
24+
'OPM',
25+
'SBA',
26+
'SSA',
27+
'TREASURY',
28+
'USAID',
29+
'USDA',
30+
'VA'
31+
]
732

8-
const dataurl = `${PUBLIC_PATH }src/components/about-page/html/`
33+
const dataurl = `${PUBLIC_PATH}src/components/about-page/html/`
934

1035
const configJSON = {
1136
scores: {
12-
'compliant': [1, null],
13-
'partial': [0.25, 0.9999999],
14-
'noncompliant': [null, 0.244444444]
37+
compliant: [1, null],
38+
partial: [0.25, 0.9999999],
39+
noncompliant: [null, 0.244444444]
1540
},
1641
text: [
1742
{
1843
req: 'agencyWidePolicy',
1944
variants: {
2045
compliant: 'Agency policy is consistent with the Federal Source Code Policy.',
21-
noncompliant: 'Agency policy has not been reviewed for consistency with the Federal Source Code Policy.',
22-
partial: 'Agency policy is being updated for consistency with the Federal Source Code Policy.'
46+
noncompliant:
47+
'Agency policy has not been reviewed for consistency with the Federal Source Code Policy.',
48+
partial:
49+
'Agency policy is being updated for consistency with the Federal Source Code Policy.'
2350
}
2451
},
2552
{
@@ -42,7 +69,6 @@ const configJSON = {
4269
}
4370

4471
class ComplianceDashboard extends Component {
45-
4672
constructor(props) {
4773
super(props)
4874
this.loading = false
@@ -53,24 +79,24 @@ class ComplianceDashboard extends Component {
5379
if (!this.loading) {
5480
const webcomponent = customElements.get('compliance-dashboard')
5581
if (!webcomponent) {
56-
loadScript(`${PUBLIC_PATH }webcomponents/compliance-dashboard.js`, true)
82+
loadScript(`${PUBLIC_PATH}webcomponents/compliance-dashboard.js`, true)
5783
}
5884
client.getCompliance().then(compliance => {
5985
compliance = compliance.filter(agency => onDashboard.includes(agency.acronym))
6086
compliance.forEach(agency => {
61-
agency.img = `${PUBLIC_PATH }assets/img/logos/agencies/${agency.acronym}-50x50.png`
87+
agency.img = `${PUBLIC_PATH}assets/img/logos/agencies/${agency.acronym}-50x50.png`
6288
})
63-
this.setState( { compliance })
89+
this.setState({ compliance })
6490
})
6591
}
6692
}
6793

6894
render() {
6995
return (
7096
<Fragment>
71-
<LazyHTML url={`${dataurl}compliance/agency-compliance.html`}/>
97+
<LazyHTML url={`${dataurl}compliance/agency-compliance.html`} />
7298
<compliance-dashboard
73-
id='compliance-dashboard'
99+
id="compliance-dashboard"
74100
config={JSON.stringify(configJSON)}
75101
data={JSON.stringify(this.state.compliance)}
76102
/>
@@ -79,4 +105,4 @@ class ComplianceDashboard extends Component {
79105
}
80106
}
81107

82-
export default ComplianceDashboard
108+
export default ComplianceDashboard

0 commit comments

Comments
 (0)