diff --git a/Accounts/src/Pages/Register.tsx b/Accounts/src/Pages/Register.tsx index 0d0db8864b..2835925bab 100644 --- a/Accounts/src/Pages/Register.tsx +++ b/Accounts/src/Pages/Register.tsx @@ -115,7 +115,7 @@ const RegisterPage: () => JSX.Element = () => { required: true, title: "Full Name", dataTestId: "name", - disableSpellCheck: true, + disableSpellCheck: true, }, ]; diff --git a/App/FeatureSet/BaseAPI/Index.ts b/App/FeatureSet/BaseAPI/Index.ts index 874a61013b..7f67da95b7 100644 --- a/App/FeatureSet/BaseAPI/Index.ts +++ b/App/FeatureSet/BaseAPI/Index.ts @@ -579,7 +579,7 @@ import OnCallDutyPolicyTimeLogService, { // statu spage announcement templates import StatusPageAnnouncementTemplate from "Common/Models/DatabaseModels/StatusPageAnnouncementTemplate"; import StatusPageAnnouncementTemplateService, { - Service as StatusPageAnnouncementTemplateServiceType, + Service as StatusPageAnnouncementTemplateServiceType, } from "Common/Server/Services/StatusPageAnnouncementTemplateService"; // Open API Spec diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1749813704371-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1749813704371-MigrationName.ts index bae28193d3..fb5f6b17c8 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1749813704371-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1749813704371-MigrationName.ts @@ -1,32 +1,67 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1749813704371 implements MigrationInterface { - public name = 'MigrationName1749813704371' + public name = "MigrationName1749813704371"; - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`CREATE TABLE "StatusPageAnnouncementTemplate" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "templateName" character varying(100) NOT NULL, "templateDescription" character varying(500), "title" character varying(100) NOT NULL, "description" text NOT NULL, "shouldStatusPageSubscribersBeNotified" boolean NOT NULL DEFAULT true, "createdByUserId" uuid, "deletedByUserId" uuid, CONSTRAINT "PK_42d7cd04fe3d2c2e25288483072" PRIMARY KEY ("_id"))`); - await queryRunner.query(`CREATE INDEX "IDX_19d05157cdb68a582d2489bc9e" ON "StatusPageAnnouncementTemplate" ("projectId") `); - await queryRunner.query(`CREATE TABLE "AnnouncementTemplateStatusPage" ("announcementTemplateId" uuid NOT NULL, "statusPageId" uuid NOT NULL, CONSTRAINT "PK_8434706f7e047041ee73a3e8b76" PRIMARY KEY ("announcementTemplateId", "statusPageId"))`); - await queryRunner.query(`CREATE INDEX "IDX_182e3a7c2c910755382971e473" ON "AnnouncementTemplateStatusPage" ("announcementTemplateId") `); - await queryRunner.query(`CREATE INDEX "IDX_d64c5bcc98bd6a09fee1f5b247" ON "AnnouncementTemplateStatusPage" ("statusPageId") `); - await queryRunner.query(`ALTER TABLE "StatusPageAnnouncementTemplate" ADD CONSTRAINT "FK_19d05157cdb68a582d2489bc9e1" FOREIGN KEY ("projectId") REFERENCES "Project"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "StatusPageAnnouncementTemplate" ADD CONSTRAINT "FK_9f1b244a75d53bd2d208934551a" FOREIGN KEY ("createdByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "StatusPageAnnouncementTemplate" ADD CONSTRAINT "FK_ced5ce354456a65d71e39cd8e7d" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "AnnouncementTemplateStatusPage" ADD CONSTRAINT "FK_182e3a7c2c910755382971e4739" FOREIGN KEY ("announcementTemplateId") REFERENCES "StatusPageAnnouncementTemplate"("_id") ON DELETE CASCADE ON UPDATE CASCADE`); - await queryRunner.query(`ALTER TABLE "AnnouncementTemplateStatusPage" ADD CONSTRAINT "FK_d64c5bcc98bd6a09fee1f5b2473" FOREIGN KEY ("statusPageId") REFERENCES "StatusPage"("_id") ON DELETE CASCADE ON UPDATE CASCADE`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE "AnnouncementTemplateStatusPage" DROP CONSTRAINT "FK_d64c5bcc98bd6a09fee1f5b2473"`); - await queryRunner.query(`ALTER TABLE "AnnouncementTemplateStatusPage" DROP CONSTRAINT "FK_182e3a7c2c910755382971e4739"`); - await queryRunner.query(`ALTER TABLE "StatusPageAnnouncementTemplate" DROP CONSTRAINT "FK_ced5ce354456a65d71e39cd8e7d"`); - await queryRunner.query(`ALTER TABLE "StatusPageAnnouncementTemplate" DROP CONSTRAINT "FK_9f1b244a75d53bd2d208934551a"`); - await queryRunner.query(`ALTER TABLE "StatusPageAnnouncementTemplate" DROP CONSTRAINT "FK_19d05157cdb68a582d2489bc9e1"`); - await queryRunner.query(`DROP INDEX "public"."IDX_d64c5bcc98bd6a09fee1f5b247"`); - await queryRunner.query(`DROP INDEX "public"."IDX_182e3a7c2c910755382971e473"`); - await queryRunner.query(`DROP TABLE "AnnouncementTemplateStatusPage"`); - await queryRunner.query(`DROP INDEX "public"."IDX_19d05157cdb68a582d2489bc9e"`); - await queryRunner.query(`DROP TABLE "StatusPageAnnouncementTemplate"`); - } + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `CREATE TABLE "StatusPageAnnouncementTemplate" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "templateName" character varying(100) NOT NULL, "templateDescription" character varying(500), "title" character varying(100) NOT NULL, "description" text NOT NULL, "shouldStatusPageSubscribersBeNotified" boolean NOT NULL DEFAULT true, "createdByUserId" uuid, "deletedByUserId" uuid, CONSTRAINT "PK_42d7cd04fe3d2c2e25288483072" PRIMARY KEY ("_id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_19d05157cdb68a582d2489bc9e" ON "StatusPageAnnouncementTemplate" ("projectId") `, + ); + await queryRunner.query( + `CREATE TABLE "AnnouncementTemplateStatusPage" ("announcementTemplateId" uuid NOT NULL, "statusPageId" uuid NOT NULL, CONSTRAINT "PK_8434706f7e047041ee73a3e8b76" PRIMARY KEY ("announcementTemplateId", "statusPageId"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_182e3a7c2c910755382971e473" ON "AnnouncementTemplateStatusPage" ("announcementTemplateId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_d64c5bcc98bd6a09fee1f5b247" ON "AnnouncementTemplateStatusPage" ("statusPageId") `, + ); + await queryRunner.query( + `ALTER TABLE "StatusPageAnnouncementTemplate" ADD CONSTRAINT "FK_19d05157cdb68a582d2489bc9e1" FOREIGN KEY ("projectId") REFERENCES "Project"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "StatusPageAnnouncementTemplate" ADD CONSTRAINT "FK_9f1b244a75d53bd2d208934551a" FOREIGN KEY ("createdByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "StatusPageAnnouncementTemplate" ADD CONSTRAINT "FK_ced5ce354456a65d71e39cd8e7d" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "AnnouncementTemplateStatusPage" ADD CONSTRAINT "FK_182e3a7c2c910755382971e4739" FOREIGN KEY ("announcementTemplateId") REFERENCES "StatusPageAnnouncementTemplate"("_id") ON DELETE CASCADE ON UPDATE CASCADE`, + ); + await queryRunner.query( + `ALTER TABLE "AnnouncementTemplateStatusPage" ADD CONSTRAINT "FK_d64c5bcc98bd6a09fee1f5b2473" FOREIGN KEY ("statusPageId") REFERENCES "StatusPage"("_id") ON DELETE CASCADE ON UPDATE CASCADE`, + ); + } + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "AnnouncementTemplateStatusPage" DROP CONSTRAINT "FK_d64c5bcc98bd6a09fee1f5b2473"`, + ); + await queryRunner.query( + `ALTER TABLE "AnnouncementTemplateStatusPage" DROP CONSTRAINT "FK_182e3a7c2c910755382971e4739"`, + ); + await queryRunner.query( + `ALTER TABLE "StatusPageAnnouncementTemplate" DROP CONSTRAINT "FK_ced5ce354456a65d71e39cd8e7d"`, + ); + await queryRunner.query( + `ALTER TABLE "StatusPageAnnouncementTemplate" DROP CONSTRAINT "FK_9f1b244a75d53bd2d208934551a"`, + ); + await queryRunner.query( + `ALTER TABLE "StatusPageAnnouncementTemplate" DROP CONSTRAINT "FK_19d05157cdb68a582d2489bc9e1"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_d64c5bcc98bd6a09fee1f5b247"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_182e3a7c2c910755382971e473"`, + ); + await queryRunner.query(`DROP TABLE "AnnouncementTemplateStatusPage"`); + await queryRunner.query( + `DROP INDEX "public"."IDX_19d05157cdb68a582d2489bc9e"`, + ); + await queryRunner.query(`DROP TABLE "StatusPageAnnouncementTemplate"`); + } } diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts index c04d82fa4b..785098f005 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts @@ -277,5 +277,5 @@ export default [ MigrationName1748456937826, MigrationName1749065784320, MigrationName1749133333893, - MigrationName1749813704371 + MigrationName1749813704371, ]; diff --git a/Common/Tests/UI/Components/MarkdownEditor.test.tsx b/Common/Tests/UI/Components/MarkdownEditor.test.tsx index 9c7be68c36..55bd4bcc36 100644 --- a/Common/Tests/UI/Components/MarkdownEditor.test.tsx +++ b/Common/Tests/UI/Components/MarkdownEditor.test.tsx @@ -9,9 +9,9 @@ describe("MarkdownEditor with SpellCheck", () => { + />, ); - + const textarea = screen.getByRole("textbox"); expect(textarea.spellcheck).toBe(true); }); @@ -22,9 +22,9 @@ describe("MarkdownEditor with SpellCheck", () => { initialValue="This is a test with speling errors" placeholder="Enter markdown here..." disableSpellCheck={true} - /> + />, ); - + const textarea = screen.getByRole("textbox"); expect(textarea.spellcheck).toBe(false); }); @@ -35,9 +35,9 @@ describe("MarkdownEditor with SpellCheck", () => { initialValue="This is a test with speling errors" placeholder="Enter markdown here..." disableSpellCheck={false} - /> + />, ); - + let textarea = screen.getByRole("textbox"); expect(textarea.spellcheck).toBe(true); @@ -46,9 +46,9 @@ describe("MarkdownEditor with SpellCheck", () => { initialValue="This is a test with speling errors" placeholder="Enter markdown here..." disableSpellCheck={true} - /> + />, ); - + textarea = screen.getByRole("textbox"); expect(textarea.spellcheck).toBe(false); }); diff --git a/Common/UI/Components/CodeEditor/CodeEditor.tsx b/Common/UI/Components/CodeEditor/CodeEditor.tsx index 4bbf5b073a..951d5cd286 100644 --- a/Common/UI/Components/CodeEditor/CodeEditor.tsx +++ b/Common/UI/Components/CodeEditor/CodeEditor.tsx @@ -96,7 +96,7 @@ const CodeEditor: FunctionComponent = ( const editor = editorRef.current; const domNode = editor.getDomNode(); if (domNode) { - const textareaElement = domNode.querySelector('textarea'); + const textareaElement = domNode.querySelector("textarea"); if (textareaElement) { textareaElement.spellcheck = !props.disableSpellCheck; } @@ -152,12 +152,12 @@ const CodeEditor: FunctionComponent = ( }} onMount={(editor, monaco) => { editorRef.current = editor; - + // Configure spell check for Markdown if (props.type === CodeType.Markdown) { const domNode = editor.getDomNode(); if (domNode) { - const textareaElement = domNode.querySelector('textarea'); + const textareaElement = domNode.querySelector("textarea"); if (textareaElement) { textareaElement.spellcheck = !props.disableSpellCheck; } diff --git a/Dashboard/src/Utils/RouteMap.ts b/Dashboard/src/Utils/RouteMap.ts index 3d602913ab..f4d32ca475 100644 --- a/Dashboard/src/Utils/RouteMap.ts +++ b/Dashboard/src/Utils/RouteMap.ts @@ -1577,10 +1577,12 @@ const RouteMap: Dictionary = { SettingsRoutePath[PageMap.SETTINGS_STATUS_PAGE_ANNOUNCEMENT_TEMPLATES] }`, ), - + [PageMap.SETTINGS_STATUS_PAGE_ANNOUNCEMENT_TEMPLATES_VIEW]: new Route( `/dashboard/${RouteParams.ProjectID}/settings/${ - SettingsRoutePath[PageMap.SETTINGS_STATUS_PAGE_ANNOUNCEMENT_TEMPLATES_VIEW] + SettingsRoutePath[ + PageMap.SETTINGS_STATUS_PAGE_ANNOUNCEMENT_TEMPLATES_VIEW + ] }`, ),