Skip to content

Commit 3f4b959

Browse files
committed
🔀 Resolve merge conflicts for about page
2 parents f4023b4 + f5095d7 commit 3f4b959

File tree

104 files changed

+5377
-892
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+5377
-892
lines changed

.dockerignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
node_modules
2+
Dockerfile*
3+
docker-compose*
4+
.dockerignore
5+
.git
6+
.gitignore
7+
README.md
8+
LICENSE
9+
.vscode
10+
Makefile
11+
helm-charts
12+
.env
13+
.editorconfig
14+
.idea
15+
coverage*
16+
17+
# Nuxt dev/build outputs
18+
.output
19+
.data
20+
.nuxt
21+
.nitro
22+
.cache
23+
dist

.gitlab-ci.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
variables:
2+
GIT_SUBMODULE_STRATEGY: recursive
3+
DOCKER_IMAGE: 'docker:latest'
4+
FOLDER_TO_BUILD: '.'
5+
6+
stages:
7+
- trigger
8+
- build
9+
- docker-push
10+
11+
trigger-pipeline:
12+
stage: trigger
13+
script:
14+
- echo "Manual trigger to start the pipeline."
15+
when: manual
16+
17+
.docker-stage:
18+
image: $DOCKER_IMAGE
19+
services:
20+
- docker:dind
21+
before_script:
22+
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
23+
24+
docker-build:
25+
extends: .docker-stage
26+
stage: build
27+
before_script:
28+
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
29+
script:
30+
- docker pull "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" || true
31+
- docker pull "$CI_REGISTRY_IMAGE:latest" || true
32+
- docker build --pull --cache-from "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" --cache-from "$CI_REGISTRY_IMAGE:latest" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" "$FOLDER_TO_BUILD"
33+
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
34+
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
35+
when: on_success
36+
37+
docker-push-latest:
38+
extends: .docker-stage
39+
stage: docker-push
40+
script:
41+
- docker pull "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
42+
- docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" "$CI_REGISTRY_IMAGE:latest"
43+
- docker push "$CI_REGISTRY_IMAGE:latest"
44+
rules:
45+
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
46+
when: on_success

Dockerfile

+30-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
1-
FROM node:22-alpine3.19
1+
# use the official Bun image
2+
# see all versions at https://hub.docker.com/r/oven/bun/tags
3+
FROM oven/bun:1 AS base
4+
WORKDIR /usr/src/app
25

3-
WORKDIR /app
6+
# install dependencies into temp directory
7+
# this will cache them and speed up future builds
8+
FROM base AS install
9+
RUN mkdir -p /temp/dev
10+
COPY package.json bun.lockb /temp/dev/
11+
RUN cd /temp/dev && bun install --frozen-lockfile
412

5-
COPY package*.json ./
6-
7-
RUN yarn install
13+
# install with --production (exclude devDependencies)
14+
RUN mkdir -p /temp/prod
15+
COPY package.json bun.lockb /temp/prod/
16+
RUN cd /temp/prod && bun install --frozen-lockfile --production
817

18+
# copy node_modules from temp directory
19+
# then copy all (non-ignored) project files into the image
20+
FROM base AS prerelease
21+
COPY --from=install /temp/dev/node_modules node_modules
922
COPY . .
1023

11-
EXPOSE 3000
24+
# [optional] tests & build
25+
ENV NODE_ENV=production
26+
RUN bun test
27+
RUN bun run build
28+
29+
# copy production dependencies and source code into final image
30+
FROM base AS release
31+
COPY --from=prerelease /usr/src/app/.output .
1232

13-
RUN yarn run build
14-
CMD [ "yarn", "run", "start" ]
33+
# run the app
34+
USER bun
35+
EXPOSE 3000/tcp
36+
ENTRYPOINT [ "bun", "run", "./server/index.mjs" ]

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ bun run preview
3333
```
3434

3535
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
36+
37+
- ne pas mettre de tabs dans les codes, mais des espaces

bun.lockb

1.36 KB
Binary file not shown.

components/Navbar.vue

+35-6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
const studentData = useStudentDataStore();
1313
const { section } = storeToRefs(studentData);
1414
15+
const isLoadingNextExercise = ref(false);
16+
const isLoadingPreviousExercise = ref(false);
17+
1518
const colorMode = useColorMode();
1619
const isDarkMode = computed(() => colorMode.value === 'dark');
1720
function switchColorMode() {
@@ -76,12 +79,25 @@
7679
<Tooltip>
7780
<TooltipTrigger>
7881
<Button
79-
@click="navigateTo(previousExerciseUrl)"
80-
:disabled="!previousExerciseUrl"
82+
@click="
83+
() => {
84+
isLoadingPreviousExercise = true;
85+
navigateTo(previousExerciseUrl);
86+
}
87+
"
88+
:disabled="
89+
!previousExerciseUrl ||
90+
isLoadingPreviousExercise ||
91+
isLoadingNextExercise
92+
"
8193
variant="outline"
8294
size="icon"
8395
>
84-
<LucideChevronLeft class="w-4 h-4" />
96+
<LucideLoaderCircle
97+
v-if="isLoadingPreviousExercise"
98+
class="w-4 h-4 animate-spin"
99+
/>
100+
<LucideChevronLeft v-else class="w-4 h-4" />
85101
</Button>
86102
</TooltipTrigger>
87103
<TooltipContent>
@@ -111,12 +127,25 @@
111127

112128
<Button
113129
v-if="isPlayground"
114-
@click="navigateTo(nextExerciseUrl)"
115-
:disabled="!nextExerciseUrl"
130+
@click="
131+
() => {
132+
isLoadingNextExercise = true;
133+
navigateTo(nextExerciseUrl);
134+
}
135+
"
136+
:disabled="
137+
!nextExerciseUrl ||
138+
isLoadingPreviousExercise ||
139+
isLoadingNextExercise
140+
"
116141
variant="default"
117142
size="default"
118143
>
119-
<LucideChevronRight class="w-4 h-4 mr-1" />
144+
<LucideLoaderCircle
145+
v-if="isLoadingNextExercise"
146+
class="w-4 h-4 mr-1 animate-spin"
147+
/>
148+
<LucideChevronRight v-else class="w-4 h-4 mr-1" />
120149
{{ nextExerciseUrl ? 'Exercice suivant' : 'Aucun exercice suivant' }}
121150
</Button>
122151

components/on-boarding/SectionDialog.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
<LucideSwatchBook class="ml-2 h-5 w-5" />
2525
</AlertDialogTitle>
2626
<AlertDialogDescription>
27-
Voluptate reprehenderit aute ullamco culpa consectetur laboris
28-
voluptate ea proident ut. Reprehenderit occaecat dolore qui ad enim
29-
dolor.
27+
Bienvenue sur le site web de programmation de Students 4 Students !
28+
Chaque section apprend un langage de programmation différent, veuillez
29+
choisir celle dans laquelle vous êtes inscrits en BA1 ou CMS.
3030
</AlertDialogDescription>
3131
</AlertDialogHeader>
3232
<AlertDialogFooter>

components/playground/ExerciseView.vue

+16-26
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,22 @@
1414
<template>
1515
<div class="h-full bg-accent">
1616
<ContentRenderer :value="props.exerciseData">
17-
<ScrollAreaRoot class="h-full px-4">
18-
<ScrollAreaViewport
19-
class="h-full w-full [&>div]:!flex [&>div]:flex-col [&>div]:justify-between [&>div]:h-full"
20-
>
21-
<ContentRendererMarkdown
22-
:value="props.exerciseData"
23-
class="py-4 prose font-main text-justify prose-headings:text-left dark:prose-invert text-neutral-700 dark:text-neutral-200 prose-img:w-full prose-img:border prose-img:rounded-md prose-img:first:mt-0 prose-pre:bg-background prose-pre:border prose-pre:p-4 lg:prose-lg prose-code:font-code prose-code:after:content-[''] prose-code:before:content-[''] prose-h2:after:mt-2 prose-h2:font-[750] prose-h2:first:mt-0 prose-h2:after:content-[''] prose-h2:after:w-full prose-h2:after:h-0.5 prose-h2:after:block prose-h2:after:bg-primary/50 prose-h3:after:mt-1 prose-h3:after:content-[''] prose-h3:after:w-full prose-h3:after:h-0.5 prose-h3:after:block prose-h3:after:bg-primary/35 prose-a:prose-headings:font-[610] prose-a:prose-headings:pointer-events-none prose-a:prose-headings:cursor-default prose-a:prose-headings:no-underline prose-a:prose-headings:text-neutral-950 prose-a:prose-headings:dark:text-neutral-100 prose-a:font-[570] prose-a:underline-offset-[3px] prose-a:text-primary prose-strong:font-semibold prose-strong:dark:font-bold prose-strong:dark:text-[0.99em] prose-code:prose-p:bg-background prose-code:prose-p:dark:border-slate-400/25 prose-code:prose-p:break-keep prose-code:prose-p:border prose-code:prose-p:rounded prose-code:prose-p:px-2 prose-code:prose-p:m-0.5 prose-code:prose-p:inline-block prose-blockquote:border-slate-300/50 prose-ul:mt-0"
24-
/>
25-
<div class="flex gap-2 [&>*]:w-full pb-4">
26-
<Button @click="navigateTo('/about')" variant="outline" size="lg">
27-
<LucideUsers class="h-4 mr-1" />
28-
À propos
29-
</Button>
30-
<PlaygroundDialogNeedHelp>
31-
<template #trigger>
32-
<Button variant="outline" size="lg">
33-
<LucideCircleHelp class="h-4 mr-1" />
34-
J'ai besoin d'aide
35-
</Button>
36-
</template>
37-
</PlaygroundDialogNeedHelp>
38-
</div>
39-
</ScrollAreaViewport>
40-
<ScrollBar />
41-
<ScrollAreaCorner />
42-
</ScrollAreaRoot>
17+
<ScrollArea class="h-full px-4">
18+
<ContentRendererMarkdown
19+
:value="props.exerciseData"
20+
class="py-4 pb-0 prose font-main text-justify prose-headings:text-left dark:prose-invert text-neutral-700 dark:text-neutral-200 prose-img:w-full prose-img:border prose-img:rounded-md prose-img:first:mt-0 prose-pre:bg-background prose-pre:border prose-pre:p-4 lg:prose-lg prose-code:font-code prose-code:after:content-[''] prose-code:before:content-[''] prose-h2:after:mt-2 prose-h2:font-[750] prose-h2:first:mt-0 prose-h2:after:content-[''] prose-h2:after:w-full prose-h2:after:h-0.5 prose-h2:after:block prose-h2:after:bg-primary/50 prose-h3:after:mt-1 prose-h3:after:content-[''] prose-h3:after:w-full prose-h3:after:h-0.5 prose-h3:after:block prose-h3:after:bg-primary/35 prose-a:prose-headings:font-[610] prose-a:prose-headings:pointer-events-none prose-a:prose-headings:cursor-default prose-a:prose-headings:no-underline prose-a:prose-headings:text-neutral-950 prose-a:prose-headings:dark:text-neutral-100 prose-a:font-[570] prose-a:underline-offset-[3px] prose-a:text-primary prose-strong:font-semibold prose-strong:dark:font-bold prose-strong:dark:text-[0.99em] prose-code:prose-p:bg-background prose-code:prose-p:dark:border-slate-400/25 prose-code:prose-p:break-keep prose-code:prose-p:border prose-code:prose-p:rounded prose-code:prose-p:px-2 prose-code:prose-p:m-0.5 prose-code:prose-p:inline-block prose-blockquote:border-slate-300/50 prose-ul:mt-0"
21+
/>
22+
<div class="flex gap-2 [&>*]:w-full mb-4">
23+
<Button variant="outline" size="lg">
24+
<LucideCircleHelp class="h-4 mr-1" />
25+
J'ai besoin d'aide
26+
</Button>
27+
<Button variant="outline" size="lg">
28+
<LucideUsers class="h-4 mr-1" />
29+
À propos
30+
</Button>
31+
</div>
32+
</ScrollArea>
4333
<template #empty>
4434
<div class="flex h-full items-center justify-center">
4535
<div class="flex flex-col space-y-4 items-center justify-center">

components/playground/dialog/CorrectedCodeWarning.vue

+24-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
1+
<script setup lang="ts">
2+
const props = defineProps<{
3+
onlyKeepTrigger?: boolean;
4+
}>();
5+
6+
const emit = defineEmits<{
7+
(e: 'acknowledgeWarning'): void;
8+
}>();
9+
</script>
10+
111
<template>
2-
<Dialog>
12+
<slot v-if="props.onlyKeepTrigger" name="trigger" />
13+
<Dialog v-bind="$attrs" v-else>
14+
<DialogTrigger as-child>
15+
<slot name="trigger" />
16+
</DialogTrigger>
317
<DialogContent>
418
<DialogHeader>
519
<DialogTitle>Attention</DialogTitle>
620
<DialogDescription>
7-
Laboris commodo cillum est laborum nulla do nulla eu velit. Eu ullamco
8-
nostrud ex adipisicing duis ad cupidatat. Consectetur ex esse occaecat
9-
pariatur.
21+
Avez-vous déjà passé du temps à chercher la solution par vous-même ?
22+
Passer du temps à chercher maintenant auprès d'assistants est le plus
23+
productif pour vous !
1024
</DialogDescription>
1125
</DialogHeader>
1226

1327
<DialogFooter>
14-
<Button size="default">Oui</Button>
15-
<Button size="default" variant="outline">
16-
Non, je souhaite continuer à chercher
17-
</Button>
28+
<Button @click="emit('acknowledgeWarning')" size="default">Oui</Button>
29+
<DialogClose as-child>
30+
<Button size="default" variant="outline">
31+
Non, je souhaite continuer à chercher
32+
</Button>
33+
</DialogClose>
1834
</DialogFooter>
1935
</DialogContent>
2036
</Dialog>

components/playground/dialog/ExerciseCompletion.vue

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
/>
1616
<DialogTitle>Exercice réussi !</DialogTitle>
1717
<DialogDescription>
18-
Laboris commodo cillum est laborum nulla do nulla eu velit. Eu ullamco
19-
nostrud ex adipisicing duis ad cupidatat. Consectetur ex esse occaecat
20-
pariatur.
18+
Bravo ! Votre code fonctionne exactement comme demandé.
2119
</DialogDescription>
2220
</DialogHeader>
2321

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<template>
2+
<PlaygroundEditorSkeleton v-if="!hasEditorLoaded && displayLoader" />
3+
<DelayHydration>
4+
<LazyPlaygroundEditorWrapper
5+
@update:load="hasEditorLoaded = true"
6+
v-bind="$props"
7+
v-model="writtenCode"
8+
/>
9+
</DelayHydration>
10+
</template>
11+
12+
<script lang="ts" setup>
13+
import type { EditorProps, EditorEmits } from '.';
14+
15+
defineProps<EditorProps>();
16+
defineEmits<EditorEmits>();
17+
18+
const displayLoader = ref(false);
19+
const hasEditorLoaded = ref(false);
20+
const writtenCode = defineModel<string>();
21+
22+
onMounted(() => {
23+
setTimeout(() => {
24+
displayLoader.value = true;
25+
}, 1000);
26+
});
27+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<script setup lang="ts">
2+
// The width of each skeleton element in percentage
3+
const skeletonSizes = [30, 55, 40, 0, 25, 40, 35, 30, 20, 15, 0, 50, 35, 40];
4+
</script>
5+
6+
<template>
7+
<div class="w-full space-y-2 p-4">
8+
<p class="font-medium mb-4 text-muted-foreground">
9+
Chargement de l'éditeur en cours... Cela peut prendre un moment.
10+
</p>
11+
<Skeleton
12+
v-for="width in skeletonSizes"
13+
:style="`width: ${width}%`"
14+
:class="`h-5`"
15+
/>
16+
</div>
17+
</template>

0 commit comments

Comments
 (0)