Skip to content

Commit 1b58a2a

Browse files
igorihimbazweIgor IHIMBAZWE
andauthored
fix rating trainee (#512)
* fix rating trainee * fix rating trainee * fix rating trainee --------- Co-authored-by: Igor IHIMBAZWE <[email protected]>
1 parent 5b12e79 commit 1b58a2a

27 files changed

+370
-266
lines changed

src/components/ratings/ViewWeeklyRatings.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,8 @@ function ViewSprintRatings({
350350
loggedUserRole === 'ttl') ||
351351
loggedUserRole === 'coordinator' ? (
352352
<Button
353-
type="submit"
353+
type="submit"
354+
disabled={traineeStatus.status==="drop"}
354355
variant="primary"
355356
size="sm"
356357
style="inline-flex justify-center float-right rounded-md border border-transparent bg-primary px-4 py-2 text-sm font-medium text-white hover:bg-opacity-40 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2"

src/components/ratings/hooks/useAddNewRating.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const useAddRating = ({
119119
content: ratingData.feedback.toString(),
120120
},
121121
onError: (err) => {
122-
setFeedbackError('Leave a feedback');
122+
setFeedbackError('This Trainee was Dropped out ');
123123
},
124124
onCompleted: () => {
125125
setRatingData(initialRatingData);

src/components/tests/__snapshots__/AdminTraineeDashboard.test.tsx.snap

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Array [
6060
className="flex justify-between w-full"
6161
>
6262
<button
63-
className="btn info sm w-[30%] md:w-1/4 text-sm font-sans font-serif"
63+
className="btn info sm w-[30%] md:w-1/4 text-sm font-sans font-serif "
6464
data-testid="removeInviteModel"
6565
disabled={false}
6666
onClick={[Function]}
@@ -69,7 +69,7 @@ Array [
6969
Cancel
7070
</button>
7171
<button
72-
className="btn primary sm w-[30%] md:w-1/4 text-sm font-sans font-serif"
72+
className="btn primary sm w-[30%] md:w-1/4 text-sm font-sans font-serif "
7373
disabled={false}
7474
onClick={[Function]}
7575
type="button"
@@ -326,7 +326,7 @@ Array [
326326
className="flex justify-between w-full"
327327
>
328328
<button
329-
className="btn info sm w-[30%] md:w-1/4 text-sm font-sans font-serif"
329+
className="btn info sm w-[30%] md:w-1/4 text-sm font-sans font-serif "
330330
data-testid="removeModel1"
331331
disabled={false}
332332
onClick={[Function]}
@@ -335,7 +335,7 @@ Array [
335335
Cancel
336336
</button>
337337
<button
338-
className="btn primary sm w-[30%] md:w-1/4 text-sm font-sans font-serif"
338+
className="btn primary sm w-[30%] md:w-1/4 text-sm font-sans font-serif "
339339
disabled={false}
340340
onClick={[Function]}
341341
type="button"
@@ -384,7 +384,7 @@ Array [
384384
className="flex justify-between w-full"
385385
>
386386
<button
387-
className="btn info sm w-[30%] md:w-1/4 text-sm font-sans font-serif"
387+
className="btn info sm w-[30%] md:w-1/4 text-sm font-sans font-serif "
388388
data-testid="removeModel2"
389389
disabled={false}
390390
onClick={[Function]}
@@ -393,7 +393,7 @@ Array [
393393
Cancel
394394
</button>
395395
<button
396-
className="btn primary sm w-[30%] md:w-1/4 text-sm font-sans font-serif"
396+
className="btn primary sm w-[30%] md:w-1/4 text-sm font-sans font-serif "
397397
data-testid="removeMemberFromCohort"
398398
disabled={false}
399399
onClick={[Function]}
@@ -463,14 +463,14 @@ Array [
463463
name="date"
464464
readOnly={true}
465465
type="text"
466-
value="2024-09-13"
466+
value="2024-09-26"
467467
/>
468468
</div>
469469
<div
470470
className="flex justify-between w-full"
471471
>
472472
<button
473-
className="btn info sm w-[30%] md:w-1/4 text-sm font-sans font-serif"
473+
className="btn info sm w-[30%] md:w-1/4 text-sm font-sans font-serif "
474474
data-testid="dropModel"
475475
disabled={false}
476476
onClick={[Function]}
@@ -479,7 +479,7 @@ Array [
479479
Cancel
480480
</button>
481481
<button
482-
className="btn primary sm w-[30%] md:w-1/4 text-sm font-sans font-serif"
482+
className="btn primary sm w-[30%] md:w-1/4 text-sm font-sans font-serif "
483483
data-testid="dropMemberFromCohort"
484484
disabled={false}
485485
onClick={[Function]}
@@ -493,16 +493,16 @@ Array [
493493
</div>
494494
</div>,
495495
<div
496-
className="h-screen w-screen z-20 bg-black bg-opacity-30 backdrop-blur-sm fixed top-0 left-0 flex items-center justify-center px-4 hidden"
496+
className="h-screen w-screen z-20 bg-black bg-opacity-30 backdrop-blur-sm fixed top-0 left-0 flex items-center justify-center px-4 hidden"
497497
>
498498
<div
499499
className="w-full p-4 pb-8 bg-indigo-100 rounded-lg dark:bg-dark-bg sm:w-3/4 xl:w-4/12"
500500
>
501501
<div
502-
className="flex flex-wrap items-center justify-center w-full card-title "
502+
className="flex flex-wrap items-center justify-center w-full card-title"
503503
>
504504
<h3
505-
className="w-11/12 text-sm font-bold text-center dark:text-white "
505+
className="w-11/12 text-sm font-bold text-center dark:text-white"
506506
>
507507
Add Trainee
508508
</h3>
@@ -514,10 +514,10 @@ Array [
514514
className="card-body"
515515
>
516516
<form
517-
className="px-8 py-3 "
517+
className="px-8 py-3"
518518
>
519519
<div
520-
className="my-3 input h-9 "
520+
className="my-3 input h-9"
521521
>
522522
<div
523523
className="flex items-center w-full h-full rounded-md grouped-input"
@@ -625,7 +625,7 @@ Array [
625625
</div>
626626
</div>
627627
<div
628-
className="my-3 text-white input h-9 "
628+
className="my-3 text-white input h-9"
629629
>
630630
<div
631631
className="flex items-center w-full h-full text-white rounded-md grouped-input"
@@ -733,7 +733,7 @@ Array [
733733
</div>
734734
</div>
735735
<div
736-
className="my-3 text-white input h-9 "
736+
className="my-3 text-white input h-9"
737737
>
738738
<div
739739
className="flex items-center w-full h-full text-white rounded-md grouped-input"
@@ -844,7 +844,7 @@ Array [
844844
className="flex justify-between w-full"
845845
>
846846
<button
847-
className="btn info sm w-[30%] md:w-1/4 text-sm font-sans font-serif"
847+
className="btn info sm w-[30%] md:w-1/4 text-sm font-sans font-serif "
848848
data-testid="removeModel"
849849
disabled={false}
850850
onClick={[Function]}
@@ -853,7 +853,7 @@ Array [
853853
Cancel
854854
</button>
855855
<button
856-
className="btn primary sm w-[30%] md:w-1/4 text-sm font-sans font-serif"
856+
className="btn primary sm w-[30%] md:w-1/4 text-sm font-sans font-serif "
857857
data-testid="saveButton"
858858
disabled={false}
859859
onClick={[Function]}
@@ -886,7 +886,7 @@ Array [
886886
className="flex gap-2"
887887
>
888888
<button
889-
className="btn primary lg m-0 font-serif"
889+
className="btn primary lg m-0 font-serif "
890890
data-testid="registerModel"
891891
disabled={false}
892892
onClick={[Function]}
@@ -897,7 +897,7 @@ Array [
897897
898898
</button>
899899
<button
900-
className="btn primary lg m-0 font-serif"
900+
className="btn primary lg m-0 font-serif "
901901
data-testid="inviteModel"
902902
disabled={false}
903903
onClick={[Function]}

src/components/tests/__snapshots__/Header.test.tsx.snap

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ exports[`Header Tests Should render the header with home 1`] = `
127127
onClick={[Function]}
128128
>
129129
<button
130-
className="btn primary lg undefined font-serif"
130+
className="btn primary lg undefined font-serif "
131131
disabled={false}
132132
type="button"
133133
>
@@ -141,7 +141,7 @@ exports[`Header Tests Should render the header with home 1`] = `
141141
onClick={[Function]}
142142
>
143143
<button
144-
className="btn transparentbtn lg mr-8 font-serif"
144+
className="btn transparentbtn lg mr-8 font-serif "
145145
disabled={false}
146146
type="button"
147147
>
@@ -257,7 +257,7 @@ exports[`Header Tests Should render the header with home 1`] = `
257257
onClick={[Function]}
258258
>
259259
<button
260-
className="btn transparentbtn lg mr-8 font-serif"
260+
className="btn transparentbtn lg mr-8 font-serif "
261261
disabled={false}
262262
type="button"
263263
>
@@ -396,7 +396,7 @@ exports[`Header Tests Should render the header with no active 1`] = `
396396
onClick={[Function]}
397397
>
398398
<button
399-
className="btn primary lg undefined font-serif"
399+
className="btn primary lg undefined font-serif "
400400
disabled={false}
401401
type="button"
402402
>
@@ -410,7 +410,7 @@ exports[`Header Tests Should render the header with no active 1`] = `
410410
onClick={[Function]}
411411
>
412412
<button
413-
className="btn transparentbtn lg mr-8 font-serif"
413+
className="btn transparentbtn lg mr-8 font-serif "
414414
disabled={false}
415415
type="button"
416416
>
@@ -526,7 +526,7 @@ exports[`Header Tests Should render the header with no active 1`] = `
526526
onClick={[Function]}
527527
>
528528
<button
529-
className="btn transparentbtn lg mr-8 font-serif"
529+
className="btn transparentbtn lg mr-8 font-serif "
530530
disabled={false}
531531
type="button"
532532
>
@@ -655,7 +655,7 @@ exports[`Header Tests Should render the header with no active 2`] = `
655655
onClick={[Function]}
656656
>
657657
<button
658-
className="btn primary lg undefined font-serif"
658+
className="btn primary lg undefined font-serif "
659659
disabled={false}
660660
type="button"
661661
>
@@ -665,7 +665,7 @@ exports[`Header Tests Should render the header with no active 2`] = `
665665
</button>
666666
</a>
667667
<button
668-
className="btn transparentbtn lg text-red-500 font-bolf dark:text-dark-text-fill mr-8 border border-red-600 dark:border-dark-text-fill font-serif"
668+
className="btn transparentbtn lg text-red-500 font-bolf dark:text-dark-text-fill mr-8 border border-red-600 dark:border-dark-text-fill font-serif "
669669
disabled={false}
670670
onClick={[Function]}
671671
type="button"
@@ -768,7 +768,7 @@ exports[`Header Tests Should render the header with no active 2`] = `
768768
</a>
769769
</li>
770770
<button
771-
className="btn transparentbtn lg text-red-500 font-bolf dark:text-dark-text-fill mr-8 border border-red-600 dark:border-dark-text-fill font-serif"
771+
className="btn transparentbtn lg text-red-500 font-bolf dark:text-dark-text-fill mr-8 border border-red-600 dark:border-dark-text-fill font-serif "
772772
disabled={false}
773773
onClick={[Function]}
774774
type="button"
@@ -906,7 +906,7 @@ exports[`Header Tests Should render the header with no active 3`] = `
906906
onClick={[Function]}
907907
>
908908
<button
909-
className="btn primary lg undefined font-serif"
909+
className="btn primary lg undefined font-serif "
910910
disabled={false}
911911
type="button"
912912
>
@@ -920,7 +920,7 @@ exports[`Header Tests Should render the header with no active 3`] = `
920920
onClick={[Function]}
921921
>
922922
<button
923-
className="btn transparentbtn lg mr-8 font-serif"
923+
className="btn transparentbtn lg mr-8 font-serif "
924924
disabled={false}
925925
type="button"
926926
>
@@ -1036,7 +1036,7 @@ exports[`Header Tests Should render the header with no active 3`] = `
10361036
onClick={[Function]}
10371037
>
10381038
<button
1039-
className="btn transparentbtn lg mr-8 font-serif"
1039+
className="btn transparentbtn lg mr-8 font-serif "
10401040
disabled={false}
10411041
type="button"
10421042
>
@@ -1176,7 +1176,7 @@ exports[`Header Tests Should render the header with pricing active 1`] = `
11761176
onClick={[Function]}
11771177
>
11781178
<button
1179-
className="btn primary lg undefined font-serif"
1179+
className="btn primary lg undefined font-serif "
11801180
disabled={false}
11811181
type="button"
11821182
>
@@ -1190,7 +1190,7 @@ exports[`Header Tests Should render the header with pricing active 1`] = `
11901190
onClick={[Function]}
11911191
>
11921192
<button
1193-
className="btn transparentbtn lg mr-8 font-serif"
1193+
className="btn transparentbtn lg mr-8 font-serif "
11941194
disabled={false}
11951195
type="button"
11961196
>
@@ -1306,7 +1306,7 @@ exports[`Header Tests Should render the header with pricing active 1`] = `
13061306
onClick={[Function]}
13071307
>
13081308
<button
1309-
className="btn transparentbtn lg mr-8 font-serif"
1309+
className="btn transparentbtn lg mr-8 font-serif "
13101310
disabled={false}
13111311
type="button"
13121312
>
@@ -1445,7 +1445,7 @@ exports[`Header Tests Should render the header with product active 1`] = `
14451445
onClick={[Function]}
14461446
>
14471447
<button
1448-
className="btn primary lg undefined font-serif"
1448+
className="btn primary lg undefined font-serif "
14491449
disabled={false}
14501450
type="button"
14511451
>
@@ -1459,7 +1459,7 @@ exports[`Header Tests Should render the header with product active 1`] = `
14591459
onClick={[Function]}
14601460
>
14611461
<button
1462-
className="btn transparentbtn lg mr-8 font-serif"
1462+
className="btn transparentbtn lg mr-8 font-serif "
14631463
disabled={false}
14641464
type="button"
14651465
>
@@ -1575,7 +1575,7 @@ exports[`Header Tests Should render the header with product active 1`] = `
15751575
onClick={[Function]}
15761576
>
15771577
<button
1578-
className="btn transparentbtn lg mr-8 font-serif"
1578+
className="btn transparentbtn lg mr-8 font-serif "
15791579
disabled={false}
15801580
type="button"
15811581
>

0 commit comments

Comments
 (0)