@designcrowd/fe-shared-lib 1.4.2 → 1.4.3-MP-4489.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/css/tailwind-brandCrowd.css +3 -6
  2. package/dist/css/tailwind-brandPage.css +3 -6
  3. package/dist/css/tailwind-crazyDomains.css +3 -6
  4. package/dist/css/tailwind-designCom.css +3 -6
  5. package/dist/css/tailwind-designCrowd.css +3 -6
  6. package/package.json +1 -1
  7. package/src/atoms/components/Dropdown/DropdownItem.vue +1 -1
  8. package/src/atoms/components/TextInput/TextInput.vue +2 -1
  9. package/src/bundles/bundled-translations.de-DE.json +2 -1
  10. package/src/bundles/bundled-translations.es-ES.json +2 -1
  11. package/src/bundles/bundled-translations.fr-CA.json +2 -1
  12. package/src/bundles/bundled-translations.fr-FR.json +2 -1
  13. package/src/bundles/bundled-translations.json +2 -1
  14. package/src/bundles/bundled-translations.pt-BR.json +2 -1
  15. package/src/bundles/bundled-translations.pt-PT.json +2 -1
  16. package/src/experiences/clients/brand-crowd-api.client.js +12 -1
  17. package/src/experiences/clients/brand-page-api.client.js +15 -0
  18. package/src/experiences/components/AuthFlow/AuthModal.vue +1 -1
  19. package/src/experiences/components/AuthFlow/ForgotPassword.vue +1 -1
  20. package/src/experiences/components/AuthFlow/ResetPassword.vue +1 -1
  21. package/src/experiences/components/AuthFlow/ResetPasswordSuccessModal.vue +1 -1
  22. package/src/experiences/components/AuthFlow/SocialSignInButton.vue +1 -1
  23. package/src/experiences/components/AuthFlow/SubmissionButton.vue +1 -1
  24. package/src/experiences/components/PaymentConfigList/PaymentConfig.mixin.js +20 -0
  25. package/src/experiences/components/PaymentConfigList/PaymentConfigDeleteConfigModal.vue +7 -5
  26. package/src/experiences/components/PaymentConfigList/PaymentConfigDropdown.vue +77 -39
  27. package/src/experiences/components/PaymentConfigList/PaymentConfigList.stories.js +45 -0
  28. package/src/experiences/components/PaymentConfigList/PaymentConfigList.vue +3 -3
  29. package/src/experiences/components/PaymentConfigList/i18n/shared-payment-config.de-DE.json +2 -1
  30. package/src/experiences/components/PaymentConfigList/i18n/shared-payment-config.es-ES.json +2 -1
  31. package/src/experiences/components/PaymentConfigList/i18n/shared-payment-config.fr-CA.json +2 -1
  32. package/src/experiences/components/PaymentConfigList/i18n/shared-payment-config.fr-FR.json +2 -1
  33. package/src/experiences/components/PaymentConfigList/i18n/shared-payment-config.json +2 -1
  34. package/src/experiences/components/PaymentConfigList/i18n/shared-payment-config.pt-BR.json +2 -1
  35. package/src/experiences/components/PaymentConfigList/i18n/shared-payment-config.pt-PT.json +2 -1
  36. package/src/experiences/components/UploadYourLogoApplication/UploadYourLogoApplication.vue +9 -3
  37. package/src/experiences/components/UploadYourLogoOnBoarding/LogoBusinessBrandColours.vue +3 -3
  38. package/src/experiences/components/UploadYourLogoOnBoarding/LogoCropper.vue +1 -1
  39. package/src/experiences/components/UploadYourLogoOnBoarding/LogoUploadModal.vue +1 -1
  40. package/src/experiences/components/UploadYourLogoOnBoarding/LogoUploader.vue +6 -1
  41. package/src/experiences/components/UploadYourLogoOnBoarding/UploadYourLogoOnBoarding.vue +6 -0
  42. package/src/experiences/components/UploadedLogoSearchResultCard/UploadedLogoSearchResultCard.vue +1 -1
@@ -738,6 +738,9 @@ video {
738
738
  .tw-mt-0 {
739
739
  margin-top: 0px;
740
740
  }
741
+ .tw-mt-0\.5 {
742
+ margin-top: 0.125rem;
743
+ }
741
744
  .tw-mt-1 {
742
745
  margin-top: 0.25rem;
743
746
  }
@@ -1600,9 +1603,6 @@ video {
1600
1603
  .tw-p-4 {
1601
1604
  padding: 1rem;
1602
1605
  }
1603
- .tw-p-5 {
1604
- padding: 1.25rem;
1605
- }
1606
1606
  .tw-p-6 {
1607
1607
  padding: 1.5rem;
1608
1608
  }
@@ -1738,9 +1738,6 @@ video {
1738
1738
  .tw-pt-2 {
1739
1739
  padding-top: 0.5rem;
1740
1740
  }
1741
- .tw-pt-4 {
1742
- padding-top: 1rem;
1743
- }
1744
1741
  .tw-pt-6 {
1745
1742
  padding-top: 1.5rem;
1746
1743
  }
@@ -738,6 +738,9 @@ video {
738
738
  .tw-mt-0 {
739
739
  margin-top: 0px;
740
740
  }
741
+ .tw-mt-0\.5 {
742
+ margin-top: 0.125rem;
743
+ }
741
744
  .tw-mt-1 {
742
745
  margin-top: 0.25rem;
743
746
  }
@@ -1448,9 +1451,6 @@ video {
1448
1451
  .tw-p-4 {
1449
1452
  padding: 1rem;
1450
1453
  }
1451
- .tw-p-5 {
1452
- padding: 1.25rem;
1453
- }
1454
1454
  .tw-p-6 {
1455
1455
  padding: 1.5rem;
1456
1456
  }
@@ -1586,9 +1586,6 @@ video {
1586
1586
  .tw-pt-2 {
1587
1587
  padding-top: 0.5rem;
1588
1588
  }
1589
- .tw-pt-4 {
1590
- padding-top: 1rem;
1591
- }
1592
1589
  .tw-pt-6 {
1593
1590
  padding-top: 1.5rem;
1594
1591
  }
@@ -738,6 +738,9 @@ video {
738
738
  .tw-mt-0 {
739
739
  margin-top: 0px;
740
740
  }
741
+ .tw-mt-0\.5 {
742
+ margin-top: 0.125rem;
743
+ }
741
744
  .tw-mt-1 {
742
745
  margin-top: 0.25rem;
743
746
  }
@@ -1600,9 +1603,6 @@ video {
1600
1603
  .tw-p-4 {
1601
1604
  padding: 1rem;
1602
1605
  }
1603
- .tw-p-5 {
1604
- padding: 1.25rem;
1605
- }
1606
1606
  .tw-p-6 {
1607
1607
  padding: 1.5rem;
1608
1608
  }
@@ -1738,9 +1738,6 @@ video {
1738
1738
  .tw-pt-2 {
1739
1739
  padding-top: 0.5rem;
1740
1740
  }
1741
- .tw-pt-4 {
1742
- padding-top: 1rem;
1743
- }
1744
1741
  .tw-pt-6 {
1745
1742
  padding-top: 1.5rem;
1746
1743
  }
@@ -738,6 +738,9 @@ video {
738
738
  .tw-mt-0 {
739
739
  margin-top: 0px;
740
740
  }
741
+ .tw-mt-0\.5 {
742
+ margin-top: 0.125rem;
743
+ }
741
744
  .tw-mt-1 {
742
745
  margin-top: 0.25rem;
743
746
  }
@@ -1600,9 +1603,6 @@ video {
1600
1603
  .tw-p-4 {
1601
1604
  padding: 1rem;
1602
1605
  }
1603
- .tw-p-5 {
1604
- padding: 1.25rem;
1605
- }
1606
1606
  .tw-p-6 {
1607
1607
  padding: 1.5rem;
1608
1608
  }
@@ -1738,9 +1738,6 @@ video {
1738
1738
  .tw-pt-2 {
1739
1739
  padding-top: 0.5rem;
1740
1740
  }
1741
- .tw-pt-4 {
1742
- padding-top: 1rem;
1743
- }
1744
1741
  .tw-pt-6 {
1745
1742
  padding-top: 1.5rem;
1746
1743
  }
@@ -738,6 +738,9 @@ video {
738
738
  .tw-mt-0 {
739
739
  margin-top: 0px;
740
740
  }
741
+ .tw-mt-0\.5 {
742
+ margin-top: 0.125rem;
743
+ }
741
744
  .tw-mt-1 {
742
745
  margin-top: 0.25rem;
743
746
  }
@@ -1600,9 +1603,6 @@ video {
1600
1603
  .tw-p-4 {
1601
1604
  padding: 1rem;
1602
1605
  }
1603
- .tw-p-5 {
1604
- padding: 1.25rem;
1605
- }
1606
1606
  .tw-p-6 {
1607
1607
  padding: 1.5rem;
1608
1608
  }
@@ -1738,9 +1738,6 @@ video {
1738
1738
  .tw-pt-2 {
1739
1739
  padding-top: 0.5rem;
1740
1740
  }
1741
- .tw-pt-4 {
1742
- padding-top: 1rem;
1743
- }
1744
1741
  .tw-pt-6 {
1745
1742
  padding-top: 1.5rem;
1746
1743
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designcrowd/fe-shared-lib",
3
- "version": "1.4.2",
3
+ "version": "1.4.3-MP-4489.1",
4
4
  "scripts": {
5
5
  "start": "run-p storybook watch:translation",
6
6
  "build": "npm run build:css --production",
@@ -2,7 +2,7 @@
2
2
  <div>
3
3
  <div
4
4
  class="tw-flex tw-items-center tw-px-2 tw-py-2 tw-cursor-pointer"
5
- @click="onClick"
5
+ @click.stop="onClick"
6
6
  :class="{
7
7
  'dropdown-item-hover': backgroundHover,
8
8
  }"
@@ -25,8 +25,9 @@
25
25
  <div
26
26
  :class="{
27
27
  'tw-relative': icon || enableInput,
28
+ 'tw-grow': !!prefixText,
29
+ 'tw-w-full': !prefixText,
28
30
  }"
29
- class="tw-w-full"
30
31
  >
31
32
  <div
32
33
  v-if="icon"
@@ -9,7 +9,8 @@
9
9
  "connected": "Verbunden",
10
10
  "inactive": "Inaktiv",
11
11
  "addPaymentProvider": "Zahlungsanbieter hinzufügen",
12
- "deletePaymentMethod": "Zahlungsmethode löschen"
12
+ "deletePaymentMethod": "Zahlungsmethode löschen",
13
+ "currencyLabel": "Währung"
13
14
  },
14
15
  "publishBrandPageModal": {
15
16
  "firstTimePublishHeaderLabel": "Legen Sie die URL für {{brandPageDisplayName}} fest",
@@ -9,7 +9,8 @@
9
9
  "connected": "Conectado",
10
10
  "inactive": "Inactivo",
11
11
  "addPaymentProvider": "Añadir proveedor de pago",
12
- "deletePaymentMethod": "Eliminar método de pago"
12
+ "deletePaymentMethod": "Eliminar método de pago",
13
+ "currencyLabel": "Moneda"
13
14
  },
14
15
  "publishBrandPageModal": {
15
16
  "firstTimePublishHeaderLabel": "Establece la URL para {{brandPageDisplayName}}",
@@ -9,7 +9,8 @@
9
9
  "connected": "Connecté",
10
10
  "inactive": "Inactif",
11
11
  "addPaymentProvider": "Ajouter un fournisseur de paiement",
12
- "deletePaymentMethod": "Supprimer le mode de paiement"
12
+ "deletePaymentMethod": "Supprimer le mode de paiement",
13
+ "currencyLabel": "Devise"
13
14
  },
14
15
  "publishBrandPageModal": {
15
16
  "firstTimePublishHeaderLabel": "Définissez l'URL pour {{brandPageDisplayName}}",
@@ -9,7 +9,8 @@
9
9
  "connected": "Connecté",
10
10
  "inactive": "Inactif",
11
11
  "addPaymentProvider": "Ajouter un fournisseur de paiement",
12
- "deletePaymentMethod": "Supprimer le mode de paiement"
12
+ "deletePaymentMethod": "Supprimer le mode de paiement",
13
+ "currencyLabel": "Devise"
13
14
  },
14
15
  "publishBrandPageModal": {
15
16
  "firstTimePublishHeaderLabel": "Définissez l'URL pour {{brandPageDisplayName}}",
@@ -9,7 +9,8 @@
9
9
  "connected": "Connected",
10
10
  "inactive": "Inactive",
11
11
  "addPaymentProvider": "Add Payment Provider",
12
- "deletePaymentMethod": "Delete payment method"
12
+ "deletePaymentMethod": "Delete payment method",
13
+ "currencyLabel": "Currency"
13
14
  },
14
15
  "publishBrandPageModal": {
15
16
  "firstTimePublishHeaderLabel": "Set the URL for {{brandPageDisplayName}}",
@@ -9,7 +9,8 @@
9
9
  "connected": "Conectado",
10
10
  "inactive": "Inativo",
11
11
  "addPaymentProvider": "Adicionar fornecedor de pagamentos",
12
- "deletePaymentMethod": "Excluir método de pagamento"
12
+ "deletePaymentMethod": "Excluir método de pagamento",
13
+ "currencyLabel": "Moeda"
13
14
  },
14
15
  "publishBrandPageModal": {
15
16
  "firstTimePublishHeaderLabel": "Defina o URL para {{brandPageDisplayName}}",
@@ -9,7 +9,8 @@
9
9
  "connected": "Ligado",
10
10
  "inactive": "Inativo",
11
11
  "addPaymentProvider": "Adicionar fornecedor de pagamentos",
12
- "deletePaymentMethod": "Eliminar método de pagamento"
12
+ "deletePaymentMethod": "Eliminar método de pagamento",
13
+ "currencyLabel": "Moeda"
13
14
  },
14
15
  "publishBrandPageModal": {
15
16
  "firstTimePublishHeaderLabel": "Defina o URL para {{brandPageDisplayName}}",
@@ -12,10 +12,21 @@ const getAxios = () => {
12
12
  return internalAxios || axios;
13
13
  };
14
14
 
15
- const uploadLogoAndGetDetails = async (logoFile) => {
15
+ /**
16
+ * @param {File} logoFile
17
+ * @param {Object} data
18
+ * @returns Promise<{ success: boolean, response: any, error: any }>
19
+ */
20
+ const uploadLogoAndGetDetails = async (logoFile, data) => {
16
21
  const formData = new FormData();
17
22
  formData.append('logoImage', logoFile && logoFile.file);
18
23
 
24
+ if (data && Object.keys(data).length > 0) {
25
+ Object.keys(data).forEach((key) => {
26
+ formData.append(key, data[key]);
27
+ });
28
+ }
29
+
19
30
  try {
20
31
  const response = await getAxios()({
21
32
  method: 'post',
@@ -24,6 +24,20 @@ const getPaymentConfigsByBrandPageToken = async (brandPageToken) => {
24
24
  }
25
25
  };
26
26
 
27
+ const getPaymentConfigCurrencyListByBrandPageTokenAsync = async () => {
28
+ try {
29
+ const response = await getAxios().get(`/maker/api/brand-pages/payment-configs/currency-list`);
30
+
31
+ if (response.status === 200) {
32
+ return response.data;
33
+ }
34
+
35
+ return null;
36
+ } catch (err) {
37
+ return null;
38
+ }
39
+ };
40
+
27
41
  const deletePaymentConfigByBrandPageTokenAndConfigId = async (brandPageToken, paymentConfigId) => {
28
42
  try {
29
43
  const response = await getAxios().delete(`/maker/api/brand-pages/${brandPageToken}/payment-configs`, {
@@ -44,4 +58,5 @@ export default {
44
58
  setBrandPageApiClientAxios,
45
59
  getPaymentConfigsByBrandPageToken,
46
60
  deletePaymentConfigByBrandPageTokenAndConfigId,
61
+ getPaymentConfigCurrencyListByBrandPageTokenAsync,
47
62
  };
@@ -17,7 +17,7 @@
17
17
  </div>
18
18
  </template>
19
19
  <script>
20
- import Icon from '../../../../src/atoms/components/Icon/Icon.vue';
20
+ import Icon from '../../../atoms/components/Icon/Icon.vue';
21
21
 
22
22
  export default {
23
23
  components: {
@@ -74,7 +74,7 @@
74
74
  </template>
75
75
  <script>
76
76
  import { getCurrentLocale } from '../../../useSharedLibTranslate';
77
- import HelloBar from '../../../../src/atoms/components/HelloBar/HelloBar.vue';
77
+ import HelloBar from '../../../atoms/components/HelloBar/HelloBar.vue';
78
78
  import SubmissionButton from './SubmissionButton.vue';
79
79
 
80
80
  export default {
@@ -64,7 +64,7 @@
64
64
  </template>
65
65
  <script>
66
66
  import { getCurrentLocale } from '../../../useSharedLibTranslate';
67
- import HelloBar from '../../../../src/atoms/components/HelloBar/HelloBar.vue';
67
+ import HelloBar from '../../../atoms/components/HelloBar/HelloBar.vue';
68
68
  import SubmissionButton from './SubmissionButton.vue';
69
69
 
70
70
  export default {
@@ -19,7 +19,7 @@
19
19
  </div>
20
20
  </template>
21
21
  <script>
22
- import Button from '../../../../src/atoms/components/Button/Button.vue';
22
+ import Button from '../../../atoms/components/Button/Button.vue';
23
23
 
24
24
  import AuthModal from './AuthModal.vue';
25
25
 
@@ -23,7 +23,7 @@
23
23
  </button>
24
24
  </template>
25
25
  <script>
26
- import Icon from '../../../../src/atoms/components/Icon/Icon.vue';
26
+ import Icon from '../../../atoms/components/Icon/Icon.vue';
27
27
 
28
28
  const TYPES = {
29
29
  FACEBOOK: 'facebook',
@@ -20,7 +20,7 @@
20
20
  </template>
21
21
 
22
22
  <script>
23
- import Button from '../../../../src/atoms/components/Button/Button.vue';
23
+ import Button from '../../../atoms/components/Button/Button.vue';
24
24
 
25
25
  export default {
26
26
  components: {
@@ -32,9 +32,15 @@ export default {
32
32
  data: () => ({
33
33
  isLoading: true,
34
34
  paymentConfigs: [],
35
+ currencies: [],
35
36
  selectedPaymentConfig: {},
36
37
  isStripeOptionActionVisible: false,
37
38
  }),
39
+ computed: {
40
+ selectedCurrency() {
41
+ return this.currencies.find((currency) => currency.iso4127Code === this.selectedPaymentConfig?.defaultCurrency);
42
+ },
43
+ },
38
44
  methods: {
39
45
  getPaymentConfigStatusDisplayText(paymentConfigStatus) {
40
46
  switch (paymentConfigStatus) {
@@ -94,5 +100,19 @@ export default {
94
100
  this.isLoading = false;
95
101
  }
96
102
  },
103
+
104
+ async getCurrentListAsync() {
105
+ try {
106
+ const result = await brandPageApiClient.getPaymentConfigCurrencyListByBrandPageTokenAsync();
107
+
108
+ if (result) {
109
+ this.currencies = result?.currencies || [];
110
+ }
111
+ } catch (err) {
112
+ if (process.env.NODE_ENV !== 'production') {
113
+ console.error(`Error fetching currency list: ${err}`);
114
+ }
115
+ }
116
+ },
97
117
  },
98
118
  };
@@ -40,17 +40,17 @@
40
40
  </Modal>
41
41
  </template>
42
42
  <script>
43
- import Modal from '../../../../src/atoms/components/Modal/Modal.vue';
44
- import Button from '../../../../src/atoms/components/Button/Button.vue';
45
- import Loader from '../../../../src/atoms/components/Loader/Loader.vue';
46
- import brandPageApiClient from './../../clients/brand-page-api.client';
43
+ import Modal from '../../../atoms/components/Modal/Modal.vue';
44
+ import Button from '../../../atoms/components/Button/Button.vue';
45
+ import Loader from '../../../atoms/components/Loader/Loader.vue';
46
+ import brandPageApiClient from '../../clients/brand-page-api.client';
47
+
47
48
  export default {
48
49
  components: {
49
50
  Modal,
50
51
  Button,
51
52
  Loader,
52
53
  },
53
- emits: ['close-modal', 'on-delete'],
54
54
  props: {
55
55
  paymentConfig: {
56
56
  type: Object,
@@ -60,8 +60,10 @@ export default {
60
60
  brandPageToken: {
61
61
  type: String,
62
62
  required: false,
63
+ default: () => undefined,
63
64
  },
64
65
  },
66
+ emits: ['close-modal', 'on-delete'],
65
67
  data: () => ({
66
68
  isLoading: false,
67
69
  }),
@@ -10,54 +10,84 @@
10
10
  variant="outline"
11
11
  @on-click="onAddPaymentProviderButtonClick"
12
12
  ></Button>
13
- <Dropdown v-if="!isLoading && !isAddPaymentProviderButtonVisible" ref="dropdown">
14
- <template #title>
15
- <div
16
- v-if="selectedPaymentConfig"
17
- class="tw-flex tw-items-center tw-px-2 tw-py-2 drop-down-item tw-cursor-pointer"
13
+ <div v-if="!isLoading && !isAddPaymentProviderButtonVisible">
14
+ <Dropdown ref="dropdown">
15
+ <template #title>
16
+ <div
17
+ v-if="selectedPaymentConfig"
18
+ class="tw-flex tw-items-center tw-px-2 tw-py-2 drop-down-item tw-cursor-pointer"
19
+ >
20
+ <span class="tw-text-sm tw-grow tw-select-none tw-flex tw-flex-col">
21
+ <span>{{ selectedPaymentConfig.name }}</span>
22
+ <small class="stripe-acct">({{ selectedPaymentConfig.paymentProviderExternalId }})</small>
23
+ </span>
24
+ <Pill class="tw-text-white" :class="getPaymentConfigStatusDisplayClasses(selectedPaymentConfig.status)">
25
+ {{ getPaymentConfigStatusDisplayText(selectedPaymentConfig.status) }}
26
+ </Pill>
27
+ </div>
28
+ </template>
29
+
30
+ <DropdownItem
31
+ v-for="paymentConfig in paymentConfigs"
32
+ :key="`payment-config-${paymentConfig.id}`"
33
+ @click="onPaymentConfigClick(paymentConfig)"
18
34
  >
19
35
  <span class="tw-text-sm tw-grow tw-select-none tw-flex tw-flex-col">
20
- <span>{{ selectedPaymentConfig.name }}</span>
21
- <small class="stripe-acct">({{ selectedPaymentConfig.paymentProviderExternalId }})</small>
36
+ <span>{{ paymentConfig.name }}</span>
37
+ <small class="stripe-acct">({{ paymentConfig.paymentProviderExternalId }})</small>
22
38
  </span>
23
- <Pill class="tw-text-white" :class="getPaymentConfigStatusDisplayClasses(selectedPaymentConfig.status)">
24
- {{ getPaymentConfigStatusDisplayText(selectedPaymentConfig.status) }}
39
+ <Pill class="tw-text-white" :class="getPaymentConfigStatusDisplayClasses(paymentConfig.status)">
40
+ {{ getPaymentConfigStatusDisplayText(paymentConfig.status) }}
25
41
  </Pill>
26
- </div>
27
- </template>
42
+ </DropdownItem>
28
43
 
29
- <DropdownItem
30
- v-for="paymentConfig in paymentConfigs"
31
- :key="`payment-config-${paymentConfig.id}`"
32
- @click="onPaymentConfigClick(paymentConfig)"
33
- >
34
- <span class="tw-text-sm tw-grow tw-select-none tw-flex tw-flex-col">
35
- <span>{{ paymentConfig.name }}</span>
36
- <small class="stripe-acct">({{ paymentConfig.paymentProviderExternalId }})</small>
37
- </span>
38
- <Pill class="tw-text-white" :class="getPaymentConfigStatusDisplayClasses(paymentConfig.status)">
39
- {{ getPaymentConfigStatusDisplayText(paymentConfig.status) }}
40
- </Pill>
41
- </DropdownItem>
44
+ <DropdownItem v-if="showAddPaymentProvider" class="tw-border-t-2" @click="onAddPaymentProviderButtonClick">
45
+ <Button
46
+ :full-width="true"
47
+ :label="sharedPaymentConfigTr('addPaymentProvider')"
48
+ size="small"
49
+ variant="outline"
50
+ @on-click="onAddPaymentProviderButtonClick"
51
+ />
52
+ </DropdownItem>
53
+ </Dropdown>
54
+ <!-- Currency -->
55
+ <template v-if="currencies && currencies.length > 0">
56
+ <h4 class="tw-mt-6 tw-mb-2 tw-text-sm tw-font-bold">{{ sharedPaymentConfigTr('currencyLabel') }}</h4>
57
+ <Dropdown ref="dropdownCurrency" :menu-element-classes="'tw-w-full'">
58
+ <template #title>
59
+ <div
60
+ v-if="selectedCurrency"
61
+ class="tw-flex tw-items-center tw-px-2 tw-py-2 drop-down-item tw-cursor-pointer"
62
+ >
63
+ <span class="tw-text-sm tw-grow tw-select-none tw-flex tw-flex-col">
64
+ <span>{{ selectedCurrency.iso4127Code }} ({{ selectedCurrency.symbol }})</span>
65
+ </span>
66
+ </div>
67
+ </template>
42
68
 
43
- <DropdownItem v-if="showAddPaymentProvider" class="tw-border-t-2" @click="onAddPaymentProviderButtonClick">
44
- <Button
45
- :full-width="true"
46
- :label="sharedPaymentConfigTr('addPaymentProvider')"
47
- size="small"
48
- variant="outline"
49
- @on-click="onAddPaymentProviderButtonClick"
50
- />
51
- </DropdownItem>
52
- </Dropdown>
69
+ <DropdownItem
70
+ v-for="currency in currencies"
71
+ :key="`currency-${currency.id}`"
72
+ @click="onCurrencyClick(currency)"
73
+ >
74
+ <span class="tw-text-sm tw-grow tw-select-none tw-flex tw-flex-col">
75
+ <span>{{ currency.iso4127Code }} ({{ currency.symbol }})</span>
76
+ </span>
77
+ <Icon v-if="selectedCurrency?.id === currency.id" name="check-thin" />
78
+ </DropdownItem>
79
+ </Dropdown>
80
+ </template>
81
+ </div>
53
82
  </div>
54
83
  </template>
55
84
  <script>
56
- import Button from '../../../../src/atoms/components/Button/Button.vue';
57
- import Dropdown from '../../../../src/atoms/components/Dropdown/Dropdown.vue';
58
- import DropdownItem from '../../../../src/atoms/components/Dropdown/DropdownItem.vue';
59
- import Loader from '../../../../src/atoms/components/Loader/Loader.vue';
60
- import Pill from '../../../../src/atoms/components/Pill/Pill.vue';
85
+ import Button from '../../../atoms/components/Button/Button.vue';
86
+ import Dropdown from '../../../atoms/components/Dropdown/Dropdown.vue';
87
+ import DropdownItem from '../../../atoms/components/Dropdown/DropdownItem.vue';
88
+ import Loader from '../../../atoms/components/Loader/Loader.vue';
89
+ import Pill from '../../../atoms/components/Pill/Pill.vue';
90
+ import Icon from '../../../atoms/components/Icon/Icon.vue';
61
91
 
62
92
  import PaymentConfigMixin, { paymentConfigStatuses } from './PaymentConfig.mixin';
63
93
  import { sharedPaymentConfigTr } from '../../../useSharedLibTranslate';
@@ -69,6 +99,7 @@ export default {
69
99
  DropdownItem,
70
100
  Loader,
71
101
  Pill,
102
+ Icon,
72
103
  },
73
104
  mixins: [PaymentConfigMixin],
74
105
  props: {
@@ -89,6 +120,8 @@ export default {
89
120
  },
90
121
  },
91
122
  async mounted() {
123
+ this.getCurrentListAsync();
124
+
92
125
  if (this.brandPageToken) {
93
126
  await this.updatePaymentConfigs();
94
127
  if (!this.selectedPaymentConfig && this.paymentConfigs.length === 0) {
@@ -125,6 +158,11 @@ export default {
125
158
  this.selectedPaymentConfig = paymentConfig;
126
159
  this.$emit('on-payment-config-selected', this.selectedPaymentConfig);
127
160
  },
161
+
162
+ onCurrencyClick(currency) {
163
+ this.$refs.dropdownCurrency.hideMenu();
164
+ this.$emit('on-currency-selected', currency);
165
+ },
128
166
  },
129
167
  };
130
168
  </script>
@@ -57,11 +57,53 @@ const PAYMENT_CONFIGS_RESPONSE = [
57
57
  },
58
58
  ];
59
59
 
60
+ const PAYMENT_CONFIGS_CURRENCY_LIST_RESPONSE = {
61
+ currencies: [
62
+ {
63
+ id: '9dce1a02-f415-433b-8ea8-0144c651e236',
64
+ name: 'United State Dollar',
65
+ iso4127Code: 'USD',
66
+ iso31662Code: 'US',
67
+ symbol: '$',
68
+ isSymbolPlacedBeforePrice: true,
69
+ created: '2023-06-21T01:04:12.961Z',
70
+ },
71
+ {
72
+ id: '38dc53a9-a66f-4c6d-b14c-cf987d7f779b',
73
+ name: 'Australian Dollar',
74
+ iso4127Code: 'AUD',
75
+ iso31662Code: 'AU',
76
+ symbol: '$',
77
+ isSymbolPlacedBeforePrice: true,
78
+ created: '2023-06-21T01:04:12.961Z',
79
+ },
80
+ {
81
+ id: '02c5a9f3-39f1-4764-bd91-a76982dd949a',
82
+ name: 'British Pound Sterling',
83
+ iso4127Code: 'GBP',
84
+ iso31662Code: 'UK',
85
+ symbol: '£',
86
+ isSymbolPlacedBeforePrice: true,
87
+ created: '2023-06-21T01:04:12.961Z',
88
+ },
89
+ {
90
+ id: '2b26857d-0525-4bf0-b37c-e020847e0bd2',
91
+ name: 'Euro',
92
+ iso4127Code: 'EUR',
93
+ iso31662Code: 'EU',
94
+ symbol: '€',
95
+ isSymbolPlacedBeforePrice: true,
96
+ created: '2023-06-21T01:04:12.961Z',
97
+ },
98
+ ],
99
+ };
100
+
60
101
  export const SampleStripe = () => {
61
102
  const mock = new MockAdapter(axios, { delayResponse: MOCK_RESPONSE_DELAY });
62
103
  const brandPageToken = '6bc3885c-7e5c-4c9e-9b54-21dcd06ca647';
63
104
 
64
105
  mock.onGet(`/maker/api/brand-pages/${brandPageToken}/payment-configs`).reply(200, PAYMENT_CONFIGS_RESPONSE);
106
+ mock.onGet(`/maker/api/brand-pages/payment-configs/currency-list`).reply(200, PAYMENT_CONFIGS_CURRENCY_LIST_RESPONSE);
65
107
 
66
108
  return {
67
109
  components: {
@@ -85,6 +127,7 @@ export const SampleStripeHideExternalId = () => {
85
127
  const brandPageToken = '6bc3885c-7e5c-4c9e-9b54-21dcd06ca647';
86
128
 
87
129
  mock.onGet(`/maker/api/brand-pages/${brandPageToken}/payment-configs`).reply(200, PAYMENT_CONFIGS_RESPONSE);
130
+ mock.onGet(`/maker/api/brand-pages/payment-configs/currency-list`).reply(200, PAYMENT_CONFIGS_CURRENCY_LIST_RESPONSE);
88
131
 
89
132
  return {
90
133
  components: {
@@ -112,6 +155,7 @@ export const SampleDropdownStripe = () => {
112
155
  const brandPageToken = '6bc3885c-7e5c-4c9e-9b54-21dcd06ca647';
113
156
 
114
157
  mock.onGet(`/maker/api/brand-pages/${brandPageToken}/payment-configs`).reply(200, PAYMENT_CONFIGS_RESPONSE);
158
+ mock.onGet(`/maker/api/brand-pages/payment-configs/currency-list`).reply(200, PAYMENT_CONFIGS_CURRENCY_LIST_RESPONSE);
115
159
 
116
160
  return {
117
161
  components: {
@@ -139,6 +183,7 @@ export const SampleDropdownStripeWithFilter = () => {
139
183
  const brandPageToken = '6bc3885c-7e5c-4c9e-9b54-21dcd06ca647';
140
184
 
141
185
  mock.onGet(`/maker/api/brand-pages/${brandPageToken}/payment-configs`).reply(200, PAYMENT_CONFIGS_RESPONSE);
186
+ mock.onGet(`/maker/api/brand-pages/payment-configs/currency-list`).reply(200, PAYMENT_CONFIGS_CURRENCY_LIST_RESPONSE);
142
187
 
143
188
  return {
144
189
  components: {
@@ -65,10 +65,10 @@
65
65
  </template>
66
66
 
67
67
  <script>
68
- import Loader from '../../../../src/atoms/components/Loader/Loader.vue';
69
- import Button from '../../../../src/atoms/components/Button/Button.vue';
68
+ import Loader from '../../../atoms/components/Loader/Loader.vue';
69
+ import Button from '../../../atoms/components/Button/Button.vue';
70
70
  import PaymentConfigDeleteConfigModal from './PaymentConfigDeleteConfigModal.vue';
71
- import Icon from '../../../../src/atoms/components/Icon/Icon.vue';
71
+ import Icon from '../../../atoms/components/Icon/Icon.vue';
72
72
 
73
73
  import PaymentConfigMixin from './PaymentConfig.mixin';
74
74
  import { sharedPaymentConfigTr } from '../../../useSharedLibTranslate';
@@ -5,6 +5,7 @@
5
5
  "connected" : "Verbunden",
6
6
  "inactive" : "Inaktiv",
7
7
  "addPaymentProvider" : "Zahlungsanbieter hinzufügen",
8
- "deletePaymentMethod" : "Zahlungsmethode löschen"
8
+ "deletePaymentMethod" : "Zahlungsmethode löschen",
9
+ "currencyLabel" : "Währung"
9
10
  }
10
11
  }
@@ -5,6 +5,7 @@
5
5
  "connected" : "Conectado",
6
6
  "inactive" : "Inactivo",
7
7
  "addPaymentProvider" : "Añadir proveedor de pago",
8
- "deletePaymentMethod" : "Eliminar método de pago"
8
+ "deletePaymentMethod" : "Eliminar método de pago",
9
+ "currencyLabel" : "Moneda"
9
10
  }
10
11
  }
@@ -5,6 +5,7 @@
5
5
  "connected" : "Connecté",
6
6
  "inactive" : "Inactif",
7
7
  "addPaymentProvider" : "Ajouter un fournisseur de paiement",
8
- "deletePaymentMethod" : "Supprimer le mode de paiement"
8
+ "deletePaymentMethod" : "Supprimer le mode de paiement",
9
+ "currencyLabel" : "Devise"
9
10
  }
10
11
  }
@@ -5,6 +5,7 @@
5
5
  "connected" : "Connecté",
6
6
  "inactive" : "Inactif",
7
7
  "addPaymentProvider" : "Ajouter un fournisseur de paiement",
8
- "deletePaymentMethod" : "Supprimer le mode de paiement"
8
+ "deletePaymentMethod" : "Supprimer le mode de paiement",
9
+ "currencyLabel" : "Devise"
9
10
  }
10
11
  }
@@ -5,6 +5,7 @@
5
5
  "connected": "Connected",
6
6
  "inactive": "Inactive",
7
7
  "addPaymentProvider": "Add Payment Provider",
8
- "deletePaymentMethod": "Delete payment method"
8
+ "deletePaymentMethod": "Delete payment method",
9
+ "currencyLabel": "Currency"
9
10
  }
10
11
  }
@@ -5,6 +5,7 @@
5
5
  "connected" : "Conectado",
6
6
  "inactive" : "Inativo",
7
7
  "addPaymentProvider" : "Adicionar fornecedor de pagamentos",
8
- "deletePaymentMethod" : "Excluir método de pagamento"
8
+ "deletePaymentMethod" : "Excluir método de pagamento",
9
+ "currencyLabel" : "Moeda"
9
10
  }
10
11
  }
@@ -5,6 +5,7 @@
5
5
  "connected" : "Ligado",
6
6
  "inactive" : "Inativo",
7
7
  "addPaymentProvider" : "Adicionar fornecedor de pagamentos",
8
- "deletePaymentMethod" : "Eliminar método de pagamento"
8
+ "deletePaymentMethod" : "Eliminar método de pagamento",
9
+ "currencyLabel" : "Moeda"
9
10
  }
10
11
  }
@@ -3,6 +3,7 @@
3
3
  <UploadYourLogoOnBoarding
4
4
  v-if="active"
5
5
  :logo-file="logoData.logoFile"
6
+ :logo-data="logoData.data"
6
7
  :use-dropzone="useDropzone"
7
8
  :is-post-purchase-user-upload="isPostPurchaseUserUpload"
8
9
  @on-exit="onExit"
@@ -41,6 +42,7 @@ export default {
41
42
  return {
42
43
  logoData: {
43
44
  logoFile: null,
45
+ data: null,
44
46
  },
45
47
  active: this.useDropzone,
46
48
  };
@@ -67,20 +69,21 @@ export default {
67
69
  */
68
70
  if (window) {
69
71
  window.addEventListener(Events.BeginUploadLogoExperience, (e) => {
70
- this.onBeginUploadLogoExperience(e.detail.file);
72
+ this.onBeginUploadLogoExperience(e.detail.file, e.detail.data);
71
73
  });
72
74
  }
73
75
  },
74
76
  beforeDestroy() {
75
77
  window.removeEventListener(Events.BeginUploadLogoExperience, (e) => {
76
- this.onBeginUploadLogoExperience(e.detail.file);
78
+ this.onBeginUploadLogoExperience(e.detail.file, e.detail.data);
77
79
  });
78
80
  },
79
81
  methods: {
80
- onBeginUploadLogoExperience(file) {
82
+ onBeginUploadLogoExperience(file, data) {
81
83
  this.active = true;
82
84
  this.logoData.logoFile = {
83
85
  file,
86
+ data,
84
87
  };
85
88
  },
86
89
  onExit({ currentStepTrackingLabel }) {
@@ -90,13 +93,16 @@ export default {
90
93
  reset() {
91
94
  this.active = false;
92
95
  this.logoData.logoFile = null;
96
+ this.logoData.data = null;
93
97
  },
94
98
  onUploadError() {
95
99
  this.logoData.logoFile = null;
100
+ this.logoData.data = null;
96
101
  },
97
102
  onFileChange(file) {
98
103
  this.logoData.logoFile = {
99
104
  file,
105
+ data: this.logoData.data || null,
100
106
  };
101
107
  },
102
108
  onFinish(e) {
@@ -121,9 +121,9 @@
121
121
  </template>
122
122
  <script>
123
123
  /* eslint-disable no-param-reassign */
124
- import Button from '../../../../src/atoms/components/Button/Button.vue';
125
- import Icon from '../../../../src/atoms/components/Icon/Icon.vue';
126
- import HelloBar from '../../../../src/atoms/components/HelloBar/HelloBar.vue';
124
+ import Button from '../../../atoms/components/Button/Button.vue';
125
+ import Icon from '../../../atoms/components/Icon/Icon.vue';
126
+ import HelloBar from '../../../atoms/components/HelloBar/HelloBar.vue';
127
127
  import trackEvent from '../../helpers/tracking';
128
128
  import hexDiff from '../../helpers/hex-diff';
129
129
  import { uploadYourLogoTr } from '../../../useSharedLibTranslate';
@@ -47,8 +47,8 @@
47
47
  </div>
48
48
  </template>
49
49
  <script>
50
- import Button from '../../../../src/atoms/components/Button/Button.vue';
51
50
  import VueCropper from 'vue-cropperjs';
51
+ import Button from '../../../atoms/components/Button/Button.vue';
52
52
 
53
53
  import trackEvent from '../../helpers/tracking';
54
54
  import { uploadYourLogoTr } from '../../../useSharedLibTranslate';
@@ -16,7 +16,7 @@
16
16
  </div>
17
17
  </template>
18
18
  <script>
19
- import Icon from '../../../../src/atoms/components/Icon/Icon.vue';
19
+ import Icon from '../../../atoms/components/Icon/Icon.vue';
20
20
 
21
21
  export default {
22
22
  components: {
@@ -19,6 +19,11 @@ export default {
19
19
  required: true,
20
20
  default: undefined,
21
21
  },
22
+ logoData: {
23
+ type: Object,
24
+ required: true,
25
+ default: undefined,
26
+ },
22
27
  eventCategory: {
23
28
  type: String,
24
29
  required: true,
@@ -50,7 +55,7 @@ export default {
50
55
  duration = Date.now() - start;
51
56
  }, 1);
52
57
 
53
- const result = await brandCrowdClient.uploadLogoAndGetDetails(this.logoFile);
58
+ const result = await brandCrowdClient.uploadLogoAndGetDetails(this.logoFile, this.logoData);
54
59
 
55
60
  clearInterval(intervalTimer);
56
61
  this.isRunning = false;
@@ -20,6 +20,7 @@
20
20
  <LogoUploader
21
21
  v-if="logoFile && !isAttemptingToExit && !hasError && currentStep === 1"
22
22
  :logo-file="logoFile"
23
+ :logo-data="logoData"
23
24
  :event-category="eventCategory"
24
25
  @on-upload-success="onUploadSuccess"
25
26
  @on-upload-error="onUploadError"
@@ -117,6 +118,11 @@ export default {
117
118
  required: false,
118
119
  default: undefined,
119
120
  },
121
+ logoData: {
122
+ type: Object,
123
+ required: false,
124
+ default: undefined,
125
+ },
120
126
  useDropzone: {
121
127
  type: Boolean,
122
128
  required: false,
@@ -98,7 +98,7 @@
98
98
  </template>
99
99
  <script>
100
100
  import axios from 'axios';
101
- import Button from '../../../../src/atoms/components/Button/Button.vue';
101
+ import Button from '../../../atoms/components/Button/Button.vue';
102
102
  import Events from '../../constants/event-constants';
103
103
  import API from '../../constants/api';
104
104
  import trackEvent from '../../helpers/tracking';