fix(editor): Error dropdown in resource locator disappears when search filter is required (#9681)
This commit is contained in:
@@ -410,7 +410,7 @@ export default defineComponent({
|
||||
return this.cachedResponses[this.currentRequestKey] || null;
|
||||
},
|
||||
currentQueryResults(): IResourceLocatorResultExpanded[] {
|
||||
const results = this.currentResponse ? this.currentResponse.results : [];
|
||||
const results = this.currentResponse?.results ?? [];
|
||||
|
||||
return results.map(
|
||||
(result: INodeListSearchItems): IResourceLocatorResultExpanded => ({
|
||||
@@ -648,6 +648,11 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
loadResourcesDebounced() {
|
||||
if (this.currentResponse?.error) {
|
||||
// Clear error response immediately when retrying to show loading state
|
||||
delete this.cachedResponses[this.currentRequestKey];
|
||||
}
|
||||
|
||||
void this.callDebounced(this.loadResources, {
|
||||
debounceTime: 1000,
|
||||
trailing: true,
|
||||
@@ -664,6 +669,11 @@ export default defineComponent({
|
||||
const paramsKey = this.currentRequestKey;
|
||||
const cachedResponse = this.cachedResponses[paramsKey];
|
||||
|
||||
if (this.credentialsNotSet) {
|
||||
this.setResponse(paramsKey, { error: true });
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.requiresSearchFilter && !params.filter) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
:width="width"
|
||||
:popper-class="$style.popover"
|
||||
:visible="show"
|
||||
trigger="manual"
|
||||
:teleported="false"
|
||||
data-test-id="resource-locator-dropdown"
|
||||
>
|
||||
<div v-if="errorView" :class="$style.messageContainer">
|
||||
|
||||
Reference in New Issue
Block a user