@@ -1,74 +1,136 @@
|
|||||||
import {SyncOutlined} from "@ant-design/icons";
|
import {Button, Card, Space, Switch, Table} from "antd";
|
||||||
import {Button, Card, Input, Space, Table, Typography} from "antd";
|
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, {useState} from "react";
|
import React, {useCallback, useState} from "react";
|
||||||
import {useTranslation} from "react-i18next";
|
import {useTranslation} from "react-i18next";
|
||||||
import {useLocation, useNavigate} from "react-router-dom";
|
import {useLocation, useNavigate} from "react-router-dom";
|
||||||
import {pageLimit} from "../../utils/config";
|
import {pageLimit} from "../../utils/config";
|
||||||
|
import dayjs from "../../utils/day";
|
||||||
|
import {
|
||||||
|
CheckCircleFilled,
|
||||||
|
CheckCircleOutlined,
|
||||||
|
DeleteFilled,
|
||||||
|
DeleteOutlined, ExclamationCircleFilled,
|
||||||
|
SyncOutlined
|
||||||
|
} from "@ant-design/icons";
|
||||||
|
|
||||||
|
const DueDateRecord = ({dueDate}) => {
|
||||||
|
if (dueDate) {
|
||||||
|
const dueDateFormatted = dayjs(dueDate).format("YYYY-MM-DD");
|
||||||
|
const relativeDueDate = dayjs(dueDate).fromNow();
|
||||||
|
const today = dayjs().format("YYYY-MM-DD");
|
||||||
|
if (dueDateFormatted < today) {
|
||||||
|
return <div title={relativeDueDate} style={{color: 'red'}}>{dueDateFormatted}</div>;
|
||||||
|
} else {
|
||||||
|
return <div title={relativeDueDate}>{dueDateFormatted}</div>;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return <div>N/A</div>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const PriorityLabel = ({priority}) => {
|
||||||
|
switch(priority) {
|
||||||
|
case 1:
|
||||||
|
return <div>
|
||||||
|
<ExclamationCircleFilled style={{color: 'red'}} /> High
|
||||||
|
</div>;
|
||||||
|
case 2:
|
||||||
|
return <div>
|
||||||
|
<ExclamationCircleFilled style={{ color: 'yellow' }} /> Medium
|
||||||
|
</div>;
|
||||||
|
case 3:
|
||||||
|
return <div>
|
||||||
|
<ExclamationCircleFilled style={{ color: 'green' }} /> Low
|
||||||
|
</div>;
|
||||||
|
default:
|
||||||
|
return <div>
|
||||||
|
<ExclamationCircleFilled style={{ color: 'black' }} /> None
|
||||||
|
</div>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default function TaskListComponent({
|
export default function TaskListComponent({
|
||||||
loading,
|
loading,
|
||||||
tasks,
|
tasks,
|
||||||
total,
|
total,
|
||||||
refetch,
|
refetch,
|
||||||
|
toggleCompletedStatus,
|
||||||
}) {
|
}) {
|
||||||
|
const {t} = useTranslation();
|
||||||
|
|
||||||
const search = queryString.parse(useLocation().search);
|
const search = queryString.parse(useLocation().search);
|
||||||
|
|
||||||
|
// Extract Query Params
|
||||||
const {
|
const {
|
||||||
page,
|
page,
|
||||||
// sortcolumn, sortorder
|
sortcolumn,
|
||||||
|
sortorder,
|
||||||
|
deleted,
|
||||||
|
completed
|
||||||
} = search;
|
} = search;
|
||||||
|
|
||||||
const history = useNavigate();
|
const history = useNavigate();
|
||||||
|
|
||||||
const [state, setState] = useState({
|
|
||||||
sortedInfo: {},
|
|
||||||
filteredInfo: {text: ""},
|
|
||||||
});
|
|
||||||
|
|
||||||
const {t} = useTranslation();
|
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: t("tasks.fields.title"),
|
title: t("tasks.fields.title"),
|
||||||
dataIndex: "title",
|
dataIndex: "title",
|
||||||
key: "title",
|
key: "title",
|
||||||
|
sorter: true,
|
||||||
|
sortOrder: sortcolumn === "title" && sortorder,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("tasks.fields.description"),
|
title: t("tasks.fields.description"),
|
||||||
dataIndex: "description",
|
dataIndex: "description",
|
||||||
key: "description",
|
key: "description",
|
||||||
|
sorter: true,
|
||||||
|
sortOrder: sortcolumn === "description" && sortorder,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("tasks.fields.due_date"),
|
title: t("tasks.fields.due_date"),
|
||||||
dataIndex: "due_date",
|
dataIndex: "due_date",
|
||||||
key: "due_date",
|
key: "due_date",
|
||||||
},
|
sorter: true,
|
||||||
{
|
sortOrder: sortcolumn === "due_date" && sortorder,
|
||||||
title: t("tasks.fields.assigned_to"),
|
width: '5%',
|
||||||
dataIndex: "assigned_to",
|
render: (text, record) => <DueDateRecord dueDate={record.due_date} />,
|
||||||
key: "assigned_to",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t("tasks.fields.completed"),
|
|
||||||
dataIndex: "completed",
|
|
||||||
key: "completed",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t("tasks.fields.completed_at"),
|
|
||||||
dataIndex: "completed_at",
|
|
||||||
key: "completed_at",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t("tasks.fields.remind_at"),
|
|
||||||
dataIndex: "remind_at",
|
|
||||||
key: "remind_at",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("tasks.fields.priority"),
|
title: t("tasks.fields.priority"),
|
||||||
dataIndex: "priority",
|
dataIndex: "priority",
|
||||||
key: "priority",
|
key: "priority",
|
||||||
|
sorter: true,
|
||||||
|
sortOrder: sortcolumn === "priority" && sortorder,
|
||||||
|
width: '5%',
|
||||||
|
render: (text, record) => <PriorityLabel priority={record.priority}
|
||||||
|
/>
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("tasks.fields.actions"),
|
||||||
|
key: "toggleCompleted",
|
||||||
|
width: '5%',
|
||||||
|
render: (text, record) => (
|
||||||
|
<Space direction='horizontal'>
|
||||||
|
<Button title={t('tasks.actions.toggle_completed')}
|
||||||
|
onClick={() => toggleCompletedStatus(record.id, record.completed)}>
|
||||||
|
{record.completed ? <CheckCircleOutlined/> :
|
||||||
|
<CheckCircleFilled/>}
|
||||||
|
</Button>
|
||||||
|
<Button title={t('tasks.actions.toggle_deleted')}
|
||||||
|
onClick={() => toggleDeletedStatus(record.id, record.deleted)}>
|
||||||
|
{record.deleted ? <DeleteFilled/> : <DeleteOutlined/>}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const [state, setState] = useState({
|
||||||
|
sortedInfo: {},
|
||||||
|
filteredInfo: {text: ""},
|
||||||
|
});
|
||||||
|
|
||||||
|
// Columns definition remains the same
|
||||||
|
|
||||||
const handleTableChange = (pagination, filters, sorter) => {
|
const handleTableChange = (pagination, filters, sorter) => {
|
||||||
setState({...state, filteredInfo: filters, sortedInfo: sorter});
|
setState({...state, filteredInfo: filters, sortedInfo: sorter});
|
||||||
search.page = pagination.current;
|
search.page = pagination.current;
|
||||||
@@ -76,43 +138,49 @@ export default function TaskListComponent({
|
|||||||
search.sortorder = sorter.order;
|
search.sortorder = sorter.order;
|
||||||
history({search: queryString.stringify(search)});
|
history({search: queryString.stringify(search)});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleSwitchChange = (param, value) => {
|
||||||
|
if (value) {
|
||||||
|
search[param] = "true";
|
||||||
|
} else {
|
||||||
|
delete search[param];
|
||||||
|
}
|
||||||
|
history({search: queryString.stringify(search)});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extra actions for the tasks
|
||||||
|
* @type {Function}
|
||||||
|
*/
|
||||||
|
const tasksExtra = useCallback(() => {
|
||||||
|
return (
|
||||||
|
<Space direction='horizontal'>
|
||||||
|
<Switch
|
||||||
|
checkedChildren={<CheckCircleFilled/>}
|
||||||
|
unCheckedChildren={<CheckCircleOutlined/>}
|
||||||
|
title={t('tasks.titles.completed')}
|
||||||
|
checked={completed === "true"}
|
||||||
|
onChange={(value) => handleSwitchChange('completed', value)}
|
||||||
|
/>
|
||||||
|
<Switch
|
||||||
|
checkedChildren={<DeleteOutlined/>}
|
||||||
|
unCheckedChildren={<DeleteFilled/>}
|
||||||
|
title={t('tasks.titles.deleted')}
|
||||||
|
checked={deleted === "true"}
|
||||||
|
onChange={(value) => handleSwitchChange('deleted', value)}
|
||||||
|
/>
|
||||||
|
<Button title={t('tasks.titles.refresh')}
|
||||||
|
onClick={() => refetch()}>
|
||||||
|
<SyncOutlined/>
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
}, [refetch, deleted, completed]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
title={t("menus.header.tasks")}
|
title={t("menus.header.tasks")}
|
||||||
extra={
|
extra={tasksExtra()}
|
||||||
<Space wrap>
|
|
||||||
{search.search && (
|
|
||||||
<>
|
|
||||||
<Typography.Title level={4}>
|
|
||||||
{t("general.labels.searchresults", {search: search.search})}
|
|
||||||
</Typography.Title>
|
|
||||||
<Button
|
|
||||||
onClick={() => {
|
|
||||||
delete search.search;
|
|
||||||
history({search: queryString.stringify(search)});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t("general.actions.clear")}
|
|
||||||
</Button>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
<Button onClick={() => refetch()}>
|
|
||||||
<SyncOutlined/>
|
|
||||||
</Button>
|
|
||||||
<Input.Search
|
|
||||||
placeholder={search.search || t("general.labels.search")}
|
|
||||||
onSearch={(value) => {
|
|
||||||
if (value?.length >= 3) {
|
|
||||||
search.search = value;
|
|
||||||
} else {
|
|
||||||
delete search.search;
|
|
||||||
}
|
|
||||||
history({search: queryString.stringify(search)});
|
|
||||||
}}
|
|
||||||
enterButton
|
|
||||||
/>
|
|
||||||
</Space>
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<Table
|
<Table
|
||||||
loading={loading}
|
loading={loading}
|
||||||
|
|||||||
@@ -1,21 +1,28 @@
|
|||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import {useLocation} from "react-router-dom";
|
import {useLocation} from "react-router-dom";
|
||||||
import {useQuery} from "@apollo/client";
|
import {useMutation, useQuery} from "@apollo/client";
|
||||||
import {QUERY_ALL_TASKS_PAGINATED} from "../../graphql/tasks.queries.js";
|
import {
|
||||||
|
MUTATION_TOGGLE_TASK_COMPLETED, MUTATION_TOGGLE_TASK_DELETED,
|
||||||
|
QUERY_MY_TASKS_PAGINATED
|
||||||
|
} from "../../graphql/tasks.queries.js";
|
||||||
import {pageLimit} from "../../utils/config.js";
|
import {pageLimit} from "../../utils/config.js";
|
||||||
import AlertComponent from "../alert/alert.component.jsx";
|
import AlertComponent from "../alert/alert.component.jsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import TaskListComponent from "./task-list.component.jsx";
|
import TaskListComponent from "./task-list.component.jsx";
|
||||||
|
|
||||||
export default function TaskListContainer() {
|
export default function TaskListContainer({bodyshop, currentUser}) {
|
||||||
const searchParams = queryString.parse(useLocation().search);
|
const searchParams = queryString.parse(useLocation().search);
|
||||||
const {page, sortcolumn, sortorder, search} = searchParams;
|
const {page, sortcolumn, sortorder, deleted, completed} = searchParams;
|
||||||
const {loading, error, data, refetch} = useQuery(
|
const {loading, error, data, refetch} = useQuery(
|
||||||
QUERY_ALL_TASKS_PAGINATED,
|
QUERY_MY_TASKS_PAGINATED,
|
||||||
{
|
{
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only",
|
nextFetchPolicy: "network-only",
|
||||||
variables: {
|
variables: {
|
||||||
|
bodyshop: bodyshop.id,
|
||||||
|
user: currentUser.email,
|
||||||
|
deleted: deleted === 'true',
|
||||||
|
completed: completed === "true",
|
||||||
offset: page ? (page - 1) * pageLimit : 0,
|
offset: page ? (page - 1) * pageLimit : 0,
|
||||||
limit: pageLimit,
|
limit: pageLimit,
|
||||||
order: [
|
order: [
|
||||||
@@ -30,6 +37,34 @@ export default function TaskListContainer() {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const [toggleTaskCompleted] = useMutation(MUTATION_TOGGLE_TASK_COMPLETED);
|
||||||
|
|
||||||
|
const toggleCompletedStatus = async (id, currentStatus) => {
|
||||||
|
const completed_at = !currentStatus ? new Date().toISOString() : null;
|
||||||
|
await toggleTaskCompleted({
|
||||||
|
variables: {
|
||||||
|
id: id,
|
||||||
|
completed: !currentStatus,
|
||||||
|
completed_at: completed_at
|
||||||
|
}
|
||||||
|
});
|
||||||
|
refetch();
|
||||||
|
};
|
||||||
|
|
||||||
|
const [toggleTaskDeleted] = useMutation(MUTATION_TOGGLE_TASK_DELETED);
|
||||||
|
|
||||||
|
const toggleDeletedStatus = async (id, currentStatus) => {
|
||||||
|
const deleted_at = !currentStatus ? new Date().toISOString() : null;
|
||||||
|
await toggleTaskDeleted({
|
||||||
|
variables: {
|
||||||
|
id: id,
|
||||||
|
deleted: !currentStatus,
|
||||||
|
deleted_at: deleted_at
|
||||||
|
}
|
||||||
|
});
|
||||||
|
refetch();
|
||||||
|
};
|
||||||
|
|
||||||
if (error) return <AlertComponent message={error.message} type="error"/>;
|
if (error) return <AlertComponent message={error.message} type="error"/>;
|
||||||
|
|
||||||
@@ -39,6 +74,8 @@ export default function TaskListContainer() {
|
|||||||
tasks={data ? data.tasks : null}
|
tasks={data ? data.tasks : null}
|
||||||
total={data ? data.tasks_aggregate.aggregate.count : 0}
|
total={data ? data.tasks_aggregate.aggregate.count : 0}
|
||||||
refetch={refetch}
|
refetch={refetch}
|
||||||
|
toggleCompletedStatus={toggleCompletedStatus}
|
||||||
|
toggleDeletedStatus={toggleDeletedStatus}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import {gql} from "@apollo/client";
|
import {gql} from "@apollo/client";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All tasks paginated query
|
||||||
|
* @type {DocumentNode}
|
||||||
|
*/
|
||||||
export const QUERY_ALL_TASKS_PAGINATED = gql`
|
export const QUERY_ALL_TASKS_PAGINATED = gql`
|
||||||
query QUERY_ALL_TASKS_PAGINATED(
|
query QUERY_ALL_TASKS_PAGINATED(
|
||||||
$offset: Int
|
$offset: Int
|
||||||
@@ -30,10 +34,98 @@ export const QUERY_ALL_TASKS_PAGINATED = gql`
|
|||||||
partsorderid
|
partsorderid
|
||||||
billid
|
billid
|
||||||
}
|
}
|
||||||
tasks_aggregate(args: {}) {
|
tasks_aggregate {
|
||||||
aggregate {
|
aggregate {
|
||||||
count(distinct: true)
|
count
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* My tasks paginated query
|
||||||
|
* @type {DocumentNode}
|
||||||
|
*/
|
||||||
|
export const QUERY_MY_TASKS_PAGINATED = gql`
|
||||||
|
query QUERY_TASKS_PAGINATED(
|
||||||
|
$offset: Int
|
||||||
|
$limit: Int
|
||||||
|
$user: String!
|
||||||
|
$bodyshop: uuid!
|
||||||
|
$deleted: Boolean
|
||||||
|
$completed: Boolean
|
||||||
|
$order: [tasks_order_by!]!
|
||||||
|
) {
|
||||||
|
tasks(
|
||||||
|
offset: $offset
|
||||||
|
limit: $limit
|
||||||
|
order_by: $order
|
||||||
|
where: {
|
||||||
|
assigned_to: {_eq: $user},
|
||||||
|
bodyshopid: {_eq: $bodyshop},
|
||||||
|
deleted: {_eq: $deleted},
|
||||||
|
completed: {_eq: $completed}
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
id
|
||||||
|
created_at
|
||||||
|
updated_at
|
||||||
|
title
|
||||||
|
description
|
||||||
|
deleted
|
||||||
|
deleted_at
|
||||||
|
due_date
|
||||||
|
created_by
|
||||||
|
assigned_to
|
||||||
|
completed
|
||||||
|
completed_at
|
||||||
|
remind_at
|
||||||
|
priority
|
||||||
|
jobid
|
||||||
|
joblineid
|
||||||
|
partsorderid
|
||||||
|
billid
|
||||||
|
bodyshopid
|
||||||
|
}
|
||||||
|
tasks_aggregate(
|
||||||
|
where: {
|
||||||
|
assigned_to: {_eq: $user},
|
||||||
|
bodyshopid: {_eq: $bodyshop},
|
||||||
|
deleted: {_eq: $deleted},
|
||||||
|
completed: {_eq: $completed}
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
aggregate {
|
||||||
|
count
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle task completed mutation
|
||||||
|
* @type {DocumentNode}
|
||||||
|
*/
|
||||||
|
export const MUTATION_TOGGLE_TASK_COMPLETED = gql`
|
||||||
|
mutation MUTATION_TOGGLE_TASK_COMPLETED($id: uuid!, $completed: Boolean!, $completed_at: timestamptz) {
|
||||||
|
update_tasks_by_pk(pk_columns: {id: $id}, _set: {completed: $completed, completed_at: $completed_at}) {
|
||||||
|
id
|
||||||
|
completed
|
||||||
|
completed_at
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle task deleted mutation
|
||||||
|
* @type {DocumentNode}
|
||||||
|
*/
|
||||||
|
export const MUTATION_TOGGLE_TASK_DELETED = gql`
|
||||||
|
mutation MUTATION_TOGGLE_TASK_DELETED($id: uuid!, $deleted: Boolean!, $deleted_at: timestamptz) {
|
||||||
|
update_tasks_by_pk(pk_columns: {id: $id}, _set: {deleted: $deleted, deleted_at: $deleted_at}) {
|
||||||
|
id
|
||||||
|
deleted
|
||||||
|
deleted_at
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export default function TasksPageComponent({bodyshop, currentUser}) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<TaskListContainer />
|
<TaskListContainer bodyshop={bodyshop} currentUser={currentUser} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
actions: [ ]
|
actions: []
|
||||||
custom_types:
|
custom_types:
|
||||||
enums: [ ]
|
enums: []
|
||||||
input_objects: [ ]
|
input_objects: []
|
||||||
objects: [ ]
|
objects: []
|
||||||
scalars: [ ]
|
scalars: []
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
[ ]
|
[]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
[ ]
|
[]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{ }
|
{}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
[ ]
|
[]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
[ ]
|
[]
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
update_permissions:
|
update_permissions:
|
||||||
- role: user
|
- role: user
|
||||||
permission:
|
permission:
|
||||||
columns: [ ]
|
columns: []
|
||||||
filter:
|
filter:
|
||||||
jobline:
|
jobline:
|
||||||
job:
|
job:
|
||||||
@@ -569,6 +569,13 @@
|
|||||||
table:
|
table:
|
||||||
name: parts_orders
|
name: parts_orders
|
||||||
schema: public
|
schema: public
|
||||||
|
- name: tasks
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on:
|
||||||
|
column: billid
|
||||||
|
table:
|
||||||
|
name: tasks
|
||||||
|
schema: public
|
||||||
insert_permissions:
|
insert_permissions:
|
||||||
- role: user
|
- role: user
|
||||||
permission:
|
permission:
|
||||||
@@ -698,7 +705,7 @@
|
|||||||
value_from_env: EVENT_SECRET
|
value_from_env: EVENT_SECRET
|
||||||
request_transform:
|
request_transform:
|
||||||
method: POST
|
method: POST
|
||||||
query_params: { }
|
query_params: {}
|
||||||
template_engine: Kriti
|
template_engine: Kriti
|
||||||
url: '{{$base_url}}/opensearch'
|
url: '{{$base_url}}/opensearch'
|
||||||
version: 2
|
version: 2
|
||||||
@@ -818,6 +825,13 @@
|
|||||||
table:
|
table:
|
||||||
name: inventory
|
name: inventory
|
||||||
schema: public
|
schema: public
|
||||||
|
- name: ioevents
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on:
|
||||||
|
column: bodyshopid
|
||||||
|
table:
|
||||||
|
name: ioevents
|
||||||
|
schema: public
|
||||||
- name: jobs
|
- name: jobs
|
||||||
using:
|
using:
|
||||||
foreign_key_constraint_on:
|
foreign_key_constraint_on:
|
||||||
@@ -846,6 +860,13 @@
|
|||||||
table:
|
table:
|
||||||
name: phonebook
|
name: phonebook
|
||||||
schema: public
|
schema: public
|
||||||
|
- name: tasks
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on:
|
||||||
|
column: bodyshopid
|
||||||
|
table:
|
||||||
|
name: tasks
|
||||||
|
schema: public
|
||||||
- name: timetickets
|
- name: timetickets
|
||||||
using:
|
using:
|
||||||
foreign_key_constraint_on:
|
foreign_key_constraint_on:
|
||||||
@@ -1653,7 +1674,7 @@
|
|||||||
columns:
|
columns:
|
||||||
- config
|
- config
|
||||||
- id
|
- id
|
||||||
filter: { }
|
filter: {}
|
||||||
limit: 1
|
limit: 1
|
||||||
- role: user
|
- role: user
|
||||||
permission:
|
permission:
|
||||||
@@ -2491,7 +2512,7 @@
|
|||||||
- effective_date
|
- effective_date
|
||||||
- end_date
|
- end_date
|
||||||
- content
|
- content
|
||||||
filter: { }
|
filter: {}
|
||||||
- table:
|
- table:
|
||||||
name: exportlog
|
name: exportlog
|
||||||
schema: public
|
schema: public
|
||||||
@@ -2675,6 +2696,13 @@
|
|||||||
- table:
|
- table:
|
||||||
name: ioevents
|
name: ioevents
|
||||||
schema: public
|
schema: public
|
||||||
|
object_relationships:
|
||||||
|
- name: bodyshop
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on: bodyshopid
|
||||||
|
- name: user
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on: useremail
|
||||||
- table:
|
- table:
|
||||||
name: job_ar_schema
|
name: job_ar_schema
|
||||||
schema: public
|
schema: public
|
||||||
@@ -2824,6 +2852,13 @@
|
|||||||
table:
|
table:
|
||||||
name: parts_order_lines
|
name: parts_order_lines
|
||||||
schema: public
|
schema: public
|
||||||
|
- name: tasks
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on:
|
||||||
|
column: joblineid
|
||||||
|
table:
|
||||||
|
name: tasks
|
||||||
|
schema: public
|
||||||
insert_permissions:
|
insert_permissions:
|
||||||
- role: user
|
- role: user
|
||||||
permission:
|
permission:
|
||||||
@@ -3311,6 +3346,13 @@
|
|||||||
table:
|
table:
|
||||||
name: scoreboard
|
name: scoreboard
|
||||||
schema: public
|
schema: public
|
||||||
|
- name: tasks
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on:
|
||||||
|
column: jobid
|
||||||
|
table:
|
||||||
|
name: tasks
|
||||||
|
schema: public
|
||||||
- name: timetickets
|
- name: timetickets
|
||||||
using:
|
using:
|
||||||
foreign_key_constraint_on:
|
foreign_key_constraint_on:
|
||||||
@@ -4200,13 +4242,13 @@
|
|||||||
interval_sec: 10
|
interval_sec: 10
|
||||||
num_retries: 0
|
num_retries: 0
|
||||||
timeout_sec: 60
|
timeout_sec: 60
|
||||||
webhook: https://worktest.home.irony.online
|
webhook_from_env: HASURA_API_URL
|
||||||
headers:
|
headers:
|
||||||
- name: event-secret
|
- name: event-secret
|
||||||
value_from_env: EVENT_SECRET
|
value_from_env: EVENT_SECRET
|
||||||
request_transform:
|
request_transform:
|
||||||
method: POST
|
method: POST
|
||||||
query_params: { }
|
query_params: {}
|
||||||
template_engine: Kriti
|
template_engine: Kriti
|
||||||
url: '{{$base_url}}/job/statustransition'
|
url: '{{$base_url}}/job/statustransition'
|
||||||
version: 2
|
version: 2
|
||||||
@@ -4220,7 +4262,7 @@
|
|||||||
webhook_from_env: HASURA_API_URL
|
webhook_from_env: HASURA_API_URL
|
||||||
request_transform:
|
request_transform:
|
||||||
method: POST
|
method: POST
|
||||||
query_params: { }
|
query_params: {}
|
||||||
template_engine: Kriti
|
template_engine: Kriti
|
||||||
url: '{{$base_url}}/record-handler/arms'
|
url: '{{$base_url}}/record-handler/arms'
|
||||||
version: 2
|
version: 2
|
||||||
@@ -4243,7 +4285,7 @@
|
|||||||
value_from_env: EVENT_SECRET
|
value_from_env: EVENT_SECRET
|
||||||
request_transform:
|
request_transform:
|
||||||
method: POST
|
method: POST
|
||||||
query_params: { }
|
query_params: {}
|
||||||
template_engine: Kriti
|
template_engine: Kriti
|
||||||
url: '{{$base_url}}/opensearch'
|
url: '{{$base_url}}/opensearch'
|
||||||
version: 2
|
version: 2
|
||||||
@@ -4256,13 +4298,13 @@
|
|||||||
columns:
|
columns:
|
||||||
- key
|
- key
|
||||||
- value
|
- value
|
||||||
filter: { }
|
filter: {}
|
||||||
- role: user
|
- role: user
|
||||||
permission:
|
permission:
|
||||||
columns:
|
columns:
|
||||||
- key
|
- key
|
||||||
- value
|
- value
|
||||||
filter: { }
|
filter: {}
|
||||||
- table:
|
- table:
|
||||||
name: messages
|
name: messages
|
||||||
schema: public
|
schema: public
|
||||||
@@ -4694,7 +4736,7 @@
|
|||||||
value_from_env: EVENT_SECRET
|
value_from_env: EVENT_SECRET
|
||||||
request_transform:
|
request_transform:
|
||||||
method: POST
|
method: POST
|
||||||
query_params: { }
|
query_params: {}
|
||||||
template_engine: Kriti
|
template_engine: Kriti
|
||||||
url: '{{$base_url}}/opensearch'
|
url: '{{$base_url}}/opensearch'
|
||||||
version: 2
|
version: 2
|
||||||
@@ -5008,6 +5050,13 @@
|
|||||||
table:
|
table:
|
||||||
name: parts_order_lines
|
name: parts_order_lines
|
||||||
schema: public
|
schema: public
|
||||||
|
- name: tasks
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on:
|
||||||
|
column: partsorderid
|
||||||
|
table:
|
||||||
|
name: tasks
|
||||||
|
schema: public
|
||||||
insert_permissions:
|
insert_permissions:
|
||||||
- role: user
|
- role: user
|
||||||
permission:
|
permission:
|
||||||
@@ -5302,7 +5351,7 @@
|
|||||||
value_from_env: EVENT_SECRET
|
value_from_env: EVENT_SECRET
|
||||||
request_transform:
|
request_transform:
|
||||||
method: POST
|
method: POST
|
||||||
query_params: { }
|
query_params: {}
|
||||||
template_engine: Kriti
|
template_engine: Kriti
|
||||||
url: '{{$base_url}}/opensearch'
|
url: '{{$base_url}}/opensearch'
|
||||||
version: 2
|
version: 2
|
||||||
@@ -5623,6 +5672,129 @@
|
|||||||
_eq: X-Hasura-User-Id
|
_eq: X-Hasura-User-Id
|
||||||
- active:
|
- active:
|
||||||
_eq: true
|
_eq: true
|
||||||
|
- table:
|
||||||
|
name: tasks
|
||||||
|
schema: public
|
||||||
|
object_relationships:
|
||||||
|
- name: bill
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on: billid
|
||||||
|
- name: bodyshop
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on: bodyshopid
|
||||||
|
- name: job
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on: jobid
|
||||||
|
- name: jobline
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on: joblineid
|
||||||
|
- name: parts_order
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on: partsorderid
|
||||||
|
- name: user
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on: assigned_to
|
||||||
|
- name: userByCreatedBy
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on: created_by
|
||||||
|
insert_permissions:
|
||||||
|
- role: user
|
||||||
|
permission:
|
||||||
|
check:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
_and:
|
||||||
|
- user:
|
||||||
|
authid:
|
||||||
|
_eq: X-Hasura-User-Id
|
||||||
|
- active:
|
||||||
|
_eq: true
|
||||||
|
columns:
|
||||||
|
- completed
|
||||||
|
- deleted
|
||||||
|
- priority
|
||||||
|
- assigned_to
|
||||||
|
- created_by
|
||||||
|
- description
|
||||||
|
- title
|
||||||
|
- completed_at
|
||||||
|
- created_at
|
||||||
|
- deleted_at
|
||||||
|
- due_date
|
||||||
|
- remind_at
|
||||||
|
- updated_at
|
||||||
|
- billid
|
||||||
|
- bodyshopid
|
||||||
|
- id
|
||||||
|
- jobid
|
||||||
|
- joblineid
|
||||||
|
- partsorderid
|
||||||
|
select_permissions:
|
||||||
|
- role: user
|
||||||
|
permission:
|
||||||
|
columns:
|
||||||
|
- completed
|
||||||
|
- deleted
|
||||||
|
- priority
|
||||||
|
- assigned_to
|
||||||
|
- created_by
|
||||||
|
- description
|
||||||
|
- title
|
||||||
|
- completed_at
|
||||||
|
- created_at
|
||||||
|
- deleted_at
|
||||||
|
- due_date
|
||||||
|
- remind_at
|
||||||
|
- updated_at
|
||||||
|
- billid
|
||||||
|
- bodyshopid
|
||||||
|
- id
|
||||||
|
- jobid
|
||||||
|
- joblineid
|
||||||
|
- partsorderid
|
||||||
|
filter:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
_and:
|
||||||
|
- user:
|
||||||
|
authid:
|
||||||
|
_eq: X-Hasura-User-Id
|
||||||
|
- active:
|
||||||
|
_eq: true
|
||||||
|
allow_aggregations: true
|
||||||
|
update_permissions:
|
||||||
|
- role: user
|
||||||
|
permission:
|
||||||
|
columns:
|
||||||
|
- completed
|
||||||
|
- deleted
|
||||||
|
- priority
|
||||||
|
- assigned_to
|
||||||
|
- created_by
|
||||||
|
- description
|
||||||
|
- title
|
||||||
|
- completed_at
|
||||||
|
- created_at
|
||||||
|
- deleted_at
|
||||||
|
- due_date
|
||||||
|
- remind_at
|
||||||
|
- updated_at
|
||||||
|
- billid
|
||||||
|
- bodyshopid
|
||||||
|
- id
|
||||||
|
- jobid
|
||||||
|
- joblineid
|
||||||
|
- partsorderid
|
||||||
|
filter:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
_and:
|
||||||
|
- user:
|
||||||
|
authid:
|
||||||
|
_eq: X-Hasura-User-Id
|
||||||
|
- active:
|
||||||
|
_eq: true
|
||||||
|
check: null
|
||||||
- table:
|
- table:
|
||||||
name: timetickets
|
name: timetickets
|
||||||
schema: public
|
schema: public
|
||||||
@@ -5843,7 +6015,7 @@
|
|||||||
- user:
|
- user:
|
||||||
authid:
|
authid:
|
||||||
_eq: X-Hasura-User-Id
|
_eq: X-Hasura-User-Id
|
||||||
check: { }
|
check: {}
|
||||||
- table:
|
- table:
|
||||||
name: tt_approval_queue
|
name: tt_approval_queue
|
||||||
schema: public
|
schema: public
|
||||||
@@ -6006,6 +6178,13 @@
|
|||||||
table:
|
table:
|
||||||
name: exportlog
|
name: exportlog
|
||||||
schema: public
|
schema: public
|
||||||
|
- name: ioevents
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on:
|
||||||
|
column: useremail
|
||||||
|
table:
|
||||||
|
name: ioevents
|
||||||
|
schema: public
|
||||||
- name: messages
|
- name: messages
|
||||||
using:
|
using:
|
||||||
foreign_key_constraint_on:
|
foreign_key_constraint_on:
|
||||||
@@ -6034,6 +6213,20 @@
|
|||||||
table:
|
table:
|
||||||
name: parts_orders
|
name: parts_orders
|
||||||
schema: public
|
schema: public
|
||||||
|
- name: tasks
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on:
|
||||||
|
column: assigned_to
|
||||||
|
table:
|
||||||
|
name: tasks
|
||||||
|
schema: public
|
||||||
|
- name: tasksByCreatedBy
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on:
|
||||||
|
column: created_by
|
||||||
|
table:
|
||||||
|
name: tasks
|
||||||
|
schema: public
|
||||||
- name: timetickets
|
- name: timetickets
|
||||||
using:
|
using:
|
||||||
foreign_key_constraint_on:
|
foreign_key_constraint_on:
|
||||||
@@ -6051,7 +6244,7 @@
|
|||||||
insert_permissions:
|
insert_permissions:
|
||||||
- role: user
|
- role: user
|
||||||
permission:
|
permission:
|
||||||
check: { }
|
check: {}
|
||||||
columns:
|
columns:
|
||||||
- authid
|
- authid
|
||||||
- email
|
- email
|
||||||
@@ -6253,7 +6446,7 @@
|
|||||||
value_from_env: EVENT_SECRET
|
value_from_env: EVENT_SECRET
|
||||||
request_transform:
|
request_transform:
|
||||||
method: POST
|
method: POST
|
||||||
query_params: { }
|
query_params: {}
|
||||||
template_engine: Kriti
|
template_engine: Kriti
|
||||||
url: '{{$base_url}}/opensearch'
|
url: '{{$base_url}}/opensearch'
|
||||||
version: 2
|
version: 2
|
||||||
|
|||||||
Reference in New Issue
Block a user