Skip to content

Commit

Permalink
feat: new operation information listed properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mbetancurt committed Jul 15, 2020
1 parent c506c21 commit ceff7aa
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 14 deletions.
4 changes: 2 additions & 2 deletions cypress/integration/map_createnewoperation.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ describe('Use Case 01A: Create New Operation (valid)', function () {
});
it('Complete Volume information', function () {
//cy.get('[data-test-id="mapInputEditorVolumeDescr"]').
cy.get('[data-test-id="mapInputEditorFlightNumber"]')
/*cy.get('[data-test-id="mapInputEditorFlightNumber"]')
.clear()
.type('123');
.type('123');*/
cy.get('[data-test-id="map#editor#operation#info#contact"]')
.clear()
.type('E2E Testing');
Expand Down
14 changes: 11 additions & 3 deletions src/dashboard/operation/OperationsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ function Operation({children}) {
const [showProperties, setShowProperties] = useState(false);
return (
<Callout
key={children.flight_comments}
key={children.name}
className={styles.item}
title={children.flight_comments}
data-test-id={'op' + children.flight_comments}
title={children.name}
data-test-id={'op' + children.name}
icon="double-chevron-right"
onClick={() => setShowProperties(show => !show)}
>
Expand All @@ -38,6 +38,10 @@ function Operation({children}) {
{children.gufi}
</div>
</GenericListLine>
<GenericListLine>
{t('operation.owner')}
{children.owner.firstName + ' ' + children.owner.lastName + ' (' + children.owner.username + ')'}
</GenericListLine>
<GenericListLine>
{t('volume.effective_time_begin')}
{children.operation_volumes[0].effective_time_begin}
Expand Down Expand Up @@ -70,6 +74,10 @@ function Operation({children}) {
{t('operation.state')}
{children.state}
</GenericListLine>
<GenericListLine>
{t('operation.flight_comments')}
{children.flight_comments}
</GenericListLine>
<GenericListLine>
{t('operation.free_text')}
{children.free_text}
Expand Down
12 changes: 6 additions & 6 deletions src/map/editor/OperationInfoEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ function OperationInfoEditor({info, setInfo, volumeInfo, setVolumeInfo, saveOper
/>
</FormGroup>
<FormGroup
className="rightAreaButtonText"
className={styles.sidebarButtonText}
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)}
value={info.owner}
onChange={(evt) => editInfo('owner', evt.target.value)}
/>
</FormGroup>
{/* "flight_number": "12345678" */}
{/* "flight_number": "12345678"
<FormGroup
className={styles.sidebarButtonText}
label={t('editor.operation.flightnumber')}
Expand All @@ -69,7 +69,7 @@ function OperationInfoEditor({info, setInfo, volumeInfo, setVolumeInfo, saveOper
value={info.flight_number}
onChange={(evt) => editInfo('flight_number', evt.target.value)}
/>
</FormGroup>
</FormGroup>*/}
{/* "Contact Name"*/}
<FormGroup
className={styles.sidebarButtonText}
Expand Down Expand Up @@ -98,7 +98,7 @@ function OperationInfoEditor({info, setInfo, volumeInfo, setVolumeInfo, saveOper
</FormGroup>
{/* "flight_comments": "Untitled" */}
<FormGroup
className="rightAreaButtonText"
className={styles.sidebarButtonText}
label={t('editor.operation.flight_comments')}
labelFor="flight_comments"
>
Expand Down
2 changes: 1 addition & 1 deletion src/map/editor/OperationVolumeInfoEditor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {Alignment, Checkbox, FormGroup, InputGroup} from '@blueprintjs/core';
import {FormGroup, InputGroup} from '@blueprintjs/core';
import {DateInput, TimePrecision} from '@blueprintjs/datetime';
import {useTranslation} from 'react-i18next';
import styles from '../Map.module.css';
Expand Down
4 changes: 2 additions & 2 deletions src/map/hooks/useEditorLogic.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const swap = (array) => [array[1], array[0]];
function UseEditorLogic(refMapOnClick, mapInitialized) {
const [operationInfo, setOperationInfo] = useState(S.Just({
name: 'Untitled',
pilot: 'Not assigned',
owner: 'error error',
contact: '',
contact_phone: '',
flight_comments: '',
volumes_description: 'v0.1',
flight_number: '',
flight_number: Date.now(),
submit_time: new Date().toISOString(), // TODO: Proper format for time 2019-12-11T19:59:10Z
update_time: new Date().toISOString(),
faa_rule: 0,
Expand Down

0 comments on commit ceff7aa

Please sign in to comment.