Job page sidebar copy button should be for source branch instead of ref name
The following discussion from !68148 (merged) should be addressed:
It's confusing here because it looks like the copy button should be for either the source or target branch, but it's actually the ref name.
possible fix in diff:
bonus:
- make
b
shortcut work (like on MR page) - add copy button for target branch (if not default branch)
diff --git a/app/assets/javascripts/jobs/components/stages_dropdown.vue b/app/assets/javascripts/jobs/components/stages_dropdown.vue
index 1780afd39e8..b2a807f4f9e 100644
--- a/app/assets/javascripts/jobs/components/stages_dropdown.vue
+++ b/app/assets/javascripts/jobs/components/stages_dropdown.vue
@@ -73,7 +73,13 @@ export default {
class="link-commit ref-name"
data-testid="source-branch-link"
>{{ pipeline.merge_request.source_branch }}</gl-link
- >
+ ><clipboard-button
+ :text="pipeline.merge_request.source_branch"
+ :title="__('Copy branch name')"
+ category="tertiary"
+ size="small"
+ data-testid="copy-source-branch-link"
+ />
<template v-if="isMergeRequestPipeline">
{{ s__('Job|into') }}
@@ -85,16 +91,18 @@ export default {
>
</template>
</template>
- <gl-link v-else :href="pipeline.ref.path" class="link-commit ref-name">{{
- pipeline.ref.name
- }}</gl-link
- ><clipboard-button
- :text="pipeline.ref.name"
- :title="__('Copy reference')"
- category="tertiary"
- size="small"
- data-testid="copy-source-ref-link"
- />
+ <template v-else>
+ <gl-link :href="pipeline.ref.path" class="link-commit ref-name">{{
+ pipeline.ref.name
+ }}</gl-link
+ ><clipboard-button
+ :text="pipeline.ref.name"
+ :title="__('Copy reference')"
+ category="tertiary"
+ size="small"
+ data-testid="copy-source-ref-link"
+ />
+ </template>
</template>
</div>
Edited by Simon Knox