-
Notifications
You must be signed in to change notification settings - Fork 1
feat(currency): Currency switcher #175
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
base: release/v0.2
Are you sure you want to change the base?
Conversation
WalkthroughA currency switching feature was introduced. This includes a new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CurrencySwitcherInner
participant usePondSalesChannel
participant ShopwareApiClient
participant SessionContext
User->>CurrencySwitcherInner: Mount component
CurrencySwitcherInner->>SessionContext: Get current currency
CurrencySwitcherInner->>usePondSalesChannel: getAvailableCurrencies()
usePondSalesChannel->>ShopwareApiClient: Fetch available currencies
ShopwareApiClient-->>usePondSalesChannel: Return currency list
usePondSalesChannel-->>CurrencySwitcherInner: Return currency list
CurrencySwitcherInner->>User: Render dropdown with currencies
User->>CurrencySwitcherInner: Select new currency
CurrencySwitcherInner->>SessionContext: Update current currency
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
components/CurrencySwitcher.vue
(1 hunks)components/CurrencySwitcherInner.vue
(1 hunks)components/layout/footer/LayoutFooterInner.vue
(1 hunks)composables/usePondSalesChannel.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: review-app
🔇 Additional comments (4)
composables/usePondSalesChannel.ts (2)
1-15
: Well-structured composable with proper caching and error handling.The composable follows good patterns with dependency injection, caching, and error handling. The API integration looks correct for Shopware's sales channel.
8-11
: ```shell
#!/bin/bashDisplay CurrencySwitcherInner.vue to verify null handling after API failure
sed -n '1,200p' components/CurrencySwitcherInner.vue
</details> <details> <summary>components/CurrencySwitcher.vue (1)</summary> `1-3`: **Good wrapper pattern for component composition.** Clean implementation using the wrapper pattern, allowing for separation of concerns between layout and logic components. </details> <details> <summary>components/layout/footer/LayoutFooterInner.vue (1)</summary> `52-56`: **Well-positioned currency switcher slot with responsive design.** The slot placement between navigation sections is logical, and the responsive CSS classes properly handle mobile (`w-full mt-5`) and desktop (`md:mt-0 md:w-auto`) layouts with appropriate alignment. </details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
components/CurrencySwitcherInner.vue
Outdated
const availableCurrencies: Ref<null | Schemas['Currency'][]> = ref(null); | ||
const selectedCurrencyId: Ref<null | AcceptableValue> = ref(null); |
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.
const availableCurrencies: Ref<null | Schemas['Currency'][]> = ref(null); | |
const selectedCurrencyId: Ref<null | AcceptableValue> = ref(null); | |
const availableCurrencies: Ref<undefined | Schemas['Currency'][]> = ref(undefined); | |
const selectedCurrencyId: Ref<undefined | AcceptableValue> = ref(undefined); |
https://cookbook.bscm.academy/general/codingConventionsTypescript/#undefined-instead-of-null
components/CurrencySwitcherInner.vue
Outdated
<UiSelectContent> | ||
<UiSelectGroup> | ||
<UiSelectItem | ||
v-for="availableCurrency in availableCurrencies || []" |
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.
why not using a v-if to check whether its undefined?
Summary by CodeRabbit