From 824af8b740743de738e326e344e672cc5cb3df0b Mon Sep 17 00:00:00 2001 From: Joe Karow <58997957+JoeKarow@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:10:30 -0500 Subject: [PATCH 1/4] cherry-pick migration from IN-831-edit-organization-page --- packages/db/prisma/migrations/20230928155156_/migration.sql | 2 ++ packages/db/prisma/schema.prisma | 1 + 2 files changed, 3 insertions(+) create mode 100644 packages/db/prisma/migrations/20230928155156_/migration.sql diff --git a/packages/db/prisma/migrations/20230928155156_/migration.sql b/packages/db/prisma/migrations/20230928155156_/migration.sql new file mode 100644 index 0000000000..894418f6eb --- /dev/null +++ b/packages/db/prisma/migrations/20230928155156_/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "OrgPhone" ADD COLUMN "countryCode" TEXT; diff --git a/packages/db/prisma/schema.prisma b/packages/db/prisma/schema.prisma index d07833831e..f17d3bf837 100644 --- a/packages/db/prisma/schema.prisma +++ b/packages/db/prisma/schema.prisma @@ -523,6 +523,7 @@ model OrgPhone { id String @id @default(cuid()) legacyId String? @unique /// old ID from MongoDB legacyDesc String? + countryCode String? number String ext String? primary Boolean @default(false) From f2d2e947de9951a522a8366a91fc95fe89aa54fc Mon Sep 17 00:00:00 2001 From: Joe Karow <58997957+JoeKarow@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:13:34 -0500 Subject: [PATCH 2/4] update bool defaults --- .../migration.sql | 37 +++++++++++++++++++ packages/db/prisma/schema.prisma | 6 +-- 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 packages/db/prisma/migrations/20231211210937_boolean_defaults_for_location/migration.sql diff --git a/packages/db/prisma/migrations/20231211210937_boolean_defaults_for_location/migration.sql b/packages/db/prisma/migrations/20231211210937_boolean_defaults_for_location/migration.sql new file mode 100644 index 0000000000..ab2af21f3e --- /dev/null +++ b/packages/db/prisma/migrations/20231211210937_boolean_defaults_for_location/migration.sql @@ -0,0 +1,37 @@ +/* + Warnings: + + - Made the column `mailOnly` on table `OrgLocation` required. This step will fail if there are existing NULL values in that column. + - Made the column `mapCityOnly` on table `OrgLocation` required. This step will fail if there are existing NULL values in that column. + - Made the column `notVisitable` on table `OrgLocation` required. This step will fail if there are existing NULL values in that column. + */ +-- Update values for Location +UPDATE + "OrgLocation" +SET + "mailOnly" = FALSE +WHERE + "mailOnly" IS NULL; + +UPDATE + "OrgLocation" +SET + "mapCityOnly" = FALSE +WHERE + "mapCityOnly" IS NULL; + +UPDATE + "OrgLocation" +SET + "notVisitable" = FALSE +WHERE + "notVisitable" IS NULL; + +-- AlterTable +ALTER TABLE "OrgLocation" + ALTER COLUMN "mailOnly" SET NOT NULL, + ALTER COLUMN "mailOnly" SET DEFAULT FALSE, + ALTER COLUMN "mapCityOnly" SET NOT NULL, + ALTER COLUMN "mapCityOnly" SET DEFAULT FALSE, + ALTER COLUMN "notVisitable" SET NOT NULL, + ALTER COLUMN "notVisitable" SET DEFAULT FALSE; diff --git a/packages/db/prisma/schema.prisma b/packages/db/prisma/schema.prisma index f17d3bf837..5fc329e11f 100644 --- a/packages/db/prisma/schema.prisma +++ b/packages/db/prisma/schema.prisma @@ -631,9 +631,9 @@ model OrgLocation { postCode String? primary Boolean @default(false) - mailOnly Boolean? - notVisitable Boolean? - mapCityOnly Boolean? + mailOnly Boolean @default(false) + notVisitable Boolean @default(false) + mapCityOnly Boolean @default(false) description FreeText? @relation(fields: [descriptionId], references: [id], onDelete: SetNull, onUpdate: Cascade) descriptionId String? @unique From e4c7cd3209d5df2b840ed0352c3c12a98501f760 Mon Sep 17 00:00:00 2001 From: Joe Karow <58997957+JoeKarow@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:32:10 -0500 Subject: [PATCH 3/4] fix hours styling --- packages/ui/components/data-display/Hours.tsx | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/ui/components/data-display/Hours.tsx b/packages/ui/components/data-display/Hours.tsx index 9919b43871..e6574ded5a 100644 --- a/packages/ui/components/data-display/Hours.tsx +++ b/packages/ui/components/data-display/Hours.tsx @@ -17,6 +17,14 @@ const useStyles = createStyles(() => ({ dow: { verticalAlign: 'baseline', paddingRight: rem(4), + borderTopStyle: 'none !important' as 'none', + paddingTop: '0 !important', + paddingBottom: '0 !important', + }, + hours: { + borderTopStyle: 'none !important' as 'none', + paddingTop: '0 !important', + paddingBottom: '0 !important', }, })) @@ -34,19 +42,23 @@ export const Hours = ({ parentId, label = 'regular' }: HoursProps) => { const hourTable = Object.entries(data).map(([dayIdx, data]) => { return (