|
9 | 9 | data() { |
10 | 10 | return { |
11 | 11 | ready: false, |
12 | | - loadingError: null, |
13 | 12 | loadingNewEntries: false, |
14 | 13 | hasNewEntries: false, |
15 | 14 | page: 1, |
|
147 | 146 | loadFlows(page = 1, refreshing = false) { |
148 | 147 | if (!refreshing) { |
149 | 148 | this.ready = false; |
150 | | - this.loadingError = null; |
151 | 149 | } |
152 | 150 |
|
153 | 151 | return this.$http.get(Waterline.basePath + '/api/flows/' + this.$route.params.type + '?' + this.apiQueryString(page)) |
|
170 | 168 | } |
171 | 169 |
|
172 | 170 | this.ready = true; |
173 | | - this.loadingError = null; |
174 | 171 | }) |
175 | | - .catch((error) => { |
| 172 | + .catch(() => { |
176 | 173 | if (!refreshing) { |
177 | 174 | this.flows = []; |
178 | 175 | this.totalPages = 1; |
179 | 176 | this.visibilityFilters = null; |
180 | | - this.loadingError = this.flowListLoadErrorMessage(error); |
181 | 177 | } |
182 | 178 |
|
183 | 179 | this.ready = true; |
|
1411 | 1407 | this.hasNewEntries = false; |
1412 | 1408 | }, |
1413 | 1409 |
|
1414 | | - retryLoadFlows() { |
1415 | | - this.loadFlows(this.page || 1, false); |
1416 | | - }, |
1417 | | -
|
1418 | | - flowListLoadErrorMessage(error) { |
1419 | | - if (error && error.code === 'ECONNABORTED') { |
1420 | | - return 'The flow list request timed out.'; |
1421 | | - } |
1422 | | -
|
1423 | | - if (error && error.response && error.response.status) { |
1424 | | - const status = error.response.status; |
1425 | | - const message = error.response.data && error.response.data.message |
1426 | | - ? error.response.data.message |
1427 | | - : 'Waterline could not load this flow list.'; |
1428 | | -
|
1429 | | - return `HTTP ${status}: ${message}`; |
1430 | | - } |
1431 | | -
|
1432 | | - if (error && error.request) { |
1433 | | - return 'Waterline could not reach the flow list API.'; |
1434 | | - } |
1435 | | -
|
1436 | | - return error && error.message |
1437 | | - ? error.message |
1438 | | - : 'Waterline could not load this flow list.'; |
1439 | | - }, |
1440 | | -
|
1441 | | - flowListLoadingLabel() { |
1442 | | - return 'Loading ' + this.flowCollectionLabel().toLowerCase() + ' flows'; |
1443 | | - }, |
1444 | | -
|
1445 | | - flowListEmptyTitle() { |
1446 | | - return this.hasActiveFilters |
1447 | | - ? 'No matching ' + this.flowCollectionLabel().toLowerCase() + ' flows' |
1448 | | - : 'No ' + this.flowCollectionLabel().toLowerCase() + ' flows'; |
1449 | | - }, |
1450 | | -
|
1451 | 1410 |
|
1452 | 1411 | /** |
1453 | 1412 | * Refresh the flows every period of time. |
|
1636 | 1595 | </div> |
1637 | 1596 |
|
1638 | 1597 | <div v-if="!ready" |
1639 | | - class="d-flex align-items-center justify-content-center card-bg-secondary p-5 bottom-radius" |
1640 | | - role="status" |
1641 | | - aria-live="polite" |
1642 | | - :aria-label="flowListLoadingLabel()"> |
1643 | | - <svg xmlns="http://www.w3.org/2000/svg" |
1644 | | - viewBox="0 0 20 20" |
1645 | | - class="icon spin mr-2 fill-text-color" |
1646 | | - aria-hidden="true"> |
| 1598 | + class="d-flex align-items-center justify-content-center card-bg-secondary p-5 bottom-radius"> |
| 1599 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" class="icon spin mr-2 fill-text-color"> |
1647 | 1600 | <path |
1648 | 1601 | d="M12 10a2 2 0 0 1-3.41 1.41A2 2 0 0 1 10 8V0a9.97 9.97 0 0 1 10 10h-8zm7.9 1.41A10 10 0 1 1 8.59.1v2.03a8 8 0 1 0 9.29 9.29h2.02zm-4.07 0a6 6 0 1 1-7.25-7.25v2.1a3.99 3.99 0 0 0-1.4 6.57 4 4 0 0 0 6.56-1.42h2.1z"></path> |
1649 | 1602 | </svg> |
1650 | 1603 |
|
1651 | | - <span>{{ flowListLoadingLabel() }}</span> |
| 1604 | + <span>Loading...</span> |
1652 | 1605 | </div> |
1653 | 1606 |
|
1654 | | - <div v-if="ready && loadingError" |
1655 | | - class="d-flex flex-column align-items-center justify-content-center card-bg-secondary p-5 bottom-radius text-center" |
1656 | | - role="alert" |
1657 | | - aria-live="assertive"> |
1658 | | - <strong>Flow list unavailable</strong> |
1659 | | - <span class="text-muted mt-2">{{ loadingError }}</span> |
1660 | | - <button class="btn btn-outline-secondary btn-sm mt-3" @click="retryLoadFlows"> |
1661 | | - Retry |
1662 | | - </button> |
1663 | | - </div> |
1664 | 1607 |
|
1665 | | - <div v-if="ready && !loadingError && flows.length == 0" |
1666 | | - class="d-flex flex-column align-items-center justify-content-center card-bg-secondary p-5 bottom-radius text-center" |
1667 | | - role="status" |
1668 | | - aria-live="polite"> |
1669 | | - <strong>{{ flowListEmptyTitle() }}</strong> |
1670 | | - <span v-if="hasActiveFilters" class="text-muted mt-2">Clear the active view or filters to widen the list.</span> |
| 1608 | + <div v-if="ready && flows.length == 0" |
| 1609 | + class="d-flex flex-column align-items-center justify-content-center card-bg-secondary p-5 bottom-radius"> |
| 1610 | + <span>There aren't any flows.</span> |
1671 | 1611 | </div> |
1672 | 1612 |
|
1673 | | - <table v-if="ready && !loadingError && flows.length > 0" :class="workflowListTableClass"> |
| 1613 | + <table v-if="ready && flows.length > 0" :class="workflowListTableClass"> |
1674 | 1614 | <thead> |
1675 | 1615 | <tr> |
1676 | 1616 | <th v-if="columnEnabled('flow')">Flow</th> |
|
0 commit comments