Skip to content

Commit

Permalink
Allows new-tile-step to properly load from the restored state. re #4821
Browse files Browse the repository at this point in the history
  • Loading branch information
chiatt committed Jun 14, 2019
1 parent 7d6c669 commit 169530b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions arches/app/media/js/views/components/workflows/new-tile-step.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ define([
], function(_, $, arches, ko, koMapping, GraphModel, CardViewModel, ProvisionalTileViewModel, AlertViewModel) {
function viewModel(params) {
var self = this;
if (!params.resourceid() && params.requirements){
params.resourceid(params.requirements.resourceid);
params.tileid(params.requirements.tileid);
}
var url = arches.urls.api_card + (ko.unwrap(params.resourceid) || ko.unwrap(params.graphid));

this.card = ko.observable();
Expand Down Expand Up @@ -127,12 +131,12 @@ define([
// commented the line below because it causes steps to automatically advance on page reload
// self.complete(!!ko.unwrap(params.tileid));
});

params.tile = self.tile;
params.stateProperties = function(){
return {
resourceid: ko.unwrap(params.resourceid),
tile: !!(params.tile) ? koMapping.toJS(params.tile().data) : undefined,
tileid: !!(params.tile) ? ko.unwrap(params.tile().tileid): undefined
tile: !!(ko.unwrap(params.tile)) ? koMapping.toJS(params.tile().data) : undefined,
tileid: !!(ko.unwrap(params.tile)) ? ko.unwrap(params.tile().tileid): undefined
};
};

Expand Down

0 comments on commit 169530b

Please sign in to comment.