+
+ Error in filter:
+
+ {{ formattedSearchError.filter }}'{{ formattedSearchError.value }}'
+
+
No data found for selected filter.
@@ -153,6 +160,7 @@ import HistoryDetails from "./HistoryDetails";
import HistoryDropZone from "./HistoryDropZone";
import HistoryEmpty from "./HistoryEmpty";
import HistoryFilters from "./HistoryFilters/HistoryFilters";
+import { getOperatorForAlias } from "utils/filtering";
import HistoryMessages from "./HistoryMessages";
import HistorySelectionOperations from "./HistoryOperations/SelectionOperations";
import HistorySelectionStatus from "./HistoryOperations/SelectionStatus";
@@ -190,12 +198,12 @@ export default {
},
data() {
return {
- error: null,
filterText: "",
highlightsKey: null,
invisible: {},
loading: false,
offset: 0,
+ searchError: null,
showAdvanced: false,
showDropZone: false,
operationRunning: null,
@@ -248,6 +256,23 @@ export default {
const { getWatchingVisibility } = storeToRefs(useHistoryItemsStore());
return getWatchingVisibility.value;
},
+ /** @returns {Object} */
+ formattedSearchError() {
+ if (this.searchError) {
+ const { column, col, operation, op, value, val, err_msg, ValueError } = this.searchError;
+ const alias = operation || op;
+ const operator = alias ? getOperatorForAlias(alias) : ":";
+ const formatted = {
+ filter: `${column || col}${operator}`,
+ value: value || val,
+ msg: err_msg,
+ typeError: ValueError,
+ };
+ return formatted;
+ } else {
+ return null;
+ }
+ },
/** @returns {String} */
storeFilterText() {
const { currentFilterText } = storeToRefs(useHistoryStore());
@@ -316,11 +341,15 @@ export default {
this.loading = true;
try {
await this.fetchHistoryItems(this.historyId, this.filterText, this.offset);
- this.error = null;
+ this.searchError = null;
this.loading = false;
} catch (error) {
- console.debug("HistoryPanel - Load error.", error);
- this.error = error;
+ if (error.response && error.response.data && error.response.data.err_msg) {
+ console.debug("HistoryPanel - Load items error:", error.response.data.err_msg);
+ this.searchError = error.response.data;
+ } else {
+ console.debug("HistoryPanel - Load items error.", error);
+ }
this.loading = false;
}
},
diff --git a/client/src/stores/history/historyItemsStore.js b/client/src/stores/history/historyItemsStore.js
index f93d640acd70..a8df77781101 100644
--- a/client/src/stores/history/historyItemsStore.js
+++ b/client/src/stores/history/historyItemsStore.js
@@ -67,7 +67,7 @@ export const useHistoryItemsStore = defineStore("historyItemsStore", {
const params = `v=dev&order=hid&offset=${offset}&limit=${limit}`;
const url = `/api/histories/${historyId}/contents?${params}&${queryString}`;
const headers = { accept: "application/vnd.galaxy.history.contents.stats+json" };
- await queue.enqueue(urlData, { url, headers }, historyId).then((data) => {
+ return await queue.enqueue(urlData, { url, headers, errorSimplify: false }, historyId).then((data) => {
const stats = data.stats;
this.totalMatchesCount = stats.total_matches;
const payload = data.contents;
diff --git a/client/src/style/scss/ui.scss b/client/src/style/scss/ui.scss
index d8d3c5caabb5..fe370727b928 100644
--- a/client/src/style/scss/ui.scss
+++ b/client/src/style/scss/ui.scss
@@ -213,6 +213,10 @@ $ui-margin-horizontal-large: $margin-v * 2;
}
}
+.ui-input-error {
+ border-color: $brand-danger;
+}
+
.ui-textarea {
@extend .ui-input;
height: 100px !important;
diff --git a/client/src/utils/url.js b/client/src/utils/url.js
index df8c36629713..6fda0c5960bc 100644
--- a/client/src/utils/url.js
+++ b/client/src/utils/url.js
@@ -2,14 +2,18 @@ import axios from "axios";
import { withPrefix } from "utils/redirect";
import { rethrowSimple } from "utils/simple-error";
-export async function urlData({ url, headers, params }) {
+export async function urlData({ url, headers, params, errorSimplify = true }) {
try {
headers = headers || {};
params = params || {};
const { data } = await axios.get(withPrefix(url), { headers, params });
return data;
} catch (e) {
- rethrowSimple(e);
+ if (errorSimplify) {
+ rethrowSimple(e);
+ } else {
+ throw e;
+ }
}
}