Skip to content

Commit f47a7e1

Browse files
committed
review fixes
1 parent 15f4d01 commit f47a7e1

File tree

2 files changed

+8
-12
lines changed
  • src/sentry/static/sentry/app
    • components/organizations/globalSelectionHeader
    • views/organizationGroupDetails

2 files changed

+8
-12
lines changed

src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/index.jsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class GlobalSelectionHeader extends React.Component {
175175
}
176176

177177
// Update if URL parameters change
178-
if (this.didQueryChange(this.props, nextProps)) {
178+
if (this.changedQueryKeys(this.props, nextProps).length > 0) {
179179
return true;
180180
}
181181

@@ -232,26 +232,22 @@ class GlobalSelectionHeader extends React.Component {
232232
* Identifies if query string has changed (with query params that this component cares about)
233233
*
234234
*
235-
* @return {Boolean|String[]} Returns `false` if did not change, otherwise return an array of params that have changed
235+
* @return {String[]} Returns `false` if did not change, otherwise return an array of params that have changed
236236
*/
237-
didQueryChange = (prevProps, nextProps) => {
237+
changedQueryKeys = (prevProps, nextProps) => {
238238
const urlParamKeys = Object.values(URL_PARAM);
239239
const prevQuery = pick(prevProps.location.query, urlParamKeys);
240240
const nextQuery = pick(nextProps.location.query, urlParamKeys);
241241

242242
// If no next query is specified keep the previous global selection values
243243
if (Object.keys(prevQuery).length === 0 && Object.keys(nextQuery).length === 0) {
244-
return false;
244+
return [];
245245
}
246246

247247
const changedKeys = Object.values(urlParamKeys).filter(
248248
key => !isEqual(prevQuery[key], nextQuery[key])
249249
);
250250

251-
if (changedKeys.length === 0) {
252-
return false;
253-
}
254-
255251
return changedKeys;
256252
};
257253

@@ -260,7 +256,7 @@ class GlobalSelectionHeader extends React.Component {
260256
//
261257
// e.g. if selection store changed, don't trigger more actions
262258
// to update global selection store (otherwise we'll get recursive updates)
263-
const changedKeys = this.didQueryChange(prevProps, nextProps);
259+
const changedKeys = this.changedQueryKeys(prevProps, nextProps);
264260

265261
if (changedKeys === false) {
266262
return;

src/sentry/static/sentry/app/views/organizationGroupDetails/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class OrganizationGroupDetails extends React.Component {
2626
return (
2727
<GroupDetails
2828
environments={selection.environments}
29-
enableSnuba={true}
30-
showGlobalHeader={true}
29+
enableSnuba
30+
showGlobalHeader
3131
{...props}
3232
/>
3333
);
@@ -39,5 +39,5 @@ const OrganizationGroupDetailsHoC = withOrganization(
3939
);
4040

4141
export default function OrganizationGroupDetailsContainer(props) {
42-
return <OrganizationGroupDetailsHoC disableLoadFromStore={true} {...props} />;
42+
return <OrganizationGroupDetailsHoC disableLoadFromStore {...props} />;
4343
}

0 commit comments

Comments
 (0)