Browse Source

SYSTEM | Version

merge-requests/249/head
Vitalik 3 years ago
parent
commit
62a1454d0c
  1. 2
      ios/Podfile
  2. 34
      ios/Podfile.lock
  3. 16
      ios/taskme.xcodeproj/project.pbxproj
  4. 15431
      package-lock.json
  5. 4
      src/modules/chats/atoms/attachments-menu.atom.tsx
  6. 16
      src/modules/comments/hooks/use-task-comments.hook.ts
  7. 25
      src/modules/comments/screens/comments.screen.tsx
  8. 6
      src/services/domain/taxonomies.service.ts
  9. 9
      src/services/system/media-permissions.service.ts
  10. 4
      tsconfig.json

2
ios/Podfile

@ -1,7 +1,7 @@
require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '10.0' platform :ios, '11.0'
target 'taskme' do target 'taskme' do
config = use_native_modules! config = use_native_modules!

34
ios/Podfile.lock

@ -213,6 +213,8 @@ PODS:
- React - React
- react-native-date-picker (3.4.3): - react-native-date-picker (3.4.3):
- React-Core - React-Core
- react-native-document-picker (8.0.0):
- React-Core
- react-native-image-picker (4.7.1): - react-native-image-picker (4.7.1):
- React-Core - React-Core
- react-native-netinfo (6.2.1): - react-native-netinfo (6.2.1):
@ -348,6 +350,7 @@ DEPENDENCIES:
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- react-native-clear-cache (from `../node_modules/oa-react-native-clear-cache`) - react-native-clear-cache (from `../node_modules/oa-react-native-clear-cache`)
- react-native-date-picker (from `../node_modules/react-native-date-picker`) - react-native-date-picker (from `../node_modules/react-native-date-picker`)
- react-native-document-picker (from `../node_modules/react-native-document-picker`)
- react-native-image-picker (from `../node_modules/react-native-image-picker`) - react-native-image-picker (from `../node_modules/react-native-image-picker`)
- "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)" - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)"
- react-native-onesignal (from `../node_modules/react-native-onesignal`) - react-native-onesignal (from `../node_modules/react-native-onesignal`)
@ -426,6 +429,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/oa-react-native-clear-cache" :path: "../node_modules/oa-react-native-clear-cache"
react-native-date-picker: react-native-date-picker:
:path: "../node_modules/react-native-date-picker" :path: "../node_modules/react-native-date-picker"
react-native-document-picker:
:path: "../node_modules/react-native-document-picker"
react-native-image-picker: react-native-image-picker:
:path: "../node_modules/react-native-image-picker" :path: "../node_modules/react-native-image-picker"
react-native-netinfo: react-native-netinfo:
@ -493,12 +498,12 @@ SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
FBLazyVector: c71c5917ec0ad2de41d5d06a5855f6d5eda06971 FBLazyVector: c71c5917ec0ad2de41d5d06a5855f6d5eda06971
FBReactNativeSpec: 1b104089c962a23178ab10f7d072921d46a48d43 FBReactNativeSpec: 50ac84ed135478e1b20e25b4c165cd57b2ce1988
glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62 glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62
OneSignal: 198da4de73fb7bd6e45bc04221a7f16efca057ad OneSignal: 198da4de73fb7bd6e45bc04221a7f16efca057ad
OneSignalXCFramework: 10648e60ff3d335fbffa62d9b44b700b56d49b51 OneSignalXCFramework: 10648e60ff3d335fbffa62d9b44b700b56d49b51
Permission-Camera: 53efcbb755b0e8bdf253dbb27cc7559ccfce8480 Permission-Camera: 9eb618fd601ae4a674b072c3b0d37f109d7b91e5
Permission-PhotoLibrary: 7bec836dcdd04a0bfb200c314f1aae06d4476357 Permission-PhotoLibrary: 900e7e33012bd5e02e5859cb65d5bb2134259c64
RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c
RCTRequired: d34bf57e17cb6e3b2681f4809b13843c021feb6c RCTRequired: d34bf57e17cb6e3b2681f4809b13843c021feb6c
RCTTypeSafety: 8dab4933124ed39bb0c1d88d74d61b1eb950f28f RCTTypeSafety: 8dab4933124ed39bb0c1d88d74d61b1eb950f28f
@ -512,13 +517,14 @@ SPEC CHECKSUMS:
React-jsinspector: 34e23860273a23695342f58eed3ffd3ba10c31e0 React-jsinspector: 34e23860273a23695342f58eed3ffd3ba10c31e0
react-native-clear-cache: 28bce59b33cd809e0afe903786787b4409d1c1fb react-native-clear-cache: 28bce59b33cd809e0afe903786787b4409d1c1fb
react-native-date-picker: 201b481c94dcb7678f4712477ad026dd7793305b react-native-date-picker: 201b481c94dcb7678f4712477ad026dd7793305b
react-native-image-picker: 5fe0a96bef4935bbdfb02f59b910bf40d5526109 react-native-document-picker: 772d04a4bc5c35da9abe27b08ac271420ae3f9ef
react-native-netinfo: 3d3769f0d65de15c83a9bf1346f8be71de5a24bf react-native-image-picker: 27c3726557dac6e224a17c564c16cdc7fb952f79
react-native-onesignal: 6ce91b6cb91e6e2b9caf051da82a27573bf9950c react-native-netinfo: 877946c7b4eb85a639cf1ea31333dadc2be999a1
react-native-onesignal: 9afcdc24aa4557ed58a92803695382b0fe8ea6e7
react-native-orientation-locker: 998c0744e26624407dac068c04c605b4af7304a2 react-native-orientation-locker: 998c0744e26624407dac068c04c605b4af7304a2
react-native-pager-view: 5ab4d0b4b44d89f77310cb3eb8129745f274ce55 react-native-pager-view: f21658a2e12eced35ef998250375e4e4dc9b8487
react-native-restart: 45c8dca02491980f2958595333cbccd6877cb57e react-native-restart: 8af4579c94638f38bd9074ec477ebf087de87dc5
react-native-safe-area-context: 61c8c484a3a9e7d1fda19f7b1794b35bbfd2262a react-native-safe-area-context: 8465df05de8106c584b117f0e027e17174d6e02e
react-native-splash-screen: 200d11d188e2e78cea3ad319964f6142b6384865 react-native-splash-screen: 200d11d188e2e78cea3ad319964f6142b6384865
React-perflogger: cc76a4254d19640f1d8ad1c66fdee800414b805c React-perflogger: cc76a4254d19640f1d8ad1c66fdee800414b805c
React-RCTActionSheet: 7448f049318d8d7e8a9a1ebb742ada721757eea8 React-RCTActionSheet: 7448f049318d8d7e8a9a1ebb742ada721757eea8
@ -532,19 +538,19 @@ SPEC CHECKSUMS:
React-RCTVibration: c7f845861e79eae13dc1e8217a3cf47a3945b504 React-RCTVibration: c7f845861e79eae13dc1e8217a3cf47a3945b504
React-runtimeexecutor: 493d9abb8b23c3f84e19ae221eeba92cadcb70dc React-runtimeexecutor: 493d9abb8b23c3f84e19ae221eeba92cadcb70dc
ReactCommon: 8fea6422328e2fc093e25c9fac67adbcf0f04fb4 ReactCommon: 8fea6422328e2fc093e25c9fac67adbcf0f04fb4
RNCAsyncStorage: e8b8d6320a0dd90eb610fb0d0b1ef90596697c69 RNCAsyncStorage: 0f655864a81214d1c5a9bf0faf79d86dc25c383e
RNCPicker: c3a3d481bec16624ed84a3c2a64c92fdc5515960 RNCPicker: c3a3d481bec16624ed84a3c2a64c92fdc5515960
RNCPushNotificationIOS: 87b8d16d3ede4532745e05b03c42cff33a36cc45 RNCPushNotificationIOS: 089da3b657e1e3d464f38195fd2e3069608ef5af
RNDeviceInfo: cc7de0772378f85d8f36ae439df20f05c590a651 RNDeviceInfo: 0d6865ab0a57d9192bdd4e4f5894340b846c3e53
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211 RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
RNImageCropPicker: 448d3c6e923fde3466b49caf3c2457c2a0ba02dd RNImageCropPicker: 448d3c6e923fde3466b49caf3c2457c2a0ba02dd
RNPermissions: f7ebe52db07c00901127966ca080b4ec6a6ceb0a RNPermissions: bf844d392fe0ecbfbd2e4ae2b88cc32f2f09b369
RNScreens: eb0dfb2d6b21d2d7f980ad46b14eb306d2f1062e RNScreens: eb0dfb2d6b21d2d7f980ad46b14eb306d2f1062e
RNSVG: 8ba35cbeb385a52fd960fd28db9d7d18b4c2974f RNSVG: 8ba35cbeb385a52fd960fd28db9d7d18b4c2974f
RNVectorIcons: f67a1abce2ec73e62fe4606e8110e95a832bc859 RNVectorIcons: f67a1abce2ec73e62fe4606e8110e95a832bc859
TOCropViewController: 3105367e808b7d3d886a74ff59bf4804e7d3ab38 TOCropViewController: 3105367e808b7d3d886a74ff59bf4804e7d3ab38
Yoga: e6ecf3fa25af9d4c87e94ad7d5d292eedef49749 Yoga: e6ecf3fa25af9d4c87e94ad7d5d292eedef49749
PODFILE CHECKSUM: 2e885545d59675f6e47ce2e674d5845cfdd2550f PODFILE CHECKSUM: 39216d0b0cefabcff3ab72e7003b18f6ef39a19e
COCOAPODS: 1.11.2 COCOAPODS: 1.11.2

16
ios/taskme.xcodeproj/project.pbxproj

@ -692,7 +692,7 @@
INFOPLIST_FILE = OneSignalNotificationServiceExtension/Info.plist; INFOPLIST_FILE = OneSignalNotificationServiceExtension/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = OneSignalNotificationServiceExtension; INFOPLIST_KEY_CFBundleDisplayName = OneSignalNotificationServiceExtension;
INFOPLIST_KEY_NSHumanReadableCopyright = ""; INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 10.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -734,7 +734,7 @@
INFOPLIST_FILE = OneSignalNotificationServiceExtension/Info.plist; INFOPLIST_FILE = OneSignalNotificationServiceExtension/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = OneSignalNotificationServiceExtension; INFOPLIST_KEY_CFBundleDisplayName = OneSignalNotificationServiceExtension;
INFOPLIST_KEY_NSHumanReadableCopyright = ""; INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 10.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -763,12 +763,12 @@
CODE_SIGN_ENTITLEMENTS = taskme/taskme.entitlements; CODE_SIGN_ENTITLEMENTS = taskme/taskme.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 52; CURRENT_PROJECT_VERSION = 54;
DEVELOPMENT_TEAM = HQ3J3TDPR2; DEVELOPMENT_TEAM = HQ3J3TDPR2;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
INFOPLIST_FILE = taskme/Info.plist; INFOPLIST_FILE = taskme/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -801,12 +801,12 @@
CODE_SIGN_ENTITLEMENTS = taskme/taskme.entitlements; CODE_SIGN_ENTITLEMENTS = taskme/taskme.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 52; CURRENT_PROJECT_VERSION = 54;
DEVELOPMENT_TEAM = HQ3J3TDPR2; DEVELOPMENT_TEAM = HQ3J3TDPR2;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
INFOPLIST_FILE = taskme/Info.plist; INFOPLIST_FILE = taskme/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -862,7 +862,7 @@
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES; ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 "; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99; GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO; GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES; GCC_NO_COMMON_BLOCKS = YES;
@ -927,7 +927,7 @@
COPY_PHASE_STRIP = YES; COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO; ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 "; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99; GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES; GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES;

15431
package-lock.json generated

File diff suppressed because it is too large Load Diff

4
src/modules/chats/atoms/attachments-menu.atom.tsx

@ -17,8 +17,8 @@ export const AttachmentsMenu = ({ isMenuOpen, onPressItem }: IProps) => {
return ( return (
<View style={styles.menu}> <View style={styles.menu}>
{attachmentsMenuConfig.map(it => ( {attachmentsMenuConfig.map((it, i) => (
<AttachmentsMenuItem {...it} onPress={onPressItem} /> <AttachmentsMenuItem key={i} {...it} onPress={onPressItem} />
))} ))}
</View> </View>
) )

16
src/modules/comments/hooks/use-task-comments.hook.ts

@ -22,13 +22,9 @@ export const useTaskComments = (taskId: number) => {
console.log(taskComments) console.log(taskComments)
if (!taskComments) return if (!taskComments) return
setComments(prev => [ setComments(transformComments(taskComments, accountId))
...prev,
...transformComments(taskComments, accountId)
])
} catch (e) { } catch (e) {
console.log('FETCH TASK DETAILS FAIL: ', e) console.log('FETCH TASK DETAILS FAIL: ', e)
} finally { } finally {
setLoad(false) setLoad(false)
} }
@ -36,13 +32,15 @@ export const useTaskComments = (taskId: number) => {
useEffect(() => { useEffect(() => {
if (taskId) loadComments() if (taskId) loadComments()
}, []) }, [taskId])
const sendComment = async messages => { const sendComment = async messages => {
const commentData = { const commentData = {
taskId, taskId,
content: commentText, content: commentText.trim(),
} }
console.log('messages', messages)
try { try {
const comment = await commentsService.addTaskComment(commentData) const comment = await commentsService.addTaskComment(commentData)
@ -70,6 +68,6 @@ export const useTaskComments = (taskId: number) => {
comments, comments,
commentText, commentText,
setCommentText, setCommentText,
sendComment sendComment,
} }
} }

25
src/modules/comments/screens/comments.screen.tsx

@ -1,4 +1,4 @@
import React, { FC } from 'react' import React, { FC, useRef } from 'react'
import { import {
$size, $size,
Avatar, Avatar,
@ -35,10 +35,20 @@ export const Comments: FC<IProps> = ({ navigation, route }) => {
const { taskId } = route.params const { taskId } = route.params
const { styles } = useTheme(createStyles) const { styles } = useTheme(createStyles)
const accountId = useSelector(selectId) const accountId = useSelector(selectId)
const scrollRef = useRef(null)
const { comments, commentText, setCommentText, sendComment } = const { comments, commentText, setCommentText, sendComment } =
useTaskComments(taskId) useTaskComments(taskId)
const handleSendComment = async (messages: any[]) => {
try {
await sendComment(messages)
} catch (e) {
} finally {
scrollRef.current.scrollToBottom()
}
}
const renderAvatar = props => { const renderAvatar = props => {
return ( return (
<Avatar <Avatar
@ -53,12 +63,13 @@ export const Comments: FC<IProps> = ({ navigation, route }) => {
<CommentsLayout title="Коментарі" goBack={navigation.goBack}> <CommentsLayout title="Коментарі" goBack={navigation.goBack}>
<> <>
<GiftedChat <GiftedChat
ref={scrollRef}
text={commentText} text={commentText}
timeFormat="HH:mm" timeFormat="HH:mm"
dateFormat="DD.MM.YY" dateFormat="DD.MM.YY"
onInputTextChanged={text => setCommentText(text)} onInputTextChanged={text => setCommentText(text)}
messages={comments} messages={comments}
onSend={sendComment} onSend={handleSendComment}
alwaysShowSend={true} alwaysShowSend={true}
renderBubble={props => <BubbleComments {...props} />} renderBubble={props => <BubbleComments {...props} />}
renderAvatarOnTop={true} renderAvatarOnTop={true}
@ -69,7 +80,7 @@ export const Comments: FC<IProps> = ({ navigation, route }) => {
<NewCommentMessageInput {...props} /> <NewCommentMessageInput {...props} />
)} )}
renderChatFooter={() => { renderChatFooter={() => {
return <View style={{ backgroundColor: '#000'}}></View> return <View style={{ backgroundColor: '#000' }}></View>
}} }}
renderMessageText={props => <CommentMessage {...props} />} renderMessageText={props => <CommentMessage {...props} />}
renderChatEmpty={() => ( renderChatEmpty={() => (
@ -84,7 +95,10 @@ export const Comments: FC<IProps> = ({ navigation, route }) => {
}} }}
/> />
<KeyboardSpacer heightSpace={isAndroid(30, 20)} /> <KeyboardSpacer
style={styles.keyboard}
heightSpace={isAndroid(30, $size(30, 20))}
/>
</> </>
</CommentsLayout> </CommentsLayout>
) )
@ -111,4 +125,7 @@ const createStyles = (theme: PartialTheme) =>
marginTop: $size(40), marginTop: $size(40),
transform: [{ scaleY: -1 }], transform: [{ scaleY: -1 }],
}, },
keyboard: {
marginTop: $size(20),
},
}) })

6
src/services/domain/taxonomies.service.ts

@ -61,8 +61,10 @@ const createTaxonomyReason = async (
: createNewTaxonomyReason : createNewTaxonomyReason
const { data: newReason } = await req(params) const { data: newReason } = await req(params)
simpleDispatch(new SaveNewReasonTaxonomy({ item: newReason })) if (!isPersonal) {
simpleDispatch(new SetLoadingTaxonomies({ loading: false })) simpleDispatch(new SaveNewReasonTaxonomy({ item: newReason }))
simpleDispatch(new SetLoadingTaxonomies({ loading: false }))
}
return newReason return newReason
} }

9
src/services/system/media-permissions.service.ts

@ -27,10 +27,11 @@ const requestCameraPermission = async () => {
const checkCameraPermissions = async (permission: any): Promise<boolean> => { const checkCameraPermissions = async (permission: any): Promise<boolean> => {
const perm = await check(permission) const perm = await check(permission)
console.log(permission, perm)
switch (perm) { switch (perm) {
case RESULTS.GRANTED: case RESULTS.GRANTED:
return true return true
case RESULTS.LIMITED:
return true
case RESULTS.BLOCKED: { case RESULTS.BLOCKED: {
// needMediaPermissions() // needMediaPermissions()
break break
@ -44,7 +45,11 @@ const checkCameraPermissions = async (permission: any): Promise<boolean> => {
console.log('requestRes', requestRes) console.log('requestRes', requestRes)
if (requestRes === RESULTS.GRANTED) return true if (
requestRes === RESULTS.GRANTED ||
requestRes === RESULTS.LIMITED
)
return true
else return false else return false
} }
} }

4
tsconfig.json

@ -65,3 +65,7 @@
"jest.config.js" "jest.config.js"
] ]
} }

Loading…
Cancel
Save