Skip to content
代码片段 群组 项目
提交 7187d5a0 编辑于 作者: Paul Slaughter's avatar Paul Slaughter
浏览文件

Merge branch 'afontaine/link-short-sha' into 'master'

Make Short Sha in Deployments Page a Link

See merge request gitlab-org/gitlab!96581
No related branches found
No related tags found
无相关合并请求
......@@ -47,6 +47,9 @@ export default {
commit() {
return this.deployment?.commit;
},
commitPath() {
return this.commit?.commitPath;
},
user() {
return this.deployment?.user;
},
......@@ -147,7 +150,9 @@ export default {
class="gl-font-monospace gl-display-flex gl-align-items-center"
>
<gl-icon ref="deployment-commit-icon" name="commit" class="gl-mr-2" />
<span v-gl-tooltip :title="$options.i18n.commitSha">{{ shortSha }}</span>
<gl-link v-gl-tooltip :title="$options.i18n.commitSha" :href="commitPath">
{{ shortSha }}
</gl-link>
<clipboard-button
:text="shortSha"
category="tertiary"
......
......@@ -101,10 +101,11 @@ describe('~/environments/components/deployment.vue', () => {
});
it('shows the short SHA for the commit of the deployment', () => {
const sha = wrapper.findByTitle(__('Commit SHA'));
const sha = wrapper.findByRole('link', { name: __('Commit SHA') });
expect(sha.exists()).toBe(true);
expect(sha.text()).toBe(deployment.commit.shortId);
expect(sha.attributes('href')).toBe(deployment.commit.commitPath);
});
it('shows the commit icon', () => {
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册