Skip to content

Commit

Permalink
Closes #643 - Fixed AM edit dialog for latest PrimeReact version (#764)
Browse files Browse the repository at this point in the history
  • Loading branch information
fylip97 authored Jun 2, 2020
1 parent d0a55b0 commit 4c7dd57
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class SourceTree extends React.Component {
state = {
tree: [treeUtils.rootNode],
selectedSources: {},
initialized: false,
};

render() {
Expand All @@ -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;
}

Expand Down
8 changes: 4 additions & 4 deletions components/inspectit-ocelot-configurationserver-ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4c7dd57

Please sign in to comment.