Loading client/src/components/JobStates/CollectionJobStates.vue +4 −1 Original line number Diff line number Diff line <template> <div v-if="!jobSourceType || jobSourceType == 'Job' || isTerminal"> <div v-if="!jobSourceType || jobSourceType == 'Job' || (isTerminal && !isErrored)"> {{ simpleDescription }} </div> <div v-else-if="!jobStatesSummary || !jobStatesSummary.hasDetails()"> Loading Loading @@ -52,6 +52,9 @@ export default { return DC_VIEW.collectionDescription(this.collection); }, errorDescription() { if (this.isPopulationFailed) { return `${this.collection.get("populated_state_message")}`; } var jobCount = this.jobCount; var errorCount = this.jobStatesSummary.numInError(); return `a ${this.collectionTypeDescription} with ${errorCount} / ${jobCount} jobs in error`; Loading client/src/components/JobStates/mixin.js +3 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,9 @@ export default { isErrored() { return this.jobStatesSummary && this.jobStatesSummary.errored(); }, isPopulationFailed() { return this.jobStatesSummary && this.jobStatesSummary.populationFailed(); }, isTerminal() { return this.jobStatesSummary && this.jobStatesSummary.terminal(); }, Loading client/src/mvc/collection/collection-model.js +9 −0 Original line number Diff line number Diff line Loading @@ -252,6 +252,15 @@ var DatasetCollection = Backbone.Model.extend(BASE_MVC.LoggableMixin) _.extend(element, { parent_hdca_id: parentHdcaId, }); // Warning: MEGA-hack ahead... if (!element.element_type && !element.object) { // The DCE has to be in error state... so we simulate it _.extend(element, { element_type: "hda", object: { state: "error" }, }); } }); this.elements = new collectionClass(elements); //this.debug( 'collectionClass:', this.collectionClass + '', this.elements ); Loading client/src/mvc/collection/collection-view.js +6 −1 Original line number Diff line number Diff line Loading @@ -62,11 +62,16 @@ var CollectionView = _super.extend( }, handleWarning: function ($newRender) { var $warns = $newRender.find(".elements-warning"); if (this.model.get("populated_state") === "failed") { var error = _l(`${this.model.get("populated_state_message")}`); $warns.html(`<div class="errormessagesmall">${error}</div>`); return; } var viewLength = this.views.length; var elementCount = this.model.get("element_count"); if (elementCount && elementCount !== viewLength) { var warning = _l(`displaying only ${viewLength} of ${elementCount} items`); var $warns = $newRender.find(".elements-warning"); $warns.html(`<div class="warningmessagesmall">${warning}</div>`); } }, Loading client/src/mvc/history/job-states-model.js +6 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ var UPDATE_DELAY = 2000; var NON_TERMINAL_STATES = ["new", "queued", "running", "waiting"]; var ERROR_STATES = ["error", "deleted"]; var TERMINAL_STATES = ["ok"].concat(ERROR_STATES); const POPULATED_STATE_FAILED = "failed"; /** Fetch state on add or just wait for polling to start. */ var FETCH_STATE_ON_ADD = false; var BATCH_FETCH_STATE = true; Loading @@ -26,8 +27,12 @@ var JobStatesSummary = Backbone.Model.extend({ return !this.hasDetails() || this.get("populated_state") == "new"; }, populationFailed: function () { return this.get("populated_state") === POPULATED_STATE_FAILED; }, errored: function () { return this.get("populated_state") === "error" || this.anyWithStates(ERROR_STATES); return this.populationFailed() || this.anyWithStates(ERROR_STATES); }, states: function () { Loading Loading
client/src/components/JobStates/CollectionJobStates.vue +4 −1 Original line number Diff line number Diff line <template> <div v-if="!jobSourceType || jobSourceType == 'Job' || isTerminal"> <div v-if="!jobSourceType || jobSourceType == 'Job' || (isTerminal && !isErrored)"> {{ simpleDescription }} </div> <div v-else-if="!jobStatesSummary || !jobStatesSummary.hasDetails()"> Loading Loading @@ -52,6 +52,9 @@ export default { return DC_VIEW.collectionDescription(this.collection); }, errorDescription() { if (this.isPopulationFailed) { return `${this.collection.get("populated_state_message")}`; } var jobCount = this.jobCount; var errorCount = this.jobStatesSummary.numInError(); return `a ${this.collectionTypeDescription} with ${errorCount} / ${jobCount} jobs in error`; Loading
client/src/components/JobStates/mixin.js +3 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,9 @@ export default { isErrored() { return this.jobStatesSummary && this.jobStatesSummary.errored(); }, isPopulationFailed() { return this.jobStatesSummary && this.jobStatesSummary.populationFailed(); }, isTerminal() { return this.jobStatesSummary && this.jobStatesSummary.terminal(); }, Loading
client/src/mvc/collection/collection-model.js +9 −0 Original line number Diff line number Diff line Loading @@ -252,6 +252,15 @@ var DatasetCollection = Backbone.Model.extend(BASE_MVC.LoggableMixin) _.extend(element, { parent_hdca_id: parentHdcaId, }); // Warning: MEGA-hack ahead... if (!element.element_type && !element.object) { // The DCE has to be in error state... so we simulate it _.extend(element, { element_type: "hda", object: { state: "error" }, }); } }); this.elements = new collectionClass(elements); //this.debug( 'collectionClass:', this.collectionClass + '', this.elements ); Loading
client/src/mvc/collection/collection-view.js +6 −1 Original line number Diff line number Diff line Loading @@ -62,11 +62,16 @@ var CollectionView = _super.extend( }, handleWarning: function ($newRender) { var $warns = $newRender.find(".elements-warning"); if (this.model.get("populated_state") === "failed") { var error = _l(`${this.model.get("populated_state_message")}`); $warns.html(`<div class="errormessagesmall">${error}</div>`); return; } var viewLength = this.views.length; var elementCount = this.model.get("element_count"); if (elementCount && elementCount !== viewLength) { var warning = _l(`displaying only ${viewLength} of ${elementCount} items`); var $warns = $newRender.find(".elements-warning"); $warns.html(`<div class="warningmessagesmall">${warning}</div>`); } }, Loading
client/src/mvc/history/job-states-model.js +6 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ var UPDATE_DELAY = 2000; var NON_TERMINAL_STATES = ["new", "queued", "running", "waiting"]; var ERROR_STATES = ["error", "deleted"]; var TERMINAL_STATES = ["ok"].concat(ERROR_STATES); const POPULATED_STATE_FAILED = "failed"; /** Fetch state on add or just wait for polling to start. */ var FETCH_STATE_ON_ADD = false; var BATCH_FETCH_STATE = true; Loading @@ -26,8 +27,12 @@ var JobStatesSummary = Backbone.Model.extend({ return !this.hasDetails() || this.get("populated_state") == "new"; }, populationFailed: function () { return this.get("populated_state") === POPULATED_STATE_FAILED; }, errored: function () { return this.get("populated_state") === "error" || this.anyWithStates(ERROR_STATES); return this.populationFailed() || this.anyWithStates(ERROR_STATES); }, states: function () { Loading