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

fix(helpers): extract option name from translated object #1243

Merged

Conversation

mkucmus
Copy link
Collaborator

@mkucmus mkucmus commented Nov 18, 2020

Changes

Always try to use the translated label/name of an option. If it's not possible, use the entity's name directly.

Checklist

@mkucmus mkucmus requested a review from Malwurf November 18, 2020 10:52
@vercel
Copy link

vercel bot commented Nov 18, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/shopware-pwa/shopware-pwa-docs/5fli2p177
✅ Preview: https://shopware-pwa-d-git-fix-extract-option-name-from-translat-fec85c.shopware-pwa.vercel.app

@mkucmus mkucmus changed the base branch from master to release/v0.5 November 18, 2020 10:52
@github-actions
Copy link

💙 shopware-pwa-canary successfully deployed at https://1422098ce37f9395d3e4e21e027bf96e3cfcb218.shopware-pwa-canary.preview.storefrontcloud.io

Copy link
Collaborator

@Malwurf Malwurf left a comment

Choose a reason for hiding this comment

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

Yeah! Now we know blau color 💙

@mkucmus mkucmus merged commit 8537e36 into release/v0.5 Nov 18, 2020
@mkucmus mkucmus deleted the fix/extract-option-name-from-translated-object branch November 18, 2020 13:30
if (option.group?.name) {
if (!typeOptions.hasOwnProperty(option.group.name)) {
typeOptions[option.group.name] = [];
const groupName = option.group?.translated?.name || option.group?.name;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we've got a couple of places left in our code, where we go straight for the property instead of the translated.property. We should, in general, always go for the translated field and never use the original field of any entity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants