From 9703e76e673a607e7916c64716365ffd1f172f8a Mon Sep 17 00:00:00 2001 From: BlueSodaWater <835059949@qq.com> Date: Sun, 2 Jul 2023 13:34:51 +0800 Subject: [PATCH 1/4] Fix the issue that clear content when paste the same content in namespace (#4919) --- CHANGES.md | 1 + .../scripts/directive/namespace-panel-directive.js | 12 ++---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index dda6ea314c7..356786ab9de 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -28,6 +28,7 @@ Apollo 2.2.0 * [Bump springboot version from 2.7.9 to 2.7.11](https://github.com/apolloconfig/apollo/pull/4828) * [[Multi-Database Support][h2] Support run on h2](https://github.com/apolloconfig/apollo/pull/4851) * [Fix the issue that env special case handling is missing in some case](https://github.com/apolloconfig/apollo/pull/4887) +* [Fix the issue that clear content when paste the same content in namespace](https://github.com/apolloconfig/apollo/pull/4922) ------------------ All issues and pull requests are [here](https://github.com/apolloconfig/apollo/milestone/13?closed=1) \ No newline at end of file diff --git a/apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js b/apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js index 974c599d5f2..9254d861ef6 100644 --- a/apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js +++ b/apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js @@ -989,16 +989,8 @@ function directive($window, $translate, toastr, AppUtil, EventManager, Permissio }) }, onChange: function (e) { - if ((e[0].action === 'insert') && (scope.namespace.hasOwnProperty("editText")) && (scope.namespace.editText.length === 0)) { - let text = '' - for (let i = 0; i < e[0].lines.length; i++) { - if (i === 0) { - text = e[0].lines[0] - } else { - text += '\r\n' + e[0].lines[i] - } - } - scope.namespace.editText = text + if ((e[0].action === 'insert') && (scope.namespace.hasOwnProperty("editText"))) { + scope.namespace.editText = e[1].session.getValue() } } From 1e49ae977dd446aded0707974776c77eb70b69ce Mon Sep 17 00:00:00 2001 From: Jason Song Date: Sun, 2 Jul 2023 22:27:09 +0800 Subject: [PATCH 2/4] Update CHANGES.md --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 356786ab9de..15bfd6a50ee 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -28,7 +28,7 @@ Apollo 2.2.0 * [Bump springboot version from 2.7.9 to 2.7.11](https://github.com/apolloconfig/apollo/pull/4828) * [[Multi-Database Support][h2] Support run on h2](https://github.com/apolloconfig/apollo/pull/4851) * [Fix the issue that env special case handling is missing in some case](https://github.com/apolloconfig/apollo/pull/4887) -* [Fix the issue that clear content when paste the same content in namespace](https://github.com/apolloconfig/apollo/pull/4922) +* [Fix the issue that namespace content being cleared when identical content is pasted into the namespace.](https://github.com/apolloconfig/apollo/pull/4922) ------------------ All issues and pull requests are [here](https://github.com/apolloconfig/apollo/milestone/13?closed=1) \ No newline at end of file From 2b99443d1d765cc8c52aa4bd2e86eb71eef7fc6a Mon Sep 17 00:00:00 2001 From: Jason Song Date: Sun, 2 Jul 2023 22:32:48 +0800 Subject: [PATCH 3/4] Update apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js --- .../static/scripts/directive/namespace-panel-directive.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js b/apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js index 9254d861ef6..80ace173339 100644 --- a/apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js +++ b/apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js @@ -990,7 +990,7 @@ function directive($window, $translate, toastr, AppUtil, EventManager, Permissio }, onChange: function (e) { if ((e[0].action === 'insert') && (scope.namespace.hasOwnProperty("editText"))) { - scope.namespace.editText = e[1].session.getValue() + scope.namespace.editText = e[1].session.getValue(); } } From a684c9c53676a6172d8236072d3829d85c5e4da8 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Sun, 2 Jul 2023 22:40:03 +0800 Subject: [PATCH 4/4] Update CHANGES.md --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 15bfd6a50ee..37b3715e34e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -28,7 +28,7 @@ Apollo 2.2.0 * [Bump springboot version from 2.7.9 to 2.7.11](https://github.com/apolloconfig/apollo/pull/4828) * [[Multi-Database Support][h2] Support run on h2](https://github.com/apolloconfig/apollo/pull/4851) * [Fix the issue that env special case handling is missing in some case](https://github.com/apolloconfig/apollo/pull/4887) -* [Fix the issue that namespace content being cleared when identical content is pasted into the namespace.](https://github.com/apolloconfig/apollo/pull/4922) +* [Fix the issue that namespace content being cleared when identical content is pasted into the namespace](https://github.com/apolloconfig/apollo/pull/4922) ------------------ All issues and pull requests are [here](https://github.com/apolloconfig/apollo/milestone/13?closed=1) \ No newline at end of file