From 4c7dd57255ada2c9628bc260a5aa63dee31d409c Mon Sep 17 00:00:00 2001 From: Philip Dengler <44269226+fylip97@users.noreply.github.com> Date: Tue, 2 Jun 2020 15:54:59 +0200 Subject: [PATCH] Closes #643 - Fixed AM edit dialog for latest PrimeReact version (#764) --- .../inspectit-ocelot-configurationserver-ui/package.json | 2 +- .../editComponents/EditSourceComponents/SourceTree.js | 7 ++++--- .../inspectit-ocelot-configurationserver-ui/yarn.lock | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/components/inspectit-ocelot-configurationserver-ui/package.json b/components/inspectit-ocelot-configurationserver-ui/package.json index beac1f0720..2935b924b7 100644 --- a/components/inspectit-ocelot-configurationserver-ui/package.json +++ b/components/inspectit-ocelot-configurationserver-ui/package.json @@ -34,7 +34,7 @@ "next": "^9.3.2", "primeflex": "^1.0.0-rc.1", "primeicons": "^1.0.0", - "primereact": "^3.1.7", + "primereact": "^4.2.1", "prop-types": "^15.7.2", "randexp": "^0.5.3", "react": "^16.7.0", diff --git a/components/inspectit-ocelot-configurationserver-ui/src/components/views/mappings/editComponents/EditSourceComponents/SourceTree.js b/components/inspectit-ocelot-configurationserver-ui/src/components/views/mappings/editComponents/EditSourceComponents/SourceTree.js index a3d11272f6..9d63cf2192 100644 --- a/components/inspectit-ocelot-configurationserver-ui/src/components/views/mappings/editComponents/EditSourceComponents/SourceTree.js +++ b/components/inspectit-ocelot-configurationserver-ui/src/components/views/mappings/editComponents/EditSourceComponents/SourceTree.js @@ -14,6 +14,7 @@ class SourceTree extends React.Component { state = { tree: [treeUtils.rootNode], selectedSources: {}, + initialized: false, }; render() { @@ -28,20 +29,20 @@ class SourceTree extends React.Component { ); } - componentDidUpdate = (prevProps) => { + componentDidUpdate = () => { /** * initializing tree when the component becomes visible * makes it more likely for the files already beeing fetched * and this.props.files to not be empty */ - if (!prevProps.visible && this.props.visible) { + if (!this.state.initialized) { const newTree = [ { ...treeUtils.rootNode, children: cloneDeep(this.props.files), }, ]; - this.setState({ tree: newTree }); + this.setState({ tree: newTree, initialized: true }); return; } diff --git a/components/inspectit-ocelot-configurationserver-ui/yarn.lock b/components/inspectit-ocelot-configurationserver-ui/yarn.lock index aa2c66c42c..e7d096c5ba 100644 --- a/components/inspectit-ocelot-configurationserver-ui/yarn.lock +++ b/components/inspectit-ocelot-configurationserver-ui/yarn.lock @@ -5817,10 +5817,10 @@ primeicons@^1.0.0: resolved "https://registry.yarnpkg.com/primeicons/-/primeicons-1.0.0.tgz#90061f168ef6227f21f0a7db8204ffa85cd27aec" integrity sha512-p/hzIjUVccW4eJPhuORHI3AUkDpqfvCQVrjxbFEejnTEdWY4C8fomVfjiaA9jCu83fSQnBHuRIGB96iAR8R6uA== -primereact@^3.1.7: - version "3.4.0" - resolved "https://registry.yarnpkg.com/primereact/-/primereact-3.4.0.tgz#cbc0534abd4917355975d0213b612df49f44d880" - integrity sha512-XsLkInlYsFSK5/FRAM0JMyJEc+9lyI6feKJLNbQIwpker6mk587T3uwfZd8RYhmUGpj/jKEnZ+3V9tl+PKniAg== +primereact@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/primereact/-/primereact-4.2.1.tgz#535f1baf3729490d33798bb3f7cce954920329b9" + integrity sha512-i8+ZvbbbaZl0gNTCmEkDyCUStBu6sWNjM5wypTKmP5YT0DAL1sLdqiQKQrZGh4elDDMDYJ2Mz6wCjZS34nwcMw== private@^0.1.6, private@^0.1.8: version "0.1.8"