IO-1096 Added order by to Parts Order

This commit is contained in:
Patrick Fic
2021-06-02 08:49:10 -07:00
parent 28326f2628
commit 9ff9baa78c
29 changed files with 461 additions and 47 deletions

View File

@@ -26853,6 +26853,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>orderedby</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>quantity</name>
<definition_loaded>false</definition_loaded>

View File

@@ -1,3 +1,4 @@
import { Space } from "antd";
import React from "react";
import PhoneNumberFormatter from "../../utils/PhoneFormatter";
import ChatConversationTitleTags from "../chat-conversation-title-tags/chat-conversation-title-tags.component";
@@ -5,20 +6,16 @@ import ChatTagRoContainer from "../chat-tag-ro/chat-tag-ro.container";
export default function ChatConversationTitle({ conversation }) {
return (
<div>
<div className="imex-flex-row">
<ChatConversationTitleTags
jobConversations={
(conversation && conversation.job_conversations) || []
}
/>
<ChatTagRoContainer conversation={conversation || []} />
</div>
<div className="imex-flex-row">
<PhoneNumberFormatter>
{conversation && conversation.phone_num}
</PhoneNumberFormatter>
</div>
</div>
<Space flex>
<PhoneNumberFormatter>
{conversation && conversation.phone_num}
</PhoneNumberFormatter>
<ChatConversationTitleTags
jobConversations={
(conversation && conversation.job_conversations) || []
}
/>
<ChatTagRoContainer conversation={conversation || []} />
</Space>
);
}

View File

@@ -1,5 +1,5 @@
import { CloseCircleOutlined, LoadingOutlined } from "@ant-design/icons";
import { Select, Empty } from "antd";
import { Select, Empty, Space } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
@@ -13,27 +13,27 @@ export default function ChatTagRoComponent({
const { t } = useTranslation();
return (
<div>
<Select
showSearch
autoFocus
style={{
width: 300,
}}
placeholder={t("general.labels.search")}
filterOption={false}
onSearch={handleSearch}
onSelect={handleInsertTag}
notFoundContent={loading ? <LoadingOutlined /> : <Empty />}
>
{roOptions.map((item, idx) => (
<Select.Option key={item.id || idx}>
{` ${item.ro_number || ""} | ${item.ownr_fn || ""} ${
item.ownr_ln || ""
} ${item.ownr_co_nm || ""}`}
</Select.Option>
))}
</Select>
<Space flex>
<div style={{ width: "15rem" }}>
<Select
showSearch
autoFocus
dropdownMatchSelectWidth
placeholder={t("general.labels.search")}
filterOption={false}
onSearch={handleSearch}
onSelect={handleInsertTag}
notFoundContent={loading ? <LoadingOutlined /> : <Empty />}
>
{roOptions.map((item, idx) => (
<Select.Option key={item.id || idx}>
{` ${item.ro_number || ""} | ${item.ownr_fn || ""} ${
item.ownr_ln || ""
} ${item.ownr_co_nm || ""}`}
</Select.Option>
))}
</Select>
</div>
{loading ? <LoadingOutlined /> : null}
{loading ? (
@@ -41,6 +41,6 @@ export default function ChatTagRoComponent({
) : (
<CloseCircleOutlined onClick={() => setVisible(false)} />
)}
</div>
</Space>
);
}

View File

@@ -2,7 +2,7 @@ import { DetermineFileType } from "../documents-upload/documents-upload.utility"
export const GenerateSrcUrl = (value) => {
let extension = value.extension;
if (extension && extension.includes("heic")) extension = "jpg";
if (extension && extension.toLowerCase().includes("heic")) extension = "jpg";
return `${process.env.REACT_APP_CLOUDINARY_ENDPOINT}/${DetermineFileType(
value.type

View File

@@ -166,7 +166,6 @@ function JobsDocumentsComponent({
zIndex: "5",
}}
onClick={() => {
console.log(`Clicked`);
const newWindow = window.open(
`${window.location.protocol}//${window.location.host}/edit?documentId=${galleryImages.images[index].id}`,
"_blank",

View File

@@ -237,6 +237,11 @@ export function PartsOrderListTableComponent({
<DateFormatter>{record.deliver_by}</DateFormatter>
),
},
{
title: t("parts_orders.fields.orderedby"),
dataIndex: "orderedby",
key: "orderedby",
},
{
title: t("general.labels.actions"),
dataIndex: "actions",
@@ -336,6 +341,7 @@ export function PartsOrderListTableComponent({
/>
),
},
{
title: t("general.labels.actions"),
dataIndex: "actions",

View File

@@ -73,6 +73,7 @@ export default function PartsOrderModalComponent({
<Form.Item required={false} key={field.key}>
<LayoutFormRow grow noDivider>
<Form.Item
span={8}
label={t("parts_orders.fields.line_desc")}
key={`${index}line_desc`}
name={[field.name, "line_desc"]}

View File

@@ -81,6 +81,7 @@ export function PartsOrderModalContainer({
po: [
{
...values,
orderedby: currentUser.email,
jobid: jobId,
user_email: currentUser.email,
return: isReturn,

View File

@@ -73,7 +73,7 @@ export const QUERY_BILLS_BY_JOBID = gql`
order_date
deliver_by
return
orderedby
parts_order_lines {
id
act_price

View File

@@ -1602,6 +1602,7 @@
"oem_partno": "Part #",
"order_date": "Order Date",
"order_number": "Order Number",
"orderedby": "Ordered By",
"quantity": "Qty.",
"return": "Return",
"status": "Status"

View File

@@ -1602,6 +1602,7 @@
"oem_partno": "",
"order_date": "",
"order_number": "",
"orderedby": "",
"quantity": "",
"return": "",
"status": ""

View File

@@ -1602,6 +1602,7 @@
"oem_partno": "",
"order_date": "",
"order_number": "",
"orderedby": "",
"quantity": "",
"return": "",
"status": ""

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."conversations" DROP COLUMN "archived";
type: run_sql

View File

@@ -0,0 +1,6 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."conversations" ADD COLUMN "archived" boolean NOT NULL
DEFAULT false;
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."parts_orders" DROP COLUMN "orderedby";
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."parts_orders" ADD COLUMN "orderedby" text NULL;
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: alter table "public"."parts_orders" drop constraint "parts_orders_orderedby_fkey";
type: run_sql

View File

@@ -0,0 +1,10 @@
- args:
cascade: false
read_only: false
sql: |-
alter table "public"."parts_orders"
add constraint "parts_orders_orderedby_fkey"
foreign key ("orderedby")
references "public"."users"
("email") on update set null on delete set null;
type: run_sql

View File

@@ -0,0 +1,37 @@
- args:
role: user
table:
name: parts_orders
schema: public
type: drop_insert_permission
- args:
permission:
check:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- created_at
- deliver_by
- id
- jobid
- order_date
- order_number
- return
- returnfrombill
- status
- updated_at
- user_email
- vendorid
set: {}
role: user
table:
name: parts_orders
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,38 @@
- args:
role: user
table:
name: parts_orders
schema: public
type: drop_insert_permission
- args:
permission:
check:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- created_at
- deliver_by
- id
- jobid
- order_date
- order_number
- orderedby
- return
- returnfrombill
- status
- updated_at
- user_email
- vendorid
set: {}
role: user
table:
name: parts_orders
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,38 @@
- args:
role: user
table:
name: parts_orders
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- created_at
- deliver_by
- id
- jobid
- order_date
- order_number
- return
- returnfrombill
- status
- updated_at
- user_email
- vendorid
computed_fields: []
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: parts_orders
schema: public
type: create_select_permission

View File

@@ -0,0 +1,39 @@
- args:
role: user
table:
name: parts_orders
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- created_at
- deliver_by
- id
- jobid
- order_date
- order_number
- orderedby
- return
- returnfrombill
- status
- updated_at
- user_email
- vendorid
computed_fields: []
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: parts_orders
schema: public
type: create_select_permission

View File

@@ -0,0 +1,36 @@
- args:
role: user
table:
name: parts_orders
schema: public
type: drop_update_permission
- args:
permission:
columns:
- created_at
- deliver_by
- id
- jobid
- order_date
- order_number
- returnfrombill
- status
- updated_at
- user_email
- vendorid
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
set: {}
role: user
table:
name: parts_orders
schema: public
type: create_update_permission

View File

@@ -0,0 +1,37 @@
- args:
role: user
table:
name: parts_orders
schema: public
type: drop_update_permission
- args:
permission:
columns:
- created_at
- deliver_by
- id
- jobid
- order_date
- order_number
- orderedby
- returnfrombill
- status
- updated_at
- user_email
- vendorid
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
set: {}
role: user
table:
name: parts_orders
schema: public
type: create_update_permission

View File

@@ -0,0 +1,30 @@
- args:
role: user
table:
name: conversations
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: true
columns:
- phone_num
- created_at
- updated_at
- bodyshopid
- id
computed_fields: []
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: conversations
schema: public
type: create_select_permission

View File

@@ -0,0 +1,31 @@
- args:
role: user
table:
name: conversations
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: true
columns:
- archived
- bodyshopid
- created_at
- id
- phone_num
- updated_at
computed_fields: []
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: conversations
schema: public
type: create_select_permission

View File

@@ -0,0 +1,29 @@
- args:
role: user
table:
name: conversations
schema: public
type: drop_update_permission
- args:
permission:
columns:
- phone_num
- created_at
- updated_at
- bodyshopid
- id
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
set: {}
role: user
table:
name: conversations
schema: public
type: create_update_permission

View File

@@ -0,0 +1,30 @@
- args:
role: user
table:
name: conversations
schema: public
type: drop_update_permission
- args:
permission:
columns:
- archived
- bodyshopid
- created_at
- id
- phone_num
- updated_at
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
set: {}
role: user
table:
name: conversations
schema: public
type: create_update_permission

View File

@@ -1114,11 +1114,12 @@ tables:
- role: user
permission:
columns:
- phone_num
- created_at
- updated_at
- archived
- bodyshopid
- created_at
- id
- phone_num
- updated_at
filter:
bodyshop:
associations:
@@ -1133,11 +1134,12 @@ tables:
- role: user
permission:
columns:
- phone_num
- created_at
- updated_at
- archived
- bodyshopid
- created_at
- id
- phone_num
- updated_at
filter:
bodyshop:
associations:
@@ -3622,6 +3624,7 @@ tables:
- jobid
- order_date
- order_number
- orderedby
- return
- returnfrombill
- status
@@ -3638,6 +3641,7 @@ tables:
- jobid
- order_date
- order_number
- orderedby
- return
- returnfrombill
- status
@@ -3664,6 +3668,7 @@ tables:
- jobid
- order_date
- order_number
- orderedby
- returnfrombill
- status
- updated_at