Skip to content

Commit

Permalink
super_user only change status done under feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamsinghbundela committed Nov 5, 2023
1 parent bb810c4 commit 7e083c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/tasks/card/TaskStatusEditMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import classNames from '@/components/tasks/card/card.module.scss';
import { PENDING, SAVED, ERROR_STATUS } from '../constants';
import { useUpdateTaskMutation } from '@/app/services/tasksApi';
import { StatusIndicator } from './StatusIndicator';
import { useRouter } from 'next/router';

type Props = {
task: task;
Expand All @@ -13,9 +14,13 @@ type Props = {

// TODO: remove this after fixing the card beautify status
const beautifyStatus = (status: string) => status.split('_').join(' ');
const taskStatus = Object.entries(BACKEND_TASK_STATUS);

const TaskStatusEditMode = ({ task, setEditedTaskDetails }: Props) => {
const router = useRouter();
const devMode = router.query.dev === 'true' ? true : false;
const taskStatus = Object.entries(BACKEND_TASK_STATUS).filter(
([key]) => !(devMode === true && key === 'COMPLETED')
);
const [saveStatus, setSaveStatus] = useState('');
const [updateTask] = useUpdateTaskMutation();

Expand Down

0 comments on commit 7e083c4

Please sign in to comment.