Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow widget validation issues in multi-tile component #11194

Open
wants to merge 5 commits into
base: dev/7.5.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arches/app/media/js/viewmodels/workflow-step.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ define([
lockableExternalSteps: self.lockableExternalSteps,
workflowId: self.workflowId,
workflowName: self.workflow.plugin.componentname,
alert: self.alert,
alert: self.workflow.alert,
outerSaveOnQuit: self.outerSaveOnQuit,
isStepActive: self.active,
workflowHistory: config.workflowHistory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,11 +560,29 @@ define([

var unorderedSavedData = ko.observableArray();

var allTileLength = self.tiles().length
var errorTiles = [];
var successfulTiles = [];

self.tiles().forEach(function(tile) {
tile.save(
function(){/* onFail */},
function(response){
self.alert(new AlertViewModel(
'ep-alert-red',
response.responseJSON.title,
response.responseJSON.message,
null,
function(){ return; }
));

errorTiles.push(tile);
self.saving(false);
checkErrorTiles();
},
function(savedTileData) {
unorderedSavedData.push(savedTileData);
successfulTiles.push(savedTileData);
checkErrorTiles();
}
);
});
Expand Down Expand Up @@ -608,6 +626,21 @@ define([
saveSubscription.dispose(); /* self-disposing subscription only runs once */
}
});

var checkErrorTiles = () => {
if (errorTiles) {
if (allTileLength == errorTiles.length + successfulTiles.length) {
if (self.tiles().length === 1) {
self.tiles(errorTiles);
} else {
self.tiles(errorTiles)
}
self.saving(false);
self.complete(false);
// self.loading(false);
}
}
}
};

this.clearEditor = function() {
Expand Down
1 change: 1 addition & 0 deletions releases/7.5.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Arches 7.5.4 Release Notes
- Ensure search result pagination is visible on small screens #11191
- Allow main (left) nav to scroll to content height when expanded #11243
- Ensure resource type search filter dropdown is not displayed beneath search filter buttons #11188
- Add error alerts to workflow multi-tile component #11194

### Dependency changes:
```
Expand Down