From c0c6d7741601d3ae6d9127f176d470f0490dc62c Mon Sep 17 00:00:00 2001
From: Chris <125088905+wyattchris@users.noreply.github.com>
Date: Sat, 16 Mar 2024 13:02:24 -0400
Subject: [PATCH] refactor: fix cicd
---
client/assets/close/close1.svg | 2 +-
client/components/DropDownItem.tsx | 6 ++---
client/components/TaskInfoCard.tsx | 8 +++---
client/components/TaskType/CloseButton.tsx | 4 ---
client/screens/TaskList.tsx | 14 +++++-----
client/services/task.ts | 18 +++++++------
client/types/label.ts | 8 +++---
client/types/task.ts | 30 +++++++++++-----------
8 files changed, 43 insertions(+), 47 deletions(-)
diff --git a/client/assets/close/close1.svg b/client/assets/close/close1.svg
index 6528766..fcf27d8 100644
--- a/client/assets/close/close1.svg
+++ b/client/assets/close/close1.svg
@@ -1,3 +1,3 @@
\ No newline at end of file
+
diff --git a/client/components/DropDownItem.tsx b/client/components/DropDownItem.tsx
index 7aa866f..3278a09 100644
--- a/client/components/DropDownItem.tsx
+++ b/client/components/DropDownItem.tsx
@@ -1,13 +1,13 @@
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
-const DropdownItem = ({ label }: { label: string }) => {
+function DropdownItem({ label }: { label: string }) {
return (
{label}
);
-};
+}
const styles = StyleSheet.create({
container: {
@@ -27,4 +27,4 @@ const styles = StyleSheet.create({
}
});
-export default DropdownItem;
+export { DropdownItem };
diff --git a/client/components/TaskInfoCard.tsx b/client/components/TaskInfoCard.tsx
index b471399..7e2414b 100644
--- a/client/components/TaskInfoCard.tsx
+++ b/client/components/TaskInfoCard.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
-const TaskInfoComponent = ({
+export function TaskInfoComponent({
name,
label,
category,
@@ -13,7 +13,7 @@ const TaskInfoComponent = ({
category: string;
type: string;
date: Date;
-}) => {
+}) {
const formattedStartDate = date ? new Date(date).toLocaleDateString() : 'N/A';
return (
@@ -26,7 +26,7 @@ const TaskInfoComponent = ({
{`${formattedStartDate}`}
);
-};
+}
const styles = StyleSheet.create({
container: {
@@ -53,5 +53,3 @@ const styles = StyleSheet.create({
marginTop: 10
}
});
-
-export default TaskInfoComponent;
diff --git a/client/components/TaskType/CloseButton.tsx b/client/components/TaskType/CloseButton.tsx
index 7cc3003..45167ee 100644
--- a/client/components/TaskType/CloseButton.tsx
+++ b/client/components/TaskType/CloseButton.tsx
@@ -1,15 +1,11 @@
import React from 'react';
-import { useNavigation } from '@react-navigation/native';
import { IconButton } from 'react-native-paper';
import Close1 from '../../assets/close/close1.svg';
import Close2 from '../../assets/close/close2.svg';
-import { AppStackNavigation } from '../../navigation/AppNavigation';
export function CloseButton({ onPress }: { onPress: () => void }) {
- const navigation = useNavigation();
-
return (
{
- setSearchQuery('');
- setSelectedLabel(null);
- closeBottomSheet();
- };
+ // // TODO: Implement clearFilters function in dropdown picker
+ // const clearFilters = () => {
+ // setSearchQuery('');
+ // setSelectedLabel(null);
+ // closeBottomSheet();
+ // };
// Fetch task labels for each task (2d array list)
useEffect(() => {
diff --git a/client/services/task.ts b/client/services/task.ts
index cc5e167..995f1bd 100644
--- a/client/services/task.ts
+++ b/client/services/task.ts
@@ -1,8 +1,8 @@
-import { useQuery, useQueryClient } from '@tanstack/react-query';
+import { useQuery } from '@tanstack/react-query';
import axios from 'axios';
-import { Task } from '../types/task';
import { TaskLabel } from '../types/label';
+import { Task } from '../types/task';
import { api_url } from './api-links';
type TaskQueryParams = {
@@ -15,9 +15,11 @@ type TaskQueryParams = {
endDate?: string;
};
-const getFilteredTasks = async (queryParams: TaskQueryParams): Promise => {
+const getFilteredTasks = async (
+ queryParams: TaskQueryParams
+): Promise => {
const { data } = await axios.get(`${api_url}/tasks/filtered?`, {
- params: queryParams,
+ params: queryParams
});
return data;
};
@@ -28,16 +30,16 @@ export const getTaskLabels = async (taskID: string): Promise => {
};
export const useFilteredTasks = (queryParams: TaskQueryParams) => {
- const queryClient = useQueryClient();
+ // const queryClient = useQueryClient();
const { data: tasks, isLoading: tasksIsLoading } = useQuery({
queryKey: ['filteredTaskList', queryParams],
queryFn: () => getFilteredTasks(queryParams),
- refetchInterval: 20000,
+ refetchInterval: 20000
});
return {
tasks,
- tasksIsLoading,
+ tasksIsLoading
};
-};
\ No newline at end of file
+};
diff --git a/client/types/label.ts b/client/types/label.ts
index c91852b..3a3e99c 100644
--- a/client/types/label.ts
+++ b/client/types/label.ts
@@ -1,5 +1,5 @@
export interface TaskLabel {
- task_id: number;
- group_id: number;
- label_name: string;
-}
\ No newline at end of file
+ task_id: number;
+ group_id: number;
+ label_name: string;
+}
diff --git a/client/types/task.ts b/client/types/task.ts
index 104f5d7..f6d0e82 100644
--- a/client/types/task.ts
+++ b/client/types/task.ts
@@ -1,16 +1,16 @@
export interface Task {
- task_id: number;
- group_id: number;
- created_by: string;
- created_date: string;
- start_date?: string | null;
- end_date?: string | null;
- notes?: string | null;
- repeating: boolean;
- repeating_interval?: string | null;
- repeating_end_date?: string | null;
- task_status: string;
- task_type: string;
- task_info?: string | null;
- [key: string]: string | number | boolean | null | undefined; // Index signature for string indexing
-};
\ No newline at end of file
+ task_id: number;
+ group_id: number;
+ created_by: string;
+ created_date: string;
+ start_date?: string | null;
+ end_date?: string | null;
+ notes?: string | null;
+ repeating: boolean;
+ repeating_interval?: string | null;
+ repeating_end_date?: string | null;
+ task_status: string;
+ task_type: string;
+ task_info?: string | null;
+ [key: string]: string | number | boolean | null | undefined; // Index signature for string indexing
+}