diff --git a/app/assets/javascripts/runner/graphql/list/group_runner_connection.fragment.graphql b/app/assets/javascripts/runner/graphql/list/group_runner_connection.fragment.graphql new file mode 100644 index 0000000000000000000000000000000000000000..66975bf2c36300308bac449ff8b4e8ff9dd4f33b --- /dev/null +++ b/app/assets/javascripts/runner/graphql/list/group_runner_connection.fragment.graphql @@ -0,0 +1,17 @@ +#import "ee_else_ce/runner/graphql/list/list_item.fragment.graphql" +#import "~/graphql_shared/fragments/page_info.fragment.graphql" + +fragment GroupRunnerConnection on CiRunnerConnection { + edges { + webUrl + editUrl + node { + ...ListItem + projectCount # Used to determine why some project runners can't be deleted + } + } + pageInfo { + __typename + ...PageInfo + } +} diff --git a/app/assets/javascripts/runner/graphql/list/group_runners.query.graphql b/app/assets/javascripts/runner/graphql/list/group_runners.query.graphql index b7a8889ea0e1f9bd645f97c6a9df2401cd8d4995..4c519b9b8677a1c45008ab28ff2900124fafd700 100644 --- a/app/assets/javascripts/runner/graphql/list/group_runners.query.graphql +++ b/app/assets/javascripts/runner/graphql/list/group_runners.query.graphql @@ -1,5 +1,4 @@ -#import "ee_else_ce/runner/graphql/list/list_item.fragment.graphql" -#import "~/graphql_shared/fragments/page_info.fragment.graphql" +#import "~/runner/graphql/list/group_runner_connection.fragment.graphql" query getGroupRunners( $groupFullPath: ID! @@ -27,17 +26,7 @@ query getGroupRunners( search: $search sort: $sort ) { - edges { - webUrl - editUrl - node { - ...ListItem - projectCount # Used to determine why some project runners can't be deleted - } - } - pageInfo { - ...PageInfo - } + ...GroupRunnerConnection } } } diff --git a/app/assets/javascripts/runner/group_runners/group_runners_app.vue b/app/assets/javascripts/runner/group_runners/group_runners_app.vue index e8446dbe345aa5b14d581bec94acd49e513165b1..76b518648761ceaae011e2b8762c422113e2937d 100644 --- a/app/assets/javascripts/runner/group_runners/group_runners_app.vue +++ b/app/assets/javascripts/runner/group_runners/group_runners_app.vue @@ -3,6 +3,14 @@ import { GlLink } from '@gitlab/ui'; import { createAlert } from '~/flash'; import { updateHistory } from '~/lib/utils/url_utility'; import { fetchPolicies } from '~/lib/graphql'; +import { upgradeStatusTokenConfig } from 'ee_else_ce/runner/components/search_tokens/upgrade_status_token_config'; +import { + fromUrlQueryToSearch, + fromSearchToUrl, + fromSearchToVariables, + isSearchFiltered, +} from 'ee_else_ce/runner/runner_search_utils'; +import groupRunnersQuery from 'ee_else_ce/runner/graphql/list/group_runners.query.graphql'; import RegistrationDropdown from '../components/registration/registration_dropdown.vue'; import RunnerFilteredSearchBar from '../components/runner_filtered_search_bar.vue'; @@ -22,13 +30,6 @@ import { PROJECT_TYPE, I18N_FETCH_ERROR, } from '../constants'; -import groupRunnersQuery from '../graphql/list/group_runners.query.graphql'; -import { - fromUrlQueryToSearch, - fromSearchToUrl, - fromSearchToVariables, - isSearchFiltered, -} from '../runner_search_utils'; import { captureException } from '../sentry_utils'; export default { @@ -123,7 +124,7 @@ export default { return !this.runnersLoading && !this.runners.items.length; }, searchTokens() { - return [pausedTokenConfig, statusTokenConfig]; + return [pausedTokenConfig, statusTokenConfig, upgradeStatusTokenConfig]; }, filteredSearchNamespace() { return `${GROUP_FILTERED_SEARCH_NAMESPACE}/${this.groupFullPath}`; diff --git a/ee/app/assets/javascripts/runner/graphql/list/group_runners.query.graphql b/ee/app/assets/javascripts/runner/graphql/list/group_runners.query.graphql new file mode 100644 index 0000000000000000000000000000000000000000..f663ea3ae0f8073b530999794d5f22eda0538d43 --- /dev/null +++ b/ee/app/assets/javascripts/runner/graphql/list/group_runners.query.graphql @@ -0,0 +1,34 @@ +#import "~/runner/graphql/list/group_runner_connection.fragment.graphql" + +query getGroupRunnersEE( + $groupFullPath: ID! + $before: String + $after: String + $first: Int + $last: Int + $paused: Boolean + $status: CiRunnerStatus + $upgradeStatus: CiRunnerUpgradeStatus + $type: CiRunnerType + $search: String + $sort: CiRunnerSort +) { + group(fullPath: $groupFullPath) { + id # Apollo required + runners( + membership: DESCENDANTS + before: $before + after: $after + first: $first + last: $last + paused: $paused + status: $status + upgradeStatus: $upgradeStatus # Added in EE + type: $type + search: $search + sort: $sort + ) { + ...GroupRunnerConnection + } + } +} diff --git a/spec/frontend/runner/group_runners/group_runners_app_spec.js b/spec/frontend/runner/group_runners/group_runners_app_spec.js index 3012240d8f4b6fa3c33c050d219910fe87e3fd2b..9c85e5de96cd3623034d4b5e976cd9ba1a54ad6a 100644 --- a/spec/frontend/runner/group_runners/group_runners_app_spec.js +++ b/spec/frontend/runner/group_runners/group_runners_app_spec.js @@ -13,6 +13,7 @@ import { createAlert } from '~/flash'; import { s__ } from '~/locale'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { updateHistory } from '~/lib/utils/url_utility'; +import { upgradeStatusTokenConfig } from 'ee_else_ce/runner/components/search_tokens/upgrade_status_token_config'; import RunnerTypeTabs from '~/runner/components/runner_type_tabs.vue'; import RunnerFilteredSearchBar from '~/runner/components/runner_filtered_search_bar.vue'; @@ -37,7 +38,7 @@ import { RUNNER_PAGE_SIZE, I18N_EDIT, } from '~/runner/constants'; -import groupRunnersQuery from '~/runner/graphql/list/group_runners.query.graphql'; +import groupRunnersQuery from 'ee_else_ce/runner/graphql/list/group_runners.query.graphql'; import groupRunnersCountQuery from 'ee_else_ce/runner/graphql/list/group_runners_count.query.graphql'; import GroupRunnersApp from '~/runner/group_runners/group_runners_app.vue'; import { captureException } from '~/runner/sentry_utils'; @@ -196,6 +197,7 @@ describe('GroupRunnersApp', () => { type: PARAM_KEY_STATUS, options: expect.any(Array), }), + upgradeStatusTokenConfig, ]); });