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

IBX-7725: RTE area is hidden if custom-tag label is too long #146

Merged
merged 4 commits into from
Mar 4, 2024

Conversation

vidarl
Copy link
Contributor

@vidarl vidarl commented Feb 6, 2024

Question Answer
JIRA issue IBX-7725
Bug/Improvement yes
New feature no
Target version 4.5, main
BC breaks no
Tests pass yes
Doc needed no

The label of the custom tag might hide the input field
The label is absolutely positioned before the input field, so the input field doesn't automatically float according to size of label

Before patch
IBX-7725_problem

After patch
IBX-7725_fixed

TODO:

  • Implement feature / fix a bug.
  • Implement tests.
  • Fix new code according to Coding Standards ($ composer fix-cs).
  • Ask for Code Review.

@vidarl vidarl changed the base branch from main to 4.5 February 6, 2024 10:46
@vidarl vidarl requested a review from dew326 February 6, 2024 10:48
@@ -48,7 +48,7 @@ class IbexaCustomTagEditing extends Plugin {
</button>`;

domElement.innerHTML = `
<div class="ibexa-custom-tag__header-title">${customTagConfig.label}</div>
<div class="ibexa-custom-tag__header-title" title="${customTagConfig.label}">${customTagConfig.label}</div>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The label should strictly speaking be escaped. If so, how do you want it escaped?
For instance, adding " or </div> in translation file will break the html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, changed title= into data-cke-tooltip-text=. Not sure if this is preferable or not

@vidarl vidarl requested a review from a team February 7, 2024 09:41
@vidarl
Copy link
Contributor Author

vidarl commented Feb 14, 2024

[warn] src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-editing.js
[warn] Code style issues found in the above file(s). Forgot to run Prettier?

I don't get it.. When running it locally, prettier doesn't complain about the file

@Gengar-i
Copy link
Contributor

Gengar-i commented Feb 15, 2024

[warn] src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-editing.js
[warn] Code style issues found in the above file(s). Forgot to run Prettier?

I don't get it.. When running it locally, prettier doesn't complain about the file

You need to install prettier with yarn and then update file with prettier.

Use yarn install in fieldtype-richtext.

@vidarl
Copy link
Contributor Author

vidarl commented Feb 15, 2024

You need to install prettier with yarn and then update file with prettier.

Use yarn install in fieldtype-richtext.

Yeah, I got that part:

$ yarn prettier "./src/bundle/Resources/**/*.{js,scss}" -w
yarn run v1.22.17
(...)
src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-editing.js 24ms (unchanged)
(...)
$ yarn prettier --version
yarn run v1.22.17
$ /var/www/vendor/ibexa/fieldtype-richtext/node_modules/.bin/prettier --version
3.2.5
Done in 0.21s.

@Gengar-i

@Gengar-i
Copy link
Contributor

Gengar-i commented Feb 15, 2024

You need to install prettier with yarn and then update file with prettier.
Use yarn install in fieldtype-richtext.

Yeah, I got that part:

$ yarn prettier "./src/bundle/Resources/**/*.{js,scss}" -w
yarn run v1.22.17
(...)
src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-editing.js 24ms (unchanged)
(...)
$ yarn prettier --version
yarn run v1.22.17
$ /var/www/vendor/ibexa/fieldtype-richtext/node_modules/.bin/prettier --version
3.2.5
Done in 0.21s.

@Gengar-i

With my prettier your changes modiefied looks differently.
Looks like prettier is not appling changes for you to this file.

@Gengar-i
Copy link
Contributor

@vidarl I fixed prettier

@vidarl
Copy link
Contributor Author

vidarl commented Feb 27, 2024

@vidarl I fixed prettier

Thank you

Copy link
Contributor

@dew326 dew326 left a comment

Choose a reason for hiding this comment

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

just code style

…om-tag/custom-tag-editing.js

Co-authored-by: Dariusz Szut <dew326@gmail.com>
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

@tomaszszopinski tomaszszopinski left a comment

Choose a reason for hiding this comment

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

QA approved on IbexaDXP 4.5 commerce.

@tomaszszopinski tomaszszopinski self-assigned this Mar 4, 2024
@dew326 dew326 merged commit fa7f5f0 into 4.5 Mar 4, 2024
21 checks passed
@dew326 dew326 deleted the RTE_area_is_hidden_if_custom-tag_label_is_too_long branch March 4, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants