Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #1931

Merged
merged 5 commits into from
Dec 1, 2023
Merged

Release #1931

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions apps/mobile/app/components/TeamDropdown/DropDownSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,18 @@ const DropDownSection: FC<Props> = observer(function DropDownSection({

const others = teams.filter((t) => t.id !== activeTeamId);

const { colors } = useAppTheme();
const { colors, dark } = useAppTheme();
return (
<View
style={[styles.mainContainer, { backgroundColor: colors.background, shadowColor: 'rgba(0, 0, 0, 0.12)' }]}
style={[
styles.mainContainer,
{
backgroundColor: colors.background,
shadowColor: 'rgba(0, 0, 0, 0.12)',
borderWidth: dark ? 1 : 0,
borderColor: colors.border
}
]}
>
{/* <View style={styles.indDropDown}>
<View style={{ flexDirection: "row", alignItems: "center" }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -87,14 +87,7 @@
</View>
</View>
<View style={[styles.times, { borderTopColor: colors.divider }]}>
<TouchableWithoutFeedback
onPress={(event) => {
if (Platform.OS === 'android' && taskEdition.estimateEditMode) {
event.stopPropagation();
taskEdition.setEstimateEditMode(false);
}
}}
>
<TouchableWithoutFeedback>
<View
style={{
flexDirection: 'row',
Expand All @@ -114,7 +107,11 @@
</View>

{memberInfo.memberTask && taskEdition.estimateEditMode ? (
<View style={styles.estimate} ref={clickOutsideTaskEstimationInputRef}>
<View
style={styles.estimate}
collapsable={false}

Check warning on line 112 in apps/mobile/app/screens/Authenticated/TeamScreen/components/ListCardItem.tsx

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (collapsable)
ref={clickOutsideTaskEstimationInputRef}
>
<EstimateTime
setEditEstimate={taskEdition.setEstimateEditMode}
currentTask={memberInfo.memberTask}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@
import { typography, useAppTheme } from '../../../../theme';
import { useTeamTasks } from '../../../../services/hooks/features/useTeamTasks';
import { ITeamTask } from '../../../../services/interfaces/ITask';
import { useClickOutside } from 'react-native-click-outside';

interface Props {
setEditEstimate?: (value: boolean) => unknown;
currentTask: ITeamTask;
setEstimateTime?: (value: number) => unknown;
timerScreen?: boolean;
}
const EstimateTime: FC<Props> = ({ setEditEstimate, currentTask, setEstimateTime }) => {
const EstimateTime: FC<Props> = ({ setEditEstimate, currentTask, setEstimateTime, timerScreen }) => {
// Hooks
const { updateTask } = useTeamTasks();
const { colors } = useAppTheme();
const { colors, dark } = useAppTheme();

// STATES
const textInputRef = useRef(null);
Expand All @@ -26,6 +28,18 @@
const [isLoading, setIsLoading] = useState<boolean>(false);
const [showCheckIcon, setShowCheckIcon] = useState<boolean>(false);

const clickOutsideTaskEstimationInputRef = useClickOutside<View>(() => 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({
Expand Down Expand Up @@ -127,7 +141,7 @@
};

return (
<View style={[styles.estimate, {}]}>
<View style={[styles.estimate, {}]} collapsable={false} ref={timerScreen && clickOutsideTaskEstimationInputRef}>

Check warning on line 144 in apps/mobile/app/screens/Authenticated/TimerScreen/components/EstimateTime.tsx

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (collapsable)
<View>
<TextInput
ref={textInputRef}
Expand Down Expand Up @@ -174,8 +188,22 @@
</View>
</View>
<Text style={[styles.suffix, { color: colors.primary }]}>{' m'}</Text>
{showCheckIcon && <Feather size={25} color={'green'} name="check" onPress={() => handleSubmit()} />}
{isLoading ? <ActivityIndicator size={14} color="#1B005D" style={styles.loading} /> : null}
{showCheckIcon && (
<Feather
size={25}
color={'green'}
name="check"
onPress={() => handleSubmit()}
style={timerScreen ? { position: 'absolute', right: -24 } : undefined}
/>
)}
{isLoading && (
<ActivityIndicator
size={14}
color={timerScreen ? (dark ? colors.primary : '#1B005D') : '#1B005D'}
style={timerScreen ? { position: 'absolute', right: -19 } : styles.loading}
/>
)}
</View>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ const TimerTaskSection = observer(
>
{translate('myWorkScreen.estimateLabel')} :{' '}
</Text>
<EstimateTime currentTask={activeTask} />

<EstimateTime timerScreen={true} currentTask={activeTask} />
</View>
<TaskSize
task={activeTask}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
/^\/$/,
Expand Down
7 changes: 5 additions & 2 deletions apps/web/pages/auth/passcode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading