From f35eef62c6cb3d22ee8602c66cc98f3cfdf299e0 Mon Sep 17 00:00:00 2001 From: Badal Khatri Date: Fri, 1 Dec 2023 18:53:27 +0530 Subject: [PATCH 1/3] fix: Logout Redirection and Auto Login for single team/workspace --- apps/web/app/constants.ts | 2 +- apps/web/pages/auth/passcode.tsx | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/web/app/constants.ts b/apps/web/app/constants.ts index 6f4e68d77..f36e052a6 100644 --- a/apps/web/app/constants.ts +++ b/apps/web/app/constants.ts @@ -2,7 +2,7 @@ import { JitsuOptions } from '@jitsu/jitsu-react/dist/useJitsu'; import { I_SMTPRequest } from './interfaces/ISmtp'; export const API_BASE_URL = '/api'; -export const DEFAULT_APP_PATH = '/auth/team'; +export const DEFAULT_APP_PATH = '/auth/passcode'; export const DEFAULT_MAIN_PATH = '/'; export const PROTECTED_APP_URL_PATHS: RegExp[] = [ /^\/$/, diff --git a/apps/web/pages/auth/passcode.tsx b/apps/web/pages/auth/passcode.tsx index e249930fa..f4067b730 100644 --- a/apps/web/pages/auth/passcode.tsx +++ b/apps/web/pages/auth/passcode.tsx @@ -212,8 +212,11 @@ function WorkSpaceScreen({ form, className }: { form: TAuthenticationPasscode } useEffect(() => { if (form.workspaces.length === 1) { setSelectedWorkspace(0); - form.workspaces[0].current_teams.length === 1 && - setSelectedTeam(form.workspaces[0].current_teams[0].team_id); + } + if (form.workspaces.length === 1 && form.workspaces[0].current_teams.length === 1) { + setSelectedTeam(form.workspaces[0].current_teams[0].team_id); + } + if (form.workspaces.length === 1 && form.workspaces[0].current_teams.length <= 1) { setTimeout(() => { document.getElementById('continue-to-workspace')?.click(); }, 100); From 381796d89879773da8c32e3e0b4f1ab85fa38d1a Mon Sep 17 00:00:00 2001 From: desperado1802 Date: Fri, 1 Dec 2023 17:03:43 +0200 Subject: [PATCH 2/3] added border to the teams dropdown in dark theme --- .../app/components/TeamDropdown/DropDownSection.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/mobile/app/components/TeamDropdown/DropDownSection.tsx b/apps/mobile/app/components/TeamDropdown/DropDownSection.tsx index e6711ae90..cb4e6ed5d 100644 --- a/apps/mobile/app/components/TeamDropdown/DropDownSection.tsx +++ b/apps/mobile/app/components/TeamDropdown/DropDownSection.tsx @@ -41,10 +41,18 @@ const DropDownSection: FC = observer(function DropDownSection({ const others = teams.filter((t) => t.id !== activeTeamId); - const { colors } = useAppTheme(); + const { colors, dark } = useAppTheme(); return ( {/* From e924f3feddf912bc19c06cf6082cbda0d7f45a4c Mon Sep 17 00:00:00 2001 From: desperado1802 Date: Fri, 1 Dec 2023 17:51:02 +0200 Subject: [PATCH 3/3] fixed estimate time overlay and added outside click to exit edit mode --- .../TeamScreen/components/ListCardItem.tsx | 17 ++++----- .../TimerScreen/components/EstimateTime.tsx | 38 ++++++++++++++++--- .../components/TimerTaskSection.tsx | 3 +- 3 files changed, 42 insertions(+), 16 deletions(-) diff --git a/apps/mobile/app/screens/Authenticated/TeamScreen/components/ListCardItem.tsx b/apps/mobile/app/screens/Authenticated/TeamScreen/components/ListCardItem.tsx index 8e5b3c98c..fbcfb0d65 100644 --- a/apps/mobile/app/screens/Authenticated/TeamScreen/components/ListCardItem.tsx +++ b/apps/mobile/app/screens/Authenticated/TeamScreen/components/ListCardItem.tsx @@ -2,7 +2,7 @@ /* eslint-disable react-native/no-color-literals */ /* eslint-disable react-native/no-inline-styles */ import React, { useState } from 'react'; -import { View, ViewStyle, TouchableOpacity, StyleSheet, TouchableWithoutFeedback, Platform } from 'react-native'; +import { View, ViewStyle, TouchableOpacity, StyleSheet, TouchableWithoutFeedback } from 'react-native'; import { Ionicons, Entypo } from '@expo/vector-icons'; // COMPONENTS @@ -87,14 +87,7 @@ export const ListItemContent: React.FC = observer(({ memberInfo, - { - if (Platform.OS === 'android' && taskEdition.estimateEditMode) { - event.stopPropagation(); - taskEdition.setEstimateEditMode(false); - } - }} - > + = observer(({ memberInfo, {memberInfo.memberTask && taskEdition.estimateEditMode ? ( - + unknown; currentTask: ITeamTask; setEstimateTime?: (value: number) => unknown; + timerScreen?: boolean; } -const EstimateTime: FC = ({ setEditEstimate, currentTask, setEstimateTime }) => { +const EstimateTime: FC = ({ setEditEstimate, currentTask, setEstimateTime, timerScreen }) => { // Hooks const { updateTask } = useTeamTasks(); - const { colors } = useAppTheme(); + const { colors, dark } = useAppTheme(); // STATES const textInputRef = useRef(null); @@ -26,6 +28,18 @@ const EstimateTime: FC = ({ setEditEstimate, currentTask, setEstimateTime const [isLoading, setIsLoading] = useState(false); const [showCheckIcon, setShowCheckIcon] = useState(false); + const clickOutsideTaskEstimationInputRef = useClickOutside(() => outsideClickInTimerScreen()); + + const outsideClickInTimerScreen = () => { + setShowCheckIcon(false); + textInputRef?.current?.blur(); + const { h, m } = secondsToTime(currentTask?.estimate || 0); + setEstimate({ + hours: h.toString(), + minutes: m.toString() + }); + }; + useEffect(() => { const { h, m } = secondsToTime(currentTask?.estimate || 0); setEstimate({ @@ -127,7 +141,7 @@ const EstimateTime: FC = ({ setEditEstimate, currentTask, setEstimateTime }; return ( - + = ({ setEditEstimate, currentTask, setEstimateTime {' m'} - {showCheckIcon && handleSubmit()} />} - {isLoading ? : null} + {showCheckIcon && ( + handleSubmit()} + style={timerScreen ? { position: 'absolute', right: -24 } : undefined} + /> + )} + {isLoading && ( + + )} ); }; diff --git a/apps/mobile/app/screens/Authenticated/TimerScreen/components/TimerTaskSection.tsx b/apps/mobile/app/screens/Authenticated/TimerScreen/components/TimerTaskSection.tsx index a13d39315..b61f29370 100644 --- a/apps/mobile/app/screens/Authenticated/TimerScreen/components/TimerTaskSection.tsx +++ b/apps/mobile/app/screens/Authenticated/TimerScreen/components/TimerTaskSection.tsx @@ -160,7 +160,8 @@ const TimerTaskSection = observer( > {translate('myWorkScreen.estimateLabel')} :{' '} - + +