Skip to content
Snippets Groups Projects
Commit 53e4dee6 authored by Reinder Kraaij's avatar Reinder Kraaij :eye:
Browse files

add Cross related Jump to SUID

parent 9a1aa4a4
No related branches found
No related tags found
1 merge request!1323add Cross related Jump to SUID
......@@ -189,6 +189,7 @@ export default function WeekView(props) {
//timeline item pop-over component
const [mouseOverItem, setMouseOverItem] = useState()
const [popPosition, setPopPosition] = useState({ display: 'none' })
const [requestedFocusOnDUID, setRequestedFocusOnDUID] = useState()
const [summaryItem, setSummaryItem] = useState()
//marker that also displays time information on thge group
......@@ -228,6 +229,22 @@ export default function WeekView(props) {
}, [isExpanded])
useEffect(() => {
if (requestedFocusOnDUID && items?.schedulingUnitItems?.length>0) {
const schedulingunit = items.schedulingUnitItems.find(function(schedulingunit) {
return schedulingunit.suId === requestedFocusOnDUID;
});
if (schedulingunit?.missing_stations) {
setSummaryItem( { id: requestedFocusOnDUID, item: schedulingunit} )
setRequestedFocusOnDUID(undefined);
}
}
},[requestedFocusOnDUID,items])
useEffect(
() => {
async function GetDateToolTipForMouseOver() {
......@@ -323,6 +340,10 @@ export default function WeekView(props) {
}
// websocket handling
......@@ -364,6 +385,8 @@ export default function WeekView(props) {
}));
}
......@@ -431,6 +454,7 @@ export default function WeekView(props) {
startTime={startTime}
setStartTime={setStartTime}
setEndTime={setEndTime}
setJumptoSuIdCallBack={setRequestedFocusOnDUID}
/>
<ZoomAndMove timelineStore={timelineStore}
startTime={startTime}
......
......@@ -89,11 +89,14 @@ function changeStartAndEndTimeCallback(setStartTime, setEndTime) {
};
}
export default function DateTimeNavigator(props) {
const {
startTime,
setStartTime,
setEndTime
setEndTime,
setJumptoSuIdCallBack
} = props
......@@ -116,8 +119,14 @@ export default function DateTimeNavigator(props) {
}
if (suIdInput) {
fetchStartTimeOfSUId(suIdInput).catch(e => console.error("Couldn't fetch the start time for SU id:", suIdInput, e))
}
fetchStartTimeOfSUId(suIdInput)
.then(() => {
// Do something with the startTime if needed
// Call your function here since there are no errors
setJumptoSuIdCallBack(suIdInput);
})
.catch(e => console.error("Couldn't fetch the start time for SU id:", suIdInput, e));
}
}, [searchForSUIdTrigger])
return <div className="p-grid timeline-datetime-navigator">
......@@ -138,5 +147,6 @@ export default function DateTimeNavigator(props) {
DateTimeNavigator.propTypes = {
startTime: PropTypes.any,
setStartTime: PropTypes.func,
setEndTime: PropTypes.func
setEndTime: PropTypes.func,
setJumptoSuIdCallBack:PropTypes.func
}
\ No newline at end of file
......@@ -87,14 +87,6 @@ export class ShowErrorDetails extends Component {
}
ShowErrorDetails.propTypes = {
response: PropTypes.shape({
request: PropTypes.shape({
response: PropTypes.shape({
size: PropTypes.any
})
}),
status: PropTypes.any,
statusText: PropTypes.any
})
response: PropTypes.any
}
export default ShowErrorDetails;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment