From 750a4cc26cda06b9a5f97fc8d1371225ed2af32d Mon Sep 17 00:00:00 2001 From: Stefan Kairinos Date: Mon, 9 Dec 2024 11:55:50 +0000 Subject: [PATCH 1/2] fix: default settings (#69) --- src/settings.ts | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/settings.ts b/src/settings.ts index 65c7358..416ebcc 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -10,24 +10,11 @@ const env = import.meta.env as Record export default env // The name of the current service. -export const SERVICE_NAME = env.VITE_SERVICE_NAME ?? "replace-me" - -// If the current service the root service. This will only be true for portal. -export const SERVICE_IS_ROOT = Boolean(Number(env.VITE_SERVICE_IS_ROOT ?? "0")) - -// The protocol, domain and port of the current service. -export const SERVICE_PROTOCOL = env.VITE_SERVICE_PROTOCOL ?? "http" -export const SERVICE_DOMAIN = env.VITE_SERVICE_DOMAIN ?? "localhost" -export const SERVICE_PORT = Number(env.VITE_SERVICE_PORT ?? "8000") - -// The base url of the current service. -// The root service does not need its name included in the base url. -export const SERVICE_BASE_URL = - `${SERVICE_PROTOCOL}://${SERVICE_DOMAIN}:${SERVICE_PORT}` + - (SERVICE_IS_ROOT ? "" : `/${SERVICE_NAME}`) +export const SERVICE_NAME = env.VITE_SERVICE_NAME ?? "REPLACE_ME" // The api url of the current service. -export const SERVICE_API_URL = `${SERVICE_BASE_URL}/api` +export const SERVICE_API_URL = + env.VITE_SERVICE_API_URL ?? "http://localhost:8000" // The names of cookies. export const CSRF_COOKIE_NAME = `${SERVICE_NAME}_csrftoken` From 262478688cfdc131a633236dfaaf7d2b9104d135 Mon Sep 17 00:00:00 2001 From: cfl-bot Date: Mon, 9 Dec 2024 11:57:48 +0000 Subject: [PATCH 2/2] chore(release): 2.5.2 [skip ci] ## [2.5.2](https://github.com/ocadotechnology/codeforlife-package-javascript/compare/v2.5.1...v2.5.2) (2024-12-09) ### Bug Fixes * default settings ([#69](https://github.com/ocadotechnology/codeforlife-package-javascript/issues/69)) ([750a4cc](https://github.com/ocadotechnology/codeforlife-package-javascript/commit/750a4cc26cda06b9a5f97fc8d1371225ed2af32d)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7e90e6..6bb8cf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.5.2](https://github.com/ocadotechnology/codeforlife-package-javascript/compare/v2.5.1...v2.5.2) (2024-12-09) + + +### Bug Fixes + +* default settings ([#69](https://github.com/ocadotechnology/codeforlife-package-javascript/issues/69)) ([750a4cc](https://github.com/ocadotechnology/codeforlife-package-javascript/commit/750a4cc26cda06b9a5f97fc8d1371225ed2af32d)) + ## [2.5.1](https://github.com/ocadotechnology/codeforlife-package-javascript/compare/v2.5.0...v2.5.1) (2024-11-20) diff --git a/package.json b/package.json index 3ab937c..7c36eda 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "name": "codeforlife", "description": "Common frontend code", "private": true, - "version": "2.5.1", + "version": "2.5.2", "type": "module", "scripts": { "dev": "vite",