From ed3b4d2730091aa4cd38d1577f55da8ca66e3fc7 Mon Sep 17 00:00:00 2001 From: Natasha Boyse Date: Fri, 7 Feb 2025 11:06:36 +0000 Subject: [PATCH] chore: remove svelkit app and upgrade opensearch and remove legacy iai waffle flag --- Makefile | 2 +- django_app/redbox_app/jinja2.py | 2 - .../redbox_core/views/info_views.py | 6 +- .../templates/accessibility-statement.html | 17 +-- django_app/redbox_app/templates/base.html | 4 +- django_app/redbox_app/templates/homepage.html | 21 +-- .../redbox_app/templates/privacy-notice.html | 13 +- docker-compose.yml | 2 +- sveltekit_app/.gitignore | 1 - sveltekit_app/.npmrc | 1 - sveltekit_app/.prettierrc | 11 -- sveltekit_app/Dockerfile | 15 --- sveltekit_app/README.md | 21 --- sveltekit_app/e2e/demo.test.js | 6 - sveltekit_app/jsconfig.json | 19 --- sveltekit_app/package.json | 32 ----- sveltekit_app/playwright.config.js | 10 -- sveltekit_app/src/app.d.ts | 13 -- sveltekit_app/src/app.html | 14 -- .../src/lib/components/button.svelte | 9 -- .../src/lib/components/footer.svelte | 102 -------------- .../src/lib/components/top-nav.svelte | 125 ------------------ sveltekit_app/src/routes/+layout.server.js | 38 ------ sveltekit_app/src/routes/+layout.svelte | 14 -- sveltekit_app/src/routes/+page.server.js | 11 -- sveltekit_app/src/routes/+page.svelte | 98 -------------- .../src/routes/signed-out/+page.server.js | 6 - sveltekit_app/static/favicon.ico | Bin 15086 -> 0 bytes .../fonts/Inter-VariableFont_slnt,wght.ttf | Bin 804612 -> 0 bytes sveltekit_app/static/fonts/OFL.txt | 93 ------------- sveltekit_app/static/fonts/README.txt | 72 ---------- .../static/fonts/static/Inter-Black.ttf | Bin 316848 -> 0 bytes .../static/fonts/static/Inter-Bold.ttf | Bin 316584 -> 0 bytes .../static/fonts/static/Inter-ExtraBold.ttf | Bin 317184 -> 0 bytes .../static/fonts/static/Inter-ExtraLight.ttf | Bin 311232 -> 0 bytes .../static/fonts/static/Inter-Light.ttf | Bin 310832 -> 0 bytes .../static/fonts/static/Inter-Medium.ttf | Bin 315132 -> 0 bytes .../static/fonts/static/Inter-Regular.ttf | Bin 310252 -> 0 bytes .../static/fonts/static/Inter-SemiBold.ttf | Bin 316220 -> 0 bytes .../static/fonts/static/Inter-Thin.ttf | Bin 310984 -> 0 bytes sveltekit_app/static/scripts/main.js | 2 - sveltekit_app/static/scripts/main.js.map | 1 - sveltekit_app/static/styles.css | 2 - sveltekit_app/static/styles.css.map | 1 - sveltekit_app/svelte.config.js | 11 -- sveltekit_app/vite.config.js | 6 - 46 files changed, 15 insertions(+), 786 deletions(-) delete mode 100644 sveltekit_app/.gitignore delete mode 100644 sveltekit_app/.npmrc delete mode 100644 sveltekit_app/.prettierrc delete mode 100644 sveltekit_app/Dockerfile delete mode 100644 sveltekit_app/README.md delete mode 100644 sveltekit_app/e2e/demo.test.js delete mode 100644 sveltekit_app/jsconfig.json delete mode 100644 sveltekit_app/package.json delete mode 100644 sveltekit_app/playwright.config.js delete mode 100644 sveltekit_app/src/app.d.ts delete mode 100644 sveltekit_app/src/app.html delete mode 100644 sveltekit_app/src/lib/components/button.svelte delete mode 100644 sveltekit_app/src/lib/components/footer.svelte delete mode 100644 sveltekit_app/src/lib/components/top-nav.svelte delete mode 100644 sveltekit_app/src/routes/+layout.server.js delete mode 100644 sveltekit_app/src/routes/+layout.svelte delete mode 100644 sveltekit_app/src/routes/+page.server.js delete mode 100644 sveltekit_app/src/routes/+page.svelte delete mode 100644 sveltekit_app/src/routes/signed-out/+page.server.js delete mode 100644 sveltekit_app/static/favicon.ico delete mode 100644 sveltekit_app/static/fonts/Inter-VariableFont_slnt,wght.ttf delete mode 100644 sveltekit_app/static/fonts/OFL.txt delete mode 100644 sveltekit_app/static/fonts/README.txt delete mode 100644 sveltekit_app/static/fonts/static/Inter-Black.ttf delete mode 100644 sveltekit_app/static/fonts/static/Inter-Bold.ttf delete mode 100644 sveltekit_app/static/fonts/static/Inter-ExtraBold.ttf delete mode 100644 sveltekit_app/static/fonts/static/Inter-ExtraLight.ttf delete mode 100644 sveltekit_app/static/fonts/static/Inter-Light.ttf delete mode 100644 sveltekit_app/static/fonts/static/Inter-Medium.ttf delete mode 100644 sveltekit_app/static/fonts/static/Inter-Regular.ttf delete mode 100644 sveltekit_app/static/fonts/static/Inter-SemiBold.ttf delete mode 100644 sveltekit_app/static/fonts/static/Inter-Thin.ttf delete mode 100644 sveltekit_app/static/scripts/main.js delete mode 100644 sveltekit_app/static/scripts/main.js.map delete mode 100644 sveltekit_app/static/styles.css delete mode 100644 sveltekit_app/static/styles.css.map delete mode 100644 sveltekit_app/svelte.config.js delete mode 100644 sveltekit_app/vite.config.js diff --git a/Makefile b/Makefile index cb6a350ff..718cc2aad 100644 --- a/Makefile +++ b/Makefile @@ -113,7 +113,7 @@ PREV_IMAGE_TAG=$$(git rev-parse HEAD~1) IMAGE_TAG=$$(git rev-parse HEAD) tf_build_args=-var "image_tag=$(IMAGE_TAG)" -DOCKER_SERVICES=$$(docker compose config --services | grep -Ev 'worker|sveltekit-app') +DOCKER_SERVICES=$$(docker compose config --services | grep -Ev 'worker') AUTO_APPLY_RESOURCES = module.django-app.aws_ecs_task_definition.aws-ecs-task \ module.django-app.aws_ecs_service.aws-ecs-service \ diff --git a/django_app/redbox_app/jinja2.py b/django_app/redbox_app/jinja2.py index 9e7d4b2f6..bfd6b2806 100644 --- a/django_app/redbox_app/jinja2.py +++ b/django_app/redbox_app/jinja2.py @@ -86,7 +86,6 @@ def environment(**options): "to_user_timezone": to_user_timezone, "environment": settings.ENVIRONMENT.value, "security": settings.MAX_SECURITY_CLASSIFICATION.value, - "waffle_flag": waffle.flag_is_active, } ) env.globals.update( @@ -98,7 +97,6 @@ def environment(**options): "to_user_timezone": to_user_timezone, "environment": settings.ENVIRONMENT.value, "security": settings.MAX_SECURITY_CLASSIFICATION.value, - "waffle_flag": waffle.flag_is_active, "google_analytics_tag": settings.GOOGLE_ANALYTICS_TAG, "google_analytics_link": settings.GOOGLE_ANALYTICS_LINK, "google_analytics_iframe_src": settings.GOOGLE_ANALYTICS_IFRAME_SRC, diff --git a/django_app/redbox_app/redbox_core/views/info_views.py b/django_app/redbox_app/redbox_core/views/info_views.py index df4741474..93f149ac2 100644 --- a/django_app/redbox_app/redbox_core/views/info_views.py +++ b/django_app/redbox_app/redbox_core/views/info_views.py @@ -13,10 +13,7 @@ def privacy_notice_view(request): return render( request, - "privacy-notice.html", - { - "waffle_flag": waffle.flag_is_active, - }, + "privacy-notice.html" ) @@ -34,6 +31,5 @@ def accessibility_statement_view(request): "accessibility-statement.html", { "contact_email": settings.CONTACT_EMAIL, - "waffle_flag": waffle.flag_is_active, }, ) diff --git a/django_app/redbox_app/templates/accessibility-statement.html b/django_app/redbox_app/templates/accessibility-statement.html index 8e749aa77..dccc87db8 100644 --- a/django_app/redbox_app/templates/accessibility-statement.html +++ b/django_app/redbox_app/templates/accessibility-statement.html @@ -2,18 +2,11 @@ {% set pageTitle = "Accessibility statement" %} -{% if waffle_flag(request, "uktrade") %} - {% set departmental_owner = "Department for Business and Trade" %} - {% set zoom_level = "300%" %} - {% set review_date_last = "21st June 2024" %} - {% set compliance_status = 'This website is fully compliant with the Web Content Accessibility Guidelines version 2.2 AA standard.' %} - -{% else %} - {% set departmental_owner = "Cabinet Office" %} - {% set zoom_level = "400%" %} - {% set review_date_last = "12th August 2024" %} - {% set compliance_status = 'The website has been tested against the Web Content Accessibility Guidelines (WCAG) 2.2 AA standard. This website is fully compliant with the Web Content Accessibility Guidelines version 2.2 AA standard.' %} -{% endif %} +{% set departmental_owner = "Department for Business and Trade" %} +{% set zoom_level = "300%" %} +{% set review_date_last = "21st June 2024" %} +{% set compliance_status = 'This website is fully compliant with the Web Content Accessibility Guidelines version 2.2 AA standard.' %} + {% block content %} diff --git a/django_app/redbox_app/templates/base.html b/django_app/redbox_app/templates/base.html index 68da6aba1..1dcdb5740 100644 --- a/django_app/redbox_app/templates/base.html +++ b/django_app/redbox_app/templates/base.html @@ -19,7 +19,7 @@ - {% if environment | lower == "prod" and waffle_flag(request, 'uktrade') %} + {% if environment | lower == "prod" %} - - diff --git a/sveltekit_app/src/lib/components/button.svelte b/sveltekit_app/src/lib/components/button.svelte deleted file mode 100644 index 5669e225f..000000000 --- a/sveltekit_app/src/lib/components/button.svelte +++ /dev/null @@ -1,9 +0,0 @@ - - - - {text} - diff --git a/sveltekit_app/src/lib/components/footer.svelte b/sveltekit_app/src/lib/components/footer.svelte deleted file mode 100644 index 08780916b..000000000 --- a/sveltekit_app/src/lib/components/footer.svelte +++ /dev/null @@ -1,102 +0,0 @@ - - - diff --git a/sveltekit_app/src/lib/components/top-nav.svelte b/sveltekit_app/src/lib/components/top-nav.svelte deleted file mode 100644 index 5a5ecc725..000000000 --- a/sveltekit_app/src/lib/components/top-nav.svelte +++ /dev/null @@ -1,125 +0,0 @@ - - -
-
-
-
- - - {#if phase} -
{phase}
- {/if} -
- -
- - - -
- - - -
diff --git a/sveltekit_app/src/routes/+layout.server.js b/sveltekit_app/src/routes/+layout.server.js deleted file mode 100644 index fbf029abc..000000000 --- a/sveltekit_app/src/routes/+layout.server.js +++ /dev/null @@ -1,38 +0,0 @@ -//import { redirect } from "@sveltejs/kit"; -import { config } from 'dotenv'; -config(); - -export async function load({ request, cookies }) { - - const API_URL = `${process.env.DJANGO_API_HOST}/api/v0?format=json`; - - let userData = {}; - - try { - const userRequest = await fetch(API_URL, { - headers: { - cookie: `sessionid=${cookies.get("sessionid")}`, - }, - }); - userData = userRequest.ok ? await userRequest.json() : {}; - } catch (err) { - console.log("Error connecting to Django", err); - } - - - const publicRoutes = [ - "/", - "/sign-in", - "/privacy", - "/accessibility", - "support", - "sitemap", - ]; - // TO DO: Add a redirect here if user is not authenticated, unless one of the publicRoutes - - return { - userIsAuthenticated: userData.email ? true : false, - user: userData, - }; - -} diff --git a/sveltekit_app/src/routes/+layout.svelte b/sveltekit_app/src/routes/+layout.svelte deleted file mode 100644 index 31fc9bf0f..000000000 --- a/sveltekit_app/src/routes/+layout.svelte +++ /dev/null @@ -1,14 +0,0 @@ - - -
- -
- -
- -