From f3ee4210304f9fb1f2305c88182f5cf9ca50cdb4 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Mon, 10 Nov 2025 11:23:49 -0800 Subject: [PATCH 1/2] IO-3435 SpeedPrint Filtering in Config Signed-off-by: Allan Carr --- .../shop-info/shop-info.speedprint.component.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/src/components/shop-info/shop-info.speedprint.component.jsx b/client/src/components/shop-info/shop-info.speedprint.component.jsx index 639e59ad8..4594ba1c5 100644 --- a/client/src/components/shop-info/shop-info.speedprint.component.jsx +++ b/client/src/components/shop-info/shop-info.speedprint.component.jsx @@ -4,10 +4,18 @@ import { useTranslation } from "react-i18next"; import { TemplateList } from "../../utils/TemplateConstants"; import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; +import InstanceRenderManager from "../../utils/instanceRenderMgr"; export default function ShopInfoSpeedPrint() { const { t } = useTranslation(); - const TemplateListGenerated = TemplateList("job"); + const allTemplates = TemplateList("job"); + const TemplateListGenerated = InstanceRenderManager({ + imex: Object.fromEntries( + Object.entries(allTemplates).filter(([, { enhanced_payroll }]) => !enhanced_payroll) + ), + rome: allTemplates + }); + return ( {(fields, { add, remove, move }) => { From 70028c8be6635af8f45fe4e4091bd8b2e05d40b9 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 10 Nov 2025 15:38:17 -0800 Subject: [PATCH 2/2] Add trigger to remove fk violations for media analytics. --- .../down.sql | 5 ++++ .../up.sql | 5 ++++ .../down.sql | 23 +++++++++++++++++++ .../up.sql | 21 +++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 hasura/migrations/1762815418708_set_fk_public_media_analytics_detail_jobid/down.sql create mode 100644 hasura/migrations/1762815418708_set_fk_public_media_analytics_detail_jobid/up.sql create mode 100644 hasura/migrations/1762816491980_media_analytics_fk_trigger/down.sql create mode 100644 hasura/migrations/1762816491980_media_analytics_fk_trigger/up.sql diff --git a/hasura/migrations/1762815418708_set_fk_public_media_analytics_detail_jobid/down.sql b/hasura/migrations/1762815418708_set_fk_public_media_analytics_detail_jobid/down.sql new file mode 100644 index 000000000..a00bbd1d0 --- /dev/null +++ b/hasura/migrations/1762815418708_set_fk_public_media_analytics_detail_jobid/down.sql @@ -0,0 +1,5 @@ +alter table "public"."media_analytics_detail" drop constraint "media_analytics_detail_jobid_fkey", + add constraint "media_analytics_detail_jobid_fkey" + foreign key ("jobid") + references "public"."jobs" + ("id") on update restrict on delete restrict; diff --git a/hasura/migrations/1762815418708_set_fk_public_media_analytics_detail_jobid/up.sql b/hasura/migrations/1762815418708_set_fk_public_media_analytics_detail_jobid/up.sql new file mode 100644 index 000000000..7f85c72e1 --- /dev/null +++ b/hasura/migrations/1762815418708_set_fk_public_media_analytics_detail_jobid/up.sql @@ -0,0 +1,5 @@ +alter table "public"."media_analytics_detail" drop constraint "media_analytics_detail_jobid_fkey", + add constraint "media_analytics_detail_jobid_fkey" + foreign key ("jobid") + references "public"."jobs" + ("id") on update set null on delete set null; diff --git a/hasura/migrations/1762816491980_media_analytics_fk_trigger/down.sql b/hasura/migrations/1762816491980_media_analytics_fk_trigger/down.sql new file mode 100644 index 000000000..845321d28 --- /dev/null +++ b/hasura/migrations/1762816491980_media_analytics_fk_trigger/down.sql @@ -0,0 +1,23 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- CREATE OR REPLACE FUNCTION set_fk_to_null_if_invalid_media_analytics() +-- RETURNS TRIGGER AS $$ +-- BEGIN +-- -- Check if the foreign key value is not NULL +-- IF NEW.jobid IS NOT NULL THEN +-- -- Check if the corresponding record exists in the parent table +-- IF NOT EXISTS (SELECT 1 FROM jobs WHERE id = NEW.jobid) THEN +-- -- If it doesn't exist, set the foreign key to NULL +-- NEW.jobid = NULL; +-- END IF; +-- END IF; +-- +-- -- Return the (potentially modified) record to be inserted/updated +-- RETURN NEW; +-- END; +-- $$ LANGUAGE plpgsql; +-- +-- CREATE TRIGGER media_analytics_fk_null +-- BEFORE INSERT OR UPDATE ON media_analytics_detail +-- FOR EACH ROW +-- EXECUTE FUNCTION set_fk_to_null_if_invalid_media_analytics(); diff --git a/hasura/migrations/1762816491980_media_analytics_fk_trigger/up.sql b/hasura/migrations/1762816491980_media_analytics_fk_trigger/up.sql new file mode 100644 index 000000000..67f1f4e49 --- /dev/null +++ b/hasura/migrations/1762816491980_media_analytics_fk_trigger/up.sql @@ -0,0 +1,21 @@ +CREATE OR REPLACE FUNCTION set_fk_to_null_if_invalid_media_analytics() +RETURNS TRIGGER AS $$ +BEGIN + -- Check if the foreign key value is not NULL + IF NEW.jobid IS NOT NULL THEN + -- Check if the corresponding record exists in the parent table + IF NOT EXISTS (SELECT 1 FROM jobs WHERE id = NEW.jobid) THEN + -- If it doesn't exist, set the foreign key to NULL + NEW.jobid = NULL; + END IF; + END IF; + + -- Return the (potentially modified) record to be inserted/updated + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +CREATE TRIGGER media_analytics_fk_null +BEFORE INSERT OR UPDATE ON media_analytics_detail +FOR EACH ROW +EXECUTE FUNCTION set_fk_to_null_if_invalid_media_analytics();