Skip to content

Commit

Permalink
Removes unused stylesheet, adds hash type to webpack config, comments…
Browse files Browse the repository at this point in the history
… unused code.
  • Loading branch information
gdbarnes committed Sep 10, 2024
1 parent 6d8ffac commit fdfee09
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 33 deletions.
1 change: 0 additions & 1 deletion front_end/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ $govuk-image-url-function: frontend-image-url;
// Custom style sheets
@import "./search.scss";
@import "./inset_text.scss";
@import "./report.scss";
21 changes: 0 additions & 21 deletions front_end/stylesheets/report.scss

This file was deleted.

14 changes: 7 additions & 7 deletions orp/orp_search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from core.forms import RegulationSearchForm

from .search import search_data_api
# from .search import search_data_api


@require_http_methods(["GET"])
Expand All @@ -32,10 +32,10 @@ def search(request: HttpRequest) -> HttpResponse:
}
form = RegulationSearchForm(request.GET or None)
context["form"] = form
if form.is_valid() and "query" in request.GET:
search_query = form.cleaned_data["query"]
search_data = search_data_api(search_query)
context["results"] = search_data["results"]
context["request_exception"] = search_data["request_exception"]
context["truncated"] = search_data["truncated"]
# if form.is_valid() and "query" in request.GET:
# search_query = form.cleaned_data["query"]
# search_data = search_data_api(search_query)
# context["results"] = search_data["results"]
# context["request_exception"] = search_data["request_exception"]
# context["truncated"] = search_data["truncated"]
return render(request, template_name="orp.html", context=context)
8 changes: 4 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const BundleTracker = require("webpack-bundle-tracker");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");

module.exports = {
mode: process.env.ENV == "production" ? "production" : "development",
mode: process.env.ENV == "production" ? "production" : "development",
context: __dirname,
entry: {
main: [
Expand All @@ -17,14 +17,14 @@ mode: process.env.ENV == "production" ? "production" : "development",
// Where the compiled assets will be accessed through Django
// (they are picked up by `collectstatic`)
publicPath: "/static/webpack_bundles/",
filename: "[name]-[hash].js",
filename: "[name]-[contenthash].js",
},

plugins: [
new BundleTracker({ path: __dirname, filename: "webpack-stats.json" }),
new MiniCssExtractPlugin({
filename: "[name]-[hash].css",
chunkFilename: "[id]-[hash].css",
filename: "[name]-[contenthash].css",
chunkFilename: "[id]-[contenthash].css",
}),
],

Expand Down

0 comments on commit fdfee09

Please sign in to comment.