Skip to content

Commit

Permalink
fix: refresh store of component
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaraLpresta committed Oct 31, 2024
1 parent b72c5d2 commit a2f1510
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
7 changes: 2 additions & 5 deletions _dev/apps/ui/src/components/commons/select-country.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
:class="{'maxw-sm-500': notFullWidth }"
>
<template #option="option">
<div class="d-flex flex-wrap flex-md-nowrap align-items-center pr-3">
<div class="flex-wrap pr-3 d-flex flex-md-nowrap align-items-center">
<span
class="mr-2"
v-html="highlightSearch(option.name)"
Expand All @@ -34,17 +34,14 @@ export default defineComponent({
},
data() {
return {
countriesChosen: [],
countriesChosen: [] as string[],
searchString: '',
};
},
props: {
defaultValue: {
type: [String, Array],
required: true,
default() {
return [];
},
},
dropdownOptions: {
type: Array,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<b-form>
<b-form-group
:label="$tc('productFeedSettings.deliveryTimeAndRates.targetCountries', 3)"
label-class="title-size-h3 font-weight-600 mb-2 d-block p-0 bg-transparent border-0"
label-class="p-0 mb-2 bg-transparent border-0 title-size-h3 font-weight-600 d-block"
>
<label class="mb-2">
{{ $t('productFeedSettings.deliveryTimeAndRates.productAvailaibleIn') }}
Expand All @@ -24,8 +24,8 @@
v-if="isUS && shippingSetupOption"
class="pb-2"
>
<div class="d-flex flex-wrap align-items-center mb-3">
<span class="h4 mb-0 font-weight-600 mr-1">
<div class="flex-wrap mb-3 d-flex align-items-center">
<span class="mb-0 mr-1 h4 font-weight-600">
{{ $t('productFeedSettings.deliveryTimeAndRates.taxSettings') }}
</span>
<span class="text-muted ps_gs-fz-12">
Expand Down Expand Up @@ -110,9 +110,12 @@ export default {
activeCountriesWithCurrency(): string[] {
return this.$store.getters['app/GET_ACTIVE_COUNTRIES_FOR_ACTIVE_CURRENCY'];
},
deliveryDetails(): DeliveryDetail[] {
return this.$store.state.productFeed.settings.deliveryDetails;
},
activeCountriesWhereShipppingExist(): string[] {
const arrayOfCountries: string[] = [];
this.$store.state.productFeed.settings.deliveryDetails.forEach((carrier: DeliveryDetail) => {
this.deliveryDetails.forEach((carrier: DeliveryDetail) => {
if (!carrier.country.length) {
return;
}
Expand All @@ -137,5 +140,9 @@ export default {
this.$emit('countrySelected', null);
},
},
mounted() {
// Refresh component
this.$store.dispatch('productFeed/GET_SAVED_ADDITIONAL_SHIPPING_SETTINGS');
},
};
</script>

0 comments on commit a2f1510

Please sign in to comment.