-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #451 from hotosm/feat/overall-orthophoto
Feat/Visualize task's and overall project orthophoto, options to start processing without GCP and other relative changes
- Loading branch information
Showing
12 changed files
with
264 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/frontend/src/components/IndividualProject/ModalContent/ChooseProcessingParameter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import RadioButton from '@Components/common/RadioButton'; | ||
import { Button } from '@Components/RadixComponents/Button'; | ||
import { startProcessingOptions } from '@Constants/projectDescription'; | ||
import { processAllImagery } from '@Services/project'; | ||
import { toggleModal } from '@Store/actions/common'; | ||
import { setProjectState } from '@Store/actions/project'; | ||
import { useMutation, useQueryClient } from '@tanstack/react-query'; | ||
import { useState } from 'react'; | ||
import { useDispatch } from 'react-redux'; | ||
import { toast } from 'react-toastify'; | ||
|
||
const ChooseProcessingParameter = () => { | ||
const dispatch = useDispatch(); | ||
const queryClient = useQueryClient(); | ||
const pathname = window.location.pathname?.split('/'); | ||
const projectId = pathname?.[2]; | ||
|
||
const [value, setValue] = useState('with_gcp'); | ||
const { mutate: startImageProcessing } = useMutation({ | ||
mutationFn: processAllImagery, | ||
onSuccess: () => { | ||
queryClient.invalidateQueries({ queryKey: ['project-detail'] }); | ||
toast.success('Processing started'); | ||
}, | ||
}); | ||
|
||
return ( | ||
<div> | ||
<p className="naxatw-text-sm naxatw-text-[#7A7676]"> | ||
Choose Processing Parameter | ||
</p> | ||
<div className="naxatw-py-1 naxatw-text-gray-700"> | ||
<RadioButton | ||
className="!naxatw-text-black" | ||
options={startProcessingOptions} | ||
direction="column" | ||
onChangeData={selectedValue => setValue(selectedValue)} | ||
value={value} | ||
/> | ||
</div> | ||
<div className="naxatw naxatw-flex naxatw-justify-center naxatw-pt-3"> | ||
<Button | ||
withLoader | ||
className="naxatw-bg-red" | ||
onClick={() => { | ||
if (value === 'with_gcp') { | ||
dispatch(setProjectState({ showGcpEditor: true })); | ||
} else { | ||
startImageProcessing({ projectId }); | ||
} | ||
dispatch(toggleModal()); | ||
}} | ||
> | ||
Proceed | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ChooseProcessingParameter; |
Oops, something went wrong.