Skip to content

fix: add cx-read-more component (for product reviews) #20250

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

Merged
merged 36 commits into from
Jun 23, 2025

Conversation

uroslates
Copy link
Contributor

@uroslates uroslates requested a review from a team as a code owner April 30, 2025 11:31
@github-actions github-actions bot marked this pull request as draft April 30, 2025 11:31
@uroslates uroslates marked this pull request as ready for review May 5, 2025 09:51
Copy link

cypress bot commented May 5, 2025

spartacus    Run #48884

Run Properties:  status check passed Passed #48884  •  git commit 99cdd449bd ℹ️: Merge d20dc90d47ee8d518a96a4a94a5e5a67066b6b48 into 472de5f66679f1f87df68d5702ac...
Project spartacus
Branch Review feature/CXSPA-9967
Run status status check passed Passed #48884
Run duration 05m 09s
Commit git commit 99cdd449bd ℹ️: Merge d20dc90d47ee8d518a96a4a94a5e5a67066b6b48 into 472de5f66679f1f87df68d5702ac...
Committer Uros Lates
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 3
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 249
View all changes introduced in this branch ↗︎

@github-actions github-actions bot marked this pull request as draft May 5, 2025 14:47
@uroslates uroslates marked this pull request as ready for review May 5, 2025 14:59
@github-actions github-actions bot marked this pull request as draft May 5, 2025 16:19
@uroslates uroslates marked this pull request as ready for review May 6, 2025 08:30
@github-actions github-actions bot marked this pull request as draft May 6, 2025 10:49
@uroslates uroslates marked this pull request as ready for review May 8, 2025 08:43
import { I18nModule } from '@spartacus/core';

/**
* Renders cx-read-more.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a nice approach to the read more case. Simple enough to understand quickly and works well. Could we expand on jsdocs for the class and properties?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Applied! 👍

@@ -43,12 +46,16 @@ export class ProductReviewsComponent {
@ViewChild('writeReviewButton', { static: false })
writeReviewButton: ElementRef;

@Input() inputCharactersForReviewTitle = 255;
Copy link
Contributor

Choose a reason for hiding this comment

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

We should keep this behaviour feature toggled as I would consider it a breaking change. If it falls back to null, then I think the maxLength property wouldn't be applied.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the property name could also be changed to something closer to the attribute it affects like maxLengthReviewTitle. Just an example, but I think it could be more clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed! 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Applied! 👍

@@ -127,12 +134,53 @@ export class ProductReviewsComponent {
}
}

get reviewTitleCharacterLeft(): number {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a huge fan of using getters this way as they retrigger on every component interaction (eg. clicking on the field triggers all, typing a character triggers all, etc). Its a big impact on performance at scale. It would be better if they could trigger only when the needed property changes.

Note: It could be an opportunity to look into the new angular signals.

image image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Applied 👍. Removed those and moved to template.

@github-actions github-actions bot marked this pull request as draft May 12, 2025 08:01
@uroslates uroslates marked this pull request as ready for review May 12, 2025 08:33
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build.
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft May 12, 2025 09:08
@uroslates uroslates marked this pull request as ready for review May 12, 2025 09:13
@uroslates uroslates marked this pull request as ready for review May 22, 2025 11:42
@github-actions github-actions bot marked this pull request as draft May 27, 2025 10:58
@uroslates uroslates marked this pull request as ready for review May 28, 2025 10:45
@github-actions github-actions bot marked this pull request as draft May 28, 2025 12:18
@uroslates uroslates marked this pull request as ready for review May 28, 2025 12:19
@github-actions github-actions bot marked this pull request as draft June 3, 2025 07:58
@uroslates uroslates marked this pull request as ready for review June 4, 2025 12:17
@github-actions github-actions bot marked this pull request as draft June 4, 2025 16:45
@uroslates uroslates marked this pull request as ready for review June 5, 2025 09:23
@github-actions github-actions bot marked this pull request as draft June 5, 2025 09:23
@Zeyber Zeyber marked this pull request as ready for review June 9, 2025 10:10
@github-actions github-actions bot marked this pull request as draft June 23, 2025 09:04
@uroslates uroslates marked this pull request as ready for review June 23, 2025 10:01
@uroslates uroslates merged commit cb8fe3f into develop Jun 23, 2025
35 checks passed
@uroslates uroslates deleted the feature/CXSPA-9967 branch June 23, 2025 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants