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

Feature/display adhooc or scheduled #731

Merged
merged 3 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
4 changes: 3 additions & 1 deletion packages/react-components/lib/tasks/create-task.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -884,8 +884,10 @@ export function CreateTaskForm({
return;
}

const requester = scheduling ? `${user}__scheduled` : user;

for (const t of taskRequests) {
t.requester = user;
t.requester = requester;
t.unix_millis_request_time = Date.now();
}

Expand Down
24 changes: 19 additions & 5 deletions packages/react-components/lib/tasks/task-table-datagrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import {
GridFilterModel,
GridSortModel,
} from '@mui/x-data-grid';
import { styled, TextField } from '@mui/material';
import { styled, TextField, Stack, Typography } from '@mui/material';
import * as React from 'react';
import { TaskState, Status } from 'api-client';
import { InsertInvitation as ScheduleIcon, Person as UserIcon } from '@mui/icons-material/';

const classes = {
taskActiveCell: 'MuiDataGrid-cell-active-cell',
Expand Down Expand Up @@ -134,11 +135,24 @@ export function TaskDataGridTable({
{
field: 'requester',
headerName: 'Requester',
width: 150,
minWidth: 160,
editable: false,
valueGetter: (params: GridValueGetterParams) =>
params.row.booking.requester ? params.row.booking.requester : 'unknown',
flex: 1,
renderCell: (cellValues) => {
return (
<Stack direction="row" alignItems="center" gap={1}>
{cellValues.row.booking.requester &&
cellValues.row.booking.requester.includes('scheduled') ? (
<ScheduleIcon />
Angatupyry marked this conversation as resolved.
Show resolved Hide resolved
) : (
<UserIcon />
)}
<Typography variant="body1">
{cellValues.row.booking.requester ? cellValues.row.booking.requester : 'unknown'}
Angatupyry marked this conversation as resolved.
Show resolved Hide resolved
</Typography>
</Stack>
);
},
flex: 2,
filterOperators: getMinimalStringFilterOperators,
filterable: true,
},
Expand Down
Loading