Skip to content

Commit

Permalink
wip environnement refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
pelord committed Jan 25, 2024
1 parent 4849bcd commit 0ff726d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 47 deletions.
42 changes: 10 additions & 32 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,9 @@
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `.angular-cli.json`.
import { LanguageOptions } from '@igo2/core';
import {
Projection,
SearchSourceOptions,
CommonVectorStyleOptions
} from '@igo2/geo';
import { AppOptions } from './environnement.interface';
import { AppEnvironmentOptions } from './environnement.interface';

interface Environment {
production: boolean;
igo: {
app: AppOptions;
language?: LanguageOptions;
projections?: Projection[];
searchSources?: { [key: string]: SearchSourceOptions };
queryOverlayStyle?: {
base?: CommonVectorStyleOptions,
selection?: CommonVectorStyleOptions,
focus?: CommonVectorStyleOptions
};
searchOverlayStyle?: {
base?: CommonVectorStyleOptions,
selection?: CommonVectorStyleOptions,
focus?: CommonVectorStyleOptions
};
};
}

export const environment: Environment = {
export const environment: AppEnvironmentOptions = {
production: false,
igo: {
app: {
Expand Down Expand Up @@ -70,17 +44,19 @@ export const environment: Environment = {
enabled: false
},
nominatim: {
available: false
available: false,
enabled: false
},
storedqueries: {
enabled: false,
available: false
},
icherche: {
searchUrl: '/apis/icherche/',
searchUrl: 'https://geoegl.msp.gouv.qc.ca/apis/icherche',
order: 2,
params: {
limit: '5'
limit: '5',
type: 'adresses,lieux,bornes-km,sorties-autoroute',
},
settings: []
},
Expand All @@ -89,9 +65,11 @@ export const environment: Environment = {
icherchereverse: {
searchUrl: '/apis/terrapi',
order: 3,
enabled: true
available: false,
enabled: false
},
ilayer: {
available: false,
enabled: false,
searchUrl: '/apis/icherche/layers',
order: 4,
Expand Down
41 changes: 26 additions & 15 deletions src/environments/environnement.interface.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
export interface AppOptions {
forceCoordsNA: boolean;
install: {
enabled?: boolean;
promote?: boolean;
manifestPath?: string;
};
pwa?: {
enabled?: boolean;
path?: string
}
import { AllEnvironmentOptions } from '@igo2/integration';
import { EnvironmentOptions as IntegrationEnvironmentOptions } from '@igo2/integration';

import { MapOverlay } from 'src/app/pages/portal/map-overlay/map-overlay.interface';

export interface AppEnvironmentOptions extends IntegrationEnvironmentOptions {
igo: EnvironmentOptions;
}

export interface InteractiveTourConfigOptions {
tourInMobile: boolean;
pathToConfigFile: string
};
export interface EnvironmentOptions extends AllEnvironmentOptions {
header?: {
hasHeader?: boolean;
logo?: string;
logoPrint?: string;
};
hasFooter?: boolean;
hasMenu?: boolean;
title?: string;
theme?: string; enum?
description?: string;
mapOverlay?: MapOverlay[];
showRotationButtonIfNoRotation?: boolean;
hasFeatureEmphasisOnSelection?: boolean;
addFeaturetoLayer?: boolean;
customFeatureDetails?: string;
customFeatureTitle?: string;
queryOnlyOne?: boolean;
}

0 comments on commit 0ff726d

Please sign in to comment.