-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: issue while logged in from the dashboard * style: change the style of custom components RadioButton and UploadArea * feat: add no fly zone option while project creation * feat: add package.json to the gitignore * feat: add a MapTools component in map section of create project form * fix: change the order of the step form * feat: add nofly zone upload area in the form * feat: specift required fields * fix: change stepswitcher width for compotibility * feat: remove unused slice * fix: make errors field not required in types * feat: add keyparameters to the form * feat: add no fly zones in define aoi section * feat: add types to formProps * feat: finalize payload for project creation * feat: add dimension while generating task * feat: add react-datepicker package * feat: create a custom date picker component * feat: make watch field not required in useFormPropTypes * refactor: remove code clutter in the project creation from section
- Loading branch information
1 parent
903deb1
commit 295109b
Showing
20 changed files
with
574 additions
and
175 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
18 changes: 14 additions & 4 deletions
18
src/frontend/src/components/CreateProject/FormContents/BasicInformation/index.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
49 changes: 40 additions & 9 deletions
49
src/frontend/src/components/CreateProject/FormContents/Contributions/index.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 |
---|---|---|
@@ -1,31 +1,62 @@ | ||
/* eslint-disable no-unused-vars */ | ||
import { useTypedDispatch, useTypedSelector } from '@Store/hooks'; | ||
import { FlexColumn } from '@Components/common/Layouts'; | ||
import { FormControl, Label, Input } from '@Components/common/FormUI'; | ||
import { setCreateProjectState } from '@Store/actions/createproject'; | ||
import RadioButton from '@Components/common/RadioButton'; | ||
import ErrorMessage from '@Components/common/ErrorMessage'; | ||
import { UseFormPropsType } from '@Components/common/FormUI/types'; | ||
import { setCreateProjectState } from '@Store/actions/createproject'; | ||
import { contributionsOptions } from '@Constants/createProject'; | ||
|
||
export default function Conditions({ formProps }: { formProps: any }) { | ||
export default function Conditions({ | ||
formProps, | ||
}: { | ||
formProps: UseFormPropsType; | ||
}) { | ||
const dispatch = useTypedDispatch(); | ||
|
||
const { register, errors } = formProps; | ||
|
||
const contributionsOption = useTypedSelector( | ||
state => state.createproject.contributionsOption, | ||
); | ||
|
||
return ( | ||
<div className="naxatw-px-10 naxatw-py-5"> | ||
<FlexColumn gap={5} className="naxatw-px-10 naxatw-py-5"> | ||
<FormControl> | ||
<Label>Instructions for Drone Operators</Label> | ||
<Input | ||
placeholder="Enter Instructions for Drone Operators" | ||
{...register('per_task_instructions', { | ||
required: 'Instructions are required', | ||
})} | ||
/> | ||
<ErrorMessage | ||
message={errors?.per_task_instructions?.message as string} | ||
/> | ||
</FormControl> | ||
<RadioButton | ||
topic="Publish" | ||
options={contributionsOptions} | ||
direction="row" | ||
direction="column" | ||
onChangeData={val => { | ||
dispatch(setCreateProjectState({ contributionsOption: val })); | ||
}} | ||
value={contributionsOption} | ||
/> | ||
<FormControl className="naxatw-mt-4 naxatw-gap-1"> | ||
<Label>Deadline for Submission</Label> | ||
<Input placeholder="Enter GSD in meter" /> | ||
<FormControl className="naxatw-gap-1"> | ||
<div className="naxatw-w-full"> | ||
<Label>Deadline for Submission</Label> | ||
<Input | ||
placeholder="Deadline for Submission" | ||
type="date" | ||
className="naxatw-mt-1" | ||
{...register('deadline_at', { | ||
required: 'Deadline forRequired', | ||
})} | ||
/> | ||
</div> | ||
<ErrorMessage message={errors?.deadline_at?.message as string} /> | ||
</FormControl> | ||
</div> | ||
</FlexColumn> | ||
); | ||
} |
Oops, something went wrong.