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

Feat/task description block #1696

Merged
merged 25 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c7b297a
Created Accordion and initiated the Details Block
desperado1802 Oct 30, 2023
0d73ed8
added component to handle task publicity
desperado1802 Oct 30, 2023
d49aec8
Merge branch 'develop' into feat/task-description-block
desperado1802 Oct 30, 2023
b381b00
added created task rows component, added creator, assignees of task
desperado1802 Oct 30, 2023
537dfb1
added manage assignees modal
desperado1802 Oct 31, 2023
9da7646
Merge branch 'develop' into feat/task-description-block
desperado1802 Oct 31, 2023
fcb3dd3
added functionality to remove and assign users to task
desperado1802 Oct 31, 2023
6e567ad
fixed text colors in dark theme
desperado1802 Oct 31, 2023
b136cc2
added calendar for task start, due and remaining days
desperado1802 Oct 31, 2023
d50b451
Merge branch 'develop' into feat/task-description-block
desperado1802 Oct 31, 2023
62ee59a
added the size, status, label and priority components
desperado1802 Oct 31, 2023
c6f9bc2
Merge branch 'develop' into feat/task-description-block
desperado1802 Oct 31, 2023
43ca511
updated the labels ui for task screen
desperado1802 Oct 31, 2023
c3f6092
created the task versions apis, query, and also hook to use them
desperado1802 Oct 31, 2023
28cc6ce
added versions button and popup, also fixed scroll issue
desperado1802 Nov 1, 2023
2e75cf5
adjusted fonts
desperado1802 Nov 1, 2023
cfe0e47
added the epic parent button
desperado1802 Nov 1, 2023
6ce674b
added the epic popup/button for issue type story tasks
desperado1802 Nov 1, 2023
9a61ae5
Merge branch 'develop' into feat/task-description-block
desperado1802 Nov 1, 2023
884d461
added issues button/modal, blur views for modals, fixed alignement is…
desperado1802 Nov 1, 2023
f91f847
added translations
desperado1802 Nov 5, 2023
d37d8cd
fixed no border issue for labels, statuses, priority and status when …
desperado1802 Nov 5, 2023
25910e4
fixed label margin issue
desperado1802 Nov 5, 2023
32960d3
Merge branch 'develop' into feat/task-description-block
desperado1802 Nov 5, 2023
66df31d
Merge branch 'develop' into feat/task-description-block
desperado1802 Nov 6, 2023
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
60 changes: 60 additions & 0 deletions apps/mobile/app/components/Accordion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* eslint-disable react-native/no-color-literals */
/* eslint-disable react-native/no-inline-styles */
import { View, Text, StyleSheet, TouchableOpacity } from "react-native"
import React, { useState } from "react"
import { Feather } from "@expo/vector-icons"
import { useAppTheme } from "../theme"

const Accordion = ({ children, title }) => {
const [expanded, setExpanded] = useState(true)
const { colors } = useAppTheme()

function toggleItem() {
setExpanded(!expanded)
}

const body = <View style={{ gap: 12 }}>{children}</View>
return (
<View style={[styles.accordContainer, { backgroundColor: colors.background }]}>
<TouchableOpacity style={styles.accordHeader} onPress={toggleItem}>
<Text style={[styles.accordTitle, { color: colors.primary }]}>{title}</Text>
<Feather
name={expanded ? "chevron-up" : "chevron-down"}
size={25}
color={colors.primary}
/>
</TouchableOpacity>
{expanded && (
<View style={{ paddingHorizontal: 12, marginBottom: 12 }}>
<View
style={{
width: "100%",
borderBottomColor: "#F2F2F2",
borderBottomWidth: 1,
}}
/>
</View>
)}
{expanded && body}
</View>
)
}

export default Accordion

const styles = StyleSheet.create({
accordContainer: {
borderRadius: 8,
width: "100%",
},
accordHeader: {
alignItems: "center",
flexDirection: "row",
justifyContent: "space-between",
padding: 12,
},
accordTitle: {
fontSize: 20,
fontWeight: "600",
},
})
28 changes: 16 additions & 12 deletions apps/mobile/app/components/IssuesModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,16 @@ import { SvgUri } from "react-native-svg"
import { IIssueType } from "../services/interfaces/ITaskIssue"
import { useTeamTasks } from "../services/hooks/features/useTeamTasks"
import { useAppTheme } from "../theme"
import { BlurView } from "expo-blur"

interface IssuesModalProps {
task: ITeamTask
readonly?: boolean
nameIncluded?: boolean
responsiveFontSize?: () => number
smallFont?: boolean
}

const IssuesModal: FC<IssuesModalProps> = ({
task,
readonly = false,
nameIncluded,
responsiveFontSize,
}) => {
const IssuesModal: FC<IssuesModalProps> = ({ task, readonly = false, nameIncluded, smallFont }) => {
const { allTaskIssues } = useTaskIssue()
const [isModalOpen, setIsModalOpen] = useState<boolean>(false)
const { updateTask } = useTeamTasks()
Expand All @@ -56,14 +52,14 @@ const IssuesModal: FC<IssuesModalProps> = ({
currentIssue?.name === "Bug" ? 15 : currentIssue?.name === "Story" ? 14 : 13

return (
<>
<View>
<View
style={[
styles.wrapButton,
{
backgroundColor: currentIssue?.color,
height: nameIncluded ? 24 : 20,
width: nameIncluded ? "auto" : 20,
width: nameIncluded ? 65 : 20,
paddingVertical: nameIncluded && 2,
paddingHorizontal: nameIncluded && 10,
flexDirection: "row",
Expand All @@ -87,7 +83,7 @@ const IssuesModal: FC<IssuesModalProps> = ({
<Text
style={{
color: "#ffffff",
fontSize: responsiveFontSize ? responsiveFontSize() : 14,
fontSize: smallFont ? 10 : 14,
}}
>
{currentIssue?.name}
Expand All @@ -110,7 +106,7 @@ const IssuesModal: FC<IssuesModalProps> = ({
/>
</View>
</ModalPopUp>
</>
</View>
)
}

Expand Down Expand Up @@ -141,6 +137,15 @@ const ModalPopUp = ({ visible, children, onDismiss }) => {
}
return (
<Modal animationType="fade" transparent visible={showModal}>
<BlurView
intensity={15}
tint="dark"
style={{
position: "absolute",
width: "100%",
height: "100%",
}}
/>
<TouchableWithoutFeedback onPress={() => onDismiss()}>
<View style={$modalBackGround}>
<Animated.View style={{ transform: [{ scale: scaleValue }] }}>
Expand Down Expand Up @@ -185,7 +190,6 @@ const Item = ({ issue, onChangeIssue, closeModal, readonly = false }: IItem) =>

const $modalBackGround: ViewStyle = {
flex: 1,
backgroundColor: "#000000AA",
justifyContent: "center",
}

Expand Down
81 changes: 48 additions & 33 deletions apps/mobile/app/components/StatusType.tsx
Original file line number Diff line number Diff line change
@@ -1,65 +1,80 @@
import React, { useMemo } from 'react';
import { View } from 'react-native';
import { SvgUri } from 'react-native-svg';
import { useTaskLabels } from '../services/hooks/features/useTaskLabels';
import { useTaskPriority } from '../services/hooks/features/useTaskPriority';
import { useTaskSizes } from '../services/hooks/features/useTaskSizes';
import { useTaskStatus } from '../services/hooks/features/useTaskStatus';
import { ITaskStatusItem } from '../services/interfaces/ITaskStatus';
import React, { useMemo } from "react"
import { View } from "react-native"
import { SvgUri } from "react-native-svg"
import { useTaskLabels } from "../services/hooks/features/useTaskLabels"
import { useTaskPriority } from "../services/hooks/features/useTaskPriority"
import { useTaskSizes } from "../services/hooks/features/useTaskSizes"
import { useTaskStatus } from "../services/hooks/features/useTaskStatus"
import { ITaskStatusItem } from "../services/interfaces/ITaskStatus"
import { useTaskVersion } from "../services/hooks/features/useTaskVersion"

export type TStatusItem = {
bgColor?: string;
icon?: React.ReactNode | undefined;
name?: string;
value?: string;
bordered?: boolean;
};
bgColor?: string
icon?: React.ReactNode | undefined
name?: string
value?: string
bordered?: boolean
}

export type TStatus<T extends string> = {
[k in T]: TStatusItem;
};
[k in T]: TStatusItem
}

export function useMapToTaskStatusValues<T extends ITaskStatusItem>(data: T[], bordered = false): TStatus<any> {
export function useMapToTaskStatusValues<T extends ITaskStatusItem>(
data: T[],
bordered = false,
): TStatus<any> {
return useMemo(() => {
return data.reduce((acc, item) => {
const value: TStatus<any>[string] = {
name: item.name?.split('-').join(' '),
name: item.name?.split("-").join(" "),
value: item.value || item.name,
bgColor: item.color,
bordered,
icon: <View>{item.fullIconUrl && <SvgUri width={14} height={14} uri={item.fullIconUrl} />}</View>
};
icon: (
<View>
{item.fullIconUrl && (
<SvgUri width={14} height={14} uri={item.fullIconUrl} />
)}
</View>
),
}

if (value.name) {
acc[value.name] = value;
acc[value.name] = value
} else if (value.value) {
acc[value.value] = value;
acc[value.value] = value
}
return acc;
}, {} as TStatus<any>);
}, [data, bordered]);
return acc
}, {} as TStatus<any>)
}, [data, bordered])
}

// ==================== Task Status ========================================
export function useTaskStatusValue() {
const { allStatuses } = useTaskStatus();
return useMapToTaskStatusValues(allStatuses);
const { allStatuses } = useTaskStatus()
return useMapToTaskStatusValues(allStatuses)
}

// =================== Task Size ==============================================
export function useTaskSizeValue() {
const { allTaskSizes } = useTaskSizes();
return useMapToTaskStatusValues(allTaskSizes);
const { allTaskSizes } = useTaskSizes()
return useMapToTaskStatusValues(allTaskSizes)
}

// =================== Task Label ==============================================
export function useTaskLabelValue() {
const { allTaskLabels } = useTaskLabels();
return useMapToTaskStatusValues(allTaskLabels);
const { allTaskLabels } = useTaskLabels()
return useMapToTaskStatusValues(allTaskLabels)
}

// =================== Task Priority ==============================================
export function useTaskPriorityValue() {
const { allTaskPriorities } = useTaskPriority();
return useMapToTaskStatusValues(allTaskPriorities);
const { allTaskPriorities } = useTaskPriority()
return useMapToTaskStatusValues(allTaskPriorities)
}
// =================== Task Priority ==============================================
export function useTaskVersionValue() {
const { taskVersionList } = useTaskVersion()
return useMapToTaskStatusValues(taskVersionList)
}
Loading
Loading