From 8eedf55ab34a9eedeea9c11e1dd9ac7b8e0ffa61 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Fri, 10 Nov 2023 12:27:23 +0000 Subject: [PATCH] fix: creating change requests in private cloud UI (#2953) --- api/app/templates/.gitignore | 5 +- api/app/templates/index.html | 125 ------------------ api/app/templates/webpack/.gitkeep | 0 api/app/views.py | 5 +- frontend/package.json | 2 +- .../webpack/webpack.config.django.prod.js | 4 +- 6 files changed, 6 insertions(+), 135 deletions(-) delete mode 100644 api/app/templates/index.html create mode 100644 api/app/templates/webpack/.gitkeep diff --git a/api/app/templates/.gitignore b/api/app/templates/.gitignore index 5129d9c4f67a..926674781170 100644 --- a/api/app/templates/.gitignore +++ b/api/app/templates/.gitignore @@ -1,4 +1,3 @@ -# Ignore Webpack Templates Folder -# Front-end production template builds are copied here by webpack. Files in this folder should not be committed to git. +# Front-end production template builds are copied here by webpack. HTML files in this folder should not be committed to git. -webpack +webpack/**.html diff --git a/api/app/templates/index.html b/api/app/templates/index.html deleted file mode 100644 index a3d3c7177375..000000000000 --- a/api/app/templates/index.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - - - Flagsmith - Feature Flags, Feature Toggles and Remote Config - Ship features with confidence - - - - - -
-
- -
- - - - - diff --git a/api/app/templates/webpack/.gitkeep b/api/app/templates/webpack/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/api/app/views.py b/api/app/views.py index e968b96ec384..ecb1fff78102 100644 --- a/api/app/views.py +++ b/api/app/views.py @@ -25,10 +25,7 @@ def index(request): return HttpResponse(status=405, content_type="application/json") template = loader.get_template("webpack/index.html") - context = { - "linkedin_api_key": settings.LINKEDIN_API_KEY, - } - return HttpResponse(template.render(context, request)) + return HttpResponse(template.render(request=request)) def project_overrides(request): diff --git a/frontend/package.json b/frontend/package.json index af6ddcfa1875..cbb92c58e14f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -20,7 +20,7 @@ "typecheck": "tsc", "dev": "cross-env npm run env && npx nodemon --watch ./api --ignore server/config/config.json --watch webpack --exec node ./api", "bundle": "npx webpack --config ./webpack/webpack.config.prod.js", - "bundledjango": "mkdir -p ../api/app/templates/webpack/ && npx webpack --config ./webpack/webpack.config.django.prod.js && rm -f ../api/app/templates/webpack/index.html && rm -f ../api/static/static/project-overrides.js && cp ../api/static/index.html ../api/app/templates/webpack/index.html" + "bundledjango": "npx webpack --config ./webpack/webpack.config.django.prod.js" }, "engines": { "node": "16.x", diff --git a/frontend/webpack/webpack.config.django.prod.js b/frontend/webpack/webpack.config.django.prod.js index b96fe08d68aa..2f9a013210f8 100644 --- a/frontend/webpack/webpack.config.django.prod.js +++ b/frontend/webpack/webpack.config.django.prod.js @@ -58,8 +58,8 @@ module.exports = { ), ]).concat(require('./pages').map(page => new HtmlWebpackPlugin({ - filename: `${page}.html`, // output template - template: `../api/app/templates/${page}.html`, // template to use + filename: `../app/templates/webpack/${page}.html`, // output template (relative from static dir) + template: `web/${page}.html`, // template to use (use the same template used for running FE outside of vercel) 'assets': { // add these script/link tags 'client': '/[fullhash].js', 'style': 'style.[fullhash].css',