Skip to content

Commit 9b5ac15

Browse files
Development: Refactor application detail components and update rating grid styling (#2615)
1 parent e961fa4 commit 9b5ac15

5 files changed

Lines changed: 39 additions & 10 deletions

File tree

src/main/webapp/app/application/application-detail-for-applicant/application-detail-for-applicant.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ <h3 class="section-card-title" jhiTranslate="entity.application_detail.reference
285285
/>
286286
}
287287
</div>
288-
<div class="section-card-body ml-2">
288+
<div class="section-card-body">
289289
<p class="flex mb-3">
290290
<fa-icon [icon]="referenceLettersConfidential() ? 'lock' : 'circle-info'" class="text-primary mr-1 w-5 shrink-0" />
291291
<span
@@ -308,10 +308,10 @@ <h3 class="section-card-title" jhiTranslate="entity.application_detail.reference
308308
(referencesChanged)="onReferencesChanged($event)"
309309
/>
310310
} @else {
311-
<ul class="list-disc list-inside marker:text-primary">
311+
<ul class="list-disc marker:text-primary ml-5">
312312
@for (reference of references(); track reference.referenceRequestId) {
313313
<li class="py-1 font-medium items-center gap-2">
314-
<span>
314+
<span class="ml-1">
315315
{{ reference.title }} {{ reference.firstName }} {{ reference.lastName }}
316316
<span class="font-normal text-text-secondary ml-1"> ({{ reference.email }}) </span>
317317
</span>

src/main/webapp/app/evaluation/application-detail/application-detail.component.html

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ <h1>
211211
</div>
212212
</div>
213213
<div class="w-full">
214-
<div class="grid xl:gap-16 grid-cols-1 xl:grid-cols-[7fr_3fr]">
214+
<div class="grid xl:gap-16 grid-cols-1 xl:grid-cols-[14fr_7fr]">
215215
<div>
216216
<!-- Education -->
217217
<jhi-section titleKey="evaluation.education.title" icon="graduation-cap">
@@ -296,22 +296,36 @@ <h1>
296296
@if (currentReferenceRequests().length > 0) {
297297
<jhi-section titleKey="evaluation.details.referenceLetterStatus" icon="envelope">
298298
<p class="flex text-sm text-text-secondary mb-2 items-start">
299-
<fa-icon [icon]="referenceLettersConfidential() ? 'lock' : 'circle-info'" class="text-primary w-5 shrink-0 -ml-2 mr-1" />
299+
<fa-icon
300+
[icon]="referenceLettersConfidential() ? 'lock' : 'circle-info'"
301+
class="text-primary w-5 shrink-0 -ml-2.75 mr-1"
302+
/>
300303
<span
301304
[jhiTranslate]="
302305
referenceLettersConfidential() ? 'evaluation.details.referenceConfidential' : 'evaluation.details.referenceShared'
303306
"
304307
></span>
305308
</p>
306-
<ul class="list-disc list-inside marker:text-primary text-sm">
309+
<ul class="list-disc marker:text-primary text-sm ml-3">
307310
@for (reference of currentReferenceRequests(); track reference.referenceRequestId) {
308311
<li class="py-1">
309-
<span class="font-medium">{{ reference.title }} {{ reference.firstName }} {{ reference.lastName }}</span>
312+
<span class="font-medium ml-1">{{ reference.title }} {{ reference.firstName }} {{ reference.lastName }}</span>
310313
<span class="font-normal text-text-secondary text-sm ml-1"> ({{ reference.email }}) </span>
311314
@if (reference.status === 'SUBMITTED') {
312315
<span class="text-positive-default ml-1" jhiTranslate="evaluation.details.referenceStatus.submitted"
313316
>Submitted</span
314317
>
318+
@if (reference.documentId) {
319+
<jhi-button
320+
class="inline-flex align-middle"
321+
classStyling="!w-8"
322+
icon="eye"
323+
variant="text"
324+
size="xs"
325+
ariaLabel="evaluation.details.viewReferenceLetter"
326+
(click)="docSection.openDocument(reference.documentId)"
327+
/>
328+
}
315329
} @else if (reference.status === 'EXPIRED') {
316330
<span class="text-negative-default ml-1" jhiTranslate="evaluation.details.referenceStatus.expired">Expired</span>
317331
} @else if (reference.status === 'DECLINED') {

src/main/webapp/app/shared/components/atoms/rating-grid/rating-grid.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="hidden lg:grid lg:items-end lg:gap-x-2 lg:px-2 lg:pb-2" [style.grid-template-columns]="gridTemplateColumns()">
44
<div></div>
55
@for (option of options(); track option.value) {
6-
<div class="px-1 text-center text-xs font-medium break-words hyphens-auto text-text-secondary">
6+
<div class="px-1 text-center text-xs font-medium break-words text-text-secondary">
77
@if (shouldTranslate()) {
88
<span [jhiTranslate]="option.name"></span>
99
} @else {

src/main/webapp/app/shared/components/organisms/document-section/document-section.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@if (extraDocuments().length > 0) {
1010
<div class="mt-8 w-full">
1111
<p class="text-sm font-semibold mb-2" jhiTranslate="evaluation.details.furtherDocuments"></p>
12-
<ul class="list-disc list-inside text-sm text-text-secondary">
12+
<ul class="list-disc text-sm text-text-secondary ml-5">
1313
@for (document of extraDocuments(); track document.document.id) {
1414
<li>
1515
@if (document.shouldTranslateLabel) {
@@ -28,4 +28,4 @@
2828
</div>
2929
}
3030

31-
<jhi-document-dialog [(isOpen)]="dialogVisible" [documentHolders]="allDocuments()" />
31+
<jhi-document-dialog [(isOpen)]="dialogVisible" [(selectedId)]="selectedDocumentId" [documentHolders]="allDocuments()" />

src/main/webapp/app/shared/components/organisms/document-section/document-section.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export class DocumentSection {
3030

3131
dialogVisible = model<boolean>(false);
3232

33+
/** Id of the document the dialog should focus when it opens. */
34+
selectedDocumentId = signal<string | undefined>(undefined);
35+
3336
documentsCount = signal<number>(0);
3437

3538
readonly NUMBER_OF_DOCUMENTS = 3;
@@ -87,6 +90,18 @@ export class DocumentSection {
8790
this.extraDocuments.set(result.slice(this.NUMBER_OF_DOCUMENTS));
8891
});
8992

93+
/**
94+
* Opens the document dialog with the given document selected.
95+
* @param documentId the id of the document to display; ignored when undefined
96+
*/
97+
openDocument(documentId: string | undefined): void {
98+
if (documentId === undefined) {
99+
return;
100+
}
101+
this.selectedDocumentId.set(documentId);
102+
this.dialogVisible.set(true);
103+
}
104+
90105
async downloadAllDocuments(): Promise<void> {
91106
const applicationId = this.applicationId();
92107
if (applicationId === undefined) {

0 commit comments

Comments
 (0)