Skip to content

Commit

Permalink
Merge branch 'main' into ans_oah_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anselmbradford authored Nov 8, 2023
2 parents 32e9f7b + 225e2ad commit de5c8e8
Show file tree
Hide file tree
Showing 1,483 changed files with 33,876 additions and 38,647 deletions.
2 changes: 0 additions & 2 deletions .env_SAMPLE
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ export NODE_ENV=development
#export AWS_ACCESS_KEY_ID=<aws_access_key_id>
#export AWS_SECRET_ACCESS_KEY=<aws_secret_access_key>
#export AWS_STORAGE_BUCKET_NAME=<aws_storage_bucket_name>
#export AWS_S3_URL=<aws_s3_url>
#export AWS_S3_CUSTOM_DOMAIN=<aws_s3_custom_domain>

##############################################################
# Elasticsearch - for indexing and storing searchable content.
Expand Down
2 changes: 0 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ module.exports = {
extensions: ['.js', '.ts', '.d.ts', '.tsx'],
moduleDirectory: [
'node_modules',
// TDP module path is for resolving js-cookie in TDP tests.
'cfgov/unprocessed/apps/teachers-digital-platform/node_modules',
],
},
},
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/artifact_cleanup.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@ name: backend

on:
workflow_dispatch:
paths:
- '**.py'
- 'requirements/**.txt'
- '**.html'
- '**.mo'
- '**.po'
pull_request:
paths:
- '**.py'
- 'requirements/**.txt'
- '**.html'
- '**.mo'
- '**.po'
merge_group:
paths:
- '**.py'
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/filter-backend.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
name: filter-backend
on:
pull_request:
paths-ignore:
- '**.py'
- 'requirements/**.txt'
- '**.html'
- '**.mo'
- '**.po'
merge_group:
paths-ignore:
- '**.py'
- 'requirements/**.txt'
- '**.html'
- '**.mo'
- '**.po'

jobs:
backend:
runs-on: ubuntu-latest
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/filter-frontend.yml

This file was deleted.

17 changes: 12 additions & 5 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
name: frontend

on:
pull_request:
merge_group:
paths:
- '**.js'
- '**package.json'
pull_request:

jobs:

frontend:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -36,6 +32,17 @@ jobs:
- name: Build Javascript
run: yarn build

- name: Zip static files
uses: montudor/action-zip@v1
with:
args: zip -q -r frontend.zip ./cfgov/static_built

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: frontend_${{ github.sha }}
path: frontend.zip

coverage:
runs-on: ubuntu-latest
needs:
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ on:
pull_request:
merge_group:

jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
cypress:
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -64,7 +67,13 @@ jobs:
build: yarn build
start: python cfgov/manage.py runserver 0.0.0.0:8000
wait-on: 'http://localhost:8000'
auto-cancel-after-failures: 2
env:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
CYPRESS_ENVIRONMENT: github
- name: Store any Cypress failure screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress_failure_screenshots
path: ./test/cypress/screenshots/
retention-days: 1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: docker

on: merge_group
# Disabled until needed
# on: merge_group

env:
TEST_TAG: cfpb/consumerfinancegov:test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: helmlint

on: pull_request
# Disabled until needed
# on: pull_request

jobs:
lint-test:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: Create Docker Image Package

on:
push:
branches:
- main

pull_request:

release:
# Disabled until needed
# push:
# branches:
# - main
# pull_request:
# release:

jobs:
push:
Expand Down
3 changes: 0 additions & 3 deletions .prettierrc

This file was deleted.

2 changes: 2 additions & 0 deletions .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Exclude SonarCloud scans of django auto-generated migration files.
sonar.exclusions = cfgov/**/migrations/*.py
40 changes: 35 additions & 5 deletions .stylelintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,62 @@
at-rule-no-unknown -
This rule enforces only @ rules that appear in the CSS spec,
however, @plugin appears in Less, so should be ignored.
rule-empty-line-before -
Custom setting that differs from stylelint-config-standard.
color-function-notation -
Set to 'legacy' to support older browsers in our browserslist (for now).
declaration-block-no-redundant-longhand-properties -
Turned off.
TODO: Turn on this rule and work out longhand properties.
declaration-empty-line-before -
Turned off.
TODO: Turn on this rule and work out what style we want.
declaration-property-value-no-unknown -
Turned off for Less per documentation guidance.
function-no-unknown -
Ignore the 'unit' helper function that comes from Less.
media-feature-range-notation -
Prefer prefixed values, since Less doesn't support ranges.
no-descending-specificity -
Turned off, but probably shouldn't be.
TODO: Turn on this rule and see if issues can be fixed.
number-max-precision -
TODO: See if long decimal values can be shortened using the unit helper.
rule-empty-line-before -
Custom setting that differs from stylelint-config-standard.
selector-id-pattern -
Turned off.
TODO: Turn on this rule and work out regex for BEM syntax.
selector-class-pattern -
Turned off.
TODO: Turn on this rule and work out regex for BEM syntax.
less/color-no-invalid-hex
less/no-duplicate-variables
Both of the above settings are turned off till
https://github.com/ssivanatarajan/stylelint-less/issues/6 is addressed.
*/
module.exports = {
extends: ['stylelint-config-recommended-less', 'stylelint-config-prettier'],
extends: ['stylelint-config-standard'],
plugins: ['stylelint-less'],
ignoreFiles: ['packages/**/node_modules/**/*.less'],
customSyntax: 'postcss-less',
rules: {
'at-rule-no-unknown': [true, { ignoreAtRules: 'plugin' }],
'color-function-notation': ['legacy'],
'declaration-block-no-redundant-longhand-properties': null,
'declaration-empty-line-before': null,
'function-name-case': ['lower', { ignoreFunctions: ['filter'] }],
'declaration-property-value-no-unknown': null,
'function-no-unknown': [true, { ignoreFunctions: ['unit'] }],
'media-feature-range-notation': ['prefix'],
'no-descending-specificity': null,
'number-max-precision': 10,
'rule-empty-line-before': [
'always-multi-line',
{
except: 'first-nested',
ignore: ['after-comment', 'inside-block'],
},
],
'no-descending-specificity': null,
'selector-id-pattern': null,
'selector-class-pattern': null,
'less/color-no-invalid-hex': null,
'less/no-duplicate-variables': null,
},
Expand Down
18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ When in doubt, mimic the styles and patterns in the existing codebase.
Within the root directory, run `npx browserslist` to output the set of browser
targets given to `autoprefixer` (CSS) transpiling.

!!! note
A browserslist string is used in `package.json`.
See the
[browserslist docs](https://github.com/browserslist/browserslist#full-list)
for information on this string and the defaults.
> [!NOTE]
> A browserslist string is used in `package.json`.
> See the
> [browserslist docs](https://github.com/browserslist/browserslist#full-list)
> for information on this string and the defaults.
For JavaScript, `esbuild` uses the [`es6`](http://es6-features.org/) target and
our code conditionally includes JavaScript in browsers that
[support fetch](https://caniuse.com/fetch).

!!! note
JavaScript may still
be delivered to legacy browsers in the form of our analytics and
related scripts.
> [!NOTE]
> JavaScript may still
> be delivered to legacy browsers in the form of our analytics and
> related scripts.
#### Browser Testing

Expand Down
2 changes: 1 addition & 1 deletion cfgov/agreements/jinja2/agreements/_need_help.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="m-related-links">
<header class="m-slug-header">
<h2 class="a-heading">
<h2 class="m-slug-header_heading">
Need help with your credit cards?
</h2>
</header>
Expand Down
67 changes: 67 additions & 0 deletions cfgov/agreements/jinja2/agreements/archive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{% extends "agreements/base_agreements.html" %}

{% block title -%}
Credit card agreement database archive | Consumer Financial Protection Bureau
{%- endblock %}

{% block content %}
<main class="content content__2-1 content__bleedbar">
<div class="content_wrapper">
{% set breadcrumb_items = [
({'href':'/','title':'Home'}),
({'href':'/data-research/credit-card-data/','title':'Credit cards'}),
({'href':'/credit-cards/agreements/','title':'Credit card agreement database'}),
] %}

{%- import 'v1/includes/molecules/breadcrumbs.html' as breadcrumbs with context -%}
{{ breadcrumbs.render(breadcrumb_items) }}
</div>
<div class="content_wrapper">
<div class="content_main">
<div class="block block__flush-top">
<h1>Credit card agreement archive</h1>
{% if agreements | length == 0 %}
We encountered an error fetching the credit card agreement archive. Please try again.
{% endif %}
<ul class="m-list m-list__links u-mt15 cc-links">
{% for agreement in agreements %}
{% set year = agreement[-11:-7] %}
{% set quarter = agreement[-6:-4] %}
{% set name = quarter + "-" + year %}
<li class="m-list m-list__links">
<a href="https://files.consumerfinance.gov/{{agreement}}">
{% if loop.index == 1 %}
<span style="font-size: 22px; line-height:3">Download all most recent agreements ({{name}})</span>
{% else %}
Archived {{name}} agreements
{% endif %}
</a>
{% if name in flexibilities %}
<br/>
<span style="font-size:14px">
Agreements may include omissions due to the Bureau’s COVID-19
<a href=" https://files.consumerfinance.gov/f/documents/cfpb_data-collection-statement_covid-19_2020-03.pdf">
regulatory flexibility statement
</a>
</span>
{% endif %}
{% if notes[name] %}
<br/>
<span style="font-size:14px">
{{notes[name]}}
</span>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
</div>

<aside class="content_sidebar o-sidebar-content">
<div class="block block__flush-top">
{% include '_need_help.html' %}
</div>
</aside>
</div>
</main>
{% endblock %}
Loading

0 comments on commit de5c8e8

Please sign in to comment.