-
Notifications
You must be signed in to change notification settings - Fork 59
Feature/sup 2150 ext acc card add profile url link #601
Feature/sup 2150 ext acc card add profile url link #601
Conversation
-- Added click listener to open the profile URL, if available for external accounts cards (not for external web links)
…rd is not opening up the weblink -- Opened web link in new tab for external web link cards -- Prevented double new tabs for the link when clicked on the URL in the card itself
@@ -1,5 +1,5 @@ | |||
.external-link-list | |||
div.external-link-tile(ng-repeat="account in linkedAccountsData", ng-class="{'external-link-tile--editable' : editable}") | |||
div.external-link-tile(ng-repeat="account in linkedAccountsData", ng-class="{'external-link-tile--editable' : editable, 'external-link-tile--pending' : account.status === 'PENDING' || account.data.status === 'PENDING'}", ng-click="openLink(account)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to check both account.status and account.data.status? is the API not consistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of using a div would it help to use anchor tag here? We wouldn't need an anchor tag for the url in that case..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that depends on whether we want the whole thing clickable or just the anchor tag below. But we can delete div
since we have an .external-link-tile
class :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are maintaining different nesting for added external account and web link. I was thinking to clean it up, however, it would have required more time and testing. Along with that, I was not sure which data structure to cleanup. For external accounts, we are nesting the added external account one more deep level e.g.
{
status: 'SUCCESS' | 'ERROR',
linkedAccount: {
provider: 'github',
data: {
handle: '',
status: 'PENDING',
...
}
}
}
while for external web links, it is
{
provider: 'weblink',
data: {
handle: '',
url: '',
title: '',
status: 'PENDING'
}
}
Can you please suggest which one to fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rationale behind not using anchor tag is that it defeats the purpose of the anchor tag. I think it is not recommended to render a complicated HTML inside an anchor tag. Regarding the anchor tag on URL, we can still avoid it because if I remove the preventEventPropagation directive from it, it would bubble the event to the div and it would take user to the link. Only thing would be that we have to style the URL text as anchor.
I think the requirement is to make the whole card clickable, hence my suggestion of replacing div w/ anchor tag :) |
-- Removed unnecessary div text as per code review comment
@parthshah @nlitwin I have created issue 605 for tracking the data structure change and regarding replacing the div with anchor tag, I think we need more discussion because using anchor tag can cause slightly complicated logic for handling pending state cards and styling the URL field to look like an anchor. |
…rd-add-profile-url-link Feature/sup 2150 ext acc card add profile url link
@parthshah @nlitwin @tladendo please suggest any change required to make the code robust and bug free. Specifically, do you guys see any other alternative to using preventStopPropagation directive, for avoiding opening of two links, when clicked on the URL inside a external web link card?