Skip to content

External links etc#198

Merged
rosemcc merged 15 commits into
masterfrom
external-links-etc
Dec 21, 2021
Merged

External links etc#198
rosemcc merged 15 commits into
masterfrom
external-links-etc

Conversation

@rosemcc
Copy link
Copy Markdown
Contributor

@rosemcc rosemcc commented Dec 19, 2021

This PR contains the following changes:

Feature

  • External links on cards and within rich text are indicated with external link icon
  • Emails in rich text are indicated with mail icon

Improvements

  • Removed unused components confirm-dialog and error-dialog
  • Minor modifications to card titles to accommodate external links icons
  • External links on cards open in new tabs and minor accessibility improvements
  • The search autocomplete panel now closes when a search is triggered by enter keypress

@rosemcc rosemcc requested review from Trombach and robmint December 20, 2021 00:05

<mat-card-title>
<a class="card-title" [attr.href]="orgUnit.link ? orgUnit.link : null">
<a class="card-title" tabindex="0" (keydown.enter)="orgUnit.link ? navigateTo(orgUnit.link) : null">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So here the title is clickable but does no action?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole card is clickable, so the title doesn't need to have the link - I realise this seems kind of odd, but the problem is that if the title does have the link then you get a new tab opening the link as well as the hub navigating to the link (double navigation). The keydown.enter is needed to navigate when the title is focused.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative is that the external links open in the current tab, but this feels a bit weird to me? What do you think? I feel like we should keep the user on the ResearchHub and open links in new tabs. But maybe that's just my personal preference making me biased :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rosemcc An alternative, and possibly better, way to handle accessibility would be to make tabbing focus the whole card and then let aria-label read out the title of the card. Therefore the titles wouldn't need to be anchors any longer

This works fine though

Copy link
Copy Markdown
Collaborator

@robmint robmint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and deleting of stuff good!

{{ contentItem.title }}
<span>{{ contentItem.title }}
&nbsp;
<mat-icon *ngIf="contentItem.ssoProtected" matTooltip="SSO Login Required">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest we remove SSO - as this is not really necessary and might be confusing to some people

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might need to discuss with team? For users that don't have access I'd say it's needed so they can understand why they can't access this content. But we haven't collected specific user feedback about it so can't be sure.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cameronmclean what do you think?

type="search"
(keydown.enter)="search()"
#trigger="matAutocompleteTrigger"
(keydown.enter)="search(); trigger.closePanel()"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this!

@rosemcc rosemcc marked this pull request as ready for review December 20, 2021 01:48
@rosemcc
Copy link
Copy Markdown
Contributor Author

rosemcc commented Dec 20, 2021

Question: @robmint @cameronmclean should asset hyperlinks be indicated as external links? Or are they technically internal links? Example towards the bottom of this page: https://research-hub-dev.connect.test.amazon.auckland.ac.nz/article/open-access

<mat-card-title>
<a
class="card-title"
[attr.href]="document.url ?? document.document?.url"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why there are 2 URL fields in the first place, but this ternary expression existed before the refactor, therefore I kept it. Are you sure we can remove this logic?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two url fields are because some documents are hosted on Contentful, and some are just linked to externally, and the respective urls are shown in different fields because of that.

Comment thread research-hub-web/src/styles.scss Outdated
* - do not apply to link cards or funding application docs
* - show the mail icon for email links within rich text
*/
#main-content a:not([href^="/"]):not([href*="//research-hub"]):not([href*="@"]):not([href^="tel"]):not(.standard-button):not(app-blocks-embedded-asset *):not(.link-card *):not(.application-doc *):after {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know you could make css look like perl. I like it! 😄

Copy link
Copy Markdown
Contributor

@Trombach Trombach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from some minor comments, this LGTM!

@rosemcc rosemcc merged commit d2903e7 into master Dec 21, 2021
@rosemcc rosemcc deleted the external-links-etc branch December 21, 2021 23:32
@rosemcc rosemcc mentioned this pull request Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants