GitLab wurde erfolgreich aktualisiert. Dank regelmäßiger Updates bleibt das THM GitLab sicher und Sie profitieren von den neuesten Funktionen. Danke für Ihre Geduld.

Commit 3317c4ba authored by Mark Lapierre's avatar Mark Lapierre

Don't check for the groups list before filtering

Filter immediately because the page is going to reload anyway.

And don't check for the loading indicator because it the groups
list tree container appears after it disappears.
parent 8589fa87
#js-groups-tree{ data: { hide_projects: 'true', endpoint: dashboard_groups_path(format: :json), path: dashboard_groups_path, form_sel: 'form#group-filter-form', filter_sel: '.js-groups-list-filter', holder_sel: '.js-groups-list-holder', dropdown_sel: '.js-group-filter-dropdown-wrap' } }
= icon('spinner spin 2x', class: 'loading-animation prepend-top-20 qa-loading-animation')
= icon('spinner spin 2x', class: 'loading-animation prepend-top-20')
= custom_icon("icon_empty_groups")
......@@ -9,52 +9,26 @@ def self.included(base)
element :groups_filter
base.view 'app/views/shared/groups/_empty_state.html.haml' do
element :groups_empty_state
base.view 'app/assets/javascripts/groups/components/groups.vue' do
element :groups_list_tree_container
base.view 'app/views/dashboard/groups/_groups.html.haml' do
element :loading_animation
# Filter the list of groups/projects by name
# If submit is true the return key will be sent to the browser to reload
# the page and fetch only the filtered results
def filter_by_name(name, submit: false)
wait(reload: false) do
# Wait 0 for the empty state element because it is there immediately
# if there are no groups. Otherwise there's a loading indicator and
# then groups_list_tree_container appears, which might take longer
page.has_css?(element_selector_css(:groups_empty_state), wait: 0) ||
field = find_element :groups_filter
field.send_keys(:return) if submit
def has_filtered_group?(name)
# Filter and submit to reload the page and only retrieve the filtered results
filter_by_name(name, submit: true)
# Since we submitted after filtering the absence of the loading
# animation and the presence of groups_list_tree_container means we
# have the complete filtered list of groups
# Since we submitted after filtering, the presence of
# groups_list_tree_container means we have the complete filtered list
# of groups
wait(reload: false) do
page.has_no_css?(element_selector_css(:loading_animation)) &&
# If there are no groups we'll know immediately because we filtered the list
return if page.has_text?(/No groups or projects matched your search/, wait: 0)
return false if page.has_text?('No groups or projects matched your search', wait: 0)
# The name will be present as filter input so we check for a link, not text
page.has_link?(name, wait: 0)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment