Skip to content
Snippets Groups Projects

feat(project): deploy and project adjustments (MIN-304)

Merged mateusz-winiarczyk requested to merge MIN-304-deploy-and-project-adjustments into development
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 variable NEXT_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:

projectId

Build with config instead of envs:

Nagranie_z_ekranu_2024-03-22_o_20.03.53

Why removed fontLoaders from next.config.js:

Zrzut_ekranu_2024-03-21_o_23.47.56

Why added images: { unoptimized: true, }, in next.config.js:

Zrzut_ekranu_2024-03-21_o_23.50.07

Overview images:

overview-images

Closes MIN-304

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
public/config.js 0 → 100644
1 window.config = {
2 BASE_API_URL: 'https://lux1.atcomp.pl/minerva/api',
3 BASE_NEW_API_URL: 'https://lux1.atcomp.pl/minerva/new_api/',
4 BASE_MAP_IMAGES_URL: 'https://lux1.atcomp.pl/',
  • 1 import { getConfigValue, getProjectIdFromUrl } from './index.utils'; // Replace 'yourModuleName' with the correct path to your module
  • 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 || '',
  • LGTM

    RFC: Please add ability to set default project id with config file

  • Adrian Orłów approved this merge request

    approved this merge request

  • added 1 commit

    • 44d78216 - feat(project): move default project env to config file

    Compare with previous version

  • mateusz-winiarczyk added 14 commits

    added 14 commits

    Compare with previous version

  • mentioned in commit 40617a4a

  • Please register or sign in to reply
    Loading