Skip to content

Commit

Permalink
Remove obsolete getStratigraphiesByBorehole function (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
danjov authored Dec 7, 2023
2 parents b43c76a + fcee1a9 commit d818ac4
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 313 deletions.
1 change: 0 additions & 1 deletion src/api-legacy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
from bms.v1.borehole.identifier import IdentifierViewerHandler

# Stratigraphy's ACTION Handlers
from bms.v1.borehole.stratigraphy.viewer import StratigraphyViewerHandler
from bms.v1.borehole.stratigraphy.producer import StratigraphyProducerHandler

# Profiles's ACTION Handlers
Expand Down
2 changes: 0 additions & 2 deletions src/api-legacy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ async def close(application):
IdentifierViewerHandler,

# Stratigraphy handlers
StratigraphyViewerHandler,
StratigraphyProducerHandler,

# Layer handlers
Expand Down Expand Up @@ -220,7 +219,6 @@ async def close(application):
(r'/api/v1/feedback', FeedbackHandler),

# Stratigraphy handlers (will be deprecated)
(r'/api/v1/borehole/stratigraphy', StratigraphyViewerHandler),
(r'/api/v1/borehole/stratigraphy/edit', StratigraphyProducerHandler),

# Layer handlers (will be deprecated)
Expand Down
1 change: 0 additions & 1 deletion src/api-legacy/v1/borehole/stratigraphy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# Actions
from bms.v1.borehole.stratigraphy.addbedrock import AddBedrock
from bms.v1.borehole.stratigraphy.list import ListStratigraphies
from bms.v1.borehole.stratigraphy.create import CreateStratigraphy
from bms.v1.borehole.stratigraphy.delete import DeleteStratigraphy
from bms.v1.borehole.stratigraphy.clone import CloneStratigraphy
Expand Down
188 changes: 0 additions & 188 deletions src/api-legacy/v1/borehole/stratigraphy/list.py

This file was deleted.

33 changes: 0 additions & 33 deletions src/api-legacy/v1/borehole/stratigraphy/viewer.py

This file was deleted.

9 changes: 0 additions & 9 deletions src/client/src/api-lib/actions/stratigraphy.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import { fetch } from "./index";

export function getStratigraphiesByBorehole(id) {
return fetch("/borehole/stratigraphy", {
action: "LIST",
filter: {
borehole: id,
},
});
}

// Create a new stratigraphy for the given borehole id
export function createStratigraphy(id, kind = null) {
return fetch("/borehole/stratigraphy/edit", {
Expand Down
2 changes: 0 additions & 2 deletions src/client/src/api-lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ import {
} from "./actions/workflow";

import {
getStratigraphiesByBorehole,
createStratigraphy,
deleteStratigraphy,
addBedrock,
Expand Down Expand Up @@ -165,7 +164,6 @@ export {
submitWorkflow,
rejectWorkflow,
resetWorkflow,
getStratigraphiesByBorehole,
createStratigraphy,
deleteStratigraphy,
addBedrock,
Expand Down
5 changes: 1 addition & 4 deletions src/client/src/commons/detail/detailsComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,7 @@ class DetailsComponent extends React.Component {
paddingBottom: "1em",
overflowY: "hidden",
}}>
<StratigraphiesComponent
data={detail}
stratigraphies={detail.stratigraphies}
/>
<StratigraphiesComponent data={detail} />
</div>,
]
) : detail.isFetching === true ? (
Expand Down
44 changes: 1 addition & 43 deletions src/client/src/commons/detail/detailsContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@ import { connect } from "react-redux";
import _ from "lodash";
import DetailsComponent from "./detailsComponent";

import { getBorehole, getStratigraphiesByBorehole } from "../../api-lib/index";
import { getBorehole } from "../../api-lib/index";

class DetailsContainer extends React.Component {
componentDidMount() {
const { id } = this.props;
if (!_.isNil(id)) {
this.props.getBorehole(id);
// this.props.getStratigraphiesByBorehole(id);
}
}
componentDidUpdate(prevProps) {
const { id, detail } = this.props;
if (detail.borehole !== null && id !== null && detail.borehole.id !== id) {
this.props.getBorehole(id);
// this.props.getStratigraphiesByBorehole(id);
} else if (detail.error !== null) {
}
}
Expand All @@ -38,7 +36,6 @@ DetailsContainer.propTypes = {
detail: PropTypes.object,
domains: PropTypes.object,
getBorehole: PropTypes.func,
getStratigraphiesByBorehole: PropTypes.func,
id: PropTypes.number,
};

Expand Down Expand Up @@ -71,23 +68,6 @@ const mapDispatchToProps = dispatch => {
type: "GETBOREHOLEDETAILS_OK",
borehole: response.data.data,
});
getStratigraphiesByBorehole(id)
.then(function (response) {
if (response.data.success) {
dispatch({
type: "GET_BOREHOLE_STRATIGRAPHIES_OK",
stratigraphies: response.data.data,
});
} else {
dispatch({
type: "GET_BOREHOLE_STRATIGRAPHIES_ERROR",
message: response.message,
});
}
})
.catch(function (error) {
console.log(error);
});
} else {
dispatch({
type: "GETBOREHOLEDETAILS_ERROR",
Expand All @@ -100,28 +80,6 @@ const mapDispatchToProps = dispatch => {
});
}
},
getStratigraphiesByBorehole: id => {
dispatch({
type: "GET_BOREHOLE_STRATIGRAPHIES",
});
getStratigraphiesByBorehole(id)
.then(function (response) {
if (response.data.success) {
dispatch({
type: "GET_BOREHOLE_STRATIGRAPHIES_OK",
stratigraphies: response.data.data,
});
} else {
dispatch({
type: "GET_BOREHOLE_STRATIGRAPHIES_ERROR",
message: response.message,
});
}
})
.catch(function (error) {
console.log(error);
});
},
};
};

Expand Down
Loading

0 comments on commit d818ac4

Please sign in to comment.