-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat(ui): add document link to drawer #12036
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
feat(ui): add document link to drawer #12036
Conversation
Hey thanks for this! My only concern is that this only works for ID's and not useAsTitle titles. For that you would need to adjust the RenderTitle component. But I am wondering if just having an external link icon (which I think we already have) that users can click would be easier. @tylandavis what do you think? |
I believe inside a drawer, we always render the A couple UX things that come to my mind:
|
The leave page modal in general doesn't show if a link is opened in a new tab, because you're technically not leaving the page. So if you open it in a new tab, you will then still have the option to either continue editing / saving or closing the drawer which would then trigger the leave page modal as currently.
I personally don't think a link which opens in a new tab should have additional side effects. A "close drawer and open in new tab"-action would IMO be a different thing. |
6fabec2
to
2de5f8c
Compare
bbf97e6
to
bd98758
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.
One general point of discussion here is that the link should probably not open in a new tab by default, and instead behave as any other anchor. This way the user could cmd+click, etc. in order to open in a new tab as expected. Some users might actually want to directly navigate to the document anyway.
This also means that we need to ensure that the LeaveWithoutSaving modal is activated even when the drawer's form is modified and the user attempts to navigate away.
Besides that, a couple of small changes needed here. I think overall this is a good change.
Thanks @jacobsfletch . I addressed your comments and added e2e tests to ensure that the link can actually be opened in both the same and in a new tab and that the leave page modal shows when necessary. |
🚀 This is included in version v3.37.0 |
What?
Adds an option to open the current document in a new tab when opened in a drawer.
Why?
There is currently no direct way to open a document when opened in a drawer. However, sometimes editors want to edit one or multiple documents from relationships independently of the current edit view and need an easy option to open these separately.
How?
Converts the document id to a link if in drawer context.