Skip to content

Commit

Permalink
chore: Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Dec 19, 2024
1 parent d487510 commit 466f969
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
$: breadcrumbObject.set(data.data);
const riskAnalysisCreated: boolean = data.data.risk_assessments.length > 0;
const dummydata = {
const workshopsData = {
ws1: [
{
title: safeTranslate(m.ebiosWs1_1()),
Expand Down Expand Up @@ -152,40 +150,20 @@
<div
class="card bg-white shadow-lg w-full h-full grid xl:grid-cols-3 lg:grid-cols-2 md:grid-cols-1 gap-8 p-8"
>
<Tile
workshop={1}
title={m.ebiosWs1()}
accent_color="bg-pink-600"
status="to_do"
meta={dummydata.ws1}
/>
<Tile workshop={1} title={m.ebiosWs1()} accent_color="bg-pink-600" meta={workshopsData.ws1} />
<Tile
workshop={2}
title={m.ebiosWs2()}
accent_color="bg-fuchsia-900"
status="to_do"
meta={dummydata.ws2}
/>
<Tile
workshop={3}
title={m.ebiosWs3()}
accent_color="bg-teal-500"
status="to_do"
meta={dummydata.ws3}
/>
<Tile
workshop={4}
title={m.ebiosWs4()}
accent_color="bg-yellow-600"
status="to_do"
meta={dummydata.ws4}
meta={workshopsData.ws2}
/>
<Tile workshop={3} title={m.ebiosWs3()} accent_color="bg-teal-500" meta={workshopsData.ws3} />
<Tile workshop={4} title={m.ebiosWs4()} accent_color="bg-yellow-600" meta={workshopsData.ws4} />
<Tile
workshop={5}
title={m.ebiosWs5()}
accent_color="bg-red-500"
status="to_do"
meta={dummydata.ws5}
meta={workshopsData.ws5}
createRiskAnalysis={true}
>
<div slot="addRiskAnalysis">
Expand All @@ -200,6 +178,6 @@
</button>
</div>
</Tile>
<Tile title={m.summary()} accent_color="bg-purple-800" status="to_do" />
<Tile title={m.summary()} accent_color="bg-purple-800" />
</div>
</div>
36 changes: 18 additions & 18 deletions frontend/src/routes/(app)/(internal)/ebios-rm/[id=uuid]/Tile.svelte
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
<script lang="ts">
import * as m from '$paraglide/messages';
import { safeTranslate } from '$lib/utils/i18n';
import { popup, type PopupSettings } from '@skeletonlabs/skeleton';
import { enhance } from '$app/forms';
import { page } from '$app/stores';
import { applyAction, enhance } from '$app/forms';
import { invalidateAll } from '$app/navigation';
import { safeTranslate } from '$lib/utils/i18n';
import * as m from '$paraglide/messages';
import { popup } from '@skeletonlabs/skeleton';
export let title = 'activity';
export let status = '';
export let meta = null;
export let meta: Record<string, any>[] = [];
export let accent_color = '';
export let createRiskAnalysis = false;
export let workshop: number;
export let workshop: number = 0;
$: workshopStatus = meta.every((step) => step.status === 'done')
? 'done'
: meta.some((step) => step.status === 'done')
? 'in_progress'
: 'to_do';
</script>

<div class="p-5 {accent_color}">
<div class="rounded-lg bg-white p-4 flex flex-col justify-between h-full">
<div class="flex justify-between mb-2">
<div class="font-semibold">{title}</div>
<div class="text-xl" title={safeTranslate(status)}>
{#if status == 'to_do'}
<div class="text-xl" title={safeTranslate(workshopStatus)}>
{#if workshopStatus == 'to_do'}
<i class="fa-solid fa-exclamation"></i>
{:else if status == 'in_progress'}
{:else if workshopStatus == 'in_progress'}
<i class="fa-solid fa-spinner"></i>
{:else if status == 'done'}
{:else if workshopStatus == 'done'}
<i class="fa-solid fa-check"></i>
{/if}
</div>
Expand Down Expand Up @@ -83,14 +87,10 @@
<input type="hidden" name="step" value={i + 1} />
{#if step.status === 'done'}
<input type="hidden" name="status" value="in_progress" />
<button type="submit" class="btn bg-initial"
>{m.markAsInProgress()} {workshop} {i + 1}</button
>
<button type="submit" class="btn bg-initial">{m.markAsInProgress()}</button>
{:else}
<input type="hidden" name="status" value="done" />
<button type="submit" class="btn bg-initial"
>{m.markAsDone()} {workshop} {i + 1}</button
>
<button type="submit" class="btn bg-initial">{m.markAsDone()}</button>
{/if}
</form>
</div>
Expand Down

0 comments on commit 466f969

Please sign in to comment.