Skip to content

Commit

Permalink
chore: add Tasks page
Browse files Browse the repository at this point in the history
  • Loading branch information
silviyaboteva committed Mar 1, 2025
1 parent bed6172 commit a71411e
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 35 deletions.
6 changes: 2 additions & 4 deletions examples/kendo-react-freemium/src/pages/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ export const DropdownFilterCell = (props: any) => {
});
};

// textField="text"

return (
<div className="k-filtercell gap-1">
<DropDownList
Expand Down Expand Up @@ -191,7 +189,7 @@ const StakeholderFilterCell = (props: any) => {

export default function Projects() {
const navigate = useNavigate();

const [data, setData] = React.useState<any>(projectsData);
const [filter, setFilter] = React.useState<any>();

Expand All @@ -215,7 +213,7 @@ export default function Projects() {
};

const itemChange = (event: GridItemChangeEvent) => {
const newData = data.map((item) =>
const newData = data.map((item: any) =>
item.ProjectID === event.dataItem.ProjectID
? {
...item,
Expand Down
143 changes: 138 additions & 5 deletions examples/kendo-react-freemium/src/pages/Tasks.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,140 @@
import { filterBy } from "@progress/kendo-data-query";
import { Button } from "@progress/kendo-react-buttons";
import { GridFilterChangeEvent, GridItemChangeEvent, Grid, GridToolbar, GridSearchBox, GridColumn } from "@progress/kendo-react-grid";
import { BreadcrumbLinkMouseEvent, Breadcrumb } from "@progress/kendo-react-layout";
import { exportIcon, homeIcon, printIcon } from "@progress/kendo-svg-icons";
import React from "react";
import { CSVLink } from "react-csv";
import { useNavigate } from "react-router-dom";
import { tasksData } from "./data";
import { SvgIcon } from "@progress/kendo-react-common";

interface DataModel {
id: string;
text?: string;
icon?: React.ReactNode;
}

const breadcrumbItems: DataModel[] = [
{ id: "home", icon: <SvgIcon icon={homeIcon} /> },
{ id: "tasks", text: "Tasks" },
];

export default function Tasks() {
const navigate = useNavigate();

const [data, setData] = React.useState<any>(tasksData);
const [filter, setFilter] = React.useState<any>();

const handleItemSelect = (e: BreadcrumbLinkMouseEvent) => {
if (e.id === "home") {
navigate("/");
}
};

const filterChange = (event: GridFilterChangeEvent) => {
setFilter(event.filter);

setData(filterBy(tasksData, event.filter));
};

const itemChange = (event: GridItemChangeEvent) => {
const newData = data.map((item: any) =>
item.taskId === event.dataItem.taskId
? {
...item,
[event.field || '']: event.value
}
: item
);

setData(newData);
};

return (
<>
Tasks
</>
)
}
<div
style={{ minHeight: "calc(100vh - 106px)" }}
className="flex flex-col p-10 gap-6"
>
<Breadcrumb
data={breadcrumbItems}
onItemSelect={handleItemSelect}
className="!bg-app-surface"
/>

<div className="flex flex-wrap items-center">
<h1 className="text-4xl">Tasks</h1>
</div>

<Grid
className="k-grid-no-scrollbar"
data={data}
autoProcessData={{
filter: false,
search: true,
page: true,
}}
// FILTER
filter={filter}
filterable={true}
onFilterChange={filterChange}
// PAGER
pageable={
{
buttonCount: 6,
pageSizes: [5, 10, 15, 'All'],

}
}
onItemChange={itemChange}
defaultTake={10}
defaultSkip={0}

// EDITING
dataItemKey={"ProjectID"}
editable={true}

>
<GridToolbar>
<GridSearchBox />
<span className="k-toolbar-spacer" />

<Button svgIcon={exportIcon} fillMode="flat">
<CSVLink data={data}>Export to CSV</CSVLink>
</Button>
<Button svgIcon={printIcon} fillMode="flat" onClick={print}>
Print
</Button>
</GridToolbar>
<GridColumn field="taskName" title="Task Name" width={350} />
<GridColumn
field="assignedTo"
title="Assigned To"
width={195}
/>
<GridColumn
field="dueDate"
title="Due Date"
width={195}
format="{0:d}"
filter="date"
/>
<GridColumn
field="priority"
title="Priority"
width={195}
/>
<GridColumn
field="status"
title="Status"
width={200}
/>
<GridColumn
field="tags"
title="Tags"
width={270}
/>
</Grid>
</div>
);
}
40 changes: 14 additions & 26 deletions examples/kendo-react-freemium/src/pages/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -617,116 +617,103 @@ export const projectsData = [
// TASKS PAGE
export const tasksData = [
{
taskId: '#2213',
taskName: 'Define project scope and objectives.',
taskName: '#2213 Define project scope and objectives.',
assignedTo: 'Fabiola.Cassin90',
dueDate: '07/31/2025',
status: '🕒 Postponed',
tags: ['Feature Development', 'Phase 1'],
priority: 'High priority'
},
{
taskId: '#2213',
taskName: 'Conduct market research to assess existing LMS solutions.',
taskName: '#2213 Conduct market research to assess existing LMS solutions.',
assignedTo: 'Marlon66',
dueDate: '08/11/2025',
status: '✅ Completed',
tags: ['Research', 'Q1 Release'],
priority: 'Medium priority'
},
{
taskId: '#5342',
taskName: 'Identify target audience and their specific needs.',
taskName: '#5342 Identify target audience and their specific needs.',
assignedTo: 'Maegan_Dietrich56',
dueDate: '08/21/2025',
status: '⚠ Delayed',
tags: ['Research', 'Client'],
priority: 'Urgent'
},
{
taskId: '#7211',
taskName: 'Create a project timeline with milestones and deliverables.',
taskName: '#7211 Create a project timeline with milestones and deliverables.',
assignedTo: 'Howell69',
dueDate: '07/17/2025',
status: '⏳ In Progress',
tags: ['Feature Development', 'Sprint 1'],
priority: 'High priority'
},
{
taskId: '#2213',
taskName: 'Review and update the incident response plan to incorporate new threats and vulnerabilities.',
taskName: '#2213 Review and update the incident response plan to incorporate new threats and vulnerabilities.',
assignedTo: 'Kory.Lockman',
dueDate: '05/24/2025',
status: '❌ Cancelled',
tags: ['Feature Development', 'Internal'],
priority: 'Low priority'
},
{
taskId: '#2811',
taskName: 'Gather requirements from stakeholders through interviews or surveys.',
taskName: '#2811 Gather requirements from stakeholders through interviews or surveys.',
assignedTo: 'Nolan.Kling13',
dueDate: '07/01/2025',
status: '🔄 Pending Review',
tags: ['Feature Development', 'Innovation'],
priority: 'Medium priority'
},
{
taskId: '#2811',
taskName: 'Set up monitoring tools and analyze system performance metrics to identify and address potential bottlenecks.',
taskName: '#2811 Set up monitoring tools and analyze system performance metrics to identify and address potential bottlenecks.',
assignedTo: 'Antoinette_Hills',
dueDate: '12/15/2025',
status: '⚠ Delayed',
tags: ['Research', 'Innovation'],
priority: 'Low priority'
},
{
taskId: '#3516',
taskName: 'Develop a budget for the project, including potential software and hardware needs.',
taskName: '#3516 Develop a budget for the project, including potential software and hardware needs.',
assignedTo: 'Alden_Upton',
dueDate: '05/03/2025',
status: '🚧 On Hold',
tags: ['Feature Development', 'Maintenance'],
priority: 'Routine'
},
{
taskId: '#1415',
taskName: 'Conduct a SWOT analysis to assess strengths, weaknesses, opportunities, and threats.',
taskName: '#1415 Conduct a SWOT analysis to assess strengths, weaknesses, opportunities, and threats.',
assignedTo: 'Travis.Gerhold80',
dueDate: '09/05/2025',
status: '✔ Approved',
tags: ['Feature Development', 'Java, Python, JavaScript, React, Node.js, SQL'],
priority: 'Medium priority'
},
{
taskId: '#1536',
taskName: 'Implement Content Management Features for Instructors.',
taskName: '#1536 Implement Content Management Features for Instructors.',
assignedTo: 'Jamaal41',
dueDate: '07/12/2025',
status: '✅ Completed',
tags: ['Bug Fix', 'Feature Development'],
priority: 'High priority'
},
{
taskId: '#1541',
taskName: 'Select a suitable technology stack or platform for the LMS.',
taskName: '#1541 Select a suitable technology stack or platform for the LMS.',
assignedTo: 'Fabiola.Cassin90',
dueDate: '07/31/2025',
status: '🕒 Postponed',
tags: ['Feature Development', 'Innovation'],
priority: 'High priority'
},
{
taskId: '#2213',
taskName: 'Evaluate potential third-party integrations (e.g., payment gateways, content libraries).',
taskName: '#2213 Evaluate potential third-party integrations (e.g., payment gateways, content libraries).',
assignedTo: 'Fabiola.Cassin90',
dueDate: '08/11/2025',
status: '✅ Completed',
tags: ['Feature Development', 'Innovation'],
priority: 'Urgent'
},
{
taskId: '#2213',
taskName: 'Create wireframes for user interface (UI) elements and navigation.',
taskName: '#2213 Create wireframes for user interface (UI) elements and navigation.',
assignedTo: 'Marlon66',
dueDate: '08/21/2025',
status: '⏳ In Progress',
Expand All @@ -735,6 +722,7 @@ export const tasksData = [
}
];


// TEAMS PAGE
export const teamsChips = [
{ text: "All", value: "all", disabled: false },
Expand Down

0 comments on commit a71411e

Please sign in to comment.