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

refactor(alert, notice)!: Renamed properties and updated values #6042

Merged
merged 8 commits into from
Dec 15, 2022

Conversation

macandcheese
Copy link
Contributor

@macandcheese macandcheese commented Dec 14, 2022

BREAKING CHANGE: Renamed color properties and updated values.

  • Renamed the property color, use kind instead.
  • Updated the accepted values of kind to brand, danger, info, success, and warning.

BREAKING CHANGE: Renamed `color` properties and updated values.

- Removed the property `color`, use `kind` instead.
- Updated the accepted values for `kind` to `brand`, `danger`, `info`, `success`, and `warning`.
@macandcheese macandcheese added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Dec 14, 2022
@macandcheese macandcheese requested a review from a team as a code owner December 14, 2022 23:40
@github-actions github-actions bot added the refactor Issues tied to code that needs to be significantly reworked. label Dec 14, 2022
@@ -16,3 +17,11 @@ export type Width = "auto" | "half" | "full";
// used to help track of event payloads to remove at 1.0.0 – see https://github.com/Esri/calcite-components/issues/3781
/* Note : should be removed before `1.0 */
export type DeprecatedEventPayload = any;

export enum KindIcons {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a better place for this? Previously notice was referencing this from the alert interfaces.ts.

Copy link
Member

Choose a reason for hiding this comment

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

I thought the enum types were causing issues on the doc site?

This is the correct place for types. constants would go in a resources file in the folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These aren't publicly exposed, so not an issue for doc site. But they are used by more than one component - it seemed weird that previously Notice was referencing this from the Alert resources file - maybe a resources file in the component root is better than this location (although this would be the only thing)?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah maybe resources is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 added a shared resources.ts file to the /component folder root. Will merge after checks run.

@@ -46,6 +46,7 @@ import {
LoadableComponent,
componentLoaded
} from "../../utils/loadable";
import { MenuPlacement } from "../../utils/floating-ui";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I updated to use this shared resource instead of explicitly defining in interfaces.ts, since the accepted values are the same. That said, alert doesn't use floating-ui, so I can revert if needed.

@macandcheese
Copy link
Contributor Author

@driskull @benelan is there a better format for Updated the accepted values... part of the changelog entry? I couldn't find any previous examples that renamed values in this way.

@macandcheese macandcheese added pr ready for visual snapshots Adding this label will run visual snapshot testing. breaking change Issues and pull requests with code changes that are not backwards compatible. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Dec 15, 2022
Copy link
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

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

👍

@macandcheese macandcheese merged commit 132d243 into master Dec 15, 2022
@macandcheese
Copy link
Contributor Author

Merging this - it's approved in Chromatic, not sure why that isn't being reflected for the "UI Tests" check.

@macandcheese macandcheese deleted the macandcheese/5950-5952-alert-notice-refactor branch December 15, 2022 20:26
@github-actions github-actions bot added this to the 2023 January Priorities milestone Dec 15, 2022
@benelan
Copy link
Member

benelan commented Dec 15, 2022

Merging this - it's approved in Chromatic, not sure why that isn't being reflected for the "UI Tests" check.

The Chromatic UI Review functionality isn't a required check, we haven't setup any workflows for using it yet. In order to pass the CI you need to accept/deny the individual snapshots by clicking on the UI Tests check's "details" link.

Additionally, when the you push more changes to the branch you need to toggle the pr ready for visual snapshots label to get the snapshots to run again. This saves us a lot of snapshots, which allows us to add more coverage. Previously screener was running every time changes were pushed to the PR's branch.

I created a bash function to automatically toggle the label when you are ready to merge, or when you need to see the results of the snapshots. It requires the GitHub CLI.

function ccvsnaps() {
    if [[ "$(gh repo view --json name -q ".name")" = "calcite-components" ]]; then
        local current_branch
        current_branch="$(git symbolic-ref --short HEAD)"
        gh pr edit "$current_branch" --remove-label "pr ready for visual snapshots"
        gh pr edit "$current_branch" --add-label "pr ready for visual snapshots"
    fi
}

We also have some known false positives that you can approve if they come up. I'll fix the false positives and add all of this info to CONTRIBUTING when I have a sec. I'll also make Chromatic run when adding a flag to a commit message so the label toggling workflow isn't so annoying lol. Maybe [ci] or [snap]. For example, pushing a commit with this message would run chromatic

fix review items [ci]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Issues and pull requests with code changes that are not backwards compatible. pr ready for visual snapshots Adding this label will run visual snapshot testing. refactor Issues tied to code that needs to be significantly reworked.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants