Skip to content

Commit

Permalink
feat: new fields in new operation, API changes pending CU-6jt1h1
Browse files Browse the repository at this point in the history
  • Loading branch information
mbetancurt committed Jul 13, 2020
1 parent 2d327d8 commit c506c21
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 18 deletions.
11 changes: 5 additions & 6 deletions cypress/integration/map_createnewoperation.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ describe('Use Case 01A: Create New Operation (valid)', function () {
});
it('Define Volume Info', function () {
cy.get('[data-test-id="rightAreaOpener"]').click();
cy.get('[data-test-id="map#editor#volume#info#min_altitude"]').clear().type('-1');
//cy.get('[data-test-id="map#editor#volume#info#min_altitude"]').clear().type('-1');
cy.get('[data-test-id="map#editor#volume#info#max_altitude"]').clear().type('50');
cy.get('[data-test-id="map#editor#volume#info#near_structure"]').check({force: true});
cy.get('[data-test-id="map#editor#volume#info#bvlos"]').check({force: true});
//cy.get('[data-test-id="map#editor#volume#info#near_structure"]').check({force: true});
//cy.get('[data-test-id="map#editor#volume#info#bvlos"]').check({force: true});
cy.get('[data-test-id="map#editor#volume#info#effective_time_begin"]').click();
cy.get('.DayPicker-Day')
.not('.DayPicker-Day--disabled')
Expand All @@ -65,9 +65,6 @@ describe('Use Case 01A: Create New Operation (valid)', function () {
.first().click();
});
it('Complete Volume information', function () {
cy.get('[data-test-id="mapInputEditorName"]')
.clear()
.type('CreateNewOp#01');
//cy.get('[data-test-id="mapInputEditorVolumeDescr"]').
cy.get('[data-test-id="mapInputEditorFlightNumber"]')
.clear()
Expand All @@ -78,6 +75,8 @@ describe('Use Case 01A: Create New Operation (valid)', function () {
cy.get('[data-test-id="map#editor#operation#info#contact_phone"]')
.clear()
.type('09123456');
cy.get('[data-test-id="map#editor#operation#info#name"]').clear().type('CreateNewOp#01');
cy.get('[data-test-id="map#editor#operation#info#flight_coments"]').clear().type('CreateNewOp#FC');
});
it('Finish and add', function () {
cy.contains('finish').click();
Expand Down
36 changes: 30 additions & 6 deletions src/map/editor/OperationInfoEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,28 @@ function OperationInfoEditor({info, setInfo, volumeInfo, setVolumeInfo, saveOper
simpleChildren={false}
forceOpen={true}
>
{/* "flight_comments": "Untitled" */}
<FormGroup
className={styles.sidebarButtonText}
label={t('editor.operation.name')}
labelFor="flight_comments"
labelFor="name"
>
<InputGroup
id="flight_comments"
data-test-id="mapInputEditorName"
value={info.flight_comments}
onChange={(evt) => editInfo('flight_comments', evt.target.value)}
id="name"
data-test-id="map#editor#operation#info#name"
value={info.name}
onChange={(evt) => editInfo('name', evt.target.value)}
/>
</FormGroup>
<FormGroup
className="rightAreaButtonText"
label={t('editor.operation.username')}
labelFor="name"
>
<InputGroup
id="pilot"
data-test-id="map#editor#operation#info#pilot"
value={info.pilot}
onChange={(evt) => editInfo('pilot', evt.target.value)}
/>
</FormGroup>
{/* "flight_number": "12345678" */}
Expand Down Expand Up @@ -85,6 +96,19 @@ function OperationInfoEditor({info, setInfo, volumeInfo, setVolumeInfo, saveOper
onChange={(evt) => editInfo('contact_phone', evt.target.value)}
/>
</FormGroup>
{/* "flight_comments": "Untitled" */}
<FormGroup
className="rightAreaButtonText"
label={t('editor.operation.flight_comments')}
labelFor="flight_comments"
>
<InputGroup
id="flight_comments"
data-test-id="map#editor#operation#info#flight_comments"
value={info.flight_comments}
onChange={(evt) => editInfo('flight_comments', evt.target.value)}
/>
</FormGroup>
<OperationVolumeInfoEditor
info={volumeInfo}
setInfo={setVolumeInfo}
Expand Down
12 changes: 6 additions & 6 deletions src/map/editor/OperationVolumeInfoEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function OperationVolumeInfoEditor(props) {
near_structure boolean
Is this operation volume within 400' of a structure?
*/}
<div className={styles.sidebarButtonText}>
{/* <div className="rightAreaButtonText">
<Checkbox
checked={info.near_structure}
alignIndicator={Alignment.LEFT}
Expand All @@ -31,13 +31,13 @@ function OperationVolumeInfoEditor(props) {
>
{t('editor.volume.nearstructure')}
</Checkbox>
</div>
</div> */}
{/*
beyond_visual_line_of_sight* boolean
x-utm-data-accessibility: OPERATIONAL
Describes whether any portion of the operation volume is beyond the visual line of sight of the RPIC.
*/}
<div className={styles.sidebarButtonText}>
{/*<div className="rightAreaButtonText">
<Checkbox
checked={info.beyond_visual_line_of_sight}
alignIndicator={Alignment.LEFT}
Expand All @@ -51,7 +51,7 @@ function OperationVolumeInfoEditor(props) {
>
{t('editor.volume.bvlos')}
</Checkbox>
</div>
</div>*/}
{/*
effective_time_begin* string($date-time)
example: 2015-08-20T14:11:56.118Z
Expand Down Expand Up @@ -102,14 +102,14 @@ function OperationVolumeInfoEditor(props) {
min_altitude* in meters. Good luck NASA!
max_altitude* in meters
*/}
<FormGroup className={styles.sidebarButtonText} label={t('volume.min_altitude')} labelFor="min_altitude">
{/* <FormGroup className="rightAreaButtonText" label={t('volume.min_altitude')} labelFor="min_altitude">
<InputGroup
id="min_altitude"
data-test-id="map#editor#volume#info#min_altitude"
value={info.min_altitude}
onChange={evt => editInfo('min_altitude', evt.target.value)}
/>
</FormGroup>
</FormGroup> */}
<FormGroup className={styles.sidebarButtonText} label={t('volume.max_altitude')} labelFor="max_altitude">
<InputGroup
id="max_altitude"
Expand Down
2 changes: 2 additions & 0 deletions src/map/hooks/useEditorLogic.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const swap = (array) => [array[1], array[0]];

function UseEditorLogic(refMapOnClick, mapInitialized) {
const [operationInfo, setOperationInfo] = useState(S.Just({
name: 'Untitled',
pilot: 'Not assigned',
contact: '',
contact_phone: '',
flight_comments: '',
Expand Down
2 changes: 2 additions & 0 deletions src/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@
"operation": {
"complete": "Editing information of operation",
"name": "Operation name",
"flight_comments": "Flight comments (optional)",
"pilot": "Pilot's username",
"untitled":"Untitled",
"volumesdescription": "Volumes description",
"defaultvolume": "v0.1 - Restricted to one volume",
Expand Down

0 comments on commit c506c21

Please sign in to comment.