Skip to content
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

[PWA-1065] Media Url generation should use store code header but have fallback to default like other store config queries #2941

Merged
merged 13 commits into from
Jan 26, 2021

Conversation

anthoula
Copy link
Contributor

@anthoula anthoula commented Jan 12, 2021

Description

As a admin user, I would like the ability to change settings in the admin panel to control the Media Url per store view so that I can store media assets for different locales in different media folders, and get that respected on Venia storefront.

Related Issue

https://jira.corp.magento.com/browse/PWA-1065

Acceptance

Verification Stakeholders

@dpatil-magento
@supernova-at

Specification

Verification Steps

  1. User goes to Stores > Configuration and change the scope to 2 store view
  2. User navigates to Store> Configuration >General> Web> Base URL (secure) for User Media Files and sees the default setting
  3. User updates the setting to use different media folder for store view 2. E.g. cdn.domain.com/store2/pub/media/
  4. User creates content (page/block) with image stored in the specified media location
  5. User navigates to the storefront and sees image displayed correctly

Screenshots / Screen Captures (if appropriate)

Checklist

  • I have added tests to cover my changes, if necessary.
  • I have added translations for new strings, if necessary.
  • I have updated the documentation accordingly, if necessary.

…fallback to default like other store config queries

- use storeConfig data on a store switch to get secure_base_media_url
- save secure_base_media_url to storage
- use secure_base_media_url in makeUrl, fallback to default
@PWAStudioBot
Copy link
Contributor

PWAStudioBot commented Jan 12, 2021

Messages
📖

Associated JIRA tickets: PWA-1065.

📖 DangerCI Failures related to missing labels/description/linked issues/etc will persist until the next push or next nightly build run (assuming they are fixed).
📖

Access a deployed version of this PR here. Make sure to wait for the "pwa-pull-request-deploy" job to complete.

Generated by 🚫 dangerJS against fb08a7c

@anthoula anthoula added the version: Minor This changeset includes functionality added in a backwards compatible manner. label Jan 12, 2021
…fallback to default like other store config queries

- update snapshot
…fallback to default like other store config queries

- set secure_base_media_url in storage, in the case of first load in non-default stores
…fallback to default like other store config queries

- use global value from AVAILABLE_STORE_VIEWS for mediaBackend default
…fallback to default like other store config queries

- fix existing tests
@anthoula anthoula marked this pull request as ready for review January 15, 2021 16:19
…fallback to default like other store config queries

- add comment to specify where AVAILABLE_STORE_VIEWS is coming from
@anthoula anthoula requested a review from supernova-at January 15, 2021 16:39
supernova-at
supernova-at previously approved these changes Jan 15, 2021
# Conflicts:
#	packages/peregrine/lib/talons/Header/__tests__/__snapshots__/useStoreSwitcher.spec.js.snap
#	packages/peregrine/lib/talons/Header/__tests__/useStoreSwitcher.spec.js
#	packages/peregrine/lib/talons/Header/storeSwitcher.gql.js
#	packages/peregrine/lib/talons/Header/useStoreSwitcher.js
@dpatil-magento
Copy link
Contributor

QA Approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:peregrine pkg:pwa-buildpack pkg:venia-ui Progress: done version: Minor This changeset includes functionality added in a backwards compatible manner.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants