-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ccdb5-ui npm infrastructure (#6794)
* Add ccdb-ui npm infrastructure * Fix bewd lint errors * Remove unneeded block * Add stylesheet * Fix import order * Add @cfpb/[email protected] * Remove ccdb5-ui wheel * Flush npm cache * Remove satellite * Add yargs to fix missing yargs dependency error * Fix URL name * Delete ccdb_ui.html * Refresh cache and bump @cfpb/ccdb5-ui * Remove unneeded context call * Add CSS overrides for global styles coming in * Update cfgov/legacy/views/complaint.py Co-authored-by: william higgins <[email protected]> * Add trailing newline * Update cfgov/legacy/views/complaint.py Co-authored-by: william higgins <[email protected]> * Update cfgov/legacy/views/complaint.py Co-authored-by: william higgins <[email protected]> * add cache-tag tests * remove explicit tag check * revert wsgi config * Update CSS padding Co-authored-by: william higgins <[email protected]> Co-authored-by: higs4281 <[email protected]>
- Loading branch information
1 parent
942b8e9
commit d08b9fa
Showing
14 changed files
with
232 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,7 +106,6 @@ | |
"login", | ||
|
||
# Satellites | ||
"ccdb5_ui", | ||
"complaint_search", | ||
"countylimits", | ||
"crtool", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{% extends 'layout-full.html' %} | ||
|
||
{% block title %} | ||
Search the Consumer Complaint Database | Consumer Financial Protection Bureau | ||
{% endblock %} | ||
|
||
{% block css %} | ||
{{ super() }} | ||
<link rel="stylesheet" href="{{ static('apps/ccdb-search/css/main.css') }}"> | ||
{% endblock %} | ||
|
||
{% block desc %} | ||
The Consumer Complaint Database is a collection of complaints about consumer financial products and services that we sent to companies for response. | ||
{% endblock %} | ||
|
||
{% block content_main_modifiers -%} | ||
{{ super() }} ccdb-search | ||
{%- endblock %} | ||
|
||
{% block content_main %} | ||
<div id="ccdb-ui-root"></div> | ||
{% endblock %} | ||
|
||
{% block javascript scoped %} | ||
{{ super() }} | ||
<script> | ||
if ( document.body.parentElement.className.indexOf( 'no-js' ) === -1 ) { | ||
!function() { | ||
var s = [ | ||
'https://files.consumerfinance.gov/ccdb/metadata.js', | ||
'{{ static('apps/ccdb-search/js/main.js') }}' | ||
]; | ||
jsl(s); | ||
}() | ||
} | ||
</script> | ||
{% endblock javascript %} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
yarn-offline-mirror "./npm-packages-offline-cache" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
@import (reference) 'cfpb-core.less'; | ||
|
||
// TODO: !important's are added for styles that are overriding ccdb5-ui styles. | ||
.wrapper { | ||
max-width: 1200px !important; | ||
} | ||
|
||
@tablet: ~"only screen and (min-width: 600px) and (max-width: 900px)"; | ||
.wrapper__match-content { | ||
@media @tablet { | ||
padding-left: 30px !important; | ||
padding-right: 30px !important; | ||
} | ||
} | ||
|
||
.ccdb-search { | ||
width: 100vw !important; | ||
max-width: 100vw; | ||
margin-left: -50vw; | ||
margin-right: -50vw; | ||
box-sizing: border-box; | ||
left: 50%; | ||
right: 50%; | ||
position: relative; | ||
padding: 0 unit( 15px / 16px, em ) !important; | ||
|
||
.respond-to-max( @bp-sm-max, { | ||
padding: 0 unit( 10px / 16px, em ) !important; | ||
} ); | ||
|
||
// Overrides for design system. | ||
.o-expandable_target .o-expandable_cue-close, .o-expandable_target .o-expandable_cue-open { | ||
display: block !important; | ||
} | ||
|
||
.o-expandable_label { | ||
margin-bottom: 0.83333333em !important; | ||
} | ||
|
||
// Overrides for cfpb-chart-builder. | ||
.cfpb-chart[data-chart-type="tile_map"] { | ||
.highcharts-legend__tile-map { | ||
transform: translate( 7px, 50px ); | ||
} | ||
} | ||
|
||
.cfpb-chart { | ||
max-width: 100% !important; | ||
} | ||
|
||
#tile-chart-map { | ||
height: auto; | ||
} | ||
|
||
// Overrides for styles in meta.less | ||
.tags { | ||
padding-left: 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import '@cfpb/ccdb5-ui/dist/ccdb5.min.js'; |
Binary file added
BIN
+2.31 MB
cfgov/unprocessed/apps/ccdb-search/npm-packages-offline-cache/@cfpb-ccdb5-ui-2.4.6.tgz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "ccdb5-ui", | ||
"version": "0.0.1", | ||
"private": "true", | ||
"description": "Consumer Complaint Database (CCDB-UI) application that appears at https://www.consumerfinance.gov/data-research/consumer-complaints/search/.", | ||
"author": { | ||
"name": "Consumer Financial Protection Bureau", | ||
"email": "[email protected]", | ||
"url": "https://cfpb.github.io/" | ||
}, | ||
"dependencies": { | ||
"@cfpb/ccdb5-ui": "2.4.6" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/cfpb/ccdb5-ui" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* ========================================================================== | ||
Settings for webpack JavaScript bundling system. | ||
========================================================================== */ | ||
|
||
const TerserPlugin = require( 'terser-webpack-plugin' ); | ||
|
||
/* Set warnings to true to show linter-style warnings. | ||
Set mangle to false and beautify to true to debug the output code. */ | ||
const COMMON_MINIFICATION_CONFIG = new TerserPlugin( { | ||
parallel: true, | ||
extractComments: false, | ||
terserOptions: { | ||
ie8: false, | ||
ecma: 5, | ||
warnings: false, | ||
mangle: true, | ||
output: { | ||
comments: false, | ||
beautify: false | ||
} | ||
} | ||
} ); | ||
|
||
/* Commmon webpack 'module' option used in each configuration. | ||
Runs code through Babel and uses global supported browser list. */ | ||
const COMMON_MODULE_CONFIG = { | ||
rules: [ { | ||
test: /\.js$/, | ||
/* Exclude modules from transpiling. | ||
The below regex will match and exclude all node modules | ||
except those that start with `@cfpb/` or `cfpb-`. | ||
Regex test: https://regex101.com/r/zizz3V/9 */ | ||
exclude: /node_modules\/(?!(?:@cfpb\/.+|cfpb\-.+)).+/, | ||
use: { | ||
loader: 'babel-loader?cacheDirectory=true', | ||
options: { | ||
presets: [ [ '@babel/preset-env', { | ||
configPath: __dirname, | ||
/* Use useBuiltIns: 'usage' and set `debug: true` to see what | ||
scripts require polyfilling. */ | ||
useBuiltIns: false, | ||
debug: false | ||
} ] ] | ||
} | ||
} | ||
} ] | ||
}; | ||
|
||
const STATS_CONFIG = { | ||
stats: { | ||
entrypoints: false | ||
} | ||
}; | ||
|
||
const conf = { | ||
cache: true, | ||
module: COMMON_MODULE_CONFIG, | ||
mode: 'production', | ||
output: { | ||
filename: '[name]' | ||
}, | ||
optimization: { | ||
minimize: true, | ||
minimizer: [ | ||
COMMON_MINIFICATION_CONFIG | ||
] | ||
}, | ||
stats: STATS_CONFIG.stats | ||
}; | ||
|
||
module.exports = { conf }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|
||
"@cfpb/[email protected]": | ||
version "2.4.6" | ||
resolved "https://registry.yarnpkg.com/@cfpb/ccdb5-ui/-/ccdb5-ui-2.4.6.tgz#aec8b24b25f4d3ae5c00f3780a51c288e5417f56" | ||
integrity sha512-OT4UnSvreitm4MDGiN+QOGMtWws38SwSpKLfQX9zrjMrIt/dQ83Y+VrThsxzSEnl6qP3u7l/NJIQrdu+zyBS/A== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters