feat(new-widget-builder-experience): Add Metrics dataset - Part 1 - [DD-537]#33047
Conversation
| export default withIssueTags(IssuesSearchBar); | ||
| const IssuesSearchBar = withIssueTags(IssuesSearchBarContainer); | ||
|
|
||
| export {IssuesSearchBar}; |
There was a problem hiding this comment.
Thank you. I wasn't quite sure how to do the named export with the HoC so this is good. I realized the tests are failing elsewhere because this IssuesSearchBar is shared with the modal, we need to update the import in issueWidgetQueriesForm.tsx. I'll push a commit up
There was a problem hiding this comment.
I think you can also do export const IssuesSearchBar = withIssueTags(IssuesSearchBarContainer); 😄
b16da70 to
2b3315a
Compare
size-limit report 📦
|
|
|
||
| export function useMetricMetas() { | ||
| const api = useApi(); | ||
| const organization = useOrganization(); |
There was a problem hiding this comment.
When I go into a dashboard and try to add from the 'Add Widget' button, I get an error saying useOrganization called but organization is not set
There was a problem hiding this comment.
this shouldn't happened :/ the OrganizationContainerContext is wrapping the whole app... I will take a look into it...thanks.
| onSearch={handleSearch(queryIndex)} | ||
| /> | ||
| ) : ( | ||
| <ReleaseSearchBar |
There was a problem hiding this comment.
when I add stuff to the filter and click outside to onBlur, it resets the selected fields to events defaults
There was a problem hiding this comment.
Order bys also are broken, they show issue fields (I guess the search bar and order by isn't in the scope of this PR?) if so, can we just remove the fields? for now?
There was a problem hiding this comment.
I've one more PR on the top of this one for the sortBy #33241
There was a problem hiding this comment.
when I add stuff to the filter and click outside to onBlur, it resets the selected fields to events defaults
yes this was fixed in the follow-up PRs
edwardgou-sentry
left a comment
There was a problem hiding this comment.
I'm not that familiar with all the release metrics context but code looks good to me. Just had a few observations but I dont think any of them are blockers
| (prevState.displayType === DisplayType.TABLE && | ||
| widgetToBeUpdated?.widgetType && | ||
| WIDGET_TYPE_TO_DATA_SET[widgetToBeUpdated.widgetType] === DataSet.ISSUES) || |
There was a problem hiding this comment.
Hmm I wonder if this part of the condition is necessary? Looks like it's going to run any time we switch to the table visualization when editing an issue widget. I notice some behaviour differences in the builder depending on the widget type due to this (switching to table display on an existing discover widget behaves differently from an existing issue widget even if you already edited the both widgets to the exact same state).
There was a problem hiding this comment.
Not a blocker though, this doesn't seem like part of what this PR is addressing. We can also discuss details offline
| useEffect(() => { | ||
| let unmounted = false; | ||
|
|
||
| if (!unmounted && shouldFetchMetricTags) { | ||
| fetchMetricsTags(api, organization.slug, selection.projects); | ||
| } | ||
|
|
||
| return () => { | ||
| unmounted = true; | ||
| }; | ||
| }, [selection.projects, organization.slug, shouldFetchMetricTags]); |
There was a problem hiding this comment.
Not a blocker, but I think it's possible for fetchMetricsTags to be ran multiple times if it is not loaded and useMetricTags is used multiple times on the same page. This is because the loaded variable is only set to true after the request to metrics/tags/ is finished so multiple requests can happen if they are fired at the same time.
Maybe we can investigate reducing this to a single request by having some kind of state for loading in the store (i think useProjects does something similar)? I think this also applies for useMetricMetas. Again, not a blocker.
There was a problem hiding this comment.
yes I've noticed that and was talking about it with @narsaynorath yesterday... that's why we are still keeping the fetching(tags and fields) on the top of the widget builder, but that's something we want to improve and will investigate afterward
|
@edwardgou-sentry I'm addressing your feedback in a follow-up PR 😉 |

useMetricTagsanduseMetricMetags+ TestsloadedPreview:
Screen.Recording.2022-04-03.at.14.24.11.mov