Skip to content

Conversation

@markstory
Copy link
Member

Add a confirmation to dashboard deletion. I needed a ?. in getSeriesSelection() to work around undefined sneaking in during tests.

Add a confirmation to dashboard deletion. I needed a ?. in
getSeriesSelection() to work around undefined sneaking in during tests.
@markstory markstory requested a review from a team January 14, 2021 19:31
@github-actions
Copy link
Contributor

size-limit report

Path Size
public/app.js 302.87 KB (added)
public/vendor.js 604.02 KB (added)
public/sentry.css 30.89 KB (added)

parameter = 'unselectedSeries'
): EChartOption.Legend['selected'] {
const unselectedSeries = decodeList(location.query[parameter]) ?? [];
const unselectedSeries = decodeList(location?.query[parameter]) ?? [];
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should abstract the decode(...location...) pattern a bit? Maybe if we start using hooks we can have functions that just useContext.

Copy link
Member

Choose a reason for hiding this comment

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

Definitely agree that abstracting the decode...(location.query...) pattern is a good idea. Though I'm not sure about hooks as we have a lot of class components using this pattern.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that we could combine the fallback values into the decodeX functions. We frequently coalesce and having simpler return types would help simplify a bunch of code.

parameter = 'unselectedSeries'
): EChartOption.Legend['selected'] {
const unselectedSeries = decodeList(location.query[parameter]) ?? [];
const unselectedSeries = decodeList(location?.query[parameter]) ?? [];
Copy link
Member

Choose a reason for hiding this comment

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

Definitely agree that abstracting the decode...(location.query...) pattern is a good idea. Though I'm not sure about hooks as we have a lot of class components using this pattern.

@markstory markstory merged commit da6bdb4 into master Jan 15, 2021
@markstory markstory deleted the fix/dashboard-delete branch January 15, 2021 15:01
@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants