diff options
Diffstat (limited to 'app/assets/javascripts/runner/graphql/list/local_state.js')
-rw-r--r-- | app/assets/javascripts/runner/graphql/list/local_state.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/app/assets/javascripts/runner/graphql/list/local_state.js b/app/assets/javascripts/runner/graphql/list/local_state.js index 154af261bba..e0477c660b4 100644 --- a/app/assets/javascripts/runner/graphql/list/local_state.js +++ b/app/assets/javascripts/runner/graphql/list/local_state.js @@ -20,10 +20,6 @@ import typeDefs from './typedefs.graphql'; * localMutations.setRunnerChecked( ... ) * ``` * - * Note: Currently only in use behind a feature flag: - * admin_runners_bulk_delete for the admin list, rollout issue: - * https://gitlab.com/gitlab-org/gitlab/-/issues/353981 - * * @returns {Object} An object to configure an Apollo client: * contains cacheConfig, typeDefs, localMutations. */ @@ -52,16 +48,18 @@ export const createLocalState = () => { const localMutations = { setRunnerChecked({ runner, isChecked }) { - checkedRunnerIdsVar({ - ...checkedRunnerIdsVar(), - [runner.id]: isChecked, - }); + const { id, userPermissions } = runner; + if (userPermissions?.deleteRunner) { + checkedRunnerIdsVar({ + ...checkedRunnerIdsVar(), + [id]: isChecked, + }); + } }, setRunnersChecked({ runners, isChecked }) { - const newVal = runners.reduce( - (acc, { id }) => ({ ...acc, [id]: isChecked }), - checkedRunnerIdsVar(), - ); + const newVal = runners + .filter(({ userPermissions }) => userPermissions?.deleteRunner) + .reduce((acc, { id }) => ({ ...acc, [id]: isChecked }), checkedRunnerIdsVar()); checkedRunnerIdsVar(newVal); }, clearChecked() { |