[ENG-9756] fix(addons): Show connected addon icon after oauth #833
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Summary of Changes
iconUrlfrom the existing authorized-storage-addon when connecting a new addon via OAuthincludedexternal-storage-providermodel of the API response ( this method here is given theincludedsection as a parameter and uses it to find the icon_url https://github.com/CenterForOpenScience/angular-osf/blob/feature/pbs-25-24/src/app/shared/mappers/addon.mapper.ts#L60)includedsection. This updates the existing authorized-storage-addon in the store as well. https://github.com/CenterForOpenScience/angular-osf/blob/develop/src/app/shared/services/addons/addons.service.ts#L93-L111?include=external-${addonType}-serviceto this PATCH request URL similar to other requests in this file, but it turns out that PATCH requests do not preserve theincludedsection of a response anyways (https://github.com/CenterForOpenScience/angular-osf/blob/develop/src/app/shared/services/json-api.service.ts#L56). I could try to monkeypatch theincludedsection into the returneddataobject if a PATCH request returns one (maybe something likedata._included?), but I don't know if it's quite worth it at this juncture and may be a broader architectural decision to make with the teamgetAuthorizedStorageOauthToken) does not have a icon_url, no icon is shown on the addon-cardScreenshot(s)
Side Effects
QA Notes