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

feat(snackbar): iss 783 viv 402 snackbar #808

Merged
merged 60 commits into from
May 11, 2021
Merged

Conversation

gullerya
Copy link
Contributor

@gullerya gullerya commented May 2, 2021

closes #783

  • Legacy mode
  • Modern mode

@github-actions
Copy link

github-actions bot commented May 2, 2021

🚀

Latest successful build of the PR deployed here.

🚀

@gullerya gullerya added the Work in Progress You're welcome to have a look around and drop your early comments label May 2, 2021
@yinonov yinonov marked this pull request as draft May 3, 2021 11:57
@yinonov
Copy link
Contributor

yinonov commented May 3, 2021

stories are evil

actualElement.show();
await waitNextTask();

await expect(actualElement).shadowDom.accessible();
Copy link
Contributor

Choose a reason for hiding this comment

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

What does accessible do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

a11y plugin installs this check and the method that is running within, to the best of my knowledge, performs set of accessibility checks (aria labels, contrast color etc).

Copy link
Contributor

Choose a reason for hiding this comment

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

So it is magic? I like...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really magic, but something quite similar to equalSnapshot.

Comment on lines +44 to +50
export enum Position {
Top = 'TOP',
Bottom = 'BOTTOM',
Start = 'START',
Center = 'CENTER',
End = 'END'
}
Copy link
Contributor

Choose a reason for hiding this comment

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

no horizontal position?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

start / center / end - this is horizontal.

Comment on lines +116 to +137
private renderFlavor(legacy: boolean): TemplateResult {
const partValue = legacy ? undefined : 'vvd-scheme-alternate';
return html`<div class="vivid-snackbar" part="${ifDefined(partValue)}">
<vwc-note
icon="${ifDefined(this.icon)}"
connotation="${ifDefined(this.connotation)}"
header="${ifDefined(this.header)}"
>
<div class="snackbar-content">
<div>
${this.message}
<div class="action-container">
<slot name="action" @click="${this.handleActionClick}"></slot>
</div>
</div>
<div class="dismiss-container">
${this.renderDismissAction()}
</div>
</div>
</vwc-note>
</div>`;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

why such a large indentation? by eslint approval?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is just github presentation - in the IDE it looks okay :)

@@ -2831,6 +2831,17 @@
lit-html "^1.1.2"
Copy link
Contributor

Choose a reason for hiding this comment

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

OMG - seeing yarn.lock changing scares me now... ;)

Comment on lines 15 to 18
const [snackbar] = addElement(
textToDomToParent(`<${COMPONENT_NAME} message="Message"></${COMPONENT_NAME}>`)
);
await openSnackbar(snackbar);
Copy link
Contributor

Choose a reason for hiding this comment

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

Move to beforeEach?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment on lines 13 to 17
const [snackbar] = addElement(
textToDomToParent(`<${COMPONENT_NAME}></${COMPONENT_NAME}>`)
);
await snackbar.updateComplete;
await openSnackbar(snackbar);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can move to beforeEach

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@sonarcloud
Copy link

sonarcloud bot commented May 10, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@gullerya gullerya merged commit 25c750e into master May 11, 2021
@gullerya gullerya deleted the iss-783/viv-402-snackbar branch May 11, 2021 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Type: Component 🛠 Assigned to PRs delivering brand-new components to the Vivid catalog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VIV-402 Implement snackbar component
4 participants