-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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])) |
There was a problem hiding this comment.
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);
There was a problem hiding this comment.
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 👍
There was a problem hiding this 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
@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. |
@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 |
Heh, fair enough. |
f82437c
to
f973812
Compare
@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.
f973812
to
eff2a4b
Compare
* 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) ...
"Sentry Apps" and Integrations are now sorted among one another. First by Installed vs Uninstalled status, then alphabetically within each of those groups.