Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-05-06 03:08:30 +00:00
parent f38bcf2e44
commit 47efbe732c
6 changed files with 28 additions and 30 deletions

View File

@ -11,6 +11,7 @@ export default () => {
url: el.dataset.endpoint,
dom_id: '#js-openapi-viewer',
deepLinking: true,
displayOperationId: true,
});
})
.catch((error) => {

View File

@ -15,11 +15,6 @@ class Admin::RunnersController < Admin::ApplicationController
end
def show
# We will show runner details in a read-only view in
# future iterations. For now, this route will have a
# redirect until this new view is developed. See more:
# https://gitlab.com/gitlab-org/gitlab/-/issues/347856
redirect_to edit_admin_runner_path(runner) unless Feature.enabled?(:runner_read_only_admin_view, default_enabled: :yaml)
end
def edit

View File

@ -1,12 +1,8 @@
- runner_name = "##{@runner.id} (#{@runner.short_sha})"
- if Feature.enabled?(:runner_read_only_admin_view, default_enabled: :yaml)
- breadcrumb_title _('Edit')
- page_title _('Edit'), runner_name
- add_to_breadcrumbs _('Runners'), admin_runners_path
- add_to_breadcrumbs runner_name, admin_runner_path(@runner)
- else
- breadcrumb_title runner_name
- page_title runner_name
- breadcrumb_title _('Edit')
- page_title _('Edit'), runner_name
- add_to_breadcrumbs _('Runners'), admin_runners_path
- add_to_breadcrumbs runner_name, admin_runner_path(@runner)
#js-admin-runner-edit{ data: {runner_id: @runner.id, runner_path: admin_runner_path(@runner) } }

View File

@ -1,8 +0,0 @@
---
name: runner_read_only_admin_view
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77682
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/350164
milestone: '14.7'
type: development
group: group::runner
default_enabled: true

View File

@ -32,15 +32,6 @@ RSpec.describe Admin::RunnersController do
expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:show)
end
it 'when runner_read_only_admin_view is off, redirects to the runner edit page' do
stub_feature_flags(runner_read_only_admin_view: false)
get :show, params: { id: runner.id }
expect(response).to have_gitlab_http_status(:redirect)
expect(response).to redirect_to edit_admin_runner_path(runner)
end
end
describe '#edit' do

View File

@ -0,0 +1,23 @@
import { SwaggerUIBundle } from 'swagger-ui-dist';
import renderOpenApi from '~/blob/openapi';
jest.mock('swagger-ui-dist');
describe('OpenAPI blob viewer', () => {
const id = 'js-openapi-viewer';
const mockEndpoint = 'some/endpoint';
beforeEach(() => {
setFixtures(`<div id="${id}" data-endpoint="${mockEndpoint}"></div>`);
renderOpenApi();
});
it('initializes SwaggerUI with the correct configuration', () => {
expect(SwaggerUIBundle).toHaveBeenCalledWith({
url: mockEndpoint,
dom_id: `#${id}`,
deepLinking: true,
displayOperationId: true,
});
});
});