ordering-ui-admin-external 1.20.1 → 1.21.0

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 (37) hide show
  1. package/_bundles/{ordering-ui-admin.a9bd3b8526ba44f15714.js → ordering-ui-admin.3d1c23579efceb29694a.js} +2 -2
  2. package/_modules/components/CartRecovery/OpenCartList/index.js +1 -1
  3. package/_modules/components/Delivery/UserDetails/index.js +1 -0
  4. package/_modules/components/Home/HomePage/index.js +1 -1
  5. package/_modules/components/Loyalty/GiftCards/index.js +1 -1
  6. package/_modules/components/Loyalty/RewardsPrograms/index.js +18 -3
  7. package/_modules/components/Orders/Messages/index.js +1 -1
  8. package/_modules/components/Orders/OrderMetaFields/index.js +1 -1
  9. package/_modules/components/Orders/OrdersFilterGroup/index.js +1 -1
  10. package/_modules/components/Orders/OrdersTable/styles.js +1 -1
  11. package/_modules/components/Settings/IntegrationListing/index.js +8 -0
  12. package/_modules/components/Settings/SettingsList/index.js +1 -1
  13. package/_modules/components/Shared/ConfirmAdmin/index.js +59 -8
  14. package/_modules/components/Shared/Schedule/index.js +15 -2
  15. package/_modules/components/Shared/Schedule/styles.js +9 -7
  16. package/_modules/components/SidebarMenu/index.js +5 -13
  17. package/_modules/components/Stores/BusinessCateringDelivery/index.js +1 -1
  18. package/_modules/components/Stores/BusinessDetails/index.js +1 -1
  19. package/_modules/components/Stores/BusinessProductsCategoyInfo/index.js +1 -1
  20. package/_modules/components/Stores/BusinessSalesFacebook/index.js +1 -1
  21. package/_modules/components/Support/index.js +1 -1
  22. package/_modules/themes/origin/src/components/OrderContentHeader/index.js +1 -1
  23. package/_modules/themes/origin/src/components/UserPopover/index.js +2 -1
  24. package/package.json +2 -2
  25. package/src/components/Delivery/UserDetails/index.js +1 -0
  26. package/src/components/Home/HomePage/index.js +1 -1
  27. package/src/components/Loyalty/RewardsPrograms/index.js +3 -3
  28. package/src/components/Orders/Messages/index.js +1 -1
  29. package/src/components/Orders/OrdersTable/styles.js +2 -2
  30. package/src/components/Settings/IntegrationListing/index.js +2 -2
  31. package/src/components/Settings/SettingsList/index.js +1 -1
  32. package/src/components/Shared/ConfirmAdmin/index.js +52 -7
  33. package/src/components/Shared/Schedule/index.js +18 -3
  34. package/src/components/Shared/Schedule/styles.js +16 -5
  35. package/src/components/SidebarMenu/index.js +2 -2
  36. package/src/components/Support/index.js +1 -1
  37. /package/_bundles/{ordering-ui-admin.a9bd3b8526ba44f15714.js.LICENSE.txt → ordering-ui-admin.3d1c23579efceb29694a.js.LICENSE.txt} +0 -0
@@ -102,7 +102,7 @@ export const OrderTbody = styled.tbody`
102
102
  border-bottom: 1px solid ${props => props.theme.colors.borderColor};
103
103
  cursor: pointer;
104
104
 
105
- /* &[data-status="delayed"] {
105
+ &[data-status="delayed"] {
106
106
  background-color: ${props => props.theme.colors.danger100};
107
107
  td {
108
108
  border-top: 1px solid ${props => props.theme.colors.danger} !important;
@@ -115,7 +115,7 @@ export const OrderTbody = styled.tbody`
115
115
  border-top: 1px solid ${props => props.theme.colors.warning} !important;
116
116
  border-bottom: 1px solid ${props => props.theme.colors.warning} !important;
117
117
  }
118
- } */
118
+ }
119
119
  &:hover {
120
120
  background-color: ${props => props.theme.colors.lightPrimary};
121
121
  }
@@ -141,7 +141,7 @@ export const IntegrationListing = (props) => {
141
141
  <p>{t('CONNECT_LALAMOVE_DESCRIPTION', 'Send orders directly to your drivers in LalaMove and keep customers happy with their deliveries.')}</p>
142
142
  </SettingItemContent>
143
143
  </SettingItemContainer>
144
- {/* <SettingItemContainer
144
+ <SettingItemContainer
145
145
  onClick={() => handleOpenSetting('picker_express')}
146
146
  >
147
147
  <IconWrapper fullWidth>
@@ -151,7 +151,7 @@ export const IntegrationListing = (props) => {
151
151
  <h5>{t('CONNECT_WITH_PICKER_EXPRESS', 'Connect with Picker Express')}</h5>
152
152
  <p>{t('CONNECT_PICKER_EXPRESS_DESCRIPTION', 'Picker express connect you with +200 hundred thousand driver from +10 delivery companies from your city.')}</p>
153
153
  </SettingItemContent>
154
- </SettingItemContainer> */}
154
+ </SettingItemContainer>
155
155
  <SettingItemContainer
156
156
  onClick={() => handleOpenSetting('deliverect')}
157
157
  >
@@ -33,7 +33,7 @@ export const SettingsListUI = (props) => {
33
33
  saveConfig
34
34
  } = props
35
35
 
36
- const settingsNotAllowed = ['guest_checkout_enabled', 'allowed_order_types_guest_checkout', 'platform_store_giftcard_enabled']
36
+ const settingsNotAllowed = ['guest_checkout_enabled', 'allowed_order_types_guest_checkout']
37
37
 
38
38
  const [, t] = useLanguage()
39
39
  const [alertState, setAlertState] = useState({ open: false, content: [] })
@@ -4,6 +4,7 @@ import parsePhoneNumber from 'libphonenumber-js'
4
4
  import OtpInput from 'react-otp-input'
5
5
  import {
6
6
  useLanguage,
7
+ useSession,
7
8
  CheckPassword as CheckPasswordController
8
9
  } from 'ordering-components-admin-external'
9
10
  import { Modal } from '../Modal'
@@ -40,15 +41,17 @@ const ConfirmAdminUI = (props) => {
40
41
  generateOtpCode,
41
42
 
42
43
  checkCodeState,
43
- credentials,
44
44
  handleChangeInput,
45
45
  handleChangeCredentials
46
46
  } = props
47
47
 
48
48
  const [, t] = useLanguage()
49
+ const [{ user }] = useSession()
49
50
  const { handleSubmit, register, errors } = useForm()
50
51
  const [alertState, setAlertState] = useState({ open: false, content: [] })
51
52
  const [willVerifyOtpState, setWillVerifyOtpState] = useState(false)
53
+ const [userPhoneNumber, setUserPhoneNumber] = useState(null)
54
+ const [isValidPhoneNumber, setIsValidPhoneNumber] = useState('')
52
55
 
53
56
  const numOtpInputs = confirmTab === 'otp' ? 6 : 4
54
57
  const otpPlaceholder = [...Array(numOtpInputs)].fill(0).join('')
@@ -71,6 +74,7 @@ const ConfirmAdminUI = (props) => {
71
74
  }
72
75
 
73
76
  const handleChangePhoneNumber = (number, isValid) => {
77
+ setUserPhoneNumber(number)
74
78
  let phoneNumberParser = null
75
79
  let values = { country_phone_code: '', cellphone: '' }
76
80
 
@@ -98,12 +102,22 @@ const ConfirmAdminUI = (props) => {
98
102
  }
99
103
 
100
104
  const onSubmit = () => {
101
- if (confirmTab === 'otp' && otpType === 'cellphone' && !credentials?.country_phone_code && !credentials?.cellphone) {
102
- setAlertState({
103
- open: true,
104
- content: [t('PHONE_NUMBER_IS_NOT_VALID', 'Phone number is not valid')]
105
- })
106
- return
105
+ if (confirmTab === 'otp' && otpType === 'cellphone') {
106
+ const isPhoneNumberValid = userPhoneNumber ? isValidPhoneNumber : true
107
+ if (!userPhoneNumber) {
108
+ setAlertState({
109
+ open: true,
110
+ content: [t('VALIDATION_ERROR_MOBILE_PHONE_REQUIRED', 'The field Phone Number is required.')]
111
+ })
112
+ return
113
+ }
114
+ if (!isPhoneNumberValid && userPhoneNumber) {
115
+ setAlertState({
116
+ open: true,
117
+ content: [t('PHONE_NUMBER_IS_NOT_VALID', 'Phone number is not valid')]
118
+ })
119
+ return
120
+ }
107
121
  }
108
122
  if (confirmTab === 'password') {
109
123
  getCheckPassword()
@@ -159,6 +173,32 @@ const ConfirmAdminUI = (props) => {
159
173
  }
160
174
  }, [errors])
161
175
 
176
+ useEffect(() => {
177
+ const _credentials = {}
178
+ if (user) {
179
+ if (user?.cellphone) {
180
+ let phone = null
181
+ if (user?.cellphone && user?.country_phone_code) {
182
+ phone = `+${user?.country_phone_code} ${user?.cellphone}`
183
+ _credentials.country_phone_code = user.country_phone_code
184
+ _credentials.cellphone = user.cellphone
185
+ } else if (user?.country_phone_code) {
186
+ phone = `+${user?.country_phone_code} ${user?.cellphone}`
187
+ _credentials.country_phone_code = user.country_phone_code
188
+ _credentials.cellphone = user?.cellphone
189
+ } else {
190
+ phone = user?.cellphone
191
+ _credentials.cellphone = user?.cellphone
192
+ }
193
+ setUserPhoneNumber(phone)
194
+ }
195
+ if (user?.email) {
196
+ _credentials.email = user?.email
197
+ }
198
+ handleChangeCredentials(_credentials)
199
+ }
200
+ }, [user])
201
+
162
202
  return (
163
203
  <Modal
164
204
  open={open}
@@ -216,6 +256,7 @@ const ConfirmAdminUI = (props) => {
216
256
  type='email'
217
257
  name='email'
218
258
  placeholder={t('EMAIL', 'Email')}
259
+ defaultValue={user?.email}
219
260
  ref={register({
220
261
  required: t(
221
262
  'VALIDATION_ERROR_REQUIRED',
@@ -238,7 +279,11 @@ const ConfirmAdminUI = (props) => {
238
279
  {!willVerifyOtpState && confirmTab === 'otp' && otpType === 'cellphone' && (
239
280
  <FormController>
240
281
  <InputPhoneNumber
282
+ isUser
283
+ user={user}
284
+ value={userPhoneNumber}
241
285
  setValue={handleChangePhoneNumber}
286
+ handleIsValid={setIsValidPhoneNumber}
242
287
  />
243
288
  </FormController>
244
289
  )}
@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react'
2
2
  import {
3
3
  useLanguage,
4
4
  useConfig,
5
+ useUtils,
5
6
  Schedule as ScheduleController
6
7
  } from 'ordering-components-admin-external'
7
8
  import {
@@ -22,7 +23,8 @@ import {
22
23
  IconWrapper,
23
24
  SelectWrapper,
24
25
  AddScheduleIconWrapper,
25
- TrashIconWrapper
26
+ TrashIconWrapper,
27
+ DateWrapper
26
28
  } from './styles'
27
29
 
28
30
  const ScheduleUI = (props) => {
@@ -43,11 +45,13 @@ const ScheduleUI = (props) => {
43
45
  selectedCopyDays,
44
46
  cleanSelectedCopyDays,
45
47
  handleSelectCopyTimes,
46
- handleApplyScheduleCopyTimes
48
+ handleApplyScheduleCopyTimes,
49
+ isShowDate
47
50
  } = props
48
51
 
49
52
  const [, t] = useLanguage()
50
53
  const [{ configs }] = useConfig()
54
+ const [{ parseDate }] = useUtils()
51
55
 
52
56
  const is12Hours = configs.format_time?.value === '12'
53
57
 
@@ -87,6 +91,12 @@ const ScheduleUI = (props) => {
87
91
  })
88
92
  }
89
93
 
94
+ const getNextDate = (x) => {
95
+ const now = new Date()
96
+ now.setDate(now.getDate() + (x + (7 - now.getDay())) % 7)
97
+ return now
98
+ }
99
+
90
100
  useEffect(() => {
91
101
  if (!isTimeChangeError) return
92
102
  setAlertState({
@@ -164,7 +174,12 @@ const ScheduleUI = (props) => {
164
174
  checked={schedule?.enabled}
165
175
  onChange={e => handleEnabledSchedule(daysOfWeekIndex, e.target.checked)}
166
176
  />
167
- <h4>{daysOfWeek[daysOfWeekIndex]}</h4>
177
+ <DateWrapper>
178
+ <h4>{daysOfWeek[daysOfWeekIndex]}</h4>
179
+ {isShowDate && (
180
+ <h4 className='date'>{parseDate(getNextDate(daysOfWeekIndex), { outputFormat: 'YYYY-MM-DD' })}</h4>
181
+ )}
182
+ </DateWrapper>
168
183
  </div>
169
184
  {schedule?.enabled ? (
170
185
  <div>
@@ -22,16 +22,16 @@ export const TimeScheduleItemContainer = styled.div`
22
22
  }
23
23
 
24
24
  &:first-child {
25
- width: 95px;
25
+ min-width: 95px;
26
26
  }
27
27
 
28
28
  &:nth-child(2) {
29
29
  flex-direction: column;
30
30
  flex: 1;
31
31
  ${props => props.theme?.rtl ? css`
32
- padding-right: 10px;
32
+ padding-right: 8px;
33
33
  ` : css`
34
- padding-left: 10px;
34
+ padding-left: 8px;
35
35
  `}
36
36
  > div {
37
37
  display: flex;
@@ -72,7 +72,7 @@ export const TimeScheduleItemContainer = styled.div`
72
72
  > div {
73
73
  h4 {
74
74
  font-size: 14px;
75
- padding: 0 16px;
75
+ padding: 0 12px;
76
76
  }
77
77
  &:nth-child(2) {
78
78
  p {
@@ -124,7 +124,7 @@ export const SelectWrapper = styled.div`
124
124
  }
125
125
 
126
126
  @media (min-width: 450px) {
127
- width: 100px;
127
+ width: 95px;
128
128
  .select {
129
129
  > div {
130
130
  font-size: 16px;
@@ -135,6 +135,7 @@ export const SelectWrapper = styled.div`
135
135
 
136
136
  export const Option = styled.div`
137
137
  white-space: nowrap;
138
+ font-size: 15px;
138
139
  `
139
140
 
140
141
  export const SplitLine = styled.div`
@@ -186,3 +187,13 @@ export const AddScheduleIconWrapper = styled.div`
186
187
  width: 56px;
187
188
  }
188
189
  `
190
+ export const DateWrapper = styled.div`
191
+ display: flex;
192
+ flex-direction: column;
193
+
194
+ h4 {
195
+ &.date {
196
+ font-weight: normal;
197
+ }
198
+ }
199
+ `
@@ -843,7 +843,7 @@ const SidebarMenuUI = (props) => {
843
843
  </MenuContainer>
844
844
  </Accordion>
845
845
  )}
846
- {sessionState?.user?.level === 0 && (
846
+ {/* {sessionState?.user?.level === 0 && (
847
847
  <Button
848
848
  className='d-flex align-items-center'
849
849
  variant={location.pathname === '/ordering-products' && 'primary'}
@@ -852,7 +852,7 @@ const SidebarMenuUI = (props) => {
852
852
  <WindowDock />
853
853
  <span>{t('ORDERING_PRODUCTS', 'Ordering products')}</span>
854
854
  </Button>
855
- )}
855
+ )} */}
856
856
  {sessionState?.user?.level === 0 && (
857
857
  <Button
858
858
  className='d-flex align-items-center'
@@ -45,7 +45,7 @@ export const Support = (props) => {
45
45
  <Button
46
46
  borderRadius='7.6px'
47
47
  color='primary'
48
- onClick={() => handleGoToLink('https://www.ordering.co/ordering-sales')}
48
+ onClick={() => handleGoToLink('https://www.ordering.co/contact-ordering')}
49
49
  outline
50
50
  >
51
51
  {t('SALES_CONTACT', 'Sales Contact')}