ordering-ui-admin-external 1.43.0 → 1.43.2

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 (25) hide show
  1. package/_bundles/{ordering-ui-admin.4cea57b9d7d8884bab6f.js → ordering-ui-admin.9f73fdc1ef3e64fd05df.js} +2 -2
  2. package/_modules/components/Delivery/DriversGroupGeneralForm/index.js +2 -2
  3. package/_modules/components/Orders/AllInOne/index.js +1 -0
  4. package/_modules/components/Orders/Messages/index.js +5 -6
  5. package/_modules/components/Orders/OrdersFilterGroup/index.js +23 -10
  6. package/_modules/components/Orders/OrdersHeaderFilterGroup/index.js +15 -5
  7. package/_modules/components/Orders/OrdersHeaderFilterGroup/styles.js +1 -1
  8. package/_modules/components/Shared/SearchBar/index.js +13 -9
  9. package/_modules/components/Shared/SearchBar/styles.js +15 -12
  10. package/_modules/components/Stores/BusinessInformation/index.js +192 -9
  11. package/_modules/components/Stores/BusinessInformation/styles.js +27 -3
  12. package/_modules/utils/index.js +38 -1
  13. package/package.json +2 -2
  14. package/src/components/Delivery/DriversGroupGeneralForm/index.js +2 -2
  15. package/src/components/Orders/AllInOne/index.js +1 -0
  16. package/src/components/Orders/Messages/index.js +4 -5
  17. package/src/components/Orders/OrdersFilterGroup/index.js +16 -7
  18. package/src/components/Orders/OrdersHeaderFilterGroup/index.js +8 -4
  19. package/src/components/Orders/OrdersHeaderFilterGroup/styles.js +1 -2
  20. package/src/components/Shared/SearchBar/index.js +17 -4
  21. package/src/components/Shared/SearchBar/styles.js +18 -16
  22. package/src/components/Stores/BusinessInformation/index.js +172 -8
  23. package/src/components/Stores/BusinessInformation/styles.js +42 -0
  24. package/src/utils/index.js +36 -0
  25. /package/_bundles/{ordering-ui-admin.4cea57b9d7d8884bab6f.js.LICENSE.txt → ordering-ui-admin.9f73fdc1ef3e64fd05df.js.LICENSE.txt} +0 -0
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.widgetURL = exports.verifyDecimals = exports.stringToSlug = exports.sortInputFields = exports.shape = exports.setStorageItem = exports.scrollTo = exports.ribbonValues = exports.reviewCommentList = exports.removeStorageItem = exports.removeQueryToUrl = exports.queryStringToObject = exports.orderStatus = exports.orderRejectCommentList = exports.optimizeImage = exports.getUniqueId = exports.getStorageItem = exports.getStarWidth = exports.getSeconds = exports.getOrderStatus = exports.getOrderStatuPickUp = exports.getMinutes = exports.getLocale = exports.getIconCard = exports.getHours = exports.getCurrenySymbol = exports.getCurrentDiffDays = exports.getAgoMinutes = exports.formatUrlVideo = exports.formatSeconds = exports.firstLetterCapital = exports.findExitingCountryPhoneCode = exports.findExitingCode = exports.fieldsToSort = exports.convertHoursToMinutes = exports.convertHMS = exports.checkValidUrlFormat = exports.checkSiteUrl = exports.checkPreSiteUrl = exports.capitalize = exports.bytesConverter = exports.addQueryToUrl = exports.DriverTipsOptions = void 0;
6
+ exports.widgetURL = exports.verifyDecimals = exports.stringToSlug = exports.sortInputFields = exports.shape = exports.setStorageItem = exports.scrollTo = exports.ribbonValues = exports.reviewCommentList = exports.removeStorageItem = exports.removeQueryToUrl = exports.queryStringToObject = exports.orderStatus = exports.orderRejectCommentList = exports.optimizeImage = exports.getUniqueId = exports.getStorageItem = exports.getStarWidth = exports.getSeconds = exports.getOrderStatus = exports.getOrderStatuPickUp = exports.getMinutes = exports.getLocale = exports.getIconCard = exports.getHours = exports.getCurrenySymbol = exports.getCurrentDiffDays = exports.getAgoMinutes = exports.formatUrlVideo = exports.formatSeconds = exports.firstLetterCapital = exports.findExitingCountryPhoneCode = exports.findExitingCode = exports.fieldsToSort = exports.disableReasons = exports.convertHoursToMinutes = exports.convertHMS = exports.checkValidUrlFormat = exports.checkSiteUrl = exports.checkPreSiteUrl = exports.capitalize = exports.bytesConverter = exports.addQueryToUrl = exports.DriverTipsOptions = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _FaCcMastercard = _interopRequireDefault(require("@meronex/icons/fa/FaCcMastercard"));
9
9
  var _FaCcVisa = _interopRequireDefault(require("@meronex/icons/fa/FaCcVisa"));
@@ -856,4 +856,41 @@ var removeQueryToUrl = exports.removeQueryToUrl = function removeQueryToUrl(remo
856
856
  } else {
857
857
  history.replaceState(null, '', "".concat(location.pathname));
858
858
  }
859
+ };
860
+ var disableReasons = exports.disableReasons = function disableReasons() {
861
+ var _useLanguage3 = (0, _orderingComponentsAdminExternal.useLanguage)(),
862
+ _useLanguage4 = _slicedToArray(_useLanguage3, 2),
863
+ t = _useLanguage4[1];
864
+ var disableReasonDictionary = {
865
+ SALE_DIVIATION: t('SALE_DIVIATION', 'Sale Diviation'),
866
+ MOTORCYCLE_FAILURE: t('MOTORCYCLE_FAILURE', 'Motorcycle failure'),
867
+ NO_DRIVERS: t('NO_DRIVERS', 'No drivers'),
868
+ OVEN_FAILURE: t('OVEN_FAILURE', 'Oven failure'),
869
+ EXCESS_ORDERS: t('EXCESS_ORDERS', 'Excess orders'),
870
+ NO_ELECTRIC_POWER: t('NO_ELECTRIC_POWER', 'No electric power'),
871
+ NO_GAS: t('NO_GAS', 'No gas'),
872
+ CONECTION_FAILURE: t('CONECTION_FAILURE', 'Conection failure'),
873
+ NO_WATER: t('NO_WATER', 'No water'),
874
+ SYSTEM_FAILURE: t('SYSTEM_FAILURE', 'System failure'),
875
+ STREETS_CLOSED: t('STREETS_CLOSED', 'Streets closed'),
876
+ NO_SERVICE: t('NO_SERVICE', 'No service'),
877
+ UNSAFETY: t('UNSAFETY', 'Unsafety'),
878
+ MAINTENANCE_IN_STORE: t('MAINTENANCE_IN_STORE', 'Maintenance in store'),
879
+ RAINING: t('RAINING', 'Raining'),
880
+ STORE_EVENT: t('STORE_EVENT', 'Store event'),
881
+ PROBLEM_WITH_POWER: t('PROBLEM_WITH_POWER', 'Problem with power'),
882
+ DRIVER_ACCIDENT: t('DRIVER_ACCIDENT', 'Driver accident'),
883
+ MAINTENANCE_SYSTEM_IN_STORE: t('MAINTENANCE_SYSTEM_IN_STORE', 'Maintenance system in store'),
884
+ PROBLEM_WITH_GAS: t('PROBLEM_WITH_GAS', 'Problem with gas'),
885
+ ROLLER_FAILURE: t('ROLLER_FAILURE', 'Roller failure'),
886
+ WEATHER: t('WEATHER', 'Weather'),
887
+ GAS_LEAK: t('GAS_LEAK', 'Gas leak'),
888
+ MANIFESTATION: t('MANIFESTATION', 'Manifestation'),
889
+ LACK_OF_STAFF: t('LACK_OF_STAFF', 'Lack of Staff'),
890
+ MIXER_FAILURE: t('MIXER_FAILURE', 'Mixer failure'),
891
+ AUTOMATICS: t('AUTOMATICS', 'Automatics'),
892
+ PRODUCT_SHORTAGE: t('PRODUCT_SHORTAGE', 'Product shortage'),
893
+ TERMINAL_FAILURES: t('TERMINAL_FAILURES', 'Terminal failures')
894
+ };
895
+ return disableReasonDictionary;
859
896
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-admin-external",
3
- "version": "1.43.0",
3
+ "version": "1.43.2",
4
4
  "description": "Ordering UI Admin Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -83,7 +83,7 @@
83
83
  "lodash": "^4.17.20",
84
84
  "moment": "^2.29.1",
85
85
  "moment-range": "^4.0.2",
86
- "ordering-components-admin-external": "1.43.0",
86
+ "ordering-components-admin-external": "1.43.1",
87
87
  "polished": "^3.6.7",
88
88
  "prop-types": "^15.7.2",
89
89
  "react-big-calendar": "^1.4.2",
@@ -139,8 +139,8 @@ export const DriversGroupGeneralForm = (props) => {
139
139
  >
140
140
  <Checkbox
141
141
  value={driverManager?.id}
142
- checked={selectedDriverManager.includes(driverManager.id)}
143
- onChange={e => handleSelectDriverManager(driverManager.id, e.target.checked)}
142
+ checked={selectedDriverManager?.includes(driverManager?.id)}
143
+ onChange={e => handleSelectDriverManager(driverManager?.id, e.target.checked)}
144
144
  />
145
145
  <WrapperImage>
146
146
  {driverManager?.photo ? (
@@ -221,6 +221,7 @@ const OrdersManagerUI = (props) => {
221
221
  <TopContent>
222
222
  <DriversContainer>
223
223
  <DriversManager
224
+ filterValues={filterValues}
224
225
  setMapsData={setMapsData}
225
226
  handleUpdateAssignedOrders={handleUpdateAssignedOrders}
226
227
  disableSocketRoomDriver
@@ -104,7 +104,6 @@ export const MessagesUI = (props) => {
104
104
  const chatDisabled = previousStatus.includes(order?.status)
105
105
  const [{ configs }] = useConfig()
106
106
  const showExternalId = configs?.change_order_id?.value === '1'
107
- const hideLogBookMessages = configs?.order_logbook_enabled?.value === '0'
108
107
 
109
108
  const adminMessageList = [
110
109
  { key: 'message_1', text: t('ADMIN_MESSAGE_1', 'admin_message_1') },
@@ -472,7 +471,7 @@ export const MessagesUI = (props) => {
472
471
  <React.Fragment key={message.id}>
473
472
  {history && tabActive === 'order_history' && (
474
473
  <>
475
- {message.type === 0 && !hideLogBookMessages && (
474
+ {message.type === 0 && (
476
475
  <MessageConsole key={message.id}>
477
476
  <BubbleConsole>
478
477
  <p
@@ -492,7 +491,7 @@ export const MessagesUI = (props) => {
492
491
  </BubbleConsole>
493
492
  </MessageConsole>
494
493
  )}
495
- {message.type === 1 && !hideLogBookMessages && (
494
+ {message.type === 1 && (
496
495
  <MessageConsole key={message.id} style={{ display: `${tabActive === 'order_history' ? 'inline-flex' : 'none'}` }}>
497
496
  {getHistoryComment(message) && (
498
497
  <BubbleConsole>
@@ -515,7 +514,7 @@ export const MessagesUI = (props) => {
515
514
  )}
516
515
  {isChat && (
517
516
  <>
518
- {message.type === 0 && !hideLogBookMessages && (
517
+ {message.type === 0 && (
519
518
  <MessageConsole key={message.id}>
520
519
  <BubbleConsole>
521
520
  <p>
@@ -534,7 +533,7 @@ export const MessagesUI = (props) => {
534
533
  </BubbleConsole>
535
534
  </MessageConsole>
536
535
  )}
537
- {message.type === 1 && !hideLogBookMessages && (
536
+ {message.type === 1 && (
538
537
  <MessageConsole key={message.id} style={{ display: `${tabActive === 'order_history' ? 'inline-flex' : 'none'}` }}>
539
538
  {getHistoryComment(message) && (
540
539
  <BubbleConsole>
@@ -64,7 +64,8 @@ const OrdersFilterGroupUI = (props) => {
64
64
  handleDeleteMetafield,
65
65
  handleChangeExternalId,
66
66
  handleChangeChildFilterValue,
67
- handleChangeGroupUnassigned
67
+ handleChangeGroupUnassigned,
68
+ handleFilterValues
68
69
  } = props
69
70
 
70
71
  const [, t] = useLanguage()
@@ -73,7 +74,8 @@ const OrdersFilterGroupUI = (props) => {
73
74
  const [filterApplied, setFilterApplied] = useState(false)
74
75
  const metafieldRef = useRef()
75
76
  const [{ configs }] = useConfig()
76
- const configFilter = configs?.filter_order_options?.value.split('|').map(value =>(value)) || []
77
+ const [_filterValues] = useFilterValues()
78
+ const configFilter = configs?.filter_order_options?.value.split('|').map(value => (value)) || []
77
79
 
78
80
  const logisticStatusList = [
79
81
  { value: 0, content: <Option>{t('PENDING', 'Pending')}<LogisticStatusDot status={0} /></Option> },
@@ -90,6 +92,7 @@ const OrdersFilterGroupUI = (props) => {
90
92
 
91
93
  const handleAcceptFilter = () => {
92
94
  handleChangeFilterValues(filterValues)
95
+ handleFilterValues(filterValues)
93
96
  setFilterModalOpen(false)
94
97
  }
95
98
 
@@ -132,10 +135,10 @@ const OrdersFilterGroupUI = (props) => {
132
135
 
133
136
  useEffect(() => {
134
137
  let _filterApplied = false
135
- if (Object.keys(filterValues).length === 0) {
138
+ if (Object.keys(_filterValues).length === 0) {
136
139
  _filterApplied = false
137
140
  } else {
138
- Object.values(filterValues).forEach(value => {
141
+ Object.values(_filterValues).forEach(value => {
139
142
  if (Array.isArray(value)) {
140
143
  if (value.length > 0) _filterApplied = true
141
144
  } else {
@@ -144,7 +147,7 @@ const OrdersFilterGroupUI = (props) => {
144
147
  })
145
148
  }
146
149
  setFilterApplied(_filterApplied)
147
- }, [filterValues])
150
+ }, [_filterValues])
148
151
 
149
152
  return (
150
153
  <>
@@ -397,13 +400,19 @@ const OrdersFilterGroupUI = (props) => {
397
400
 
398
401
  export const OrdersFilterGroup = (props) => {
399
402
  const [filterValues, { handleFilterValues }] = useFilterValues()
403
+ const [savedFilterValues, setSavedFilterValues] = useState(filterValues)
404
+
405
+ useEffect(() => {
406
+ setSavedFilterValues(filterValues)
407
+ }, [filterValues])
400
408
 
401
409
  const FilterControlProps = {
402
410
  ...props,
403
411
  UIComponent: OrdersFilterGroupUI,
404
412
  driverGroupList: props.driverGroupList,
405
- filterValues: filterValues,
406
- setFilterValues: handleFilterValues
413
+ filterValues: savedFilterValues,
414
+ setFilterValues: setSavedFilterValues,
415
+ handleFilterValues: handleFilterValues
407
416
  }
408
417
  return (
409
418
  <>
@@ -7,6 +7,7 @@ import {
7
7
  WrapperRow
8
8
  } from './styles'
9
9
  import { useFilterValues } from '../../../contexts/FilterValuesContext'
10
+ import { SearchBar } from '../../Shared'
10
11
 
11
12
  const OrdersHeaderFilterGroupUI = (props) => {
12
13
  const {
@@ -48,12 +49,15 @@ const OrdersHeaderFilterGroupUI = (props) => {
48
49
  <>
49
50
  <WrapperRow>
50
51
  {!loading && configFilter.includes('external_id') && (
51
- <Input
52
- type='text'
52
+ <SearchBar
53
53
  placeholder={dictionary?.EXTERNAL_ID ?? 'External Id'}
54
- autoComplete='off'
55
- value={filterValues?.externalId || ''}
56
54
  onChange={handleChangeExternalId}
55
+ search={filterValues?.externalId || ''}
56
+ isCustomLayout
57
+ hideSearchIcon
58
+ lazyLoad
59
+ CustomInput={Input}
60
+ onSearch={(value) => handleChangeExternalId({ target: { value } })}
57
61
  />
58
62
  )}
59
63
  {!loading && configFilter.includes('driver') && (
@@ -32,10 +32,9 @@ export const WrapperRow = styled.div`
32
32
  z-index: 100;
33
33
  }
34
34
 
35
- > input {
35
+ input {
36
36
  width: 100%;
37
37
  height: 47px;
38
- margin-bottom: 20px;
39
38
  padding: 10px 25px;
40
39
  box-sizing: border-box;
41
40
  &::-webkit-outer-spin-button,
@@ -10,7 +10,9 @@ export const SearchBar = (props) => {
10
10
  search,
11
11
  placeholder,
12
12
  lazyLoad,
13
- customClass
13
+ customClass,
14
+ hideSearchIcon,
15
+ CustomInput
14
16
  } = props
15
17
 
16
18
  let timeout = null
@@ -52,12 +54,23 @@ export const SearchBar = (props) => {
52
54
  }
53
55
  }, [search])
54
56
 
57
+ const inputProps = {
58
+ type: 'text',
59
+ ref: el,
60
+ name: 'search',
61
+ placeholder: placeholder,
62
+ autoComplete: 'off'
63
+ }
55
64
  return (
56
- <SearchContainer className={customClass || ''}>
57
- <input type='text' ref={el} name='search' placeholder={placeholder} autoComplete='off' />
65
+ <SearchContainer className={customClass || ''} isCustomInput={!!CustomInput}>
66
+ {CustomInput ? (
67
+ <CustomInput {...inputProps} />
68
+ ) : (
69
+ <input {...inputProps} />
70
+ )}
58
71
  {el.current?.value
59
72
  ? <XCircle className='close' onClick={handleClear} />
60
- : <Search />}
73
+ : !hideSearchIcon && <Search />}
61
74
  </SearchContainer>
62
75
  )
63
76
  }
@@ -6,23 +6,25 @@ export const SearchContainer = styled.div`
6
6
  align-items: center;
7
7
 
8
8
  > input {
9
- width: 100%;
10
- border: 1px solid ${props => props.theme.colors.borderColor} !important;
11
- background: ${props => props.theme.colors?.backgroundPage || '#FFF'};
12
- outline: none;
13
- padding: 10px 15px;
14
- border-radius: 8px;
15
- ${props => props.theme?.rtl ? css`
16
- padding-left: 40px;
17
- ` : css`
18
- padding-right: 40px;
19
- `}
20
- font-size: 14px;
21
- color: ${props => props.theme.colors.headingColor};
9
+ ${({ isCustomInput }) => !isCustomInput && css`
10
+ width: 100%;
11
+ border: 1px solid ${props => props.theme.colors.borderColor} !important;
12
+ background: ${props => props.theme.colors?.backgroundPage || '#FFF'};
13
+ outline: none;
14
+ padding: 10px 15px;
15
+ border-radius: 8px;
16
+ ${props => props.theme?.rtl ? css`
17
+ padding-left: 40px;
18
+ ` : css`
19
+ padding-right: 40px;
20
+ `}
21
+ font-size: 14px;
22
+ color: ${props => props.theme.colors.headingColor};
22
23
 
23
- &::placeholder {
24
- color: #909BA9;
25
- }
24
+ &::placeholder {
25
+ color: #909BA9;
26
+ }
27
+ `}
26
28
  }
27
29
 
28
30
  svg {
@@ -3,9 +3,9 @@ import { useForm } from 'react-hook-form'
3
3
  import { useLanguage, DragAndDrop, ExamineClick, BusinessFormDetails as BusinessFormDetailsController, useConfig } from 'ordering-components-admin-external'
4
4
  import Skeleton from 'react-loading-skeleton'
5
5
  import { Alert, Modal, ImageCrop, ColorPicker } from '../../Shared'
6
- import { bytesConverter, shape, ribbonValues } from '../../../utils'
6
+ import { bytesConverter, shape, ribbonValues, disableReasons } from '../../../utils'
7
7
  import BiImage from '@meronex/icons/bi/BiImage'
8
- import { Button, Input, Switch } from '../../../styles'
8
+ import { Button, Input, Switch, SecondSelect } from '../../../styles'
9
9
  import { RecordCircleFill, Circle, Facebook, Instagram, Tiktok, Pinterest, Whatsapp, Snapchat } from 'react-bootstrap-icons'
10
10
 
11
11
  import {
@@ -31,7 +31,8 @@ import {
31
31
  SocialWrapper,
32
32
  SocialItemWrapper,
33
33
  SocialItemHeader,
34
- SocialItemContent
34
+ SocialItemContent,
35
+ Option
35
36
  } from './styles'
36
37
 
37
38
  const BusinessInformationUI = (props) => {
@@ -42,7 +43,8 @@ const BusinessInformationUI = (props) => {
42
43
  handleChangeInput,
43
44
  handleButtonUpdateClick,
44
45
  handleChangeSwtich,
45
- handleChangeRibbon
46
+ handleChangeRibbon,
47
+ handleChangeSelectedOption
46
48
  } = props
47
49
 
48
50
  const formMethods = useForm()
@@ -53,6 +55,7 @@ const BusinessInformationUI = (props) => {
53
55
  const [alertState, setAlertState] = useState({ open: false, content: [] })
54
56
  const [cropState, setCropState] = useState({ name: null, data: null, open: false })
55
57
  const priceSymbol = configs?.format_number_currency?.value?.trim()
58
+ const disableReasonDictionary = disableReasons()
56
59
 
57
60
  const priceList = [
58
61
  { key: '1', value: `${priceSymbol}` },
@@ -62,6 +65,156 @@ const BusinessInformationUI = (props) => {
62
65
  { key: '5', value: `${Array(5).fill(priceSymbol).join('')}` }
63
66
  ]
64
67
 
68
+ const reasonOptionList = [
69
+ {
70
+ value: 'default',
71
+ content: <Option padding='0px'><span>{t('SELECT_OPTION', 'Select option')}</span></Option>,
72
+ color: 'primary',
73
+ disabled: true,
74
+ showDisable: true
75
+ },
76
+ {
77
+ value: disableReasonDictionary.SALE_DIVIATION,
78
+ content: <Option padding='0px'><span>{disableReasonDictionary.SALE_DIVIATION}</span></Option>,
79
+ color: 'primary'
80
+ },
81
+ {
82
+ value: disableReasonDictionary.MOTORCYCLE_FAILURE,
83
+ content: <Option padding='0px'><span>{disableReasonDictionary.MOTORCYCLE_FAILURE}</span></Option>,
84
+ color: 'primary'
85
+ },
86
+ {
87
+ value: disableReasonDictionary.NO_DRIVERS,
88
+ content: <Option padding='0px'><span>{disableReasonDictionary.NO_DRIVERS}</span></Option>,
89
+ color: 'primary'
90
+ },
91
+ {
92
+ value: disableReasonDictionary.EXCESS_ORDERS,
93
+ content: <Option padding='0px'><span>{disableReasonDictionary.EXCESS_ORDERS}</span></Option>,
94
+ color: 'primary'
95
+ },
96
+ {
97
+ value: disableReasonDictionary.NO_ELECTRIC_POWER,
98
+ content: <Option padding='0px'><span>{disableReasonDictionary.NO_ELECTRIC_POWER}</span></Option>,
99
+ color: 'primary'
100
+ },
101
+ {
102
+ value: disableReasonDictionary.NO_GAS,
103
+ content: <Option padding='0px'><span>{disableReasonDictionary.NO_GAS}</span></Option>,
104
+ color: 'primary'
105
+ },
106
+ {
107
+ value: disableReasonDictionary.CONECTION_FAILURE,
108
+ content: <Option padding='0px'><span>{disableReasonDictionary.CONECTION_FAILURE}</span></Option>,
109
+ color: 'primary'
110
+ },
111
+ {
112
+ value: disableReasonDictionary.NO_WATER,
113
+ content: <Option padding='0px'><span>{disableReasonDictionary.NO_WATER}</span></Option>,
114
+ color: 'primary'
115
+ },
116
+ {
117
+ value: disableReasonDictionary.SYSTEM_FAILURE,
118
+ content: <Option padding='0px'><span>{disableReasonDictionary.SYSTEM_FAILURE}</span></Option>,
119
+ color: 'primary'
120
+ },
121
+ {
122
+ value: disableReasonDictionary.STREETS_CLOSED,
123
+ content: <Option padding='0px'><span>{disableReasonDictionary.STREETS_CLOSED}</span></Option>,
124
+ color: 'primary'
125
+ },
126
+ {
127
+ value: disableReasonDictionary.NO_SERVICE,
128
+ content: <Option padding='0px'><span>{disableReasonDictionary.NO_SERVICE}</span></Option>,
129
+ color: 'primary'
130
+ },
131
+ {
132
+ value: disableReasonDictionary.UNSAFETY,
133
+ content: <Option padding='0px'><span>{disableReasonDictionary.UNSAFETY}</span></Option>,
134
+ color: 'primary'
135
+ },
136
+ {
137
+ value: disableReasonDictionary.MAINTENANCE_IN_STORE,
138
+ content: <Option padding='0px'><span>{disableReasonDictionary.MAINTENANCE_IN_STORE}</span></Option>,
139
+ color: 'primary'
140
+ },
141
+ {
142
+ value: disableReasonDictionary.RAINING,
143
+ content: <Option padding='0px'><span>{disableReasonDictionary.RAINING}</span></Option>,
144
+ color: 'primary'
145
+ },
146
+ {
147
+ value: disableReasonDictionary.STORE_EVENT,
148
+ content: <Option padding='0px'><span>{disableReasonDictionary.STORE_EVENT}</span></Option>,
149
+ color: 'primary'
150
+ },
151
+ {
152
+ value: disableReasonDictionary.PROBLEM_WITH_POWER,
153
+ content: <Option padding='0px'><span>{disableReasonDictionary.PROBLEM_WITH_POWER}</span></Option>,
154
+ color: 'primary'
155
+ },
156
+ {
157
+ value: disableReasonDictionary.DRIVER_ACCIDENT,
158
+ content: <Option padding='0px'><span>{disableReasonDictionary.DRIVER_ACCIDENT}</span></Option>,
159
+ color: 'primary'
160
+ },
161
+ {
162
+ value: disableReasonDictionary.MAINTENANCE_SYSTEM_IN_STORE,
163
+ content: <Option padding='0px'><span>{disableReasonDictionary.MAINTENANCE_SYSTEM_IN_STORE}</span></Option>,
164
+ color: 'primary'
165
+ },
166
+ {
167
+ value: disableReasonDictionary.PROBLEM_WITH_GAS,
168
+ content: <Option padding='0px'><span>{disableReasonDictionary.PROBLEM_WITH_GAS}</span></Option>,
169
+ color: 'primary'
170
+ },
171
+ {
172
+ value: disableReasonDictionary.ROLLER_FAILURE,
173
+ content: <Option padding='0px'><span>{disableReasonDictionary.ROLLER_FAILURE}</span></Option>,
174
+ color: 'primary'
175
+ },
176
+ {
177
+ value: disableReasonDictionary.WEATHER,
178
+ content: <Option padding='0px'><span>{disableReasonDictionary.WEATHER}</span></Option>,
179
+ color: 'primary'
180
+ },
181
+ {
182
+ value: disableReasonDictionary.GAS_LEAK,
183
+ content: <Option padding='0px'><span>{disableReasonDictionary.GAS_LEAK}</span></Option>,
184
+ color: 'primary'
185
+ },
186
+ {
187
+ value: disableReasonDictionary.MANIFESTATION,
188
+ content: <Option padding='0px'><span>{disableReasonDictionary.MANIFESTATION}</span></Option>,
189
+ color: 'primary'
190
+ },
191
+ {
192
+ value: disableReasonDictionary.LACK_OF_STAFF,
193
+ content: <Option padding='0px'><span>{disableReasonDictionary.LACK_OF_STAFF}</span></Option>,
194
+ color: 'primary'
195
+ },
196
+ {
197
+ value: disableReasonDictionary.MIXER_FAILURE,
198
+ content: <Option padding='0px'><span>{disableReasonDictionary.MIXER_FAILURE}</span></Option>,
199
+ color: 'primary'
200
+ },
201
+ {
202
+ value: disableReasonDictionary.AUTOMATICS,
203
+ content: <Option padding='0px'><span>{disableReasonDictionary.AUTOMATICS}</span></Option>,
204
+ color: 'primary'
205
+ },
206
+ {
207
+ value: disableReasonDictionary.PRODUCT_SHORTAGE,
208
+ content: <Option padding='0px'><span>{disableReasonDictionary.PRODUCT_SHORTAGE}</span></Option>,
209
+ color: 'primary'
210
+ },
211
+ {
212
+ value: disableReasonDictionary.TERMINAL_FAILURES,
213
+ content: <Option padding='0px'><span>{disableReasonDictionary.TERMINAL_FAILURES}</span></Option>,
214
+ color: 'primary'
215
+ }
216
+ ]
217
+
65
218
  const socialOriginalURL = {
66
219
  facebook: 'https://www.facebook.com/',
67
220
  instagram: 'https://www.instagram.com/',
@@ -192,7 +345,7 @@ const BusinessInformationUI = (props) => {
192
345
  ? businessState?.business?.header &&
193
346
  (<img src={businessState?.business?.header} alt='header image' loading='lazy' />)
194
347
  : formState?.changes?.header &&
195
- <img src={formState?.changes?.header} alt='header image' loading='lazy' />
348
+ <img src={formState?.changes?.header} alt='header image' loading='lazy' />
196
349
  )}
197
350
  <UploadImageIconContainer>
198
351
  <UploadImageIcon>
@@ -224,7 +377,7 @@ const BusinessInformationUI = (props) => {
224
377
  ? businessState?.business?.logo &&
225
378
  (<img src={businessState?.business?.logo} alt='logo image' loading='lazy' />)
226
379
  : formState?.changes?.logo &&
227
- <img src={formState?.changes?.logo} alt='logo image' loading='lazy' />
380
+ <img src={formState?.changes?.logo} alt='logo image' loading='lazy' />
228
381
  )}
229
382
  <UploadImageIconContainer small>
230
383
  <UploadImageIcon small>
@@ -373,14 +526,25 @@ const BusinessInformationUI = (props) => {
373
526
  }
374
527
  {(businessState?.business?.enabled === false) && (
375
528
  <InputWrapper>
376
- <label>{t('DISABLED_REASON', 'Disabled reason')} <span>({t('MAX_60_CHAR', 'Max 60 Characters')})</span></label>
377
- <Input
529
+ <label>{t('DISABLED_REASON', 'Disabled reason')}</label>
530
+ {/* <span>({t('MAX_60_CHAR', 'Max 60 Characters')})</span> */}
531
+ {/* <Input
378
532
  name='disabled_reason'
379
533
  defaultValue={formState?.changes?.disabled_reason ?? businessState?.business?.disabled_reason}
380
534
  onChange={handleChangeInput}
381
535
  disabled={formState.loading}
382
536
  autoComplete='off'
383
537
  maxLength={60}
538
+ /> */}
539
+ <SecondSelect
540
+ defaultValue={formState?.changes?.disabled_reason ?? businessState?.business?.disabled_reason ?? 'default'}
541
+ options={reasonOptionList}
542
+ optionInnerMaxHeight='200px'
543
+ onChange={(value) => handleChangeSelectedOption('disabled_reason', value)}
544
+ // isShowSearchBar
545
+ // searchBarPlaceholder={t('SEARCH', 'Search')}
546
+ // searchValue={searchValue}
547
+ // handleChangeSearch={handleSearch}
384
548
  />
385
549
  </InputWrapper>
386
550
  )}
@@ -369,3 +369,45 @@ export const SocialItemContent = styled.div`
369
369
  border-radius: 8px;
370
370
  }
371
371
  `
372
+ export const Option = styled.div`
373
+ display: flex;
374
+ align-items: center;
375
+ color: ${props => props.theme.colors?.headingColor};
376
+ padding: ${({ padding }) => padding || '5px 10px'};
377
+ white-space: nowrap;
378
+ ${({ isPhoneView }) => isPhoneView && css`
379
+ width: 100%;
380
+ `}
381
+ ${({ isRemove }) => isRemove && css`
382
+ color: ${props => props.theme.colors.danger};
383
+ padding: 3px 10px;
384
+ font-size: 14px;
385
+ `}
386
+
387
+ img {
388
+ width: 45px;
389
+ border-radius: 8px;
390
+ }
391
+
392
+ ${({ small }) => small && css`
393
+ padding: ${({ padding }) => padding || '5px 0px'};
394
+ img {
395
+ width: 25px;
396
+ }
397
+ `}
398
+
399
+ span {
400
+ font-size: 14px;
401
+ overflow: hidden;
402
+ white-space: nowrap;
403
+ text-overflow: ellipsis;
404
+ max-width: 350px;
405
+ }
406
+
407
+ @media (max-width: 576px) {
408
+ padding: ${({ padding }) => padding || '5px 0px'};
409
+ span {
410
+ max-width: 280px;
411
+ }
412
+ }
413
+ `
@@ -586,3 +586,39 @@ export const removeQueryToUrl = (removeKeys) => {
586
586
  history.replaceState(null, '', `${location.pathname}`)
587
587
  }
588
588
  }
589
+
590
+ export const disableReasons = () => {
591
+ const [, t] = useLanguage()
592
+ const disableReasonDictionary = {
593
+ SALE_DIVIATION: t('SALE_DIVIATION', 'Sale Diviation'),
594
+ MOTORCYCLE_FAILURE: t('MOTORCYCLE_FAILURE', 'Motorcycle failure'),
595
+ NO_DRIVERS: t('NO_DRIVERS', 'No drivers'),
596
+ OVEN_FAILURE: t('OVEN_FAILURE', 'Oven failure'),
597
+ EXCESS_ORDERS: t('EXCESS_ORDERS', 'Excess orders'),
598
+ NO_ELECTRIC_POWER: t('NO_ELECTRIC_POWER', 'No electric power'),
599
+ NO_GAS: t('NO_GAS', 'No gas'),
600
+ CONECTION_FAILURE: t('CONECTION_FAILURE', 'Conection failure'),
601
+ NO_WATER: t('NO_WATER', 'No water'),
602
+ SYSTEM_FAILURE: t('SYSTEM_FAILURE', 'System failure'),
603
+ STREETS_CLOSED: t('STREETS_CLOSED', 'Streets closed'),
604
+ NO_SERVICE: t('NO_SERVICE', 'No service'),
605
+ UNSAFETY: t('UNSAFETY', 'Unsafety'),
606
+ MAINTENANCE_IN_STORE: t('MAINTENANCE_IN_STORE', 'Maintenance in store'),
607
+ RAINING: t('RAINING', 'Raining'),
608
+ STORE_EVENT: t('STORE_EVENT', 'Store event'),
609
+ PROBLEM_WITH_POWER: t('PROBLEM_WITH_POWER', 'Problem with power'),
610
+ DRIVER_ACCIDENT: t('DRIVER_ACCIDENT', 'Driver accident'),
611
+ MAINTENANCE_SYSTEM_IN_STORE: t('MAINTENANCE_SYSTEM_IN_STORE', 'Maintenance system in store'),
612
+ PROBLEM_WITH_GAS: t('PROBLEM_WITH_GAS', 'Problem with gas'),
613
+ ROLLER_FAILURE: t('ROLLER_FAILURE', 'Roller failure'),
614
+ WEATHER: t('WEATHER', 'Weather'),
615
+ GAS_LEAK: t('GAS_LEAK', 'Gas leak'),
616
+ MANIFESTATION: t('MANIFESTATION', 'Manifestation'),
617
+ LACK_OF_STAFF: t('LACK_OF_STAFF', 'Lack of Staff'),
618
+ MIXER_FAILURE: t('MIXER_FAILURE', 'Mixer failure'),
619
+ AUTOMATICS: t('AUTOMATICS', 'Automatics'),
620
+ PRODUCT_SHORTAGE: t('PRODUCT_SHORTAGE', 'Product shortage'),
621
+ TERMINAL_FAILURES: t('TERMINAL_FAILURES', 'Terminal failures')
622
+ }
623
+ return disableReasonDictionary
624
+ }