core
core copied to clipboard
BlockEditor - Add Link within dotCMS
Is your feature request related to a problem? Please describe. As a users I want to to search for linkable content within dotCMS (page, urlmap, file, dotAsset) to make linking within dotCMS easy.
What is linkable:
- url mapped content (on the same host?)
- Any file or dotAsset (use the
/dA
pathing. - Any htmlpage (on the same host ?).
Describe the solution you'd like We can transform the current UI into one to do search, here is the idea:
https://user-images.githubusercontent.com/751424/167724847-18839ce7-fb62-47df-89b6-f1008742ba45.mp4
Describe alternatives you've considered We need to search for URL path and title of all the pages content types in the system.
Additional context
- We need to query by current language
- We have to make sure that the whole process can be done with keyboard interactions
- We need backend work so if the page change the URL it doesn't breaks the links
Mocks and prototypes
Question... what about if the urlmap changes? are we updating the editor content?
- We can save the identifier
Fixed:
- Paste links in the
link-form
input should not close the form link. - Paste a link directly into the editor should work. ~3. Type a link directly in the editor (E.g: google.com ) and it should be set as a link.~
-
ScrollIntoView
on the suggestions list. - Improve
Link Form plugin states
. - We now can use
PrimeNG
components inside theeditor
.
Behavior
- You should be able to open the form link by clicking on the corresponding button in the menu.
- If we click on the corresponding button in the menu when the form is open, it should close.
- If we hit
Escape
we close the form link. - If the link form does not have enough room to open down, it should open up.
On Search Suggestions
- Display a loading on
search
. -
Min 3
characters to start searching for acontentlet
. - While typing a valid URL on the
link form input
, we do notsearch
contentlets.
Suggestions
- If you type in the
link form input
, we showdotcms
content suggestions: - Link Suggestions have full keyboard support:
- When
contentlets
are not available:- If we hit
Enter
we set the current input value as a link.
- If we hit
- When
contentlets
are available:- On
ArrowUp
andArrowDown
we update the selected item. - If we hit
Enter
we set the ‘url’ of the selected item. - If we hit
Escape
we close the form Link.
- On
- The
link-form
should not hide on the suggestion list scroll but on the document scroll.
On Click
- If we
click
a link, we select the entire node and show thelink form
. -
Bubble menu
should not be open if we open the form linkclick
. - If the link form was open on
click
, when we close it, the bubble menu should not be open. - If the form link is open on
click
, and the selected node isclicked
again, we hide the link form and enabled link editing.
On Double Click
- If we double click on a link, we select the entire node and show the link form.
Scenarios I found:
- When we hit scape we need to stop the propagation of the event when the link dialog is open, so do not close the modal of the edit mode.
- if a link is without the http like facebook.com, is not opening in another tab.
PR: #22879
More info.
https://user-images.githubusercontent.com/751424/187983148-0ea007da-3add-4f07-931e-d048f043165b.mp4
Approved QA - Tested on 22.09_845c64ab_SNAPSHOT // Docker // FF