Commit 1e1f4d52 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch '216480-ide-multiproject-pipelines' into 'master'

Resolve "Multi-project pipelines in Web IDE lead to 404"

See merge request gitlab-org/gitlab!41082
parents 697a2abd 318c9bf4
......@@ -26,7 +26,13 @@ export default {
<ci-icon :status="job.status" :borderless="true" :size="24" class="d-flex" />
<span class="gl-ml-3">
{{ job.name }}
<a :href="job.path" target="_blank" class="ide-external-link position-relative">
<a
v-if="job.path"
:href="job.path"
target="_blank"
class="ide-external-link gl-relative"
data-testid="description-detail-link"
>
{{ jobId }} <gl-icon :size="12" name="external-link" />
</a>
</span>
......
......@@ -9,7 +9,8 @@ class JobEntity < Grape::Entity
expose :started?, as: :started
expose :archived?, as: :archived
expose :build_path do |build|
# bridge jobs don't have build detail pages
expose :build_path, if: ->(build) { !build.is_a?(Ci::Bridge) } do |build|
build_path(build)
end
......
---
title: Multi-project pipelines in Web IDE lead to 404
merge_request: 41082
author:
type: fixed
......@@ -27,4 +27,12 @@ describe('IDE job description', () => {
vm.$el.querySelector('.ci-status-icon [data-testid="status_success_borderless-icon"]'),
).not.toBe(null);
});
it('renders bridge job details without the job link', () => {
vm = mountComponent(Component, {
job: { ...jobs[0], path: undefined },
});
expect(vm.$el.querySelector('[data-testid="description-detail-link"]')).toBe(null);
});
});
......@@ -112,7 +112,8 @@ export const jobs = [
{
id: 4,
name: 'test 4',
path: 'testing4',
// bridge jobs don't have details page and so there is no path attribute
// see https://gitlab.com/gitlab-org/gitlab/-/issues/216480
status: {
icon: 'status_failed',
text: 'failed',
......
......@@ -218,4 +218,16 @@ RSpec.describe JobEntity do
expect(subject).not_to include('recoverable')
end
end
context 'when job is a bridge' do
let(:job) { create(:ci_bridge) }
it 'does not include build path' do
expect(subject).not_to include(:build_path)
end
it 'does not include cancel path' do
expect(subject).not_to include(:cancel_path)
end
end
end
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