Skip to content

Commit c42c772

Browse files
jb-ccFelixTeutsch
andcommitted
feat(frontend): create progress thing and add search for admin (Scrum-313) (#206)
Co-authored-by: FelixTeutsch <felix@teutsch.it>
1 parent 07dcd15 commit c42c772

File tree

10 files changed

+671
-300
lines changed

10 files changed

+671
-300
lines changed

Frontend/components/ActionCard/ActionCard.vue

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,53 @@
22
import CustomButton from "../CustomButton/CustomButton.vue";
33
44
const props = defineProps({
5-
buttonText: {
6-
type: String,
7-
default: "Click Me",
8-
},
9-
cardType: {
10-
type: String,
11-
default: 'ghost',
12-
validator: (value) => !value || ["ghost", "primary"].includes(value),
13-
},
14-
headerText: {
15-
type: String,
16-
default: ''
17-
},
5+
buttonText: {
6+
type: String,
7+
default: "Click Me",
8+
},
9+
cardType: {
10+
type: String,
11+
default: 'ghost',
12+
validator: (value) => !value || ["ghost", "primary"].includes(value),
13+
},
14+
headerText: {
15+
type: String,
16+
default: ''
17+
},
1818
});
1919
2020
const emit = defineEmits(['actionButtonClicked']);
21+
2122
function emitActionEvent() {
2223
emit('actionButtonClicked');
2324
}
2425
</script>
2526

2627
<template>
27-
<div>
28-
<p v-if="props.headerText" class="mb-2 ml-4 text-lg font-bold">
29-
{{ props.headerText }}
30-
</p>
31-
<div class="card shadow-xl border border-base-300">
32-
<slot/>
33-
<!-- Action button at the bottom -->
34-
<div class="px-16 py-4 border-t border-base-300">
35-
<CustomButton
36-
v-if="props.cardType === 'ghost'"
37-
:text="props.buttonText"
38-
block
39-
color="default"
40-
variant="ghost"
41-
@click="emitActionEvent"
42-
/>
43-
<CustomButton
44-
v-else
45-
:text="props.buttonText"
46-
block
47-
color="primary"
48-
@click="emitActionEvent"
49-
/>
50-
</div>
51-
</div>
28+
<div>
29+
<p v-if="props.headerText" class="mb-2 ml-4 text-lg font-bold">
30+
{{ props.headerText }}
31+
</p>
32+
<div class="card shadow-xl border border-base-300">
33+
<slot/>
34+
<!-- Action button at the bottom -->
35+
<div class="px-8 py-4 border-t border-base-300">
36+
<CustomButton
37+
v-if="props.cardType === 'ghost'"
38+
:text="props.buttonText"
39+
block
40+
color="default"
41+
variant="ghost"
42+
@click="emitActionEvent"
43+
/>
44+
<CustomButton
45+
v-else
46+
:text="props.buttonText"
47+
block
48+
color="primary"
49+
@click="emitActionEvent"
50+
/>
51+
</div>
5252
</div>
53+
</div>
5354
</template>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<script lang="ts" setup>
2+
3+
interface ProgressProps {
4+
progress: number;
5+
text: string;
6+
}
7+
8+
const props = defineProps<ProgressProps>();
9+
10+
</script>
11+
12+
<template>
13+
<div class="w-full h-fit flex flex-row p-6 gap-6 items-center border-b border-b-base-300">
14+
<div>
15+
<div
16+
:style="'--value:'+props.progress+';'" aria-valuenow="70"
17+
class="radial-progress bg-success text-success-content border-success border-4"
18+
role="progressbar"
19+
>
20+
{{ props.progress }}%
21+
</div>
22+
</div>
23+
<p class="text-body opacity-75">
24+
{{ props.text }}
25+
</p>
26+
</div>
27+
</template>
28+
29+
<style scoped>
30+
31+
</style>

Frontend/components/SupervisorCard/SupervisorCard.vue

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ const props = defineProps({
1919
},
2020
image: {
2121
type: String,
22-
required: true,
22+
required: false,
23+
default: '',
2324
},
2425
firstName: {
2526
type: String,
@@ -57,11 +58,11 @@ const props = defineProps({
5758
type: Number,
5859
default: 0,
5960
},
60-
dontShowStatistics: {
61+
dontShowStatistics: {
6162
type: Boolean,
6263
default: false,
6364
required: false,
64-
}
65+
}
6566
});
6667
6768
const limitedTags = computed(() =>
@@ -82,14 +83,6 @@ const cardSizeClasses = computed(() => ({
8283
'card-xl': props.fullWidth && props.size === 'xl',
8384
}));
8485
85-
const imageSizeClasses = computed(() => ({
86-
'size-8': props.size === 'xs',
87-
'size-10': props.size === 'sm',
88-
'size-12': props.size === 'md',
89-
'size-14': props.size === 'lg',
90-
'size-16': props.size === 'xl',
91-
}));
92-
9386
// Regular tag size based on card size
9487
const regularTagSize = computed(() => {
9588
switch (props.size) {
@@ -152,14 +145,13 @@ const descriptionClasses = computed(() => ({
152145
:class="cardSizeClasses" class="card bg-base-100 shadow-lg border border-base-300">
153146
<div class="card-body">
154147
<h2 class="card-title font-bold">
155-
<div class="mask mask-squircle">
156-
<img
157-
:alt="t('supervisorCard.profilePictureAlt',{firstName: props.firstName,lastName: props.lastName})"
158-
:class="imageSizeClasses"
159-
:src="props.image || getPlaceholderImage(props.firstName,props.lastName)"
160-
class="rounded-box"
161-
>
162-
</div>
148+
<Avatar
149+
:alt="t('supervisorCard.profilePictureAlt',{firstName: props.firstName,lastName: props.lastName})"
150+
:first-name="props.firstName"
151+
:last-name="props.lastName"
152+
:size="props.size"
153+
:src="props.image"
154+
/>
163155
<p class="text-large capitalize">
164156
{{ props.firstName }} {{ props.lastName }}
165157
</p>

Frontend/i18n/locales/de-DE.json

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@
1919
},
2020
"admin": {
2121
"availableSpots": "Verfügbare Plätze",
22+
"deleteUser": {
23+
"deleteButton": "Benutzer Löschen",
24+
"deleting": "Lösche...",
25+
"description": "Dies setzt das Benutzerkonto vollständig auf den nicht registrierten Zustand zurück, wobei die E-Mail-Adresse für eine erneute Registrierung erhalten bleibt.",
26+
"generalError": "Ein Fehler ist beim Zurücksetzen des Benutzers aufgetreten",
27+
"noUsersFound": "Keine Benutzer gefunden für",
28+
"permissionError": "Berechtigung verweigert - Admin-Benutzer können nicht zurückgesetzt werden",
29+
"searchInstruction": "Tippen Sie, um nach Benutzern zu suchen...",
30+
"searchPlaceholder": "Benutzer nach Name, E-Mail oder Rolle suchen...",
31+
"selectUserError": "Bitte wählen Sie einen Benutzer zum Löschen aus",
32+
"selectedUser": "Ausgewählter Benutzer:",
33+
"title": "Benutzer Löschen",
34+
"userNotFoundError": "Benutzer nicht gefunden"
35+
},
2236
"downloadDescription": "Laden Sie die bestätigten Betreuer-Studenten-Paare herunter",
2337
"downloadFileName": "lade confirmed_supervisions.csv herunter",
2438
"downloadTitle": "Bestätigte Betreuungen herunterladen",
@@ -30,21 +44,7 @@
3044
"uploadSupervisorsFileName": "wähle *.csv aus",
3145
"uploadTagsDescription": "Dies aktualisiert die Tags und die Ähnlichkeitswerte",
3246
"uploadTagsFileName": "wähle updated_tag_list.json aus",
33-
"waitingStudents": "warten derzeit auf die Genehmigung der Betreuung",
34-
"deleteUser": {
35-
"title": "Benutzer Löschen",
36-
"searchPlaceholder": "Benutzer nach Name, E-Mail oder Rolle suchen...",
37-
"selectedUser": "Ausgewählter Benutzer:",
38-
"noUsersFound": "Keine Benutzer gefunden für",
39-
"searchInstruction": "Tippen Sie, um nach Benutzern zu suchen...",
40-
"description": "Dies setzt das Benutzerkonto vollständig auf den nicht registrierten Zustand zurück, wobei die E-Mail-Adresse für eine erneute Registrierung erhalten bleibt.",
41-
"deleteButton": "Benutzer Löschen",
42-
"deleting": "Lösche...",
43-
"selectUserError": "Bitte wählen Sie einen Benutzer zum Löschen aus",
44-
"generalError": "Ein Fehler ist beim Zurücksetzen des Benutzers aufgetreten",
45-
"permissionError": "Berechtigung verweigert - Admin-Benutzer können nicht zurückgesetzt werden",
46-
"userNotFoundError": "Benutzer nicht gefunden"
47-
}
47+
"waitingStudents": "warten derzeit auf die Genehmigung der Betreuung"
4848
},
4949
"appHeader": {
5050
"addAdmin": "Admin Hinzufügen",
@@ -151,6 +151,10 @@
151151
"supervising": "Sie betreuen {firstName}"
152152
},
153153
"dashboard": {
154+
"progress": {
155+
"button": "Profil vervollständigen...",
156+
"text": "Dein Profil ist fast vollständig! Füge die letzten dinge hinzu für die beste SuperWise erfahrung!"
157+
},
154158
"student": {
155159
"downloadConfirmation": "Bestätigung herunterladen",
156160
"findSupervisor": "Finde jetzt deinen Betreuer!",
@@ -383,7 +387,8 @@
383387
},
384388
"noResults": "Keine Suchergebnisse...",
385389
"placeholderForStudents": "Betreuer suchen...",
386-
"placeholderForSupervisors": "Studenten suchen..."
390+
"placeholderForSupervisors": "Studenten suchen...",
391+
"placeholderForAdmins": "Benutzer suchen..."
387392
},
388393
"searchBar": {
389394
"noResults": "Keine Ergebnisse gefunden"
@@ -477,4 +482,4 @@
477482
"withdrawRequestFailed": "Fehler beim Zurückziehen der Betreuungsanfrage",
478483
"withdrawnRequest": "Sie haben die Betreuungsanfrage zurückgezogen"
479484
}
480-
}
485+
}

Frontend/i18n/locales/en-GB.json

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@
1919
},
2020
"admin": {
2121
"availableSpots": "Available spots",
22+
"deleteUser": {
23+
"deleteButton": "Delete User",
24+
"deleting": "Deleting...",
25+
"description": "This completely resets the user account to unregistered state while preserving email for re-registration.",
26+
"generalError": "An error occurred while resetting the user",
27+
"noUsersFound": "No users found matching",
28+
"permissionError": "Permission denied - cannot reset admin users",
29+
"searchInstruction": "Type to search for users...",
30+
"searchPlaceholder": "Search users by name, email, or role...",
31+
"selectUserError": "Please select a user to delete",
32+
"selectedUser": "Selected User:",
33+
"title": "Delete User",
34+
"userNotFoundError": "User not found"
35+
},
2236
"downloadDescription": "Download the confirmed Supervisor - Student pairs",
2337
"downloadFileName": "Download confirmed_supervisions.csv",
2438
"downloadTitle": "Download confirmed Supervisions",
@@ -30,21 +44,7 @@
3044
"uploadSupervisorsFileName": "select *.csv",
3145
"uploadTagsDescription": "This updates the tags and the similarity scores",
3246
"uploadTagsFileName": "select updated_tag_list.json",
33-
"waitingStudents": "are currently waiting for supervision approval",
34-
"deleteUser": {
35-
"title": "Delete User",
36-
"searchPlaceholder": "Search users by name, email, or role...",
37-
"selectedUser": "Selected User:",
38-
"noUsersFound": "No users found matching",
39-
"searchInstruction": "Type to search for users...",
40-
"description": "This completely resets the user account to unregistered state while preserving email for re-registration.",
41-
"deleteButton": "Delete User",
42-
"deleting": "Deleting...",
43-
"selectUserError": "Please select a user to delete",
44-
"generalError": "An error occurred while resetting the user",
45-
"permissionError": "Permission denied - cannot reset admin users",
46-
"userNotFoundError": "User not found"
47-
}
47+
"waitingStudents": "are currently waiting for supervision approval"
4848
},
4949
"appHeader": {
5050
"addAdmin": "Add Admin",
@@ -151,6 +151,10 @@
151151
"supervising": "You are supervising {firstName}"
152152
},
153153
"dashboard": {
154+
"progress": {
155+
"button": "Complete Profile...",
156+
"text": "Your profile is almost complete! Add the last things for the best experience of SuperWise"
157+
},
154158
"student": {
155159
"downloadConfirmation": "Download Confirmation",
156160
"findSupervisor": "Find your supervisor now!",
@@ -383,7 +387,8 @@
383387
},
384388
"noResults": "No search results...",
385389
"placeholderForStudents": "Search supervisor...",
386-
"placeholderForSupervisors": "Search student..."
390+
"placeholderForSupervisors": "Search student...",
391+
"placeholderForAdmins": "Search users..."
387392
},
388393
"searchBar": {
389394
"noResults": "No results found"

0 commit comments

Comments
 (0)