Skip to content

Commit

Permalink
Merge pull request #1786 from RTICWDT/staging
Browse files Browse the repository at this point in the history
2020 Annual Update
  • Loading branch information
JAFrederick committed Mar 30, 2020
2 parents 093d03a + e513fa0 commit 2ef2327
Show file tree
Hide file tree
Showing 26 changed files with 423 additions and 154 deletions.
20 changes: 1 addition & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ buildtest: &buildtest
- restore_cache:
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}

# - run:
# name: Install phantomjs
# command: |
# if ! [ $(which phantomjs) ]; then
# sudo curl --output /usr/local/bin/phantomjs https://s3.amazonaws.com/circle-downloads/phantomjs-2.1.1
# fi
# sudo chmod ugo+x /usr/local/bin/phantomjs

- run:
name: NPM Install
command: npm install
Expand All @@ -41,21 +33,11 @@ buildtest: &buildtest
command: |
mkdir -p test/reports/unit
mkdir -p test/reports/browser
- run:
name: WebDriverIO workaround directory
command: ln -s /tmp
name: Run Jest unit tests
command: JEST_JUNIT_OUTPUT_DIR="test/reports/unit" JEST_JUNIT_OUTPUT_NAME="unit.xml" npx jest --ci --reporters=default --reporters=jest-junit

# # XXX this is a workaround for a bug in WebDriverIO
# # that doesn't allow for absolute paths in the xunit
# # output directory:
# # <https://github.com/webdriverio/webdriverio/issues/926>
# - run:
# name: WebDriverIO workaround directory
# command: ln -s /tmp

- run:
name: Wait for Federalist Build
command: ./test/ci.sh
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ css/app.css
output/*.png
.jekyll-cache
__tests__/reports/*
test/reports/*
test/reports/*
analytics.txt
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ endpoint this is how to set those variables:
export API_KEY=yourkeyhere; export API_BASE_URL=https://api.data.gov/ed/collegescorecard/v1/
```

The application also expects some additional environment variables to be configured.
- `API_SIGNUP_KEY`: The API key used to facilitate the embedded API signup form.
- `BASEURL`: The application base URL. This is used to ensure that asset pathing is working
throughout different deploy environments and accessible within the JavaScript frontend code.

```
export API_SIGNUP_KEY=yourkeyhere; export BASEURL=http://localhost:4000
```

To start up the local server, run:

```sh
Expand Down
3 changes: 0 additions & 3 deletions __tests__/e2e/PageSchool_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ Scenario('Visit page and see all major page components.', (I) => {
I.seeElement(locate('.school-key_figures li.icon-city').withText('City'));
I.seeElement(locate('.school-key_figures li.icon-medium').withText('Medium'));

// See map with path
I.seeElement(locate('.leaflet-zoom-animated path'));

//Hero Stats
I.seeElement('#school-completion-rate-donut canvas#doughnut-chart');
I.seeElement('#school-salary-after-complete .range-container .range-chart');
Expand Down
16 changes: 8 additions & 8 deletions __tests__/e2e/PageSearch_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,21 @@ Scenario('Add schools to compare, Items appear in compare drawer, Remove from co

// Add items to compare search
I.click(locate(".search-result-card button").at(1));
I.click(locate(".search-result-card button").at(2));
// I.click(locate(".search-result-card button").at(2));

// Wait for compare element to show in DOM.
I.waitForElement('#compare-header',2);

// Show Modal
I.click('#compare-header');
I.waitForElement("#compare_schools-content");
I.waitForElement("#compare_schools-content",2);

// Check total number of compare schools.
I.seeNumberOfElements(locate('#compare_schools-content input'),2);
// // Check total number of compare schools.
// I.seeNumberOfElements(locate('#compare_schools-content input'),2);

// Remove from compare
I.click(locate('#compare_schools-content input').first());
// // Remove from compare
// I.click(locate('#compare_schools-content input').first());

// Correct number compare schools.
I.seeNumberOfElements(locate('#compare_schools-content input'),1);
// // Correct number compare schools.
// I.seeNumberOfElements(locate('#compare_schools-content input'),1);
});
2 changes: 1 addition & 1 deletion __tests__/utility/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (branch === 'master') {
url = 'https://collegescorecard.ed.gov';
} else if (branch && user && repo) {
var path = [user, repo, branch].join('/');
url = 'https://federalist-proxy.app.cloud.gov/preview/' + path.toLowerCase();
url = 'https://federalist-c15eda78-ad4f-46bc-ac6b-eb043d9f3780.app.cloud.gov/preview/' + path.toLowerCase();
}

if (module.parent) {
Expand Down
24 changes: 23 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ baseurl:
url: https://collegescorecard.ed.gov

# app version number
version: v2.1.2
version: v2.2.0

# Build settings
markdown: kramdown
Expand Down Expand Up @@ -41,10 +41,22 @@ analytics: true
API:
baseurl: https://api.data.gov/ed/collegescorecard/v1/
key: ''
# API key used for API Key Signup form.
signup_key: ''

# Captcha key used to protect from submissions
recaptcha-site-key: ''

# Google Maps API key
api-key-google-maps: ''

# Analtyics string
analytics-string: ''

downloads:
data-dictionary: CollegeScorecardDataDictionary.xlsx
data-base_url: https://ed-public-download.app.cloud.gov/downloads
# data-base_url: http://ed-public-download-03102020.app.cloud.gov/downloads

# specify paths to exclude from copying to _site
# Note: files and directories with the '_' prefix are excluded
Expand All @@ -68,3 +80,13 @@ exclude:
- js/src/*
- __tests
- output
- build.log
- babel.config.js
- codecept.conf.js
- CONTRIBUTING.md
- LICENSE.md
- README.md
- webpack.prod.vue.config.js
- webpack.vue.config.js
- steps.d.ts
- steps_file.js
12 changes: 7 additions & 5 deletions _data/glossary.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@
"avg-debt": {
"title": "Median Total Debt After Graduation",
"default": "<p>The median cumulative federal debt of undergraduate borrowers who graduated. This figure includes only federal loans; it excludes private student loans and Parent PLUS loans.</p>",
"glossary": "<p>The median federal loan debt accumulated at the school among undergraduate student borrowers of federal loans who graduated. Non-federal loans and federal loans not made to students (e.g., Parent PLUS loans) are not included in this value. Note that this debt metric only includes loans originated at this school, so this metric should be interpreted as the typical debt level for attending this school alone, not necessarily the total debt to obtain a credential since students often attend more than 1 school. For schools with multiple locations, this information is based on all of their locations.</p>",
"glossary": "<p>The median federal loan debt accumulated at the school among undergraduate student borrowers of federal loans who graduated. Non-federal loans and federal loans not made to students (e.g., Parent PLUS loans) are not included in this value. Note that this debt metric only includes loans originated at this school, so this metric should be interpreted as the typical debt level for attending this school alone, not necessarily the total debt to obtain a credential since students often attend more than 1 school. For schools with multiple locations, this information is based on all of their locations.</p><p>Note that the cohort described by the median total debt after graduation differs from the cohort described by the “students receiving federal loans” metric.</p>",
"info": "<p>Note that this value includes federal loan debt from all undergraduate borrowers that completed their program.</p>",
"branch": true
},
"student-aid": {
"title": "Students Receiving Federal Loans",
"default": "The share of undergraduate students who borrowed federal loans to help pay for college.",
"glossary": "<p>The proportion of all degree/certificate-seeking undergraduate students that borrowed through federal loan programs to help pay college costs. This value can help users appropriately interpret the information presented in metrics that are limited to federal borrowers. Only loans where the student is the borrower are included; loans taken out by parents through the federal Parent PLUS loan program, which allows parents to borrow money to pay for their child's college costs, are not included in this metric. </p>",
"default": "<p>The share of full-time, first-time undergraduate students who borrowed federal loans to help pay for college.</p>",
"glossary": "<p>The proportion of full-time, first-time degree/certificate-seeking undergraduate students that borrowed through federal loan programs to help pay college costs. This value can help users appropriately interpret the information presented in metrics that are limited to federal borrowers. Only loans where the student is the borrower are included; loans taken out by parents through the federal Parent PLUS loan program, which allows parents to borrow money to pay for their child's college costs, are not included in this metric. This proportion is calculated for full-time, first-time degree/certificate-seeking undergraduate students enrolled in either the fall (for academic year-based schools) or over the course of the whole year (for program calendar-based schools).</p><p>Note that the cohort described by the “students receiving federal loans” metric differs from the cohort described by the median total debt after graduation.</p>",
"info": "<p>Note that this percentage does not include students who transferred into the institution, part-time students, and non-first-year students.</p>",
"branch": false
},
"retention-rate": {
Expand All @@ -59,8 +61,8 @@
},
"socio-eco": {
"title": "Socio-Economic Diversity",
"default": "Percent of students receiving an income-based federal Pell Grant intended for low-income students.",
"glossary": "<p>The percentage of students that receive a federal Pell Grant provides an indication of the level of socio-economic diversity at the school since Pell Grants are awarded based on income. Notably, this measure may not capture all low-income students since foreign nationals (including undocumented immigrants) are not eligible for Pell Grants, and some otherwise eligible students may not have completed the application for federal student aid, which is required to receive a Pell Grant. This proportion is calculated for undergraduate students enrolled in either the fall (for academic year-based schools) or over the course of the whole year (for program calendar-based schools). </p>",
"default": "Percent of full-time, first-time students receiving an income-based federal Pell Grant intended for low-income students.",
"glossary": "<p>The percentage of full-time, first-time degree/certificate-seeking undergraduate students that receive a federal Pell Grant provides an indication of the level of socio-economic diversity at the school since Pell Grants are awarded based on income. Notably, this measure may not capture all low-income students since foreign nationals (including undocumented immigrants) are not eligible for Pell Grants, and some otherwise eligible students may not have completed the application for federal student aid, which is required to receive a Pell Grant. This proportion is calculated for full-time, first-time degree/certificate-seeking undergraduate students enrolled in either the fall (for academic year-based schools) or over the course of the whole year (for program calendar-based schools).</p>",
"branch": false
},
"test-scores": {
Expand Down
12 changes: 11 additions & 1 deletion _includes/js-config.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@

scorecard_version = "{{ site.version }}";
baseurl = "{{ site.baseurl }}";
recaptcha_site_key = "{{site.recaptcha-site-key}}"

</script>
// API Key Signup
var apiUmbrellaSignupOptions = {
registrationSource: 'college-scorecard',
apiKey: '{{ site.API.signup_key }}',
contactUrl: 'scorecarddata@rti.org',
siteName: 'College Scorecard',
emailFromName: 'College Scorecard',
exampleApiUrl: 'https://api.data.gov/ed/collegescorecard/v1/schools?api_key=API_KEY'
};

</script>
16 changes: 16 additions & 0 deletions _plugins/analytics_string.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module Jekyll
# Generator class used to pass an ENV value and create a file
class AnalyticsGenerator < Generator
def generate(site)

puts 'Adding google auth string'

if ENV['ANALYTICS_STRING']
site.config['analytics-string'] = ENV['ANALYTICS_STRING']
end

File.write('analytics.txt', site.config['analytics-string'])
site.static_files << Jekyll::StaticFile.new(site, site.source, '/', 'analytics.txt')
end
end
end
9 changes: 9 additions & 0 deletions _plugins/environment_variables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ def generate(site)
if ENV['API_KEY']
site.config['API']['key'] = ENV['API_KEY']
end
if ENV['API_SIGNUP_KEY']
site.config['API']['signup_key'] = ENV['API_SIGNUP_KEY']
end
if ENV['RECAPTCHA_SITE_KEY']
site.config['recaptcha-site-key'] = ENV['RECAPTCHA_SITE_KEY']
end
if ENV['API_KEY_GOOGLE_MAPS']
site.config['api-key-google-maps'] = ENV['API_KEY_GOOGLE_MAPS']
end
# puts "API: ------------------"
# puts site.config['API']
# puts "------------------"
Expand Down
Binary file modified assets/CollegeScorecardDataDictionary.xlsx
Binary file not shown.
Binary file modified assets/FullDataDocumentation.docx
Binary file not shown.
Binary file modified assets/FullDataDocumentation.pdf
Binary file not shown.
6 changes: 5 additions & 1 deletion data/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
layout: default
permalink: /data/documentation/
---
<script src="https://www.google.com/recaptcha/api.js?onload=vueRecaptchaApiLoaded&render=explicit" async defer>
</script>

<div id="app">
<!-- Pass other variables as props-->
<data-documentation
page-permalink="{{ page.permalink }}"
base-url="{{site.baseurl}}"
data-base_url="{{site.downloads.data-base_url}}"
data-dictionary="{{site.downloads.data-dictionary}}"
data-dictionary="{{site.downloads.data-dictionary}}"
recaptcha-site-key="{{site.recaptcha-site-key}}"
/>
</div>
8 changes: 8 additions & 0 deletions js/src/components/vue/Tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<p v-if="limitedFoS">The data shown is for undergraduate fields of study (undergraduate certificates, associate's degrees, and bachelor's degrees) for which there is data. For more information on other credentials, including Graduate-level degrees and certificates, see <a :href='limitedFoS'>All Fields of Study</a> for this school.</p>
<p v-if="showBranch">This information is based on all locations of this school.</p>
<p v-if="showCompare">For schools with multiple locations, this information is based on all of their locations.</p>
<div v-if="info" v-html="info"></div>
<p class='text-center mt-3' v-if='hasGlossary'>
<v-btn :href="$baseUrl+'/data/glossary/#'+definition" small rounded color="secondary" class='px-4'>More Information</v-btn>
</p>
Expand Down Expand Up @@ -53,6 +54,10 @@ export default {
limitedFoS:{
type: String,
default: null
},
showInfo:{
type: Boolean,
default: true
}
},
data() {
Expand All @@ -74,6 +79,9 @@ export default {
if(this.isCompare && this.entry['compare']) return this.entry['compare'];
else return this.entry[this.version];
},
info(){
return this.entry['info'] && this.showInfo? this.entry['info']:false;
},
hasGlossary(){
return this.entry['glossary']?true:false;
},
Expand Down
4 changes: 2 additions & 2 deletions js/src/vue/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export const fields = {
AVERAGE_TOTAL_DEBT: 'latest.aid.median_debt_suppressed.completers.overall',
MONTHLY_LOAN_PAYMENT: 'latest.aid.median_debt_suppressed.completers.monthly_payments',

AID_PERCENTAGE: 'latest.aid.federal_loan_rate',
PELL_PERCENTAGE: 'latest.aid.pell_grant_rate',
AID_PERCENTAGE: 'latest.aid.ftft_federal_loan_rate',
PELL_PERCENTAGE: 'latest.aid.ftft_pell_grant_rate',

MEDIAN_EARNINGS: 'latest.earnings.10_yrs_after_entry.median',

Expand Down
10 changes: 5 additions & 5 deletions js/src/vue/pages/data.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<p>
This data was
<strong>last updated December 12, 2019</strong>.
<strong>last updated March 30, 2020</strong>.
</p>
<v-row>
<v-col cols="12" sm="4">
Expand All @@ -33,13 +33,13 @@
<simple-tooltip>
<p>Contains the following data:</p>
<ul>
<li>Institution-level data files for 1996-97 through 2017-18 containing aggregate data for each institution. Includes information on institutional characteristics, enrollment, student aid, costs, and student outcomes.</li>
<li>Institution-level data files for 1996-97 through 2018-19 containing aggregate data for each institution. Includes information on institutional characteristics, enrollment, student aid, costs, and student outcomes.</li>
<li>Field of study-level data files for the pooled 2014-15, 2015-16 award years through the pooled 2015-16, 2016-17 award years containing data at the credential level and 4-digit CIP code combination for each institution. Includes information on cumulative debt at graduation and earnings one year after graduation.</li>
<li>Crosswalk files for 2000-01 through 2017-18 that link the Department’s OPEID with an IPEDS UNITID for each institution.</li>
<li>Crosswalk files for 2000-01 through 2018-19 that link the Department’s OPEID with an IPEDS UNITID for each institution.</li>
</ul>
</simple-tooltip>
</p>
<p>296 MB ZIP</p>
<p>289 MB ZIP</p>
</div>
</v-card>
</v-col>
Expand All @@ -53,7 +53,7 @@
>
<div>
<p class="title font-weight-bold">Most Recent Institution-Level Data</p>
<p>154 MB CSV</p>
<p>148 MB CSV</p>
</div>
</v-card>
</v-col>
Expand Down

0 comments on commit 2ef2327

Please sign in to comment.