From 09d8c14ef1cad71965e73858445f20d514aaef24 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Thu, 27 Oct 2016 16:58:39 +0200 Subject: [PATCH 1/2] templates/flight/change-aircraft: Use "readonly" helper This makes sure we don't try to set "model.flight.model.id" when "model.flight.model" isn't even set. --- ember/app/templates/flight/change-aircraft.hbs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ember/app/templates/flight/change-aircraft.hbs b/ember/app/templates/flight/change-aircraft.hbs index d88dd9a108..5979629b1f 100644 --- a/ember/app/templates/flight/change-aircraft.hbs +++ b/ember/app/templates/flight/change-aircraft.hbs @@ -1,9 +1,9 @@ {{#form-page title=(t "choose-aircraft")}} {{change-aircraft-form flightId=model.id - modelId=model.flight.model.id - registration=model.flight.registration - competitionId=model.flight.competitionId + modelId=(readonly model.flight.model.id) + registration=(readonly model.flight.registration) + competitionId=(readonly model.flight.competitionId) models=model.aircraftModels onDidSave=(action "transitionToFlight")}} {{/form-page}} \ No newline at end of file From ed2c897f97faa1ded8e7ad0661da01506bd52c9d Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Thu, 27 Oct 2016 17:00:13 +0200 Subject: [PATCH 2/2] components/aircraft-model-select: Fix default/empty selection --- ember/app/components/aircraft-model-select.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ember/app/components/aircraft-model-select.js b/ember/app/components/aircraft-model-select.js index 97d777ef24..7f178909ed 100644 --- a/ember/app/components/aircraft-model-select.js +++ b/ember/app/components/aircraft-model-select.js @@ -11,7 +11,7 @@ export default Ember.Component.extend({ }), model: Ember.computed('modelsWithNull.[]', 'modelId', function() { - return this.get('modelsWithNull').findBy('id', this.get('modelId')); + return this.get('modelsWithNull').findBy('id', this.get('modelId') || null); }), actions: {