Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AE-2040: Allow new käytönvalvonta toimenpidetypes in production #30

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 3 additions & 21 deletions etp-front/src/pages/valvonta-kaytto/valvonta.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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 } =
Expand All @@ -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,
Expand All @@ -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
)
);
};
Expand Down
5 changes: 0 additions & 5 deletions etp-front/src/utils/config-utils.js

This file was deleted.