Skip to content

Commit

Permalink
Merge pull request #523 from geonetwork/rework-email-contact-block-re…
Browse files Browse the repository at this point in the history
…cord-view

feat: Make email in contact block "mailto"
  • Loading branch information
fgravin authored Jul 20, 2023
2 parents 7d67c60 + 67e8c63 commit f24bd23
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@
{{ shownContact.organisation }}
</div>
</div>
<p class="text-gray-700 text-sm">{{ shownContact.email }}</p>
<a
[href]="'mailto:' + shownContact.email"
class="text-gray-700 text-sm"
target="_blank"
>{{ shownContact.email }}</a
>
<div *ngIf="shownContact.website" class="mb-2">
<a
[href]="shownContact.website"
target="_blank"
class="text-primary text-sm cursor-pointer hover:underline transition-all"
class="contact-website text-primary text-sm cursor-pointer hover:underline transition-all"
>{{ shownContact.website }}
<mat-icon class="!w-[12px] !h-[12px] !text-[12px] opacity-75"
>open_in_new</mat-icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ describe('MetadataContactComponent', () => {
})
})
describe('content', () => {
let ps
let email
beforeEach(() => {
ps = fixture.debugElement.queryAll(By.css('p'))
email = fixture.debugElement.query(By.css('a'))
})
it('displays the contact name', () => {
const el = fixture.debugElement.query(
Expand All @@ -69,10 +69,10 @@ describe('MetadataContactComponent', () => {
expect(el.innerHTML).toBe(' Worldcorp ')
})
it('displays the contact email', () => {
expect(ps[1].nativeElement.innerHTML).toBe('[email protected]')
expect(email.attributes.href).toBe('mailto:[email protected]')
})
it('displays a link to the contact website', () => {
const a = fixture.debugElement.query(By.css('a'))
const a = fixture.debugElement.query(By.css('.contact-website'))
expect(a.attributes.href).toBe('https://john.world.co')
expect(a.attributes.target).toBe('_blank')
})
Expand Down

0 comments on commit f24bd23

Please sign in to comment.