Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
Fix date display + rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylrelo committed Sep 7, 2024
1 parent 168fac2 commit 2930ab2
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 33 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 42Tools/front/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="stylesheet" href="/app.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>42Tools</title>
<script type="module" crossorigin src="/assets/index-DV81uDoe.js"></script>
<script type="module" crossorigin src="/assets/index-kx_sTfF1.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BMknnGRc.css">
</head>

Expand Down
23 changes: 19 additions & 4 deletions 42Tools/front/src/lib/Pages/RNCP/RncpSearchAlternateView.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script lang="ts">
import type { CachedRncpProgress } from "@back/src/modules/rncp-progress/rncp-progress.entity";
import type { Users } from "@back/src/modules/users/users.entity";
import {
Avatar,
Badge,
Expand All @@ -11,12 +13,10 @@
TableHead,
TableHeadCell,
} from "flowbite-svelte";
import { formatDateDisplay, showTimeLeft } from "./utils";
import type { CachedRncpProgress } from "@back/src/modules/rncp-progress/rncp-progress.entity";
import { onMount } from "svelte";
import { httpGet, httpPatch } from "../../../services/http";
import { formatDateDisplay, showTimeLeft } from "./utils";
import type { RncpDefinition } from "@back/src/modules/rncp-definition/rncp-definition.entity";
import type { Users } from "@back/src/modules/users/users.entity";
//
Expand All @@ -33,6 +33,7 @@
onMount(async () => {
apprenticeshipRythm = await httpGet("/apprenticeship");
});
//
function getColor(percent: number) {
Expand All @@ -50,6 +51,20 @@
return "red";
}
function displayCorrectRncpName(rncpKey?: string) {
if (rncpKey == null) {
return "--";
}
const rncp = rncpDefinition.find((r) => r.rncpKey === rncpKey);
if (rncp == null) {
return "--";
}
return `${rncp.level} - ${rncp.option}`;
}
async function updateUserData(
student: Users,
event: Event,
Expand Down Expand Up @@ -158,7 +173,7 @@
size="sm"
/>
{:else}
{progress.user.apprenticeshipRncp ?? "--"}
{displayCorrectRncpName(progress.user.apprenticeshipRncp)}
{/if}
</TableBodyCell>

Expand Down

0 comments on commit 2930ab2

Please sign in to comment.