Skip to content

feat(nx2): port sandbox org-check to nx2#586

Open
hannessolo wants to merge 5 commits into
mainfrom
feat/nx2-org-check
Open

feat(nx2): port sandbox org-check to nx2#586
hannessolo wants to merge 5 commits into
mainfrom
feat/nx2-org-check

Conversation

@hannessolo

@hannessolo hannessolo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Co-Authored-By: Claude <noreply@anthropic.com>
@aem-code-sync

aem-code-sync Bot commented Jul 9, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

…ation

Co-Authored-By: Claude <noreply@anthropic.com>
@aem-code-sync aem-code-sync Bot temporarily deployed to feat/nx2-org-check July 9, 2026 12:15 Inactive
Co-Authored-By: Claude <noreply@anthropic.com>
@aem-code-sync aem-code-sync Bot temporarily deployed to feat/nx2-org-check July 9, 2026 12:19 Inactive
Co-Authored-By: Claude <noreply@anthropic.com>
@aem-code-sync aem-code-sync Bot temporarily deployed to feat/nx2-org-check July 9, 2026 12:22 Inactive
@hannessolo hannessolo requested a review from sharanyavinod July 9, 2026 12:22

@mhaack mhaack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does the toast.js has some tests as well we should update or should we add some.

Comment thread nx2/blocks/shared/toast/toast.js Outdated
Comment on lines +83 to +85
let variantClass = VARIANT_SUCCESS;
if (isError) variantClass = VARIANT_ERROR;
else if (isWarning) variantClass = VARIANT_WARNING;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only cosmetic but this could be ...

Suggested change
let variantClass = VARIANT_SUCCESS;
if (isError) variantClass = VARIANT_ERROR;
else if (isWarning) variantClass = VARIANT_WARNING;
const variantClass = isError ? VARIANT_ERROR : isWarning ? VARIANT_WARNING : VARIANT_SUCCESS;

Address PR review from @mhaack. The exact suggested form
'isError ? VARIANT_ERROR : isWarning ? VARIANT_WARNING : VARIANT_SUCCESS'
trips no-nested-ternary, so use the lint-clean equivalent
'isError || isWarning ? this.variant : VARIANT_SUCCESS' — same
observable output, one expression instead of let + if/else.

New test/nx2/blocks/shared/toast/toast.test.js (11 tests):
- Host region and nx-toast are created and wired up
- Empty / whitespace / missing text is a no-op
- Text is trimmed
- Default variant is success; role is 'status'
- Error and warning variants get the right class and role='alert'
- Unknown variant falls back to success
- CTA link renders when { href, text } is provided; absent otherwise
- Close button dismisses (removes the toast)
- maxWidth is applied as the --nx-toast-max-width inline var

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

[nx2] toast

2 participants