Permalink
Browse files

Update pilot editing logic to apply to draft entry

  • Loading branch information...
markerikson committed Jan 25, 2017
1 parent 3cb01fc commit d4660442479e02fde322d06b37c3662e584c1d9c
Showing with 4 additions and 7 deletions.
  1. +0 −3 src/features/editing/editingReducer.js
  2. +4 −4 src/features/pilots/PilotDetails/PilotDetails.jsx
@@ -26,9 +26,6 @@ export function copyEntity(sourceEntities, destinationEntities, payload) {
const {itemID, itemType} = payload;
const newItemAttributes = readEntityData(sourceEntities, itemType, itemID);
if(newItemAttributes.name) {
newItemAttributes.name += " (copied)";
}
const creationPayload = {itemType, itemID, newItemAttributes}
const updatedEntities = createEntity(destinationEntities, creationPayload);
@@ -14,7 +14,7 @@ import {
stopEditingPilot,
} from "../pilotsActions";
import {updateEntity} from "features/entities/entityActions";
import {editItemAttributes} from "features/editing/editingActions";
import {getValueFromEvent} from "common/utils/clientUtils";
@@ -76,7 +76,7 @@ const mapState = (state) => {
const actions = {
startEditingPilot,
stopEditingPilot,
updateEntity,
editItemAttributes,
}
@@ -85,15 +85,15 @@ export class PilotDetails extends Component {
const newValues = getValueFromEvent(e);
const {id} = this.props.pilot;
this.props.updateEntity("Pilot", id, newValues);
this.props.editItemAttributes("Pilot", id, newValues);
}
onDropdownChanged = (e, result) => {
const {name, value} = result;
const newValues = { [name] : value};
const {id} = this.props.pilot;
this.props.updateEntity("Pilot", id, newValues);
this.props.editItemAttributes("Pilot", id, newValues);
}
onStartEditingClicked = () => {

0 comments on commit d466044

Please sign in to comment.