From 3bc26da2e878315e54253d85f618f4e64ea4a841 Mon Sep 17 00:00:00 2001 From: tienifr Date: Thu, 21 Mar 2024 18:50:16 +0700 Subject: [PATCH 1/7] Bump expensify-common commit hash --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba15feeacae6..d03a76aea00c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,7 +51,7 @@ "date-fns-tz": "^2.0.0", "dom-serializer": "^0.2.2", "domhandler": "^4.3.0", - "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#7bfd55f0ce75a37423119029fde58cfbe57086d9", + "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#33e646dc0f7c9e5a88444c36f8eababa49ca6299", "expo": "^50.0.3", "expo-av": "~13.10.4", "expo-image": "1.10.1", @@ -22986,9 +22986,9 @@ } }, "node_modules/classnames": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.4.0.tgz", - "integrity": "sha512-lWxiIlphgAhTLN657pwU/ofFxsUTOWc2CRIFeoV5st0MGRJHStUnWIUJgDHxjUO/F0mXzGufXIM4Lfu/8h+MpA==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.0.tgz", + "integrity": "sha512-FQuRlyKinxrb5gwJlfVASbSrDlikDJ07426TrfPsdGLvtochowmkbnSFdQGJ2aoXrSetq5KqGV9emvWpy+91xA==" }, "node_modules/clean-css": { "version": "5.3.2", @@ -27269,11 +27269,11 @@ }, "node_modules/expensify-common": { "version": "1.0.0", - "resolved": "git+ssh://git@github.com/Expensify/expensify-common.git#7bfd55f0ce75a37423119029fde58cfbe57086d9", - "integrity": "sha512-v6UnN9yAW6p2996Fvd4AZnMRnisVfjg6ijWzUQue/6JsjSY+MW10oP74hSjD6x32fRrNmMctjy6d5a79bQFdPA==", + "resolved": "git+ssh://git@github.com/Expensify/expensify-common.git#33e646dc0f7c9e5a88444c36f8eababa49ca6299", + "integrity": "sha512-0CVsS0jYTO7Wzh1xVAIfOT5wSN9sgeQLTjdEKDhfpyXXeUyLUsuZ+9iaBWTt6uFaMuzDcVkpJNHrK4s4MEkFxA==", "license": "MIT", "dependencies": { - "classnames": "2.4.0", + "classnames": "2.5.0", "clipboard": "2.0.11", "html-entities": "^2.4.0", "jquery": "3.6.0", @@ -27282,7 +27282,7 @@ "prop-types": "15.8.1", "react": "16.12.0", "react-dom": "16.12.0", - "semver": "^7.5.2", + "semver": "^7.6.0", "simply-deferred": "git+https://github.com/Expensify/simply-deferred.git#77a08a95754660c7bd6e0b6979fdf84e8e831bf5", "ua-parser-js": "^1.0.37", "underscore": "1.13.6" diff --git a/package.json b/package.json index d1974b99b91e..bb6bbe7a8978 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "date-fns-tz": "^2.0.0", "dom-serializer": "^0.2.2", "domhandler": "^4.3.0", - "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#7bfd55f0ce75a37423119029fde58cfbe57086d9", + "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#33e646dc0f7c9e5a88444c36f8eababa49ca6299", "expo": "^50.0.3", "expo-av": "~13.10.4", "expo-image": "1.10.1", From 56d3c884be410a9b14f11db816368301351c16f7 Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 22 Mar 2024 17:22:12 +0700 Subject: [PATCH 2/7] fix: normalize description value to match with report value --- src/pages/tasks/TaskDescriptionPage.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/tasks/TaskDescriptionPage.tsx b/src/pages/tasks/TaskDescriptionPage.tsx index e08d6380bb18..a20036a62eee 100644 --- a/src/pages/tasks/TaskDescriptionPage.tsx +++ b/src/pages/tasks/TaskDescriptionPage.tsx @@ -47,11 +47,12 @@ function TaskDescriptionPage({report, currentUserPersonalDetails}: TaskDescripti const submit = useCallback( (values: FormOnyxValues) => { + const newDescription = parser.htmlToMarkdown(parser.replace(values.description)); // report.description might contain CRLF from the server - if (StringUtils.normalizeCRLF(values.description) !== StringUtils.normalizeCRLF(report?.description) && !isEmptyObject(report)) { + if (StringUtils.normalizeCRLF(newDescription) !== StringUtils.normalizeCRLF(report?.description) && !isEmptyObject(report)) { // Set the description of the report in the store and then call EditTask API // to update the description of the report on the server - Task.editTask(report, {description: values.description}); + Task.editTask(report, {description: newDescription}); } Navigation.dismissModal(report?.reportID); From 2377f43135e5ef8f87d8f2b7e428dea93cf8e26a Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 22 Mar 2024 17:25:53 +0700 Subject: [PATCH 3/7] Bump expensify-common version --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4bff5eaf6eb8..c281ca2672d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,7 +51,7 @@ "date-fns-tz": "^2.0.0", "dom-serializer": "^0.2.2", "domhandler": "^4.3.0", - "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#4e020cfa13ffabde14313c92b341285aeb919f29", + "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#3531e7ba1b20fb0a6e87a83180f87d69d862106a", "expo": "^50.0.3", "expo-av": "~13.10.4", "expo-image": "1.11.0", @@ -27370,8 +27370,8 @@ }, "node_modules/expensify-common": { "version": "1.0.0", - "resolved": "git+ssh://git@github.com/Expensify/expensify-common.git#4e020cfa13ffabde14313c92b341285aeb919f29", - "integrity": "sha512-sx3cIYkmiydNaXRe4kJebPyEje8HfssUbsoB6uW8vvMLwFheCZfkmF9fRMBNLo8BQsfWIstT5TApEhwuWPjqZg==", + "resolved": "git+ssh://git@github.com/Expensify/expensify-common.git#3531e7ba1b20fb0a6e87a83180f87d69d862106a", + "integrity": "sha512-Ho6ffO5YS/BfCajwXIWcIaJ8xtV1bQIuAnBjMAKwgZ6ioYwKxGyUONRJuwwhxhi9Q0HVos9oR3VXgDXwB6TFvw==", "license": "MIT", "dependencies": { "classnames": "2.5.0", diff --git a/package.json b/package.json index 53eb229d7b85..78f8f8f6a89c 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "date-fns-tz": "^2.0.0", "dom-serializer": "^0.2.2", "domhandler": "^4.3.0", - "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#4e020cfa13ffabde14313c92b341285aeb919f29", + "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#3531e7ba1b20fb0a6e87a83180f87d69d862106a", "expo": "^50.0.3", "expo-av": "~13.10.4", "expo-image": "1.11.0", From 5f6b5d3053106df9d2093fb82b2f793021614ac4 Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 25 Mar 2024 11:17:37 +0700 Subject: [PATCH 4/7] Make input description consistent with report description --- src/pages/tasks/TaskDescriptionPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/tasks/TaskDescriptionPage.tsx b/src/pages/tasks/TaskDescriptionPage.tsx index a20036a62eee..e859e3cdfad9 100644 --- a/src/pages/tasks/TaskDescriptionPage.tsx +++ b/src/pages/tasks/TaskDescriptionPage.tsx @@ -47,12 +47,12 @@ function TaskDescriptionPage({report, currentUserPersonalDetails}: TaskDescripti const submit = useCallback( (values: FormOnyxValues) => { - const newDescription = parser.htmlToMarkdown(parser.replace(values.description)); // report.description might contain CRLF from the server - if (StringUtils.normalizeCRLF(newDescription) !== StringUtils.normalizeCRLF(report?.description) && !isEmptyObject(report)) { + // Parse values.description to be consistent with report.description before comparison + if (StringUtils.normalizeCRLF(parser.htmlToMarkdown(parser.replace(values.description))) !== StringUtils.normalizeCRLF(report?.description) && !isEmptyObject(report)) { // Set the description of the report in the store and then call EditTask API // to update the description of the report on the server - Task.editTask(report, {description: newDescription}); + Task.editTask(report, {description: values.description}); } Navigation.dismissModal(report?.reportID); From 48eb297b3e8ca589d8d09d120f2028ec7a21a084 Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 25 Mar 2024 16:20:41 +0700 Subject: [PATCH 5/7] Consistent between input description and report description --- src/pages/tasks/TaskDescriptionPage.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/tasks/TaskDescriptionPage.tsx b/src/pages/tasks/TaskDescriptionPage.tsx index e859e3cdfad9..dc718d29cd7f 100644 --- a/src/pages/tasks/TaskDescriptionPage.tsx +++ b/src/pages/tasks/TaskDescriptionPage.tsx @@ -47,9 +47,7 @@ function TaskDescriptionPage({report, currentUserPersonalDetails}: TaskDescripti const submit = useCallback( (values: FormOnyxValues) => { - // report.description might contain CRLF from the server - // Parse values.description to be consistent with report.description before comparison - if (StringUtils.normalizeCRLF(parser.htmlToMarkdown(parser.replace(values.description))) !== StringUtils.normalizeCRLF(report?.description) && !isEmptyObject(report)) { + if (parser.htmlToMarkdown(parser.replace(values.description)) !== parser.htmlToMarkdown(parser.replace(report?.description ?? '')) && !isEmptyObject(report)) { // Set the description of the report in the store and then call EditTask API // to update the description of the report on the server Task.editTask(report, {description: values.description}); From 782deb0db83356f61f69f6762649d6993bbb9f3b Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 25 Mar 2024 16:29:10 +0700 Subject: [PATCH 6/7] fix lint --- src/pages/tasks/TaskDescriptionPage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/tasks/TaskDescriptionPage.tsx b/src/pages/tasks/TaskDescriptionPage.tsx index dc718d29cd7f..ffc3d5880bba 100644 --- a/src/pages/tasks/TaskDescriptionPage.tsx +++ b/src/pages/tasks/TaskDescriptionPage.tsx @@ -17,7 +17,6 @@ import useThemeStyles from '@hooks/useThemeStyles'; import * as ErrorUtils from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as ReportUtils from '@libs/ReportUtils'; -import StringUtils from '@libs/StringUtils'; import updateMultilineInputRange from '@libs/updateMultilineInputRange'; import withReportOrNotFound from '@pages/home/report/withReportOrNotFound'; import type {WithReportOrNotFoundProps} from '@pages/home/report/withReportOrNotFound'; From 21ec5c147832dd940ee4c75b36dc96bfa97d328f Mon Sep 17 00:00:00 2001 From: tienifr Date: Wed, 27 Mar 2024 14:30:23 +0700 Subject: [PATCH 7/7] Bump expensify-common version --- package-lock.json | 15 ++++++++------- package.json | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index b388c7d4b680..0c822c717659 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,7 +51,7 @@ "date-fns-tz": "^2.0.0", "dom-serializer": "^0.2.2", "domhandler": "^4.3.0", - "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#3531e7ba1b20fb0a6e87a83180f87d69d862106a", + "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#f7efbd084536c140e65b49cd15f67ad8a2a10675", "expo": "^50.0.3", "expo-av": "~13.10.4", "expo-image": "1.11.0", @@ -27370,13 +27370,13 @@ }, "node_modules/expensify-common": { "version": "1.0.0", - "resolved": "git+ssh://git@github.com/Expensify/expensify-common.git#3531e7ba1b20fb0a6e87a83180f87d69d862106a", - "integrity": "sha512-Ho6ffO5YS/BfCajwXIWcIaJ8xtV1bQIuAnBjMAKwgZ6ioYwKxGyUONRJuwwhxhi9Q0HVos9oR3VXgDXwB6TFvw==", + "resolved": "git+ssh://git@github.com/Expensify/expensify-common.git#f7efbd084536c140e65b49cd15f67ad8a2a10675", + "integrity": "sha512-aLrSTuLNmp9yNJUhik/Uia5KaNVBKp7m+DStcPoed4hSe+tMBDT8HMez7PqO5uRC6GPFrbBr77Aa2AQOB7DVqQ==", "license": "MIT", "dependencies": { "classnames": "2.5.0", "clipboard": "2.0.11", - "html-entities": "^2.4.0", + "html-entities": "^2.5.2", "jquery": "3.6.0", "localforage": "^1.10.0", "lodash": "4.17.21", @@ -29529,7 +29529,9 @@ } }, "node_modules/html-entities": { - "version": "2.4.0", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz", + "integrity": "sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA==", "funding": [ { "type": "github", @@ -29539,8 +29541,7 @@ "type": "patreon", "url": "https://patreon.com/mdevils" } - ], - "license": "MIT" + ] }, "node_modules/html-escaper": { "version": "2.0.2", diff --git a/package.json b/package.json index d0560e652451..a900b8602a0d 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "date-fns-tz": "^2.0.0", "dom-serializer": "^0.2.2", "domhandler": "^4.3.0", - "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#3531e7ba1b20fb0a6e87a83180f87d69d862106a", + "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#f7efbd084536c140e65b49cd15f67ad8a2a10675", "expo": "^50.0.3", "expo-av": "~13.10.4", "expo-image": "1.11.0",