-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AB#33536 AB#33535
- Loading branch information
Showing
21 changed files
with
322 additions
and
50 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...t/components/registration-duplicates-banner/registration-duplicates-banner.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
@if (loading() || duplicates().length > 0) { | ||
<div | ||
class="mb-6 flex w-full items-start rounded-2xl border p-4" | ||
[ngClass]="{ | ||
'border-blue-500 bg-blue-100 text-blue-700': loading(), | ||
'border-red-500 bg-red-100 text-red-700': !loading(), | ||
}" | ||
> | ||
<svg-icon | ||
src="assets/duplicates.svg" | ||
class="me-2 h-7 w-7" | ||
></svg-icon> | ||
@if (loading()) { | ||
<strong | ||
i18n | ||
class="me-auto" | ||
>Loading duplicate information...</strong | ||
> | ||
<i class="pi pi-spinner animate-spin self-center text-xl"></i> | ||
} @else { | ||
<strong | ||
i18n | ||
class="me-2" | ||
>Duplicated with:</strong | ||
> | ||
<ul class="me-auto"> | ||
@for (duplicate of duplicates(); track $index) { | ||
<li class="ms-6 list-disc text-black"> | ||
<a | ||
[routerLink]="registrationLink(duplicate.registrationId)" | ||
class="underline hover:no-underline focus:no-underline" | ||
target="_blank" | ||
> | ||
<ng-container i18n>Reg. #</ng-container | ||
>{{ duplicate.registrationProgramId }} - | ||
@if (duplicate.isDuplicateAccessibleWithinScope) { | ||
{{ duplicate.name }} | ||
} @else { | ||
<ng-container i18n | ||
>(Scope - {{ duplicate.scope }})</ng-container | ||
> | ||
} | ||
<span class="pi pi-external-link ms-1"></span> | ||
</a> | ||
<span | ||
i18n | ||
class="ms-1" | ||
> | ||
(matching fields: | ||
{{ | ||
translatableStringService.commaSeparatedList( | ||
duplicate.attributeNames | ||
) | ||
}})</span | ||
> | ||
</li> | ||
} | ||
</ul> | ||
<i | ||
class="pi pi-info-circle cursor-help self-center text-xl text-black" | ||
pTooltip="To handle duplications you can edit the personal information or decline the registration." | ||
i18n-pTooltip | ||
></i> | ||
} | ||
</div> | ||
} |
35 changes: 35 additions & 0 deletions
35
...out/components/registration-duplicates-banner/registration-duplicates-banner.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { NgClass } from '@angular/common'; | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
inject, | ||
input, | ||
} from '@angular/core'; | ||
import { Router, RouterLink } from '@angular/router'; | ||
|
||
import { SvgIconComponent } from 'angular-svg-icon'; | ||
import { TooltipModule } from 'primeng/tooltip'; | ||
|
||
import { registrationLink } from '~/domains/registration/registration.helper'; | ||
import { DuplicatesResult } from '~/domains/registration/registration.model'; | ||
import { TranslatableStringService } from '~/services/translatable-string.service'; | ||
|
||
@Component({ | ||
selector: 'app-registration-duplicates-banner', | ||
imports: [SvgIconComponent, RouterLink, TooltipModule, NgClass], | ||
templateUrl: './registration-duplicates-banner.component.html', | ||
styles: ``, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class RegistrationDuplicatesBannerComponent { | ||
readonly translatableStringService = inject(TranslatableStringService); | ||
readonly router = inject(Router); | ||
|
||
readonly projectId = input.required<string>(); | ||
readonly duplicates = input.required<DuplicatesResult[]>(); | ||
readonly loading = input.required<boolean>(); | ||
|
||
registrationLink = (registrationId: number | string) => | ||
// XXX: does this work with target blank in production? | ||
registrationLink({ projectId: this.projectId(), registrationId }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.