Commit f5d96e8a authored by davelopez's avatar davelopez
Browse files

Fix collection error message rendering

- Display `populated_state_message` as description when the populated_state is `failed`
parent 52167a78
Loading
Loading
Loading
Loading
+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()">
@@ -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`;
+3 −0
Original line number Diff line number Diff line
@@ -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();
        },
+5 −1
Original line number Diff line number Diff line
@@ -27,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") === POPULATED_STATE_FAILED || this.anyWithStates(ERROR_STATES);
        return this.populationFailed() || this.anyWithStates(ERROR_STATES);
    },

    states: function () {