Skip to content

Commit

Permalink
fix: Show re-upload section if image upload is failed (#417)
Browse files Browse the repository at this point in the history
* feat: show re-upload section if the image count is >0 and task status is still `LOCKED_FOR_MAPPING`

if image count is >0 and status is same it indicates that all images upload is failed so it couldnt trigger the status update api

so display re-upload section if image count is >0 and status is `LOCKED_FOR_MAPPING`

* fix: download menu hidden on mobile view

 reduce waypoint mode switcher z-index
  • Loading branch information
suzit-10 authored Dec 31, 2024
1 parent 95e4b8a commit aefebf7
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,12 @@ const DescriptionBox = () => {
},
{
name: 'Image Status',
value: formatString(taskAssetsInformation?.state),
value:
// if the state is LOCKED_FOR_MAPPING and has a image count it means the images are not fully uploaded
taskAssetsInformation?.state === 'LOCKED_FOR_MAPPING' &&
taskAssetsInformation?.image_count > 0
? 'Image Uploading Failed'
: formatString(taskAssetsInformation?.state),
},
]}
/>
Expand Down Expand Up @@ -295,43 +300,45 @@ const DescriptionBox = () => {
</Button>
</div>
)}
{taskAssetsInformation?.state === 'IMAGE_PROCESSING_FAILED' ||
(taskAssetsInformation?.state === 'IMAGE_UPLOADED' && (
<div className="naxatw-flex naxatw-flex-col naxatw-gap-1 naxatw-pb-4">
<Label>
<p className="naxatw-text-[0.875rem] naxatw-font-semibold naxatw-leading-normal naxatw-tracking-[0.0175rem] naxatw-text-[#D73F3F]">
Upload Images
</p>
</Label>
<SwitchTab
options={[
{
name: 'image-upload-for',
value: 'add',
label: 'Add to existing',
},
{
name: 'image-upload-for',
value: 'replace',
label: 'Replace existing',
},
]}
valueKey="value"
selectedValue={uploadedImageType}
activeClassName="naxatw-bg-red naxatw-text-white"
onChange={(selected: Record<string, any>) => {
dispatch(setUploadedImagesType(selected.value));
}}
/>
<p className="naxatw-px-1 naxatw-py-1 naxatw-text-xs">
Note:{' '}
{uploadedImageType === 'add'
? 'Uploaded images will be added with the existing images.'
: 'Uploaded images will be replaced with all the existing images and starts processing.'}
{(taskAssetsInformation?.state === 'IMAGE_PROCESSING_FAILED' ||
// if the state is LOCKED_FOR_MAPPING and has a image count it means all selected images are not uploaded and the status updating api call is interrupted so need to give user to upload the remaining images
taskAssetsInformation?.state === 'LOCKED_FOR_MAPPING' ||
taskAssetsInformation?.state === 'IMAGE_UPLOADED') && (
<div className="naxatw-flex naxatw-flex-col naxatw-gap-1 naxatw-pb-4">
<Label>
<p className="naxatw-text-[0.875rem] naxatw-font-semibold naxatw-leading-normal naxatw-tracking-[0.0175rem] naxatw-text-[#D73F3F]">
Upload Images
</p>
<UploadsBox label="" />
</div>
))}
</Label>
<SwitchTab
options={[
{
name: 'image-upload-for',
value: 'add',
label: 'Add to existing',
},
{
name: 'image-upload-for',
value: 'replace',
label: 'Replace existing',
},
]}
valueKey="value"
selectedValue={uploadedImageType}
activeClassName="naxatw-bg-red naxatw-text-white"
onChange={(selected: Record<string, any>) => {
dispatch(setUploadedImagesType(selected.value));
}}
/>
<p className="naxatw-px-1 naxatw-py-1 naxatw-text-xs">
Note:{' '}
{uploadedImageType === 'add'
? 'Uploaded images will be added with the existing images.'
: 'Uploaded images will be replaced with all the existing images and starts processing.'}
</p>
<UploadsBox label="" />
</div>
)}
</div>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ const MapSection = ({ className }: { className?: string }) => {
getCoordOnProperties
/>

<div className="naxatw-absolute naxatw-right-3 naxatw-top-3 naxatw-z-40 lg:naxatw-right-64">
<div className="naxatw-absolute naxatw-right-3 naxatw-top-3 naxatw-z-10 lg:naxatw-right-64">
<SwitchTab
activeClassName="naxatw-bg-red naxatw-text-white"
options={waypointModeOptions}
Expand Down

0 comments on commit aefebf7

Please sign in to comment.