From 943c4ecee6179f74ba7623fea3b8f0a2b1a9e16e Mon Sep 17 00:00:00 2001 From: Juho Leinonen Date: Thu, 4 Jan 2024 12:46:26 +0200 Subject: [PATCH] =?UTF-8?q?AE-2040:=20Allow=20new=20k=C3=A4yt=C3=B6nvalvon?= =?UTF-8?q?ta=20toimenpidetypes=20in=20production?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/valvonta-kaytto/valvonta.svelte | 24 +++---------------- etp-front/src/utils/config-utils.js | 5 ---- 2 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 etp-front/src/utils/config-utils.js diff --git a/etp-front/src/pages/valvonta-kaytto/valvonta.svelte b/etp-front/src/pages/valvonta-kaytto/valvonta.svelte index 5544b5836..7b1b636a4 100644 --- a/etp-front/src/pages/valvonta-kaytto/valvonta.svelte +++ b/etp-front/src/pages/valvonta-kaytto/valvonta.svelte @@ -19,12 +19,8 @@ import Manager from './manager.svelte'; import Toimenpide from './toimenpide.svelte'; import Note from './note.svelte'; - import * as versionApi from '@Component/Version/version-api'; - import { isProduction } from '@Utility/config-utils'; import { announcementsForModule } from '@Utility/announce'; - const TOIMENPIDETYPES_ALLOWED_IN_PRODUCTION = [0, 1, 2, 3, 4, 5]; - const i18n = $_; const i18nRoot = 'valvonta.kaytto.valvonta'; const { announceError, announceSuccess } = @@ -48,22 +44,11 @@ overlay = false; }, R.chain( - ({ whoami, environment }) => + whoami => Future.parallelObject(7, { toimenpiteet: ValvontaApi.toimenpiteet(params.id), notes: ValvontaApi.notes(params.id), - toimenpidetyypit: R.when( - R.always(isProduction(environment)), - R.map( - R.filter( - R.propSatisfies( - R.includes(R.__, TOIMENPIDETYPES_ALLOWED_IN_PRODUCTION), - 'id' - ) - ) - ), - ValvontaApi.toimenpidetyypit - ), + toimenpidetyypit: ValvontaApi.toimenpidetyypit, templatesByType: ValvontaApi.templatesByType, roolit: ValvontaApi.roolit, toimitustavat: ValvontaApi.toimitustavat, @@ -77,10 +62,7 @@ johtaja: ValvontaApi.johtaja, whoami: Future.resolve(whoami) }), - Future.parallelObject(2, { - whoami: KayttajaApi.whoami, - environment: R.map(R.prop('environment'), versionApi.getConfig) - }) + KayttajaApi.whoami ) ); }; diff --git a/etp-front/src/utils/config-utils.js b/etp-front/src/utils/config-utils.js deleted file mode 100644 index b4e355968..000000000 --- a/etp-front/src/utils/config-utils.js +++ /dev/null @@ -1,5 +0,0 @@ -import * as R from 'ramda'; - -const PRODUCTION_ENV_NAME = 'prod'; - -export const isProduction = envName => R.equals(envName, PRODUCTION_ENV_NAME);