From 251f1342d2ff3ee68b2124089a5de9f85df52e4e Mon Sep 17 00:00:00 2001 From: caneppelevitor Date: Mon, 1 Jul 2024 22:05:04 -0300 Subject: [PATCH 1/6] Removed autoLink to do not allow explict links on the text and refactored markUp source logic to even work when the mark dosen't have an id --- lib/editor-parser.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/editor-parser.ts b/lib/editor-parser.ts index 99650ae9d..1379922ef 100644 --- a/lib/editor-parser.ts +++ b/lib/editor-parser.ts @@ -253,6 +253,7 @@ export class EditorParser { schema, { type, content: cardContent }: RemirrorJSON ) { + let sourceCounter = 0; const sourceContent = []; for (const { content } of cardContent) { if (content) { @@ -262,7 +263,7 @@ export class EditorParser { ...this.getSourcesFromEditorMarks(text, type, marks) ); const markId = marks.map( - ({ attrs }: ObjectMark) => attrs.id + () => `source${sourceCounter++}` ); // Pushing the text into content with markup based on its source id @@ -301,7 +302,7 @@ export class EditorParser { textRange: this.findTextRange( schema[field], textRange, - id + index ), targetText: textRange, sup: index + 1, @@ -314,9 +315,9 @@ export class EditorParser { return newSources.sort((a, b) => a.sup - b.sup); } - findTextRange(content, textTarget, sourceId) { + findTextRange(content, textTarget, index) { const contentArray = Array.isArray(content) ? content : [content]; - const markUpText = `{{${sourceId}|${textTarget}}}`; + const markUpText = `{{source${index}|${textTarget}}}`; // Looks for the specific text with the right markup and returns the range of the marked-up text return contentArray.flatMap((c) => { From 65071891c2e72cd03f2ddb832db35a781b60f78a Mon Sep 17 00:00:00 2001 From: caneppelevitor Date: Tue, 2 Jul 2024 00:07:26 -0300 Subject: [PATCH 2/6] Updated existing tests --- server/editor-parse/editor-parse.service.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/editor-parse/editor-parse.service.spec.ts b/server/editor-parse/editor-parse.service.spec.ts index 4600bda21..c37c50131 100644 --- a/server/editor-parse/editor-parse.service.spec.ts +++ b/server/editor-parse/editor-parse.service.spec.ts @@ -19,7 +19,7 @@ describe("ParserService", () => { href: "https://google.com", props: { field: "report", - textRange: [16, 39], + textRange: [16, 38], targetText: "duplicated", sup: 1, id: "uniqueId", @@ -28,7 +28,7 @@ describe("ParserService", () => { ], questions: ["teste1", "testekakaka ava"], summary: "teste4", - report: "duplicated word {{uniqueId|duplicated}}", + report: "duplicated word {{source0|duplicated}}", verification: "teste3", }; From 4119711f972bae194d10fde250951c79ad69f58e Mon Sep 17 00:00:00 2001 From: Mateus Santos Date: Tue, 2 Jul 2024 17:59:07 +0200 Subject: [PATCH 3/6] Revert "HotFix: Refactored MarkUp Sources Logic" --- lib/editor-parser.ts | 9 ++++----- server/editor-parse/editor-parse.service.spec.ts | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/editor-parser.ts b/lib/editor-parser.ts index 1379922ef..99650ae9d 100644 --- a/lib/editor-parser.ts +++ b/lib/editor-parser.ts @@ -253,7 +253,6 @@ export class EditorParser { schema, { type, content: cardContent }: RemirrorJSON ) { - let sourceCounter = 0; const sourceContent = []; for (const { content } of cardContent) { if (content) { @@ -263,7 +262,7 @@ export class EditorParser { ...this.getSourcesFromEditorMarks(text, type, marks) ); const markId = marks.map( - () => `source${sourceCounter++}` + ({ attrs }: ObjectMark) => attrs.id ); // Pushing the text into content with markup based on its source id @@ -302,7 +301,7 @@ export class EditorParser { textRange: this.findTextRange( schema[field], textRange, - index + id ), targetText: textRange, sup: index + 1, @@ -315,9 +314,9 @@ export class EditorParser { return newSources.sort((a, b) => a.sup - b.sup); } - findTextRange(content, textTarget, index) { + findTextRange(content, textTarget, sourceId) { const contentArray = Array.isArray(content) ? content : [content]; - const markUpText = `{{source${index}|${textTarget}}}`; + const markUpText = `{{${sourceId}|${textTarget}}}`; // Looks for the specific text with the right markup and returns the range of the marked-up text return contentArray.flatMap((c) => { diff --git a/server/editor-parse/editor-parse.service.spec.ts b/server/editor-parse/editor-parse.service.spec.ts index c37c50131..4600bda21 100644 --- a/server/editor-parse/editor-parse.service.spec.ts +++ b/server/editor-parse/editor-parse.service.spec.ts @@ -19,7 +19,7 @@ describe("ParserService", () => { href: "https://google.com", props: { field: "report", - textRange: [16, 38], + textRange: [16, 39], targetText: "duplicated", sup: 1, id: "uniqueId", @@ -28,7 +28,7 @@ describe("ParserService", () => { ], questions: ["teste1", "testekakaka ava"], summary: "teste4", - report: "duplicated word {{source0|duplicated}}", + report: "duplicated word {{uniqueId|duplicated}}", verification: "teste3", }; From b1b5b3c6ce184f19a564f2b63ef446dd574e7ae3 Mon Sep 17 00:00:00 2001 From: pepermao Date: Mon, 24 Jun 2024 20:01:45 +0200 Subject: [PATCH 4/6] Created group and verification requests models Created verification request workflow Included verification request group in claim schema Now claims can be create based on a group of verification requests Created Feature flag module --- src/components/ClaimReview/ClaimReviewHeader.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/ClaimReview/ClaimReviewHeader.tsx b/src/components/ClaimReview/ClaimReviewHeader.tsx index 1811f52af..04e8d3d24 100644 --- a/src/components/ClaimReview/ClaimReviewHeader.tsx +++ b/src/components/ClaimReview/ClaimReviewHeader.tsx @@ -66,6 +66,7 @@ const ClaimReviewHeader = ({ order: 1, span: 24, }} + style={{ padding: 32 }} md={{ order: 2, span: 24 }} sm={{ order: 2, span: 24 }} xs={{ order: 2, span: 24 }} From 7a77db33314c277aad65257a1bd7748b65429fd2 Mon Sep 17 00:00:00 2001 From: pepermao Date: Mon, 24 Jun 2024 22:20:48 +0200 Subject: [PATCH 5/6] Resolved conversation Improved user interface --- src/components/ClaimReview/ClaimReviewHeader.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/ClaimReview/ClaimReviewHeader.tsx b/src/components/ClaimReview/ClaimReviewHeader.tsx index 04e8d3d24..1811f52af 100644 --- a/src/components/ClaimReview/ClaimReviewHeader.tsx +++ b/src/components/ClaimReview/ClaimReviewHeader.tsx @@ -66,7 +66,6 @@ const ClaimReviewHeader = ({ order: 1, span: 24, }} - style={{ padding: 32 }} md={{ order: 2, span: 24 }} sm={{ order: 2, span: 24 }} xs={{ order: 2, span: 24 }} From a5f1f473f74d9398691e9816f610c13077e33e46 Mon Sep 17 00:00:00 2001 From: pepermao Date: Fri, 5 Jul 2024 16:42:05 +0200 Subject: [PATCH 6/6] Fixed machine value object reference --- server/review-task/review-task.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/review-task/review-task.service.ts b/server/review-task/review-task.service.ts index 9fd2b4146..95057e8e8 100644 --- a/server/review-task/review-task.service.ts +++ b/server/review-task/review-task.service.ts @@ -727,7 +727,7 @@ export class ReviewTaskService { const loggedInUser = this.req.user; if ( - reviewTaskMachine.value === "published" && + reviewTaskMachine.machine.value === "published" && reportModel !== ReportModelEnum.Request ) { if (