Browse Source

Merge branch 'fix/bugs' into 'master'

Fix/bugs

See merge request jetup/rws/rws-appication!360
merge-requests/361/merge
Coder 2 years ago
parent
commit
7d600bc71c
  1. 2
      ios/taskme/Info.plist
  2. 8
      src/modules/account/components/fake-date-input-with-modal.component.tsx
  3. 6
      src/modules/account/validations/edit-account.validator.ts
  4. 60
      src/modules/home/screens/home.screen.tsx
  5. 2
      src/modules/tasks/screens/task-details.screen.tsx
  6. 2
      src/modules/tasks/smart-components/swipable-task-card.smart-component.tsx

2
ios/taskme/Info.plist

@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>NSMicrophoneUsageDescription</key>
<string>Потрібно надати доступ для запису відео</string>
<string>Потрібно надати доступ для запису відео/аудіо</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Потрібно надати доступ до галереї</string>
<key>OneSignal_disable_badge_clearing</key>

8
src/modules/account/components/fake-date-input-with-modal.component.tsx

@ -2,7 +2,7 @@ import { $size, TouchableFakeInput } from '@/shared' @@ -2,7 +2,7 @@ import { $size, TouchableFakeInput } from '@/shared'
import { useTheme } from '@/shared/hooks/use-theme.hook'
import { PartialTheme } from '@/shared/themes/interfaces'
import moment from 'moment'
import 'moment/locale/uk'
import 'moment/locale/uk'
import React, { FC, useRef } from 'react'
import { StyleSheet, View, ViewStyle } from 'react-native'
import RBSheet from 'react-native-raw-bottom-sheet'
@ -22,8 +22,8 @@ export const FakeDateInputWithModal: FC<IProps> = ({ @@ -22,8 +22,8 @@ export const FakeDateInputWithModal: FC<IProps> = ({
error,
}) => {
const { styles } = useTheme(createStyles)
const dateToRender = moment(date).format('DD MMMM YYYY')
const dateToRender = date ? moment(date).format('DD MMMM YYYY') : ''
const sheetRef = useRef<RBSheet>()
const openModal = () => sheetRef.current.open()
@ -44,7 +44,7 @@ export const FakeDateInputWithModal: FC<IProps> = ({ @@ -44,7 +44,7 @@ export const FakeDateInputWithModal: FC<IProps> = ({
onChange(newDateOfBirthday)
hideModal()
}}
date={new Date(date)}
date={date ? new Date(date) : new Date()}
sheetRef={sheetRef}
title={'День народження'}
/>

6
src/modules/account/validations/edit-account.validator.ts

@ -48,14 +48,14 @@ const constraints = { @@ -48,14 +48,14 @@ const constraints = {
},
innerPhoneNumber: {
presence: presenceCost,
// presence: presenceCost,
length: {
minimum: 4,
message: '^Мінімальна довжина становить 4 цифри',
},
},
personalPhoneNumber: {
presence: presenceCost,
// presence: presenceCost,
length: {
minimum: 12,
message: '^Номер не валідний',
@ -68,7 +68,7 @@ const constraints = { @@ -68,7 +68,7 @@ const constraints = {
},
},
dateOfBirth: {
presence: true,
presence: presenceCost,
datetime: {
latest: moment.utc().subtract(18, 'years'),
message: '^Вам має бути не менше 18 років',

60
src/modules/home/screens/home.screen.tsx

@ -1,11 +1,4 @@ @@ -1,11 +1,4 @@
import React, {
FC,
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from 'react'
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'
import { ScrollView, StyleSheet, TouchableOpacity, View } from 'react-native'
import {
$size,
@ -40,7 +33,8 @@ export const HomeScreen: FC<IProps> = ({ navigation }) => { @@ -40,7 +33,8 @@ export const HomeScreen: FC<IProps> = ({ navigation }) => {
const [searchValue, setValue] = useState<string>(null)
const [isOpenDrawer, setDrawer] = useState<boolean>(false)
const countsRef = useRef(defaultCountsState)
const [counts, setCounts] = useState(defaultCountsState)
const taskFilter = useTaskFilter({
onSubmit: () => {
setDrawer(false)
@ -65,39 +59,31 @@ export const HomeScreen: FC<IProps> = ({ navigation }) => { @@ -65,39 +59,31 @@ export const HomeScreen: FC<IProps> = ({ navigation }) => {
}, [])
useEffect(() => {
if (!searchValue) countsRef.current = defaultCountsState
if (!searchValue) setCounts(counts)
}, [searchValue])
const searchResult = useMemo(
() => getHomeSearchResult(countsRef.current, searchValue),
[
searchValue,
countsRef.current.tasks,
countsRef.current.executors,
countsRef.current.groups,
],
() => getHomeSearchResult(counts, searchValue),
[searchValue, counts],
)
const setTasksCount = useCallback(
count => {
countsRef.current.tasks = count
},
[countsRef.current],
)
const setExecutorsCount = useCallback(
count => {
countsRef.current.executors = count
},
[countsRef.current],
)
const setGroupsCount = useCallback(
count => {
countsRef.current.groups = count
},
[countsRef.current],
)
const setTasksCount = count =>
setCounts({
...counts,
tasks: count,
})
const setExecutorsCount = count =>
setCounts({
...counts,
executors: count,
})
const setGroupsCount = count =>
setCounts({
...counts,
groups: count,
})
const openDrawer = useCallback(() => {
setDrawer(true)

2
src/modules/tasks/screens/task-details.screen.tsx

@ -135,7 +135,7 @@ export const TaskDetailsScreen: FC<IProps> = ({ @@ -135,7 +135,7 @@ export const TaskDetailsScreen: FC<IProps> = ({
/>
<TaskAttachmentsCollapseSmart
taskId={taskDetails.id}
taskId={taskDetails?.id}
docs={taskDetails?.documents}
mode={TaskAttachmentsActionMode.DETAIL}
/>

2
src/modules/tasks/smart-components/swipable-task-card.smart-component.tsx

@ -53,7 +53,7 @@ export const SwipableTaskCard: FC<IProps> = ({ onPress, ...props }) => { @@ -53,7 +53,7 @@ export const SwipableTaskCard: FC<IProps> = ({ onPress, ...props }) => {
() => swipableRef.current.close(),
)
props.isFinished ? btnsConfig.splice(1, 1) : null
// props.isFinished ? btnsConfig.splice(0, 1) : null
const btnsToRender = useMemo(
() =>

Loading…
Cancel
Save