diff --git a/frontend/messages/en.json b/frontend/messages/en.json index c5daff25f..b1eab95e4 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -982,9 +982,6 @@ "currentCriticality": "Current criticality", "residualCriticality": "Residual criticality", "notSelected": "Not selected", - "identifyRoTo": "Identify RO/TO", - "evaluateRoTo": "Evaluate RO/TO", - "selectRoTo": "Select RO/TO", "resetPasswordHere": "You can reset your password here.", "resetPassword": "Reset password", "ebiosRm": "Ebios RM", @@ -998,6 +995,5 @@ "operarionalScenario": "Operational scenario", "addOperationalScenario": "Add operational scenario", "workshopFour": "Workshop 4", - "notSelected": "Not selected", "noThreat": "No threat" } diff --git a/frontend/src/lib/utils/crud.ts b/frontend/src/lib/utils/crud.ts index 75eed15e3..a6ed45334 100644 --- a/frontend/src/lib/utils/crud.ts +++ b/frontend/src/lib/utils/crud.ts @@ -692,7 +692,7 @@ export const URL_MODEL_MAP: ModelMap = { foreignKeyFields: [ { field: 'ebios_rm_study', urlModel: 'ebios-rm' }, { field: 'threats', urlModel: 'threats' }, - { field: 'attack_paths', urlModel: 'attack-paths', endpointUrl: 'ebios-rm/attack-paths', urlParams: 'ebios_rm_studies=', detail: true }, + { field: 'attack_paths', urlModel: 'attack-paths', endpointUrl: 'ebios-rm/attack-paths', urlParams: 'ebios_rm_study=', detail: true }, ], selectFields: [{ field: 'likelihood', valueType: 'number', detail: true }] } diff --git a/frontend/src/routes/(app)/(internal)/[model=urlmodel]/[id=uuid]/edit/+layout.server.ts b/frontend/src/routes/(app)/(internal)/[model=urlmodel]/[id=uuid]/edit/+layout.server.ts index 10341dc6a..1b0c7b45a 100644 --- a/frontend/src/routes/(app)/(internal)/[model=urlmodel]/[id=uuid]/edit/+layout.server.ts +++ b/frontend/src/routes/(app)/(internal)/[model=urlmodel]/[id=uuid]/edit/+layout.server.ts @@ -52,8 +52,8 @@ export const load: LayoutServerLoad = async (event) => { let url = keyModel.endpointUrl ? `${BASE_API_URL}/${keyModel.endpointUrl}/${queryParams}` : `${BASE_API_URL}/${keyModel.urlModel}/${queryParams}`; - if (keyModel.urlModel === 'assets' && event.params.model === 'feared-events') { - url = `${BASE_API_URL}/${keyModel.urlModel}/${queryParams}${object.ebios_rm_study}`; + if (['assets', 'attack-paths'].includes(keyModel.urlModel) && ['feared-events', 'operational-scenarios'].includes(event.params.model)) { + url = `${BASE_API_URL}/${keyModel.endpointUrl || keyModel.urlModel}/${queryParams}${object.ebios_rm_study}`; } const response = await event.fetch(url); if (response.ok) { diff --git a/frontend/src/routes/(app)/(internal)/ebios-rm/[id=uuid]/workshop-four/operational-scenario/+page.server.ts b/frontend/src/routes/(app)/(internal)/ebios-rm/[id=uuid]/workshop-four/operational-scenario/+page.server.ts index 62a12af03..f5d61cb84 100644 --- a/frontend/src/routes/(app)/(internal)/ebios-rm/[id=uuid]/workshop-four/operational-scenario/+page.server.ts +++ b/frontend/src/routes/(app)/(internal)/ebios-rm/[id=uuid]/workshop-four/operational-scenario/+page.server.ts @@ -36,7 +36,7 @@ export const load: PageServerLoad = async ({ params, fetch }) => { for (const keyField of foreignKeyFields) { const keyModel = getModelInfo(keyField.urlModel); - const queryParams = keyField.urlParams ? `?${keyField.urlParams}` : ''; + const queryParams = keyField.urlParams ? `?${keyField.urlParams}${keyField.detail ? params.id : ''}` : ''; const url = keyModel.endpointUrl ? `${BASE_API_URL}/${keyModel.endpointUrl}/${queryParams}` : `${BASE_API_URL}/${keyModel.urlModel}/${queryParams}`; diff --git a/frontend/src/routes/(app)/(internal)/operational-scenarios/[id=uuid]/+page.svelte b/frontend/src/routes/(app)/(internal)/operational-scenarios/[id=uuid]/+page.svelte index 2e880bd45..a7c0f724c 100644 --- a/frontend/src/routes/(app)/(internal)/operational-scenarios/[id=uuid]/+page.svelte +++ b/frontend/src/routes/(app)/(internal)/operational-scenarios/[id=uuid]/+page.svelte @@ -47,7 +47,7 @@
{#if operationalScenario.is_selected} diff --git a/frontend/src/routes/(app)/(internal)/ro-to/[id=uuid]/+page.svelte b/frontend/src/routes/(app)/(internal)/ro-to/[id=uuid]/+page.svelte index 6305659e3..f3418afcc 100644 --- a/frontend/src/routes/(app)/(internal)/ro-to/[id=uuid]/+page.svelte +++ b/frontend/src/routes/(app)/(internal)/ro-to/[id=uuid]/+page.svelte @@ -49,7 +49,7 @@
@@ -84,7 +84,7 @@
@@ -127,7 +127,7 @@ ? 'text-primary-500' : 'text-gray-500'}" > - {m.selectRoTo()} + {m.ebiosWs2_3()}
{#if roto.is_selected}