diff options
Diffstat (limited to 'app/assets/javascripts/groups_projects')
-rw-r--r-- | app/assets/javascripts/groups_projects/components/transfer_locations.vue | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/assets/javascripts/groups_projects/components/transfer_locations.vue b/app/assets/javascripts/groups_projects/components/transfer_locations.vue index e0c8ce36e3c..360af772a10 100644 --- a/app/assets/javascripts/groups_projects/components/transfer_locations.vue +++ b/app/assets/javascripts/groups_projects/components/transfer_locations.vue @@ -25,6 +25,7 @@ export const i18n = { 'ProjectTransfer|An error occurred fetching the transfer locations, please refresh the page and try again.', ), ALERT_DISMISS_LABEL: __('Dismiss'), + NO_RESULTS_TEXT: __('No results found.'), }; export default { @@ -90,6 +91,9 @@ export default { hasGroupTransferLocations() { return this.groupTransferLocations.length; }, + hasAdditionalDropdownItems() { + return this.filteredAdditionalDropdownItems.length; + }, selectedText() { return this.value?.humanName || this.label; }, @@ -99,6 +103,17 @@ export default { showAdditionalDropdownItems() { return !this.isLoading && this.filteredAdditionalDropdownItems.length; }, + hasNoResults() { + if (this.isLoading || this.isSearchLoading) { + return false; + } + + return ( + !this.hasAdditionalDropdownItems && + !this.hasUserTransferLocations && + !this.hasGroupTransferLocations + ); + }, }, watch: { searchTerm() { @@ -274,6 +289,9 @@ export default { >{{ item.humanName }}</gl-dropdown-item > </div> + <gl-dropdown-item v-if="hasNoResults" button-class="gl-text-gray-900!" disabled>{{ + $options.i18n.NO_RESULTS_TEXT + }}</gl-dropdown-item> <gl-loading-icon v-if="isLoading" class="gl-mb-3" size="sm" /> <gl-intersection-observer v-if="hasNextPageOfGroups" @appear="handleLoadMoreGroups" /> </gl-dropdown> |