feat(project): deploy and project adjustments (MIN-304)
4 unresolved threads
4 unresolved threads
- Changing dynamic envs to a separate file
config.js
that is modifiable after build and export. - Changing the environment variable
NEXT_PUBLIC_PROJECT_ID
to a parameter in the URL named id, and adding a default ID defined in the environment variableNEXT_PUBLIC_DEFAULT_PROJECT_ID
. - The bug related to overview images has been fixed - in other projects, such as the one with the id covidmap_appu_test, the overview images from the backend were not an array but null, which caused an error preventing the project from functioning. I've added handling for null overview images and disabled the 'Browse overview images' button in such cases.
Project id url:
Build with config instead of envs:
Nagranie_z_ekranu_2024-03-22_o_20.03.53
Why removed fontLoaders
from next.config.js
:
Why added
images: { unoptimized: true, },
in next.config.js
:
Overview images:
Closes MIN-304
Merge request reports
Activity
Filter activity
assigned to @mateusz-winiarczyk
- public/config.js 0 → 100644
- src/constants/index.utils.test.ts 0 → 100644
1 import { getConfigValue, getProjectIdFromUrl } from './index.utils'; // Replace 'yourModuleName' with the correct path to your module changed this line in version 2 of the diff
- src/constants/index.utils.ts 0 → 100644
3 export const getConfigValue = (key: ConfigKeys): string => { 4 const defaultValue = ''; 5 if (typeof window !== 'undefined' && window.config && window.config[key]) { 6 return window.config[key]; 7 } 8 return defaultValue; 9 }; 10 11 export const getProjectIdFromUrl = (): string | null | undefined => { 12 if (typeof window !== 'undefined') { 13 const params = new URLSearchParams(window.location.search); 14 15 return params.get('id'); 16 } 17 18 return undefined; 1 1 /** @type {import('next').NextConfig} */ 2 2 const nextConfig = { 3 3 reactStrictMode: true, 4 experimental: { 5 fontLoaders: [{ loader: '@next/font/google', options: { subsets: ['latin'] } }], 4 output: 'export', 5 images: { 6 unoptimized: true, 6 7 }, 7 8 env: { 8 BASE_API_URL: process.env.NEXT_PUBLIC_BASE_API_URL || '', 9 BASE_MAP_IMAGES_URL: process.env.BASE_MAP_IMAGES_URL || '', 10 PROJECT_ID: process.env.NEXT_PUBLIC_PROJECT_ID || '', 11 9 ZOD_SEED: process.env.ZOD_SEED || 123, 10 DEFAULT_PROJECT_ID: process.env.NEXT_PUBLIC_DEFAULT_PROJECT_ID || '', changed this line in version 2 of the diff
added 1 commit
- 44d78216 - feat(project): move default project env to config file
added 14 commits
-
44d78216...3edc9180 - 13 commits from branch
development
- f8e35274 - Merge remote-tracking branch 'origin/development' into MIN-304-deploy-and-project-adjustments
-
44d78216...3edc9180 - 13 commits from branch
mentioned in commit 40617a4a
Please register or sign in to reply