Skip to content

feat(app-platform): Sort Integrations #12697

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

Merged
merged 1 commit into from
Apr 15, 2019
Merged

Conversation

mnoble
Copy link
Contributor

@mnoble mnoble commented Apr 9, 2019

"Sentry Apps" and Integrations are now sorted among one another. First by Installed vs Uninstalled status, then alphabetically within each of those groups.

@mnoble mnoble requested review from billyvg and MeredithAnya April 9, 2019 18:31
Copy link
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

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

I'm not sure those massive snapshots are providing much value. You might want to consider using a visual snapshot or an acceptance test instead.

renderBody() {
const {reloading, applications, appInstalls} = this.state;

const installedProviders = this.providers
Copy link
Member

Choose a reason for hiding this comment

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

There's kind of a lot of duplicated and/or very similar code, we could use lodash.partition to cut back some code. Downside of this is that readers will need to look up what partition does. (Current code is fine too though).

const [installedProviders, uninstalledProviders] = _.partition(this.providers.map(p => [p, this.renderProvider(p)]), ([provider,]) => provider.isInstalled);

// Combine the list of Providers and Sentry Apps that have installations.
const installed = installedProviders
.concat(installedSentryApps)
.sort((a, b) => a[0].localeCompare(b[0]))
Copy link
Member

Choose a reason for hiding this comment

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

imo, destructuring adds some more code but can be a bit more clear about what you're retrieving from the array:

const installed = installedProviders
      .concat(installedSentryApps)
      .sort(([name1,], [name2,]) => name1.localeCompare(name2))
      .map([,Component] => Component);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, more "punctuation", but definitely clearer 👍

Copy link
Member

@billyvg billyvg left a comment

Choose a reason for hiding this comment

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

Looks good, we should figure out better tests for tests/js/spec/views/settings/organizationIntegrations/__snapshots__/index.spec.jsx.snap instead of a massive 10k line snapshot

@mnoble
Copy link
Contributor Author

mnoble commented Apr 10, 2019

@billyvg 👍 Sorta tangential, but what's the benefit of those snapshot tests? I don't think I ever really understood. I suppose if you're changing data only, they ensure the rendering is unaffected? Seems like most of the time you're changing rendering and are just going to re-snapshot it, though.

@billyvg
Copy link
Member

billyvg commented Apr 10, 2019

@mnoble when they are 10k lines long... none and I think overall they provide little value. There may be some cases where you're shallow rendering and care about the structure of a component shrug

@mnoble
Copy link
Contributor Author

mnoble commented Apr 10, 2019

Heh, fair enough.

@mnoble mnoble force-pushed the app-platform/sort-integrations branch from f82437c to f973812 Compare April 10, 2019 21:45
@markstory
Copy link
Member

@mnoble Personally I would trash those jest snapshots and add percy snapshots and an acceptance test.

"Sentry Apps" and Integrations are now sorted among one another. First
by Installed vs Uninstalled status, then alphabetically within each of
those groupos.
@mnoble mnoble force-pushed the app-platform/sort-integrations branch from f973812 to eff2a4b Compare April 15, 2019 18:24
@mnoble mnoble merged commit 1362bed into master Apr 15, 2019
@mnoble mnoble deleted the app-platform/sort-integrations branch April 15, 2019 19:03
jan-auer added a commit that referenced this pull request Apr 16, 2019
* master: (50 commits)
  fix(ui) Don't show save-org-search on event search (#12785)
  ref(ui): Remove some unnecessary index.jsx files (#12606)
  feat(app-platform): Analytics (#12718)
  ref(js): Remove ApiMixin (#12384)
  test(js): Silence project plugin console info spam (#12761)
  test(js): Move SaveSearchStore.reset() (#12769)
  test(js): Add more fields to Group fixture (#12759)
  feat(app-platform): Integration "Learn More" modal (#12638)
  feat(saved-searches) Move create saved search button to search bar. (#12781)
  ref(global-header): Remove dead code (#12767)
  ref(releases): Refactored Releases Serializers (#12535)
  feat(app-platform): Sort Integrations (#12697)
  ref(audit-log): Log sso config updates (#12744)
  ref(app-platform): New 'Open In' UI  (#12621)
  feat(events): Use SnubaEvent if option is turned on (#12594)
  feat(global-selection-header): show settings icon link in single project mode (#12772)
  refs(api): Consolidate all search backend code into `SnubaSearchBackend`
  fix(tests) Remove large snapshots (#12766)
  fix: Update symbolicator snapshots (#12710)
  ref: Upgrade semaphore (#12751)
  ...
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2020
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.

3 participants