diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 8e1c7f716..2b40751f8 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -17053,6 +17053,27 @@ + + type + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + @@ -17142,27 +17163,6 @@ - - type - false - - - - - - en-US - false - - - es-MX - false - - - fr-CA - false - - - @@ -22013,7 +22013,7 @@ en-US - client/src + . tab namespaced-json true diff --git a/client/src/components/payment-form/payment-form.component.jsx b/client/src/components/payment-form/payment-form.component.jsx index 8a81c40c8..15ac9d09a 100644 --- a/client/src/components/payment-form/payment-form.component.jsx +++ b/client/src/components/payment-form/payment-form.component.jsx @@ -66,7 +66,7 @@ export function PaymentFormComponent({ ({ setEmailOptions: (e) => dispatch(setEmailOptions(e)), toggleModalVisible: () => dispatch(toggleModalVisible("printCenter")), }); -export function PrintCenterJobsComponent({ printCenterModal }) { - const { id: jobId } = printCenterModal.context; +export function PrintCenterJobsComponent({ bodyshop, printCenterModal }) { + const { id: jobId } = printCenterModal.context; const JobsReportsList = JobsReports(null); return (
+ {JobsReportsList.map((section) => ( diff --git a/client/src/components/print-center-speed-print/print-center-speed-print.component.jsx b/client/src/components/print-center-speed-print/print-center-speed-print.component.jsx new file mode 100644 index 000000000..d0f86de29 --- /dev/null +++ b/client/src/components/print-center-speed-print/print-center-speed-print.component.jsx @@ -0,0 +1,58 @@ +import React from "react"; + +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { selectBodyshop } from "../../redux/user/user.selectors"; +import { logImEXEvent } from "../../firebase/firebase.utils"; +import RenderTemplate, { + displayTemplateInWindow, +} from "../../utils/RenderTemplate"; +import { Button } from "antd"; + +const mapStateToProps = createStructuredSelector({ + bodyshop: selectBodyshop, //currentUser: selectCurrentUser +}); +const mapDispatchToProps = (dispatch) => ({ + //setUserLanguage: language => dispatch(setUserLanguage(language)) +}); + +export function PrintCenterSpeedPrint({ bodyshop, job }) { + const { speedprint } = bodyshop; + + const renderTemplate = async (templateKey) => { + logImEXEvent("speed_print_template_render"); + + const html = await RenderTemplate( + { + name: templateKey, + variables: { id: job.id }, + }, + bodyshop + ); + displayTemplateInWindow(html); + }; + + const renderAllTemplates = (templateKeys) => { + logImEXEvent("speed_print_render_all_templates"); + + templateKeys.forEach((templateKey) => renderTemplate(templateKey)); + }; + + return ( +
+ {speedprint.map((sp) => ( +
+ {JSON.stringify(sp)} + +
+ ))} +
+ ); +} + +export default connect( + mapStateToProps, + mapDispatchToProps +)(PrintCenterSpeedPrint); diff --git a/client/src/graphql/bodyshop.queries.js b/client/src/graphql/bodyshop.queries.js index 3892f217c..c25767b8f 100644 --- a/client/src/graphql/bodyshop.queries.js +++ b/client/src/graphql/bodyshop.queries.js @@ -47,6 +47,7 @@ export const QUERY_BODYSHOP = gql` md_referral_sources md_messaging_presets intakechecklist + speedprint employees { id first_name @@ -102,6 +103,7 @@ export const UPDATE_SHOP = gql` md_referral_sources md_messaging_presets intakechecklist + speedprint employees { id first_name diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 1a29837e9..549bc0203 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1048,14 +1048,14 @@ "memo": "Memo", "payer": "Payer", "stripeid": "Stripe ID", - "transactionid": "Transaction ID" + "transactionid": "Transaction ID", + "type": "Type" }, "labels": { "electronicpayment": "Use Electronic Payment Processing?", "new": "New Payment", "signup": "Please contact support to sign up for electronic payments.", - "title": "Payments", - "type": "Type" + "title": "Payments" }, "successes": { "payment": "Payment created successfully. ", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index cd5203cd7..b15fea41b 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1048,14 +1048,14 @@ "memo": "", "payer": "", "stripeid": "", - "transactionid": "" + "transactionid": "", + "type": "" }, "labels": { "electronicpayment": "", "new": "", "signup": "", - "title": "", - "type": "" + "title": "" }, "successes": { "payment": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 43d8ca6e0..d05bc3488 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1048,14 +1048,14 @@ "memo": "", "payer": "", "stripeid": "", - "transactionid": "" + "transactionid": "", + "type": "" }, "labels": { "electronicpayment": "", "new": "", "signup": "", - "title": "", - "type": "" + "title": "" }, "successes": { "payment": "", diff --git a/hasura/migrations/1596147831219_alter_table_public_bodyshops_add_column_speedprint/down.yaml b/hasura/migrations/1596147831219_alter_table_public_bodyshops_add_column_speedprint/down.yaml new file mode 100644 index 000000000..870334012 --- /dev/null +++ b/hasura/migrations/1596147831219_alter_table_public_bodyshops_add_column_speedprint/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."bodyshops" DROP COLUMN "speedprint"; + type: run_sql diff --git a/hasura/migrations/1596147831219_alter_table_public_bodyshops_add_column_speedprint/up.yaml b/hasura/migrations/1596147831219_alter_table_public_bodyshops_add_column_speedprint/up.yaml new file mode 100644 index 000000000..5c6acea5e --- /dev/null +++ b/hasura/migrations/1596147831219_alter_table_public_bodyshops_add_column_speedprint/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."bodyshops" ADD COLUMN "speedprint" jsonb NULL DEFAULT + jsonb_build_array(); + type: run_sql diff --git a/hasura/migrations/1596147842820_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations/1596147842820_update_permission_user_public_table_bodyshops/down.yaml new file mode 100644 index 000000000..b0494d6ee --- /dev/null +++ b/hasura/migrations/1596147842820_update_permission_user_public_table_bodyshops/down.yaml @@ -0,0 +1,57 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - accountingconfig + - address1 + - address2 + - appt_length + - city + - country + - created_at + - email + - federal_tax_id + - id + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - invoice_tax_rates + - logo_img_path + - md_messaging_presets + - md_order_statuses + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - messagingservicesid + - production_config + - region_config + - scoreboard_target + - shopname + - shoprates + - ssbuckets + - state + - state_tax_id + - stripe_acct_id + - template_header + - textid + - updated_at + - zip_post + computed_fields: [] + filter: + associations: + bodyshop: + associations: + user: + authid: + _eq: X-Hasura-User-Id + role: user + table: + name: bodyshops + schema: public + type: create_select_permission diff --git a/hasura/migrations/1596147842820_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations/1596147842820_update_permission_user_public_table_bodyshops/up.yaml new file mode 100644 index 000000000..f95349392 --- /dev/null +++ b/hasura/migrations/1596147842820_update_permission_user_public_table_bodyshops/up.yaml @@ -0,0 +1,58 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - accountingconfig + - address1 + - address2 + - appt_length + - city + - country + - created_at + - email + - federal_tax_id + - id + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - invoice_tax_rates + - logo_img_path + - md_messaging_presets + - md_order_statuses + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - messagingservicesid + - production_config + - region_config + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - stripe_acct_id + - template_header + - textid + - updated_at + - zip_post + computed_fields: [] + filter: + associations: + bodyshop: + associations: + user: + authid: + _eq: X-Hasura-User-Id + role: user + table: + name: bodyshops + schema: public + type: create_select_permission diff --git a/hasura/migrations/1596147854907_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations/1596147854907_update_permission_user_public_table_bodyshops/down.yaml new file mode 100644 index 000000000..5702e6737 --- /dev/null +++ b/hasura/migrations/1596147854907_update_permission_user_public_table_bodyshops/down.yaml @@ -0,0 +1,51 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_update_permission +- args: + permission: + columns: + - accountingconfig + - address1 + - address2 + - appt_length + - city + - country + - created_at + - email + - federal_tax_id + - id + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - invoice_tax_rates + - logo_img_path + - md_messaging_presets + - md_order_statuses + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - production_config + - scoreboard_target + - shopname + - shoprates + - ssbuckets + - state + - state_tax_id + - updated_at + - zip_post + filter: + associations: + bodyshop: + associations: + user: + authid: + _eq: X-Hasura-User-Id + set: {} + role: user + table: + name: bodyshops + schema: public + type: create_update_permission diff --git a/hasura/migrations/1596147854907_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations/1596147854907_update_permission_user_public_table_bodyshops/up.yaml new file mode 100644 index 000000000..04f255254 --- /dev/null +++ b/hasura/migrations/1596147854907_update_permission_user_public_table_bodyshops/up.yaml @@ -0,0 +1,52 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_update_permission +- args: + permission: + columns: + - accountingconfig + - address1 + - address2 + - appt_length + - city + - country + - created_at + - email + - federal_tax_id + - id + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - invoice_tax_rates + - logo_img_path + - md_messaging_presets + - md_order_statuses + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - production_config + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - updated_at + - zip_post + filter: + associations: + bodyshop: + associations: + user: + authid: + _eq: X-Hasura-User-Id + set: {} + role: user + table: + name: bodyshops + schema: public + type: create_update_permission diff --git a/hasura/migrations/metadata.yaml b/hasura/migrations/metadata.yaml index 0f10fb3e3..40815645b 100644 --- a/hasura/migrations/metadata.yaml +++ b/hasura/migrations/metadata.yaml @@ -484,6 +484,7 @@ tables: - scoreboard_target - shopname - shoprates + - speedprint - ssbuckets - state - state_tax_id @@ -527,6 +528,7 @@ tables: - scoreboard_target - shopname - shoprates + - speedprint - ssbuckets - state - state_tax_id