Skip to content

Commit

Permalink
Fix the issue that clear content when paste the same content in names…
Browse files Browse the repository at this point in the history
…pace (#4922)

* Fix the issue that clear content when paste the same content in namespace (#4919)

* Update CHANGES.md

* Update apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js

* Update CHANGES.md

---------

Co-authored-by: Jason Song <nobodyiam@gmail.com>
  • Loading branch information
BlueSodaWater and nobodyiam authored Jul 2, 2023
1 parent d3d17ee commit c423d35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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)
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

}
Expand Down

0 comments on commit c423d35

Please sign in to comment.