Skip to content

Commit

Permalink
Merge pull request #841 from intuitem/fix/scenario-control-tags
Browse files Browse the repository at this point in the history
fix: add tags in applied control list inside scenarios page
  • Loading branch information
nas-tabchiche authored Sep 19, 2024
2 parents 915c43d + cff22a2 commit 3d62228
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const load = (async ({ fetch, params }) => {
if (response.ok) {
const data = await response.json().then((data) => data.results);

const metaData = tableSourceMapper(data, ['id']);
const metaData = tableSourceMapper(data, ['id', 'status']);

const bodyData = tableSourceMapper(data, listViewFields[key].body);

Expand Down
20 changes: 12 additions & 8 deletions frontend/src/routes/(app)/risk-scenarios/[id=uuid]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@
<ModelTable source={data.tables['assets']} hideFilters={true} URLModel="assets" />
</div>
</div>
<div class="flex flex-row space-x-4 card px-4 py-2 bg-white shadow-lg">
<div class="flex flex-col w-1/2">
<div class="flex flex-row space-x-4 card px-4 py-2 bg-white shadow-lg justify-between">
<div class="flex flex-col w-fit">
<h4 class="h4 font-semibold">{m.currentRisk()}</h4>
<p class="text-sm font-semibold text-gray-400">{m.existingControls()}</p>
{#if data.scenario.existing_controls}
Expand All @@ -127,7 +127,7 @@
<p class="text-gray-400 italic text-sm">{m.noExistingControls()}</p>
{/if}
</div>
<div class="flex flex-row space-x-4 my-auto items-center justify-center w-1/2 h-full">
<div class="flex flex-row space-x-4 my-auto items-center justify-center w-fit h-full">
<p class="flex flex-col">
<span class="text-sm font-semibold text-gray-400">{m.probability()}</span>
<span
Expand Down Expand Up @@ -157,7 +157,9 @@
</p>
<i class="fa-solid fa-equals mt-5" />
<p class="flex flex-col">
<span class="text-sm font-semibold text-gray-400">{m.currentRiskLevel()}</span>
<span class="text-sm font-semibold text-gray-400 whitespace-nowrap"
>{m.currentRiskLevel()}</span
>
<span
class="text-sm text-center font-semibold p-2 rounded-md w-20 {classesCellText(
data.scenario.current_level.hexcolor
Expand All @@ -173,8 +175,8 @@
</p>
</div>
</div>
<div class="flex flex-row space-x-4 card px-4 py-2 bg-white shadow-lg">
<div class="flex flex-col w-1/2">
<div class="flex flex-row space-x-4 card px-4 py-2 bg-white shadow-lg justify-between">
<div class="flex flex-col w-fit">
<h4 class="h4 font-semibold">{m.residualRisk()}</h4>
<p class="text-sm font-semibold text-gray-400">{m.appliedControls()}</p>
<ModelTable
Expand All @@ -183,7 +185,7 @@
URLModel="applied-controls"
/>
</div>
<div class="flex flex-row space-x-4 my-auto items-center justify-center w-1/2">
<div class="flex flex-row space-x-4 my-auto items-center justify-center w-fit">
<p class="flex flex-col">
<span class="text-sm font-semibold text-gray-400">{m.probability()}</span>
<span
Expand Down Expand Up @@ -213,7 +215,9 @@
</p>
<i class="fa-solid fa-equals mt-5" />
<p class="flex flex-col">
<span class="text-sm font-semibold text-gray-400">{m.residualRiskLevel()}</span>
<span class="text-sm font-semibold text-gray-400 whitespace-nowrap"
>{m.residualRiskLevel()}</span
>
<span
class="text-sm text-center font-semibold p-2 rounded-md w-20 {classesCellText(
data.scenario.residual_level.hexcolor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const load: PageServerLoad = async ({ params, fetch }) => {
if (response.ok) {
const data = await response.json().then((data) => data.results);

const metaData = tableSourceMapper(data, ['id']);
const metaData = tableSourceMapper(data, ['id', 'status']);

const bodyData = tableSourceMapper(data, listViewFields[key].body);

Expand Down

0 comments on commit 3d62228

Please sign in to comment.