Skip to content
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

Assume selection is text when creating a link #8071

Conversation

jlsjonas
Copy link
Contributor

Fixes #7890

Description of what you did:

Title says it all, when replacing a selection, assume the selection is text and not a link; as per the issue

@jlsjonas jlsjonas force-pushed the feat/7890-link-creation-ux-improvement branch 2 times, most recently from a0a17b8 to 698b41b Compare September 27, 2020 17:54
@codecov
Copy link

codecov bot commented Sep 27, 2020

Codecov Report

Merging #8071 into master will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8071      +/-   ##
==========================================
- Coverage   32.71%   32.71%   -0.01%     
==========================================
  Files        1194     1194              
  Lines       12969    12970       +1     
  Branches     1280     1280              
==========================================
  Hits         4243     4243              
- Misses       7886     7887       +1     
  Partials      840      840              
Flag Coverage Δ
#front 24.80% <0.00%> (-0.01%) ⬇️
#unit 53.88% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...-manager/admin/src/components/Wysiwyg/constants.js 0.00% <ø> (ø)
...nt-manager/admin/src/components/Wysiwyg/helpers.js 0.00% <ø> (ø)
...ugin-upload/admin/src/components/EditForm/index.js 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a21a11...24c31b4. Read the comment docs.

@sam-pires
Copy link
Contributor

Hello @jlsjonas,
Thanks for the PR 👍

I still have the same behavior as the current one. It has not changed.
@soupette wdyt?

Copy link
Contributor

@soupette soupette left a comment

Choose a reason for hiding this comment

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

In order to make the selected change you'll also need to update Wysiwyg/constants.js file L.79 with the following:

{
  label: 'Link',
  style: 'LINK',
  className: 'link',
  hideLabel: true,
  handler: 'addContent',
  text: '[textToReplace](link)',
},

Fixes strapi#7890

Signed-off-by: Jonas De Kegel <jonas@fluid.desi>
@jlsjonas jlsjonas force-pushed the feat/7890-link-creation-ux-improvement branch from 698b41b to 24c31b4 Compare September 28, 2020 15:03
Copy link
Contributor

@soupette soupette left a comment

Choose a reason for hiding this comment

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

LGTM!

Thanks a lot for your contribution.

@jlsjonas
Copy link
Contributor Author

@soupette You're welcome!
What do we do with the coverage report failing at -0% due to lack of testing in that area of the code?

@soupette
Copy link
Contributor

@soupette You're welcome!
What do we do with the coverage report failing at -0% due to lack of testing in that area of the code?

Appart from adding some tests to this component not much. Even though the coverage doesn't pass we will still merge this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug source: core:admin Source is core/admin package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Link creation might not be intuitive in RichText fields
4 participants