mirror of
https://github.com/TurTaskProject/TurTaskWeb.git
synced 2025-12-19 22:14:07 +01:00
Add react-ios-time-picker package and fix merge
conflict in PieChart component
This commit is contained in:
parent
8f2e64b5e0
commit
00c68538fc
@ -46,6 +46,7 @@
|
|||||||
"react-datetime-picker": "^5.5.3",
|
"react-datetime-picker": "^5.5.3",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-icons": "^4.11.0",
|
"react-icons": "^4.11.0",
|
||||||
|
"react-ios-time-picker": "^0.2.2",
|
||||||
"react-router-dom": "^6.18.0",
|
"react-router-dom": "^6.18.0",
|
||||||
"react-tsparticles": "^2.12.2",
|
"react-tsparticles": "^2.12.2",
|
||||||
"tsparticles": "^2.12.0"
|
"tsparticles": "^2.12.0"
|
||||||
|
|||||||
@ -1,9 +1,5 @@
|
|||||||
lockfileVersion: '6.0'
|
lockfileVersion: '6.0'
|
||||||
|
|
||||||
settings:
|
|
||||||
autoInstallPeers: true
|
|
||||||
excludeLinksFromLockfile: false
|
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
'@dnd-kit/core':
|
'@dnd-kit/core':
|
||||||
specifier: ^6.1.0
|
specifier: ^6.1.0
|
||||||
@ -113,6 +109,9 @@ dependencies:
|
|||||||
react-icons:
|
react-icons:
|
||||||
specifier: ^4.11.0
|
specifier: ^4.11.0
|
||||||
version: 4.12.0(react@18.2.0)
|
version: 4.12.0(react@18.2.0)
|
||||||
|
react-ios-time-picker:
|
||||||
|
specifier: ^0.2.2
|
||||||
|
version: 0.2.2(react-dom@18.2.0)(react@18.2.0)
|
||||||
react-router-dom:
|
react-router-dom:
|
||||||
specifier: ^6.18.0
|
specifier: ^6.18.0
|
||||||
version: 6.19.0(react-dom@18.2.0)(react@18.2.0)
|
version: 6.19.0(react-dom@18.2.0)(react@18.2.0)
|
||||||
@ -3573,6 +3572,17 @@ packages:
|
|||||||
react: 18.2.0
|
react: 18.2.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/react-ios-time-picker@0.2.2(react-dom@18.2.0)(react@18.2.0):
|
||||||
|
resolution: {integrity: sha512-bi+K23lK6Pf2xDXmhAlz+RJuy9/onWYi7Ye+ODVhIkis9AVFECOza2ckkZl/4vUypj2+TdTsHn+VZrTNdGIwDQ==}
|
||||||
|
peerDependencies:
|
||||||
|
react: ^18.2.0
|
||||||
|
react-dom: ^18.2.0
|
||||||
|
dependencies:
|
||||||
|
react: 18.2.0
|
||||||
|
react-dom: 18.2.0(react@18.2.0)
|
||||||
|
react-portal: 4.2.2(react-dom@18.2.0)(react@18.2.0)
|
||||||
|
dev: false
|
||||||
|
|
||||||
/react-is@16.13.1:
|
/react-is@16.13.1:
|
||||||
resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
|
resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
|
||||||
|
|
||||||
@ -3612,6 +3622,17 @@ packages:
|
|||||||
warning: 4.0.3
|
warning: 4.0.3
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/react-portal@4.2.2(react-dom@18.2.0)(react@18.2.0):
|
||||||
|
resolution: {integrity: sha512-vS18idTmevQxyQpnde0Td6ZcUlv+pD8GTyR42n3CHUQq9OHi1C4jDE4ZWEbEsrbrLRhSECYiao58cvocwMtP7Q==}
|
||||||
|
peerDependencies:
|
||||||
|
react: ^16.0.0-0 || ^17.0.0-0 || ^18.0.0-0
|
||||||
|
react-dom: ^16.0.0-0 || ^17.0.0-0 || ^18.0.0-0
|
||||||
|
dependencies:
|
||||||
|
prop-types: 15.8.1
|
||||||
|
react: 18.2.0
|
||||||
|
react-dom: 18.2.0(react@18.2.0)
|
||||||
|
dev: false
|
||||||
|
|
||||||
/react-redux@7.2.9(react-dom@18.2.0)(react@18.2.0):
|
/react-redux@7.2.9(react-dom@18.2.0)(react@18.2.0):
|
||||||
resolution: {integrity: sha512-Gx4L3uM182jEEayZfRbI/G11ZpYdNAnBs70lFVMNdHJI76XYtR+7m0MN+eAs7UHBPhWXcnFPaS+9owSCJQHNpQ==}
|
resolution: {integrity: sha512-Gx4L3uM182jEEayZfRbI/G11ZpYdNAnBs70lFVMNdHJI76XYtR+7m0MN+eAs7UHBPhWXcnFPaS+9owSCJQHNpQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@ -4663,3 +4684,7 @@ packages:
|
|||||||
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
|
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
settings:
|
||||||
|
autoInstallPeers: true
|
||||||
|
excludeLinksFromLockfile: false
|
||||||
|
|||||||
@ -13,11 +13,7 @@ export function DonutChartGraph() {
|
|||||||
const completedTask = response.data.total_completed_tasks || 0;
|
const completedTask = response.data.total_completed_tasks || 0;
|
||||||
|
|
||||||
const donutData = [
|
const donutData = [
|
||||||
<<<<<<< HEAD
|
|
||||||
{ name: "Completed task", count: completedTask},
|
{ name: "Completed task", count: completedTask},
|
||||||
=======
|
|
||||||
{ name: "Completed task", count: completedTask},
|
|
||||||
>>>>>>> 4a3f253e3049f97ef4479dd423642897a56e13fc
|
|
||||||
{ name: "Total task", count: totalTask },
|
{ name: "Total task", count: totalTask },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@ -139,23 +139,6 @@ export function TaskCard({ task, deleteTask, updateTask }) {
|
|||||||
onMouseLeave={() => {
|
onMouseLeave={() => {
|
||||||
setMouseIsOver(false);
|
setMouseIsOver(false);
|
||||||
}}>
|
}}>
|
||||||
<<<<<<< HEAD
|
|
||||||
<p
|
|
||||||
className={`p-2.5 my-auto w-full overflow-y-auto overflow-x-hidden whitespace-pre-wrap rounded-xl shadow bg-white`}
|
|
||||||
onClick={() => document.getElementById(`task_detail_modal_${task.id}`).showModal()}>
|
|
||||||
{task.content}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{mouseIsOver && (
|
|
||||||
<button
|
|
||||||
onClick={() => {
|
|
||||||
deleteTask(task.id);
|
|
||||||
}}
|
|
||||||
className="stroke-white absolute right-0 top-1/2 rounded-full bg-white -translate-y-1/2 bg-columnBackgroundColor p-2 hover:opacity-100 ">
|
|
||||||
<BsFillTrashFill />
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
=======
|
|
||||||
{/* -------- Task Content -------- */}
|
{/* -------- Task Content -------- */}
|
||||||
{/* Tags */}
|
{/* Tags */}
|
||||||
{tags}
|
{tags}
|
||||||
@ -183,7 +166,6 @@ export function TaskCard({ task, deleteTask, updateTask }) {
|
|||||||
{dueDateTag}
|
{dueDateTag}
|
||||||
{subtaskCountTag}
|
{subtaskCountTag}
|
||||||
</div>
|
</div>
|
||||||
>>>>>>> 4a3f253e3049f97ef4479dd423642897a56e13fc
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -3,9 +3,21 @@ import { FaTasks, FaRegListAlt } from "react-icons/fa";
|
|||||||
import { FaPlus } from "react-icons/fa6";
|
import { FaPlus } from "react-icons/fa6";
|
||||||
import { TbChecklist } from "react-icons/tb";
|
import { TbChecklist } from "react-icons/tb";
|
||||||
import DatePicker from "react-datepicker";
|
import DatePicker from "react-datepicker";
|
||||||
|
import { TimePicker } from "react-ios-time-picker";
|
||||||
import "react-datepicker/dist/react-datepicker.css";
|
import "react-datepicker/dist/react-datepicker.css";
|
||||||
|
import { borderColor } from "@mui/system";
|
||||||
|
|
||||||
export function TaskDetailModal({ title, description, tags, difficulty, challenge, importance, taskId, updateTask }) {
|
export function TaskDetailModal({
|
||||||
|
title,
|
||||||
|
description,
|
||||||
|
tags,
|
||||||
|
difficulty,
|
||||||
|
challenge,
|
||||||
|
importance,
|
||||||
|
taskId,
|
||||||
|
updateTask,
|
||||||
|
}) {
|
||||||
|
let date = new Date();
|
||||||
const [isChallengeChecked, setChallengeChecked] = useState(challenge);
|
const [isChallengeChecked, setChallengeChecked] = useState(challenge);
|
||||||
const [isImportantChecked, setImportantChecked] = useState(importance);
|
const [isImportantChecked, setImportantChecked] = useState(importance);
|
||||||
const [currentDifficulty, setCurrentDifficulty] = useState(difficulty);
|
const [currentDifficulty, setCurrentDifficulty] = useState(difficulty);
|
||||||
@ -15,7 +27,11 @@ export function TaskDetailModal({ title, description, tags, difficulty, challeng
|
|||||||
const [startDateEnabled, setStartDateEnabled] = useState(false);
|
const [startDateEnabled, setStartDateEnabled] = useState(false);
|
||||||
const [endDateEnabled, setEndDateEnabled] = useState(false);
|
const [endDateEnabled, setEndDateEnabled] = useState(false);
|
||||||
const [isTaskComplete, setTaskComplete] = useState(false);
|
const [isTaskComplete, setTaskComplete] = useState(false);
|
||||||
|
const [value, setValue] = useState('10:00');
|
||||||
|
|
||||||
|
const onChange = (timeValue) => {
|
||||||
|
setValue(timeValue);
|
||||||
|
};
|
||||||
const handleChallengeChange = () => {
|
const handleChallengeChange = () => {
|
||||||
setChallengeChecked(!isChallengeChecked);
|
setChallengeChecked(!isChallengeChecked);
|
||||||
};
|
};
|
||||||
@ -30,7 +46,11 @@ export function TaskDetailModal({ title, description, tags, difficulty, challeng
|
|||||||
|
|
||||||
const handleTagChange = (tag) => {
|
const handleTagChange = (tag) => {
|
||||||
const isSelected = selectedTags.includes(tag);
|
const isSelected = selectedTags.includes(tag);
|
||||||
setSelectedTags(isSelected ? selectedTags.filter((selectedTag) => selectedTag !== tag) : [...selectedTags, tag]);
|
setSelectedTags(
|
||||||
|
isSelected
|
||||||
|
? selectedTags.filter((selectedTag) => selectedTag !== tag)
|
||||||
|
: [...selectedTags, tag]
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleStartDateChange = () => {
|
const handleStartDateChange = () => {
|
||||||
@ -59,7 +79,8 @@ export function TaskDetailModal({ title, description, tags, difficulty, challeng
|
|||||||
const existingTags = tags.map((tag, index) => (
|
const existingTags = tags.map((tag, index) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
className={`text-xs inline-flex items-center font-bold leading-sm uppercase px-2 py-1 bg-${tag.color}-200 text-${tag.color}-700 rounded-full`}>
|
className={`text-xs inline-flex items-center font-bold leading-sm uppercase px-2 py-1 bg-${tag.color}-200 text-${tag.color}-700 rounded-full`}
|
||||||
|
>
|
||||||
{tag.label}
|
{tag.label}
|
||||||
</div>
|
</div>
|
||||||
));
|
));
|
||||||
@ -68,7 +89,8 @@ export function TaskDetailModal({ title, description, tags, difficulty, challeng
|
|||||||
const selectedTagElements = selectedTags.map((tag, index) => (
|
const selectedTagElements = selectedTags.map((tag, index) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
className={`text-xs inline-flex items-center font-bold leading-sm uppercase px-2 py-1 bg-${tag.color}-200 text-${tag.color}-700 rounded-full`}>
|
className={`text-xs inline-flex items-center font-bold leading-sm uppercase px-2 py-1 bg-${tag.color}-200 text-${tag.color}-700 rounded-full`}
|
||||||
|
>
|
||||||
{tag.label}
|
{tag.label}
|
||||||
</div>
|
</div>
|
||||||
));
|
));
|
||||||
@ -92,10 +114,16 @@ export function TaskDetailModal({ title, description, tags, difficulty, challeng
|
|||||||
<div className="flex flex-col py-2 pb-4">
|
<div className="flex flex-col py-2 pb-4">
|
||||||
<div className="flex flex-row space-x-5">
|
<div className="flex flex-row space-x-5">
|
||||||
<div className="dropdown">
|
<div className="dropdown">
|
||||||
<label tabIndex={0} className="btn-md border-2 rounded-xl m-1 py-1">
|
<label
|
||||||
|
tabIndex={0}
|
||||||
|
className="btn-md border-2 rounded-xl m-1 py-1"
|
||||||
|
>
|
||||||
+ Add Tags
|
+ Add Tags
|
||||||
</label>
|
</label>
|
||||||
<ul tabIndex={0} className="dropdown-content z-[10] menu p-2 shadow bg-base-100 rounded-box w-52">
|
<ul
|
||||||
|
tabIndex={0}
|
||||||
|
className="dropdown-content z-[10] menu p-2 shadow bg-base-100 rounded-box w-52"
|
||||||
|
>
|
||||||
{tags.map((tag, index) => (
|
{tags.map((tag, index) => (
|
||||||
<li key={index}>
|
<li key={index}>
|
||||||
<label className="cursor-pointer space-x-2">
|
<label className="cursor-pointer space-x-2">
|
||||||
@ -127,10 +155,14 @@ export function TaskDetailModal({ title, description, tags, difficulty, challeng
|
|||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={startDateEnabled}
|
checked={startDateEnabled}
|
||||||
className="checkbox checkbox-xs"
|
className="checkbox checkbox-xs bg-black"
|
||||||
onChange={handleStartDateChange}
|
onChange={handleStartDateChange}
|
||||||
/>
|
/>
|
||||||
<div className={`rounded p-2 shadow border-2 ${!startDateEnabled && "opacity-50"}`}>
|
<div
|
||||||
|
className={`rounded p-2 shadow border-2 ${
|
||||||
|
!startDateEnabled && "opacity-50"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
<DatePicker
|
<DatePicker
|
||||||
selected={dateStart}
|
selected={dateStart}
|
||||||
onChange={(date) => setDateStart(date)}
|
onChange={(date) => setDateStart(date)}
|
||||||
@ -139,6 +171,15 @@ export function TaskDetailModal({ title, description, tags, difficulty, challeng
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="rounded p-2 shadow border-2">
|
||||||
|
|
||||||
|
<TimePicker
|
||||||
|
value={value}
|
||||||
|
onChange={onChange}
|
||||||
|
className="rounded p-2 shadow border-2 z-[10000] relative"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
{/* Complete? */}
|
{/* Complete? */}
|
||||||
<div className="mx-4">
|
<div className="mx-4">
|
||||||
<div className="flex items-center space-x-2 mt-4">
|
<div className="flex items-center space-x-2 mt-4">
|
||||||
@ -147,7 +188,7 @@ export function TaskDetailModal({ title, description, tags, difficulty, challeng
|
|||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={isTaskComplete}
|
checked={isTaskComplete}
|
||||||
className="checkbox checkbox-xl"
|
className="checkbox checkbox-xl bg-black"
|
||||||
onChange={handleTaskCompleteChange}
|
onChange={handleTaskCompleteChange}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -161,11 +202,19 @@ export function TaskDetailModal({ title, description, tags, difficulty, challeng
|
|||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={endDateEnabled}
|
checked={endDateEnabled}
|
||||||
className="checkbox checkbox-xs"
|
className="checkbox checkbox-xs bg-black"
|
||||||
onChange={handleEndDateChange}
|
onChange={handleEndDateChange}
|
||||||
/>
|
/>
|
||||||
<div className={`rounded p-2 shadow border-2 ${!endDateEnabled && "opacity-50"}`}>
|
<div
|
||||||
<DatePicker selected={dateEnd} onChange={(date) => setDateEnd(date)} disabled={!endDateEnabled} />
|
className={`rounded p-2 shadow border-2 ${
|
||||||
|
!endDateEnabled && "opacity-50"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<DatePicker
|
||||||
|
selected={dateEnd}
|
||||||
|
onChange={(date) => setDateEnd(date)}
|
||||||
|
disabled={!endDateEnabled}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -211,7 +260,7 @@ export function TaskDetailModal({ title, description, tags, difficulty, challeng
|
|||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={isChallengeChecked}
|
checked={isChallengeChecked}
|
||||||
className="checkbox"
|
className="checkbox bg-black"
|
||||||
onChange={handleChallengeChange}
|
onChange={handleChallengeChange}
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
@ -226,7 +275,7 @@ export function TaskDetailModal({ title, description, tags, difficulty, challeng
|
|||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={isImportantChecked}
|
checked={isImportantChecked}
|
||||||
className="checkbox"
|
className="checkbox bg-black"
|
||||||
onChange={handleImportantChange}
|
onChange={handleImportantChange}
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
@ -242,7 +291,11 @@ export function TaskDetailModal({ title, description, tags, difficulty, challeng
|
|||||||
</span>
|
</span>
|
||||||
</h2>
|
</h2>
|
||||||
<div className="flex space-x-3 pt-2">
|
<div className="flex space-x-3 pt-2">
|
||||||
<input type="text" placeholder="subtask topic" className="input input-bordered flex-1 w-full" />
|
<input
|
||||||
|
type="text"
|
||||||
|
placeholder="subtask topic"
|
||||||
|
className="input input-bordered flex-1 w-full"
|
||||||
|
/>
|
||||||
<button className="btn">
|
<button className="btn">
|
||||||
<FaPlus />
|
<FaPlus />
|
||||||
Add Subtask
|
Add Subtask
|
||||||
@ -250,7 +303,9 @@ export function TaskDetailModal({ title, description, tags, difficulty, challeng
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<form method="dialog">
|
<form method="dialog">
|
||||||
<button className="btn btn-sm btn-circle btn-ghost absolute right-2 top-2">X</button>
|
<button className="btn btn-sm btn-circle btn-ghost absolute right-2 top-2">
|
||||||
|
X
|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user