-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature(DH): Add more contact information #748
Conversation
Affected libs:
|
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.
Thanks for the work 🙂
I tested and it works well with all of my datasets.
Only UI thing to fix IMO is the spacing between the address and the email in case there is no website, i.e. without website (too narrow) :
and with website :
I also would like to wait for a second opinion about the risk of having addresses without commas (if there is no risk then I will approve the PR) 🙂
test.each(addressCases)( | ||
'adressString: $address', | ||
({ address, expectedResult }) => { | ||
console.log(component) |
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.
Forgot to delete this console.log 🙂
@@ -34,6 +34,37 @@ export class MetadataContactComponent { | |||
) | |||
} | |||
|
|||
parseAddress(inputAddress) { | |||
const addressParts = inputAddress.split(',').map((part) => part.trim()) |
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.
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.
yes definitely, there's no rule for addresses as far as I know; but then it'll simply end up being a long line, so we just need to make sure that the text overflow works well :) (looks to be the case in my tests)
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.
Okay in this case I will keep it simple as you were proposing @jahow and only split by ',' and if that's not there, it will be a long line of text which overflows, as you said. I implemented it to fit the design, but I guess there are too many different variations of the user input.
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.
A similar work has been started in #575
Dunno if it helps.
<div *ngIf="contacts[0].address" class="mb-2"> | ||
<div class="flex"> | ||
<mat-icon | ||
class="material-symbols-outlined !w-[20px] !h-[20px] !text-[20px] opacity-75" |
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.
Please use built-in classes like w-5
instead, when possible.
fff7713
to
cb35be1
Compare
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.
Added some more comments, thanks for the contribution!
libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html
Outdated
Show resolved
Hide resolved
libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html
Outdated
Show resolved
Hide resolved
libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html
Outdated
Show resolved
Hide resolved
libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html
Outdated
Show resolved
Hide resolved
> | ||
<div class="flex flex-col ml-2"> | ||
<p class="text-sm"> | ||
{{ contacts[0].firstName }} {{ contacts[0].lastName }} |
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.
This might render weirdly if only one of the two is defined
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 think now it should be handled correctly.
libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html
Outdated
Show resolved
Hide resolved
libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html
Outdated
Show resolved
Hide resolved
libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html
Outdated
Show resolved
Hide resolved
@@ -34,6 +34,37 @@ export class MetadataContactComponent { | |||
) | |||
} | |||
|
|||
parseAddress(inputAddress) { | |||
const addressParts = inputAddress.split(',').map((part) => part.trim()) |
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.
yes definitely, there's no rule for addresses as far as I know; but then it'll simply end up being a long line, so we just need to make sure that the text overflow works well :) (looks to be the case in my tests)
libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.ts
Outdated
Show resolved
Hide resolved
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.
Thanks for the improvements! As discussed, the layout can probably be slightly improved using grid
and gap
instead of mb
classes. I'm approving this, please merge when you feel this is ready!
7a8cc67
to
2a5630d
Compare
This PR adds more contact information in the metadata contact section if it exists.
It will look like this: