@feedmepos/mf-order-setting 0.0.93 → 0.0.94

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 (32) hide show
  1. package/dist/{DisplaySystemView-BMRCs7o8.js → DisplaySystemView-Doh1JUoe.js} +3 -3
  2. package/dist/{KioskDevicesView-BCZOqou3.js → KioskDevicesView-DvUq9eFa.js} +1 -1
  3. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-4wFO9co5.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-Ce-CHsOK.js} +3 -3
  4. package/dist/{KioskSettingView-DIvpRwFV.js → KioskSettingView-Ba1sLolg.js} +3 -3
  5. package/dist/{KioskView-w4txC9m2.js → KioskView-CeKSWYbI.js} +5 -5
  6. package/dist/{OrderSettingsView-BPuBA2QC.js → OrderSettingsView-CdxkPS_V.js} +17715 -17601
  7. package/dist/{app-xZAaURng.js → app-BQ0W0_dt.js} +289 -241
  8. package/dist/app.js +1 -1
  9. package/dist/{featureFlag-Cbj0uMaM.js → featureFlag-C4gAe_F4.js} +1 -1
  10. package/dist/frontend/mf-order/src/api/native-app/index.d.ts +2 -0
  11. package/dist/frontend/mf-order/src/app.d.ts +48 -0
  12. package/dist/frontend/mf-order/src/main.d.ts +48 -0
  13. package/dist/frontend/mf-order/src/views/order-settings/components/push-availability.d.ts +13 -0
  14. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  15. package/dist/{index-BAFwfvqv.js → index-BFJ4YEfL.js} +2 -2
  16. package/dist/{index-BxQKdXyN.js → index-CGiJXVU3.js} +1 -1
  17. package/dist/{index-Cipbdi6i.js → index-DSB009Br.js} +1 -1
  18. package/dist/{order.dto-yLICIGDQ.js → order.dto-CUp8zhQC.js} +18 -18
  19. package/dist/package/entity/order-platform/tng/tng-menu.do.d.ts +74 -74
  20. package/package.json +1 -1
  21. package/src/api/native-app/index.ts +26 -0
  22. package/src/api/native-app/native-app.spec.ts +42 -0
  23. package/src/locales/en-US.json +12 -0
  24. package/src/locales/ja-JP.json +12 -0
  25. package/src/locales/th-TH.json +12 -0
  26. package/src/locales/zh-CN.json +12 -0
  27. package/src/views/order-settings/components/NotifyChannelEditor.spec.ts +184 -0
  28. package/src/views/order-settings/components/NotifyChannelEditor.vue +84 -5
  29. package/src/views/order-settings/components/push-availability.spec.ts +59 -0
  30. package/src/views/order-settings/components/push-availability.ts +78 -0
  31. package/src/views/order-settings/queue/QueueSetting.vue +7 -0
  32. package/src/views/order-settings/sms/SmsSetting.vue +11 -0
@@ -13,6 +13,7 @@ import {
13
13
  } from '@entity'
14
14
  import RestaurantSelector from '../components/RestaurantSelector.vue'
15
15
  import NotifyChannelEditor from '../components/NotifyChannelEditor.vue'
16
+ import { pushBlocked, usePushAvailability } from '../components/push-availability'
16
17
 
17
18
  import { useCoreStore } from '@feedmepos/mf-common'
18
19
  import { Dinero } from '@feedmepos/core'
@@ -23,6 +24,7 @@ const { t } = useI18n()
23
24
  import { SMS } from '@common'
24
25
 
25
26
  const { showSuccess, showError } = useSnackbarFunctions()
27
+ const { availability: pushAvailability } = usePushAvailability()
26
28
  const { currentRestaurant } = useCoreStore()
27
29
  const { isLoading, startAsyncCallWithErr, startLoading } = useLoading()
28
30
 
@@ -98,6 +100,10 @@ async function toggleEnable(enable: boolean, sms: OrderSmsSettingDto) {
98
100
  showError(t('order.notifyChannel.messageRequired'))
99
101
  return
100
102
  }
103
+ if (enable && pushBlocked(sms.channels, pushAvailability.value)) {
104
+ showError(t('order.notifyChannel.pushAvailability.removeBeforeSave'))
105
+ return
106
+ }
101
107
  const smsSetting = orderSmsSettings.value.map((_sms: OrderSmsSettingDto) => {
102
108
  if (_sms.action === sms.action && _sms.type === sms.type) {
103
109
  _sms.enable = enable
@@ -134,6 +140,11 @@ async function confirmTextField(index: number) {
134
140
  showError(t('order.notifyChannel.messageRequired'))
135
141
  return
136
142
  }
143
+ // Same rule as Connect: a stored push is not saved again for a business without a native app.
144
+ if (pushBlocked(setting.channels, pushAvailability.value)) {
145
+ showError(t('order.notifyChannel.pushAvailability.removeBeforeSave'))
146
+ return
147
+ }
137
148
  await updateOrderSetting()
138
149
  }
139
150
  }