Skip to content

Commit

Permalink
Fix #9016: Catalog modal mode reset (#9028)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsuren1 authored Mar 16, 2023
1 parent e03de6b commit d47abb9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/client/components/catalog/CatalogServiceEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
import React, {useState} from 'react';
import React, {useState, useEffect} from 'react';
import Spinner from "react-spinkit";

import { FormGroup, Form, Col } from "react-bootstrap";
Expand Down Expand Up @@ -52,6 +52,9 @@ export default ({
autoSetVisibilityLimits = false
}) => {
const [valid, setValid] = useState(true);
useEffect(() => {
return () => onChangeCatalogMode("view");
}, []);
return (<BorderLayout
bodyClassName="ms2-border-layout-body catalog"
header={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,13 @@ describe('Test CatalogServiceEditor', () => {
let placeholder = defaultPlaceholder(service);
expect(placeholder).toBe("e.g. https://mydomain.com/geoserver/wms");
});
it('test reset view mode of catalog on unmount', (done) => {
ReactDOM.render(<CatalogServiceEditor onChangeCatalogMode={(value) => {
expect(value).toBe("view");
done();
}
} />, document.getElementById("container"));

ReactDOM.render(<div/>, document.getElementById("container"));
});
});

0 comments on commit d47abb9

Please sign in to comment.