54 changed files with 510 additions and 7736 deletions
@ -0,0 +1,3 @@
|
||||
web: bin/rails server -p 3000 |
||||
js: yarn build --watch |
||||
css: yarn build:css --watch |
@ -0,0 +1,2 @@
|
||||
//= link_tree ../builds/images
|
||||
//= link_tree ../builds
|
@ -1,16 +1,16 @@
|
||||
.autocomplete__wrapper, |
||||
.autocomplete__input, |
||||
.autocomplete__hint { |
||||
font-family: $govuk-font-family; |
||||
font-family: all.$govuk-font-family; |
||||
} |
||||
|
||||
.govuk-form-group--error { |
||||
.autocomplete__input { |
||||
border-color: $govuk-error-colour; |
||||
border-color: all.$govuk-error-colour; |
||||
} |
||||
|
||||
.autocomplete__input--focused { |
||||
border-color: $govuk-input-border-colour; |
||||
border-color: all.$govuk-input-border-colour; |
||||
} |
||||
} |
||||
|
@ -0,0 +1,9 @@
|
||||
.app-section-skip-link { |
||||
@include all.govuk-visually-hidden-focusable; |
||||
@include all.govuk-typography-common; |
||||
@include all.govuk-link-decoration; |
||||
@include all.govuk-link-style-text; |
||||
|
||||
display: inline-block; |
||||
padding: govuk-spacing(2) govuk-spacing(3); |
||||
} |
@ -1,5 +1,5 @@
|
||||
.app-template--wide { |
||||
.govuk-width-container { |
||||
@include govuk-width-container(1100px); |
||||
@include all.govuk-width-container(1100px); |
||||
} |
||||
} |
@ -0,0 +1,3 @@
|
||||
//= require active_admin/base
|
||||
|
||||
import "chartkick/chart.js" |
@ -0,0 +1,6 @@
|
||||
import "@hotwired/turbo-rails" |
||||
import "./controllers" |
||||
import { initAll } from 'govuk-frontend' |
||||
|
||||
Rails.start() |
||||
initAll() |
@ -0,0 +1,23 @@
|
||||
// This file is auto-generated by ./bin/rails stimulus:manifest:update
|
||||
// Run that command whenever you add a new controller or create them with
|
||||
// ./bin/rails generate stimulus controllerName
|
||||
|
||||
import { application } from "./application" |
||||
|
||||
import AccessibleAutocompleteController from "./accessible_autocomplete_controller.js" |
||||
application.register("accessible-autocomplete", AccessibleAutocompleteController) |
||||
|
||||
import ConditionalQuestionController from "./conditional_question_controller.js" |
||||
application.register("conditional-question", ConditionalQuestionController) |
||||
|
||||
import NumericQuestionController from "./numeric_question_controller.js" |
||||
application.register("numeric-question", NumericQuestionController) |
||||
|
||||
import SoftValidationsController from "./soft_validations_controller.js" |
||||
application.register("soft-validations", SoftValidationsController) |
||||
|
||||
import TasklistController from "./tasklist_controller.js" |
||||
application.register("tasklist", TasklistController) |
||||
|
||||
import GovukfrontendController from "./govukfrontend_controller.js" |
||||
application.register("govukfrontend", GovukfrontendController) |
@ -0,0 +1,28 @@
|
||||
import { Controller } from "@hotwired/stimulus" |
||||
|
||||
export default class extends Controller { |
||||
static targets = [ "override" ] |
||||
|
||||
initialize() { |
||||
let url = window.location.href + "/soft-validations" |
||||
let div = this.overrideTarget |
||||
fetch(url, { headers: { accept: "application/json" } }) |
||||
.then(response => response.json()) |
||||
.then((response) => { |
||||
if(response["show"]){ |
||||
div.style.display = "block" |
||||
let innerHTML = div.innerHTML |
||||
innerHTML = innerHTML.replace("soft-validations-placeholder-message", response["label"]) |
||||
innerHTML = innerHTML.replace("soft-validations-placeholder-hint-text", response["hint"]) |
||||
div.innerHTML = innerHTML |
||||
} else { |
||||
div.style.display = "none" |
||||
let buttons = document.getElementsByName(`case_log[override_net_income_validation][]`) |
||||
Object.entries(buttons).map(([idx, button]) => { |
||||
button.checked = false |
||||
}) |
||||
} |
||||
} |
||||
) |
||||
} |
||||
} |
@ -1,6 +0,0 @@
|
||||
// Action Cable provides the framework to deal with WebSockets in Rails.
|
||||
// You can generate new channels where WebSocket features live using the `bin/rails generate channel` command.
|
||||
|
||||
import { createConsumer } from "@rails/actioncable" |
||||
|
||||
export default createConsumer() |
@ -1,5 +0,0 @@
|
||||
// Load all the channels within this directory and all subdirectories.
|
||||
// Channel files must be named *_channel.js.
|
||||
|
||||
const channels = require.context('.', true, /_channel\.js$/) |
||||
channels.keys().forEach(channels) |
@ -1,9 +0,0 @@
|
||||
// Load all the controllers within this directory and all subdirectories.
|
||||
// Controller files must be named *_controller.js.
|
||||
|
||||
import { Application } from "@hotwired/stimulus" |
||||
import { definitionsFromContext } from "@hotwired/stimulus-webpack-helpers" |
||||
|
||||
const application = Application.start() |
||||
const context = require.context("controllers", true, /_controller\.js$/) |
||||
application.load(definitionsFromContext(context)) |
@ -1,7 +0,0 @@
|
||||
// Load Active Admin's styles into Webpacker,
|
||||
// see `active_admin.scss` for customization.
|
||||
import "../styles/active_admin"; |
||||
|
||||
import "@activeadmin/activeadmin"; |
||||
|
||||
import "chartkick/chart.js" |
@ -1,15 +0,0 @@
|
||||
// This file is automatically compiled by Webpack, along with any other files
|
||||
// present in this directory. You're encouraged to place your actual application logic in
|
||||
// a relevant structure within app/javascript and only use these pack files to reference
|
||||
// that code so it'll be compiled.
|
||||
require.context('govuk-frontend/govuk/assets') |
||||
|
||||
import '../styles/application.scss' |
||||
import * as ActiveStorage from "@rails/activestorage" |
||||
import "channels" |
||||
import "controllers" |
||||
import "@hotwired/turbo-rails" |
||||
import { initAll } from 'govuk-frontend' |
||||
|
||||
ActiveStorage.start() |
||||
initAll() |
@ -1,9 +0,0 @@
|
||||
.app-section-skip-link { |
||||
@include govuk-visually-hidden-focusable; |
||||
@include govuk-typography-common; |
||||
@include govuk-link-decoration; |
||||
@include govuk-link-style-text; |
||||
|
||||
display: inline-block; |
||||
padding: govuk-spacing(2) govuk-spacing(3); |
||||
} |
@ -1,70 +0,0 @@
|
||||
module.exports = function(api) { |
||||
var validEnv = ['development', 'test', 'production'] |
||||
var currentEnv = api.env() |
||||
var isDevelopmentEnv = api.env('development') |
||||
var isProductionEnv = api.env('production') |
||||
var isTestEnv = api.env('test') |
||||
|
||||
if (!validEnv.includes(currentEnv)) { |
||||
throw new Error( |
||||
'Please specify a valid `NODE_ENV` or ' + |
||||
'`BABEL_ENV` environment variables. Valid values are "development", ' + |
||||
'"test", and "production". Instead, received: ' + |
||||
JSON.stringify(currentEnv) + |
||||
'.' |
||||
) |
||||
} |
||||
|
||||
return { |
||||
presets: [ |
||||
isTestEnv && [ |
||||
'@babel/preset-env', |
||||
{ |
||||
targets: { |
||||
node: 'current' |
||||
} |
||||
} |
||||
], |
||||
(isProductionEnv || isDevelopmentEnv) && [ |
||||
'@babel/preset-env', |
||||
{ |
||||
forceAllTransforms: true, |
||||
useBuiltIns: 'entry', |
||||
corejs: 3, |
||||
modules: false, |
||||
exclude: ['transform-typeof-symbol'] |
||||
} |
||||
] |
||||
].filter(Boolean), |
||||
plugins: [ |
||||
'babel-plugin-macros', |
||||
'@babel/plugin-syntax-dynamic-import', |
||||
isTestEnv && 'babel-plugin-dynamic-import-node', |
||||
'@babel/plugin-transform-destructuring', |
||||
[ |
||||
'@babel/plugin-proposal-class-properties', |
||||
{ |
||||
loose: true |
||||
} |
||||
], |
||||
[ |
||||
'@babel/plugin-proposal-object-rest-spread', |
||||
{ |
||||
useBuiltIns: true |
||||
} |
||||
], |
||||
[ |
||||
'@babel/plugin-transform-runtime', |
||||
{ |
||||
helpers: false |
||||
} |
||||
], |
||||
[ |
||||
'@babel/plugin-transform-regenerator', |
||||
{ |
||||
async: false |
||||
} |
||||
] |
||||
].filter(Boolean) |
||||
} |
||||
} |
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash |
||||
|
||||
if ! command -v foreman &> /dev/null |
||||
then |
||||
echo "Installing foreman..." |
||||
gem install foreman |
||||
fi |
||||
|
||||
foreman start -f Procfile.dev |
@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env ruby |
||||
|
||||
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" |
||||
ENV["NODE_ENV"] ||= "development" |
||||
|
||||
require "pathname" |
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", |
||||
Pathname.new(__FILE__).realpath) |
||||
|
||||
require "bundler/setup" |
||||
|
||||
require "webpacker" |
||||
require "webpacker/webpack_runner" |
||||
|
||||
APP_ROOT = File.expand_path("..", __dir__) |
||||
Dir.chdir(APP_ROOT) do |
||||
Webpacker::WebpackRunner.run(ARGV) |
||||
end |
@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env ruby |
||||
|
||||
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" |
||||
ENV["NODE_ENV"] ||= "development" |
||||
|
||||
require "pathname" |
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", |
||||
Pathname.new(__FILE__).realpath) |
||||
|
||||
require "bundler/setup" |
||||
|
||||
require "webpacker" |
||||
require "webpacker/dev_server_runner" |
||||
|
||||
APP_ROOT = File.expand_path("..", __dir__) |
||||
Dir.chdir(APP_ROOT) do |
||||
Webpacker::DevServerRunner.run(ARGV) |
||||
end |
@ -1,5 +0,0 @@
|
||||
process.env.NODE_ENV = process.env.NODE_ENV || 'development' |
||||
|
||||
const environment = require('./environment') |
||||
|
||||
module.exports = environment.toWebpackConfig() |
@ -1,5 +0,0 @@
|
||||
const { environment } = require('@rails/webpacker') |
||||
const jquery = require('./plugins/jquery') |
||||
|
||||
environment.plugins.prepend('jquery', jquery) |
||||
module.exports = environment |
@ -1,7 +0,0 @@
|
||||
const webpack = require('webpack') |
||||
|
||||
module.exports = new webpack.ProvidePlugin({ |
||||
"$":"jquery", |
||||
"jQuery":"jquery", |
||||
"window.jQuery":"jquery" |
||||
}); |
@ -1,5 +0,0 @@
|
||||
process.env.NODE_ENV = process.env.NODE_ENV || 'production' |
||||
|
||||
const environment = require('./environment') |
||||
|
||||
module.exports = environment.toWebpackConfig() |
@ -1,5 +0,0 @@
|
||||
process.env.NODE_ENV = process.env.NODE_ENV || 'staging' |
||||
|
||||
const environment = require('./environment') |
||||
|
||||
module.exports = environment.toWebpackConfig() |
@ -1,5 +0,0 @@
|
||||
process.env.NODE_ENV = process.env.NODE_ENV || 'development' |
||||
|
||||
const environment = require('./environment') |
||||
|
||||
module.exports = environment.toWebpackConfig() |
@ -1,102 +0,0 @@
|
||||
# Note: You must restart bin/webpack-dev-server for changes to take effect |
||||
|
||||
default: &default |
||||
source_path: app/webpacker |
||||
source_entry_path: packs |
||||
public_root_path: public |
||||
public_output_path: packs |
||||
cache_path: tmp/cache/webpacker |
||||
webpack_compile_output: true |
||||
|
||||
# Additional paths webpack should lookup modules |
||||
# ['app/assets', 'engine/foo/app/assets'] |
||||
additional_paths: ['node_modules/govuk-frontend/govuk'] |
||||
|
||||
# Cache manifest.json for performance |
||||
cache_manifest: true |
||||
|
||||
# Extract and emit a css file |
||||
extract_css: true |
||||
|
||||
# Production depends on precompilation of packs prior to booting for performance. |
||||
compile: false |
||||
|
||||
static_assets_extensions: |
||||
- .jpg |
||||
- .jpeg |
||||
- .png |
||||
- .gif |
||||
- .tiff |
||||
- .ico |
||||
- .svg |
||||
- .eot |
||||
- .otf |
||||
- .ttf |
||||
- .woff |
||||
- .woff2 |
||||
|
||||
extensions: |
||||
- .mjs |
||||
- .js |
||||
- .sass |
||||
- .scss |
||||
- .css |
||||
- .module.sass |
||||
- .module.scss |
||||
- .module.css |
||||
- .png |
||||
- .svg |
||||
- .gif |
||||
- .jpeg |
||||
- .jpg |
||||
|
||||
development: |
||||
<<: *default |
||||
compile: true |
||||
|
||||
# Reload manifest.json on all requests so we reload latest compiled packs |
||||
cache_manifest: false |
||||
|
||||
# Extract and emit a css file |
||||
extract_css: false |
||||
|
||||
# Reference: https://webpack.js.org/configuration/dev-server/ |
||||
dev_server: |
||||
https: false |
||||
host: localhost |
||||
port: 3035 |
||||
public: localhost:3035 |
||||
hmr: false |
||||
# Inline should be set to true if using HMR |
||||
inline: false |
||||
overlay: true |
||||
compress: true |
||||
disable_host_check: true |
||||
use_local_ip: false |
||||
quiet: false |
||||
pretty: false |
||||
headers: |
||||
'Access-Control-Allow-Origin': '*' |
||||
watch_options: |
||||
ignored: '**/node_modules/**' |
||||
|
||||
|
||||
test: |
||||
<<: *default |
||||
compile: true |
||||
|
||||
# Reload manifest.json on all requests so we reload latest compiled packs |
||||
cache_manifest: false |
||||
|
||||
# Extract and emit a css file |
||||
extract_css: false |
||||
|
||||
# Compile test packs to a separate directory |
||||
public_output_path: packs-test |
||||
|
||||
|
||||
staging: |
||||
<<: *default |
||||
|
||||
production: |
||||
<<: *default |
@ -1,12 +0,0 @@
|
||||
module.exports = { |
||||
plugins: [ |
||||
require('postcss-import'), |
||||
require('postcss-flexbugs-fixes'), |
||||
require('postcss-preset-env')({ |
||||
autoprefixer: { |
||||
flexbox: 'no-2009' |
||||
}, |
||||
stage: 3 |
||||
}) |
||||
] |
||||
} |
Loading…
Reference in new issue