Skip to content

Commit

Permalink
Merge pull request #1279 from GSA/jdonis/CHAL-1797-Update-PostCSS
Browse files Browse the repository at this point in the history
Jdonis/CHAL-1797 Update PostCSS
  • Loading branch information
jdonis authored Apr 23, 2024
2 parents 6d8763f + ffbd6fd commit b03f086
Show file tree
Hide file tree
Showing 8 changed files with 1,133 additions and 1,398 deletions.
2 changes: 1 addition & 1 deletion assets/css/app/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ a {
background: 0 0;
background-color: #757575;
-webkit-mask-image: url("/images/navigate_next.svg"),linear-gradient(transparent,transparent);
mask-image: url("/imges/navigate_next.svg"),linear-gradient(transparent,transparent);
mask-image: url("/images/navigate_next.svg"),linear-gradient(transparent,transparent);
-webkit-mask-position: center center;
mask-position: center center;
-webkit-mask-repeat: no-repeat;
Expand Down
6 changes: 6 additions & 0 deletions assets/css/app/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@
@import "../public/_tile-loader";
@import "analytics";
@import "help_page";


$fa-font-path: '/fonts/webfonts';
@import '~@fortawesome/fontawesome-free/scss/fontawesome';
@import '~@fortawesome/fontawesome-free/scss/solid';
@import '~@fortawesome/fontawesome-free/scss/regular';
3 changes: 2 additions & 1 deletion assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";

// Import dependencies
import "@fortawesome/fontawesome-free/css/all.css";
// import "@fortawesome/fontawesome-free/js/all.js";
// import "@fortawesome/fontawesome-free/css/all.css";

import jquery from "jquery";
import "popper.js";
Expand Down
9 changes: 5 additions & 4 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"chart.js": "^3.2.1",
"chokidar": "^3.3.1",
"create-react-app": "^5.0.1",
"file-loader": "^3.0.1",
"inputmask": "^5.0.5",
"jquery": "^3.3.1",
"moment": "^2.27.0",
Expand All @@ -28,6 +27,7 @@
"phoenix_html": "file:../deps/phoenix_html",
"phoenix_live_view": "file:../deps/phoenix_live_view",
"popper.js": "^1.14.7",
"postcss": "8.4.32",
"query-string": "^6.13.2",
"quill": "^1.3.7",
"quill-delta-to-html": "^0.11.0",
Expand All @@ -40,6 +40,7 @@
"select2": "^4.0.13",
"string-strip-html": "^8.3.0",
"url-loader": "^1.1.2",
"file-loader": "^6.2.0",
"uswds": "2.14.0",
"yarn": "^1.13.0"
},
Expand All @@ -50,9 +51,9 @@
"@babel/preset-env": "7.24.1",
"babel-loader": "8.0.6",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^0.28.10",
"mini-css-extract-plugin": "^0.4.0",
"optimize-css-assets-webpack-plugin": "^4.0.0",
"css-loader": "^6.8.1",
"mini-css-extract-plugin": "^2.9.0",
"optimize-css-assets-webpack-plugin": "^6.0.1",
"sass-loader": "^12.3.0",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^5.76.0",
Expand Down
15 changes: 13 additions & 2 deletions assets/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,24 @@ module.exports = (env, options) => ({
},
{
test: /\.s?css$/,
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"]
use: [MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
url: false
}
},
'sass-loader'
],
}
]
},
plugins: [
new MiniCssExtractPlugin({ filename: '../css/[name].css' }),
new CopyWebpackPlugin({patterns: [{ from: 'node_modules/uswds/dist/img', to: '../assets/img/' },{ from: 'static/', to: '../' }]}),
new CopyWebpackPlugin({patterns: [{ from: 'node_modules/uswds/dist/img', to: '../assets/img/' },
{ from: 'node_modules/uswds/dist/fonts', to: '../fonts/' },
{ from: 'node_modules/@fortawesome/fontawesome-free/webfonts', to: '../fonts/webfonts' },
{ from: 'static/', to: '../' }]}),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery'
Expand Down
2,371 changes: 982 additions & 1,389 deletions assets/yarn.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/web/templates/layout/preview.html.eex
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
<script type="text/javascript" src="<%= Routes.static_path(@conn, "/js/public.js") %>"></script>
<script type="text/javascript" src="<%= Routes.static_path(@conn, "/js/preview.js") %>"></script>

</html>
</html>
123 changes: 123 additions & 0 deletions test/integration/submission_test.exs
Original file line number Diff line number Diff line change
@@ -1 +1,124 @@
# defmodule ChallengeGov.SubmissionIntegrationTest do
# use Web.FeatureCase, async: true

# alias ChallengeGov.TestHelpers.AccountHelpers
# alias ChallengeGov.TestHelpers.ChallengeHelpers

# @tag :skip
# feature "create a submission as a solver", %{session: session} do
# challenge = create_challenge()
# create_and_sign_in_solver(session)

# session
# |> visit("/public")
# |> click(link("#{challenge.title}"))
# |> click(link("Apply for this challenge"))
# |> fill_in(text_field("Title"), with: "Test Submission")
# |> execute_script(
# "document.getElementsByClassName('ql-editor')[0].innerHTML = 'Brief desciption here.'"
# )
# |> execute_script(
# "document.getElementsByClassName('ql-editor')[1].innerHTML = 'Full description here.'"
# )
# |> click(checkbox("submission[terms_accepted]"))
# |> click(button("Review and submit"))
# |> click(link("Submit"))
# |> assert_text("Submission saved")

# session
# |> click(link("< Back to submissions"))
# |> assert_text("#{challenge.title}")
# end

# feature "create a submission as an admin", %{session: session} do
# AccountHelpers.create_user(%{email: "[email protected]", role: "solver"})
# create_challenge()
# create_and_sign_in_admin(session)

# session
# |> click(link("Challenge management"))
# |> click(link("View"))
# |> click(link("View submissions"))
# |> click(link("Add solver submission ->"))
# |> click(link("New solver submission"))
# |> fill_in(text_field("Title"), with: "Test Submission")
# |> execute_script(
# "document.getElementsByClassName('ql-editor')[0].innerHTML = 'Brief desciption here.'"
# )
# |> execute_script(
# "document.getElementsByClassName('ql-editor')[1].innerHTML = 'Full description here.'"
# )
# |> touch_scroll(button("Review and submit"), 0, 1)
# |> click(button("Review and submit"))
# |> touch_scroll(link("Submit"), 0, 1)
# |> click(link("Submit"))
# |> assert_text("Submission saved")

# # Submission is not found in table to be judged
# submission_id = get_submission_id(session)

# session
# |> touch_scroll(link("< Back to submissions"), 0, 1)
# |> click(link("< Back to submissions"))

# !has_text?(session, submission_id)

# # Admin submission table shows the "no" in review verified column
# session
# |> click(link("Add solver submission ->"))
# |> assert_text("Test Submission")
# |> assert_text(submission_id)
# |> find(css("#review-verified"))
# |> has_value?("no")

# # Admin created submission is found in Solver submissions
# # Commented out pending Login.Gov approving the change to
# # our `logout` redirect url .

# # session
# # |> click(link("[email protected]"))
# # |> click(link("Logout"))
# # |> visit("/dev_accounts")
# # |> click(button("Solver Active"))
# # |> assert_text("New submission to review")
# end

# defp create_challenge() do
# user =
# AccountHelpers.create_user(%{
# email: "[email protected]",
# role: "challenge_manager"
# })

# challenge =
# ChallengeHelpers.create_single_phase_challenge(user, %{
# user_id: user.id,
# custom_url: "test-challenge"
# })

# challenge
# end

# defp create_and_sign_in_admin(session) do
# AccountHelpers.create_user(%{email: "[email protected]", role: "admin"})

# session
# |> visit("/dev_accounts")
# |> click(button("Admin Active"))
# end

# defp create_and_sign_in_solver(session) do
# AccountHelpers.create_user(%{email: "[email protected]", role: "solver"})

# session
# |> visit("/dev_accounts")
# |> click(button("Solver Active"))
# end

# defp get_submission_id(session) do
# session
# |> current_url()
# |> String.split("/")
# |> List.last()
# end
# end

0 comments on commit b03f086

Please sign in to comment.