IO-2274 Add typing to notes.

This commit is contained in:
Patrick Fic
2023-05-17 13:31:15 -07:00
parent 1c89d12034
commit e36904794b
10 changed files with 1616 additions and 8 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -75,6 +75,27 @@ export function JobNotesComponent({
</span>
),
},
{
title: t("notes.fields.type"),
dataIndex: "type",
key: "type",
width: 120,
filteredValue: filter?.type || null,
filters: [
{ value: "general", text: t("notes.fields.types.general") },
{ value: "customer", text: t("notes.fields.types.customer") },
{ value: "shop", text: t("notes.fields.types.shop") },
{ value: "office", text: t("notes.fields.types.office") },
{ value: "parts", text: t("notes.fields.types.parts") },
{ value: "paint", text: t("notes.fields.types.paint") },
{
value: "supplement",
text: t("notes.fields.types.supplement"),
},
],
onFilter: (value, record) => value.includes(record.type),
render: (text, record) => t(`notes.fields.types.${record.type}`),
},
{
title: t("notes.fields.text"),
dataIndex: "text",
@@ -106,7 +127,7 @@ export function JobNotesComponent({
title: t("notes.actions.actions"),
dataIndex: "actions",
key: "actions",
width: 150,
width: 200,
render: (text, record) => (
<Space wrap>
<Button

View File

@@ -1,4 +1,14 @@
import { Checkbox, Col, Form, Input, Row, Space, Switch, Tag } from "antd";
import {
Checkbox,
Col,
Form,
Input,
Row,
Select,
Space,
Switch,
Tag,
} from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -46,6 +56,28 @@ export function NoteUpsertModalComponent({ form, noteUpsertModal }) {
<Switch />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label={t("notes.fields.type")}
name="type"
initialValue="general"
>
<Select
options={[
{ value: "general", label: t("notes.fields.types.general") },
{ value: "customer", label: t("notes.fields.types.customer") },
{ value: "shop", label: t("notes.fields.types.shop") },
{ value: "office", label: t("notes.fields.types.office") },
{ value: "parts", label: t("notes.fields.types.parts") },
{ value: "paint", label: t("notes.fields.types.paint") },
{
value: "supplement",
label: t("notes.fields.types.supplement"),
},
]}
/>
</Form.Item>
</Col>
<Col span={8}>
<NotesPresetButton form={form} />
</Col>

View File

@@ -13,6 +13,7 @@ export const INSERT_NEW_NOTE = gql`
text
updated_at
audit
type
}
}
}
@@ -41,6 +42,7 @@ export const QUERY_NOTES_BY_JOB_PK = gql`
text
updated_at
audit
type
}
}
}
@@ -60,6 +62,7 @@ export const UPDATE_NOTE = gql`
text
updated_at
audit
type
}
}
}

View File

@@ -63,6 +63,7 @@
"scheduledfor": "Scheduled appointment for: ",
"severalerrorsfound": "Several jobs have issues which may prevent accurate smart scheduling. Click to expand.",
"smartscheduling": "Smart Scheduling",
"smspaymentreminder": "",
"suggesteddates": "Suggested Dates"
},
"successes": {
@@ -103,6 +104,7 @@
"admin_jobunvoid": "ADMIN: Job has been unvoided.",
"billposted": "Bill with invoice number {{invoice_number}} posted.",
"billupdated": "Bill with invoice number {{invoice_number}} updated.",
"failedpayment": "",
"jobassignmentchange": "Employee {{name}} assigned to {{operation}}",
"jobassignmentremoved": "Employee assignment removed for {{operation}}",
"jobchecklist": "Checklist type \"{{type}}\" completed. In production set to {{inproduction}}. Status set to {{status}}.",
@@ -227,6 +229,7 @@
},
"bodyshop": {
"actions": {
"add_task_preset": "",
"addapptcolor": "Add Appointment Color",
"addbucket": "Add Definition",
"addpartslocation": "Add Parts Location",
@@ -339,6 +342,12 @@
},
"md_payment_types": "Payment Types",
"md_referral_sources": "Referral Sources",
"md_tasks_presets": {
"hourstype": "",
"memo": "",
"name": "",
"percent": ""
},
"messaginglabel": "Messaging Preset Label",
"messagingtext": "Messaging Preset Text",
"noteslabel": "Note Label",
@@ -374,6 +383,9 @@
"export": "CSI -> Export",
"page": "CSI -> Page"
},
"employee_teams": {
"page": ""
},
"employees": {
"page": "Employees -> List"
},
@@ -432,10 +444,15 @@
},
"timetickets": {
"edit": "Time Tickets -> Edit",
"editcommitted": "",
"enter": "Time Tickets -> Enter",
"list": "Time Tickets -> List",
"shiftedit": "Time Tickets -> Shift Edit"
},
"ttapprovals": {
"approve": "",
"view": ""
},
"users": {
"editaccess": "Users -> Edit access"
}
@@ -453,6 +470,8 @@
"federal_tax": "Federal Tax",
"federal_tax_itc": "Federal Tax Credit",
"gst_override": "GST Override Account #",
"invoiceexemptcode": "",
"itemexemptcode": "",
"la1": "LA1",
"la2": "LA2",
"la3": "LA3",
@@ -504,12 +523,12 @@
"dailyhrslimit": "Daily Incoming Hours Limit"
},
"ssbuckets": {
"color": "Job Color",
"gte": "Greater Than/Equal to (hrs)",
"id": "ID",
"label": "Label",
"lt": "Less than (hrs)",
"target": "Target (count)",
"color": "Job Color"
"target": "Target (count)"
},
"state": "Province/State",
"state_tax_id": "Provincial/State Tax ID (PST, QST)",
@@ -575,6 +594,7 @@
"title": "DMS"
},
"emaillater": "Email Later",
"employee_teams": "",
"employees": "Employees",
"estimators": "Estimators",
"filehandlers": "File Handlers",
@@ -583,6 +603,7 @@
"jobstatuses": "Job Statuses",
"laborrates": "Labor Rates",
"licensing": "Licensing",
"md_tasks_presets": "",
"md_to_emails": "Preset To Emails",
"md_to_emails_emails": "Emails",
"messagingpresets": "Messaging Presets",
@@ -609,6 +630,7 @@
"speedprint": "Speed Print Configuration",
"ssbuckets": "Job Size Definitions",
"systemsettings": "System Settings",
"task-presets": "",
"workingdays": "Working Days"
},
"successes": {
@@ -908,6 +930,18 @@
"sent": "Email sent successfully."
}
},
"employee_teams": {
"actions": {
"new": "",
"newmember": ""
},
"fields": {
"active": "",
"employeeid": "",
"name": "",
"percentage": ""
}
},
"employees": {
"actions": {
"addvacation": "Add Vacation",
@@ -1147,6 +1181,30 @@
"updated": "Inventory line updated."
}
},
"job_payments": {
"buttons": {
"goback": "",
"proceedtopayment": "",
"refundpayment": ""
},
"notifications": {
"error": {
"description": "",
"title": ""
}
},
"titles": {
"amount": "",
"dateOfPayment": "",
"descriptions": "",
"payer": "",
"payername": "",
"paymentid": "",
"paymenttype": "",
"refundamount": "",
"transactionid": ""
}
},
"joblines": {
"actions": {
"converttolabor": "Convert amount to Labor.",
@@ -1579,6 +1637,7 @@
"scheddates": "Schedule Dates"
},
"labels": {
"act_price_ppc": "",
"actual_completion_inferred": "$t(jobs.fields.actual_completion) inferred using $t(jobs.fields.scheduled_completion).",
"actual_delivery_inferred": "$t(jobs.fields.actual_delivery) inferred using $t(jobs.fields.scheduled_delivery).",
"actual_in_inferred": "$t(jobs.fields.actual_in) inferred using $t(jobs.fields.scheduled_in).",
@@ -1715,6 +1774,7 @@
"partstotal": "This is the total of all parts and sublet amounts on the vehicle (some of these may require an in-house invoice).<br/>\nItems such as shop and paint materials, labor online lines, etc. are not included in this total.",
"totalreturns": "The total <b>retail</b> amount of returns created for this job."
},
"ppc": "",
"profileadjustments": "",
"prt_dsmk_total": "Line Item Adjustment",
"rates": "Rates",
@@ -1855,6 +1915,7 @@
"customers": "Customers",
"dashboard": "Dashboard",
"enterbills": "Enter Bills",
"entercardpayment": "",
"enterpayment": "Enter Payments",
"entertimeticket": "Enter Time Tickets",
"export": "Export",
@@ -1866,6 +1927,7 @@
"newjob": "Create New Job",
"owners": "Owners",
"parts-queue": "Parts Queue",
"paymentremindersms": "",
"phonebook": "Phonebook",
"productionboard": "Production Board - Visual",
"productionlist": "Production Board - List",
@@ -1891,6 +1953,7 @@
"shop_vendors": "Vendors",
"temporarydocs": "Temporary Documents",
"timetickets": "Time Tickets",
"ttapprovals": "",
"vehicles": "Vehicles"
},
"jobsactions": {
@@ -1974,6 +2037,16 @@
"critical": "Critical",
"private": "Private",
"text": "Contents",
"type": "Type",
"types": {
"customer": "Customer",
"general": "General",
"office": "Office",
"paint": "Paint",
"parts": "Parts",
"shop": "Shop",
"supplement": "Supplement"
},
"updatedat": "Updated At"
},
"labels": {
@@ -2364,6 +2437,7 @@
"qbo_usa": "QBO USA"
}
},
"cardcolor": "Card Colors",
"cardsettings": "Card Settings",
"clm_no": "Claim Number",
"comment": "Comment",
@@ -2374,6 +2448,7 @@
"ins_co_nm": "Insurance Company Name",
"jobdetail": "Job Details",
"laborhrs": "Labor Hours",
"legend": "Legend:",
"note": "Production Note",
"ownr_nm": "Owner Name",
"paintpriority": "P/P",
@@ -2386,9 +2461,7 @@
"sublets": "Sublets",
"totalhours": "Total Hrs ",
"touchtime": "T/T",
"viewname": "View Name",
"legend": "Legend:",
"cardcolor": "Card Colors"
"viewname": "View Name"
},
"successes": {
"removed": "Job removed from production."
@@ -2614,6 +2687,7 @@
},
"timetickets": {
"actions": {
"claimtasks": "",
"clockin": "Clock In",
"clockout": "Clock Out",
"enter": "Enter New Time Ticket",
@@ -2634,10 +2708,12 @@
"clockhours": "Clock Hours",
"clockoff": "Clock Off",
"clockon": "Clocked In",
"committed": "",
"cost_center": "Cost Center",
"date": "Ticket Date",
"efficiency": "Efficiency",
"employee": "Employee",
"employee_team": "",
"flat_rate": "Flat Rate?",
"memo": "Memo",
"productivehrs": "Productive Hours",
@@ -2724,6 +2800,7 @@
"shop-vendors": "Vendors",
"temporarydocs": "Temporary Documents",
"timetickets": "Time Tickets",
"ttapprovals": "",
"vehicle-details": "Vehicle: {{vehicle}}",
"vehicles": "Vehicles"
},
@@ -2769,9 +2846,15 @@
"shop_vendors": "Vendors | $t(titles.app)",
"temporarydocs": "Temporary Documents | $t(titles.app)",
"timetickets": "Time Tickets | $t(titles.app)",
"ttapprovals": "",
"vehicledetail": "Vehicle Details {{vehicle}} | $t(titles.app)",
"vehicles": "All Vehicles | $t(titles.app)"
},
"tt_approvals": {
"actions": {
"approveselected": ""
}
},
"user": {
"actions": {
"changepassword": "Change Password",

View File

@@ -63,6 +63,7 @@
"scheduledfor": "Cita programada para:",
"severalerrorsfound": "",
"smartscheduling": "",
"smspaymentreminder": "",
"suggesteddates": ""
},
"successes": {
@@ -103,6 +104,7 @@
"admin_jobunvoid": "",
"billposted": "",
"billupdated": "",
"failedpayment": "",
"jobassignmentchange": "",
"jobassignmentremoved": "",
"jobchecklist": "",
@@ -227,6 +229,7 @@
},
"bodyshop": {
"actions": {
"add_task_preset": "",
"addapptcolor": "",
"addbucket": "",
"addpartslocation": "",
@@ -339,6 +342,12 @@
},
"md_payment_types": "",
"md_referral_sources": "",
"md_tasks_presets": {
"hourstype": "",
"memo": "",
"name": "",
"percent": ""
},
"messaginglabel": "",
"messagingtext": "",
"noteslabel": "",
@@ -374,6 +383,9 @@
"export": "",
"page": ""
},
"employee_teams": {
"page": ""
},
"employees": {
"page": ""
},
@@ -432,10 +444,15 @@
},
"timetickets": {
"edit": "",
"editcommitted": "",
"enter": "",
"list": "",
"shiftedit": ""
},
"ttapprovals": {
"approve": "",
"view": ""
},
"users": {
"editaccess": ""
}
@@ -453,6 +470,8 @@
"federal_tax": "",
"federal_tax_itc": "",
"gst_override": "",
"invoiceexemptcode": "",
"itemexemptcode": "",
"la1": "",
"la2": "",
"la3": "",
@@ -504,6 +523,7 @@
"dailyhrslimit": ""
},
"ssbuckets": {
"color": "",
"gte": "",
"id": "",
"label": "",
@@ -574,6 +594,7 @@
"title": ""
},
"emaillater": "",
"employee_teams": "",
"employees": "",
"estimators": "",
"filehandlers": "",
@@ -582,6 +603,7 @@
"jobstatuses": "",
"laborrates": "",
"licensing": "",
"md_tasks_presets": "",
"md_to_emails": "",
"md_to_emails_emails": "",
"messagingpresets": "",
@@ -608,6 +630,7 @@
"speedprint": "",
"ssbuckets": "",
"systemsettings": "",
"task-presets": "",
"workingdays": ""
},
"successes": {
@@ -907,6 +930,18 @@
"sent": "Correo electrónico enviado con éxito."
}
},
"employee_teams": {
"actions": {
"new": "",
"newmember": ""
},
"fields": {
"active": "",
"employeeid": "",
"name": "",
"percentage": ""
}
},
"employees": {
"actions": {
"addvacation": "",
@@ -1146,6 +1181,30 @@
"updated": ""
}
},
"job_payments": {
"buttons": {
"goback": "",
"proceedtopayment": "",
"refundpayment": ""
},
"notifications": {
"error": {
"description": "",
"title": ""
}
},
"titles": {
"amount": "",
"dateOfPayment": "",
"descriptions": "",
"payer": "",
"payername": "",
"paymentid": "",
"paymenttype": "",
"refundamount": "",
"transactionid": ""
}
},
"joblines": {
"actions": {
"converttolabor": "",
@@ -1578,6 +1637,7 @@
"scheddates": ""
},
"labels": {
"act_price_ppc": "",
"actual_completion_inferred": "",
"actual_delivery_inferred": "",
"actual_in_inferred": "",
@@ -1714,6 +1774,7 @@
"partstotal": "",
"totalreturns": ""
},
"ppc": "",
"profileadjustments": "",
"prt_dsmk_total": "",
"rates": "Tarifas",
@@ -1854,6 +1915,7 @@
"customers": "Clientes",
"dashboard": "",
"enterbills": "",
"entercardpayment": "",
"enterpayment": "",
"entertimeticket": "",
"export": "",
@@ -1865,6 +1927,7 @@
"newjob": "",
"owners": "propietarios",
"parts-queue": "",
"paymentremindersms": "",
"phonebook": "",
"productionboard": "",
"productionlist": "",
@@ -1890,6 +1953,7 @@
"shop_vendors": "Vendedores",
"temporarydocs": "",
"timetickets": "",
"ttapprovals": "",
"vehicles": "Vehículos"
},
"jobsactions": {
@@ -1973,6 +2037,16 @@
"critical": "Crítico",
"private": "Privado",
"text": "Contenido",
"type": "",
"types": {
"customer": "",
"general": "",
"office": "",
"paint": "",
"parts": "",
"shop": "",
"supplement": ""
},
"updatedat": "Actualizado en"
},
"labels": {
@@ -2363,6 +2437,7 @@
"qbo_usa": ""
}
},
"cardcolor": "",
"cardsettings": "",
"clm_no": "",
"comment": "",
@@ -2373,6 +2448,7 @@
"ins_co_nm": "",
"jobdetail": "",
"laborhrs": "",
"legend": "",
"note": "",
"ownr_nm": "",
"paintpriority": "",
@@ -2611,6 +2687,7 @@
},
"timetickets": {
"actions": {
"claimtasks": "",
"clockin": "",
"clockout": "",
"enter": "",
@@ -2631,10 +2708,12 @@
"clockhours": "",
"clockoff": "",
"clockon": "",
"committed": "",
"cost_center": "",
"date": "",
"efficiency": "",
"employee": "",
"employee_team": "",
"flat_rate": "",
"memo": "",
"productivehrs": "",
@@ -2721,6 +2800,7 @@
"shop-vendors": "",
"temporarydocs": "",
"timetickets": "",
"ttapprovals": "",
"vehicle-details": "",
"vehicles": ""
},
@@ -2766,9 +2846,15 @@
"shop_vendors": "Vendedores | $t(titles.app)",
"temporarydocs": "",
"timetickets": "",
"ttapprovals": "",
"vehicledetail": "Detalles del vehículo {{vehicle}} | $t(titles.app)",
"vehicles": "Todos los vehiculos | $t(titles.app)"
},
"tt_approvals": {
"actions": {
"approveselected": ""
}
},
"user": {
"actions": {
"changepassword": "",

View File

@@ -63,6 +63,7 @@
"scheduledfor": "Rendez-vous prévu pour:",
"severalerrorsfound": "",
"smartscheduling": "",
"smspaymentreminder": "",
"suggesteddates": ""
},
"successes": {
@@ -103,6 +104,7 @@
"admin_jobunvoid": "",
"billposted": "",
"billupdated": "",
"failedpayment": "",
"jobassignmentchange": "",
"jobassignmentremoved": "",
"jobchecklist": "",
@@ -227,6 +229,7 @@
},
"bodyshop": {
"actions": {
"add_task_preset": "",
"addapptcolor": "",
"addbucket": "",
"addpartslocation": "",
@@ -339,6 +342,12 @@
},
"md_payment_types": "",
"md_referral_sources": "",
"md_tasks_presets": {
"hourstype": "",
"memo": "",
"name": "",
"percent": ""
},
"messaginglabel": "",
"messagingtext": "",
"noteslabel": "",
@@ -374,6 +383,9 @@
"export": "",
"page": ""
},
"employee_teams": {
"page": ""
},
"employees": {
"page": ""
},
@@ -432,10 +444,15 @@
},
"timetickets": {
"edit": "",
"editcommitted": "",
"enter": "",
"list": "",
"shiftedit": ""
},
"ttapprovals": {
"approve": "",
"view": ""
},
"users": {
"editaccess": ""
}
@@ -453,6 +470,8 @@
"federal_tax": "",
"federal_tax_itc": "",
"gst_override": "",
"invoiceexemptcode": "",
"itemexemptcode": "",
"la1": "",
"la2": "",
"la3": "",
@@ -504,6 +523,7 @@
"dailyhrslimit": ""
},
"ssbuckets": {
"color": "",
"gte": "",
"id": "",
"label": "",
@@ -574,6 +594,7 @@
"title": ""
},
"emaillater": "",
"employee_teams": "",
"employees": "",
"estimators": "",
"filehandlers": "",
@@ -582,6 +603,7 @@
"jobstatuses": "",
"laborrates": "",
"licensing": "",
"md_tasks_presets": "",
"md_to_emails": "",
"md_to_emails_emails": "",
"messagingpresets": "",
@@ -608,6 +630,7 @@
"speedprint": "",
"ssbuckets": "",
"systemsettings": "",
"task-presets": "",
"workingdays": ""
},
"successes": {
@@ -907,6 +930,18 @@
"sent": "E-mail envoyé avec succès."
}
},
"employee_teams": {
"actions": {
"new": "",
"newmember": ""
},
"fields": {
"active": "",
"employeeid": "",
"name": "",
"percentage": ""
}
},
"employees": {
"actions": {
"addvacation": "",
@@ -1146,6 +1181,30 @@
"updated": ""
}
},
"job_payments": {
"buttons": {
"goback": "",
"proceedtopayment": "",
"refundpayment": ""
},
"notifications": {
"error": {
"description": "",
"title": ""
}
},
"titles": {
"amount": "",
"dateOfPayment": "",
"descriptions": "",
"payer": "",
"payername": "",
"paymentid": "",
"paymenttype": "",
"refundamount": "",
"transactionid": ""
}
},
"joblines": {
"actions": {
"converttolabor": "",
@@ -1578,6 +1637,7 @@
"scheddates": ""
},
"labels": {
"act_price_ppc": "",
"actual_completion_inferred": "",
"actual_delivery_inferred": "",
"actual_in_inferred": "",
@@ -1714,6 +1774,7 @@
"partstotal": "",
"totalreturns": ""
},
"ppc": "",
"profileadjustments": "",
"prt_dsmk_total": "",
"rates": "Les taux",
@@ -1854,6 +1915,7 @@
"customers": "Les clients",
"dashboard": "",
"enterbills": "",
"entercardpayment": "",
"enterpayment": "",
"entertimeticket": "",
"export": "",
@@ -1865,6 +1927,7 @@
"newjob": "",
"owners": "Propriétaires",
"parts-queue": "",
"paymentremindersms": "",
"phonebook": "",
"productionboard": "",
"productionlist": "",
@@ -1890,6 +1953,7 @@
"shop_vendors": "Vendeurs",
"temporarydocs": "",
"timetickets": "",
"ttapprovals": "",
"vehicles": "Véhicules"
},
"jobsactions": {
@@ -1973,6 +2037,16 @@
"critical": "Critique",
"private": "privé",
"text": "Contenu",
"type": "",
"types": {
"customer": "",
"general": "",
"office": "",
"paint": "",
"parts": "",
"shop": "",
"supplement": ""
},
"updatedat": "Mis à jour à"
},
"labels": {
@@ -2363,6 +2437,7 @@
"qbo_usa": ""
}
},
"cardcolor": "",
"cardsettings": "",
"clm_no": "",
"comment": "",
@@ -2373,6 +2448,7 @@
"ins_co_nm": "",
"jobdetail": "",
"laborhrs": "",
"legend": "",
"note": "",
"ownr_nm": "",
"paintpriority": "",
@@ -2611,6 +2687,7 @@
},
"timetickets": {
"actions": {
"claimtasks": "",
"clockin": "",
"clockout": "",
"enter": "",
@@ -2631,10 +2708,12 @@
"clockhours": "",
"clockoff": "",
"clockon": "",
"committed": "",
"cost_center": "",
"date": "",
"efficiency": "",
"employee": "",
"employee_team": "",
"flat_rate": "",
"memo": "",
"productivehrs": "",
@@ -2721,6 +2800,7 @@
"shop-vendors": "",
"temporarydocs": "",
"timetickets": "",
"ttapprovals": "",
"vehicle-details": "",
"vehicles": ""
},
@@ -2766,9 +2846,15 @@
"shop_vendors": "Vendeurs | $t(titles.app)",
"temporarydocs": "",
"timetickets": "",
"ttapprovals": "",
"vehicledetail": "Détails du véhicule {{vehicle} | $t(titles.app)",
"vehicles": "Tous les véhicules | $t(titles.app)"
},
"tt_approvals": {
"actions": {
"approveselected": ""
}
},
"user": {
"actions": {
"changepassword": "",

View File

@@ -4333,6 +4333,7 @@
- jobid
- private
- text
- type
- updated_at
select_permissions:
- role: user
@@ -4346,6 +4347,7 @@
- jobid
- private
- text
- type
- updated_at
filter:
job:
@@ -4369,6 +4371,7 @@
- jobid
- private
- text
- type
- updated_at
filter:
job:

View File

@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."notes" add column "type" text
-- not null default 'general';

View File

@@ -0,0 +1,2 @@
alter table "public"."notes" add column "type" text
not null default 'general';