Commit 059e0397 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch '25145-remove-expand-sha-button-pipeline' into 'master'

Remove unnecessary expand sha button

See merge request gitlab-org/gitlab!47012
parents 7526e83a b0c7541a
...@@ -4,7 +4,6 @@ import './bind_in_out'; ...@@ -4,7 +4,6 @@ import './bind_in_out';
import './markdown/render_gfm'; import './markdown/render_gfm';
import initCopyAsGFM from './markdown/copy_as_gfm'; import initCopyAsGFM from './markdown/copy_as_gfm';
import initCopyToClipboard from './copy_to_clipboard'; import initCopyToClipboard from './copy_to_clipboard';
import './details_behavior';
import installGlEmojiElement from './gl_emoji'; import installGlEmojiElement from './gl_emoji';
import './quick_submit'; import './quick_submit';
import './requires_input'; import './requires_input';
......
import { loadBranches } from './load_branches'; import { loadBranches } from './load_branches';
import { initDetailsButton } from './init_details_button';
import { fetchCommitMergeRequests } from '~/commit_merge_requests'; import { fetchCommitMergeRequests } from '~/commit_merge_requests';
import MiniPipelineGraph from '~/mini_pipeline_graph_dropdown'; import MiniPipelineGraph from '~/mini_pipeline_graph_dropdown';
...@@ -15,4 +16,6 @@ export const initCommitBoxInfo = (containerSelector = '.js-commit-box-info') => ...@@ -15,4 +16,6 @@ export const initCommitBoxInfo = (containerSelector = '.js-commit-box-info') =>
new MiniPipelineGraph({ new MiniPipelineGraph({
container: '.js-commit-pipeline-graph', container: '.js-commit-pipeline-graph',
}).bindEvents(); }).bindEvents();
initDetailsButton();
}; };
import $ from 'jquery'; import $ from 'jquery';
$(() => { export const initDetailsButton = () => {
$('body').on('click', '.js-details-target', function target() {
$(this)
.closest('.js-details-container')
.toggleClass('open');
});
// Show details content. Hides link after click.
//
// %div
// %a.js-details-expand
// %div.js-details-content
//
$('body').on('click', '.js-details-expand', function expand(e) { $('body').on('click', '.js-details-expand', function expand(e) {
e.preventDefault(); e.preventDefault();
$(this) $(this)
.next('.js-details-content') .next('.js-details-content')
.removeClass('hide'); .removeClass('hide');
$(this).hide(); $(this).hide();
const truncatedItem = $(this).siblings('.js-details-short');
if (truncatedItem.length) {
truncatedItem.addClass('hide');
}
}); });
}); };
// Details
//--------
.js-details-container {
.content {
display: none;
&.hide { display: block; }
}
&.open .content {
display: block;
&.hide { display: none; }
}
}
// Toggle between two states.
.js-toggler-container {
.turn-on { display: block; }
.turn-off { display: none; }
&.on {
.turn-on { display: none; }
.turn-off { display: block; }
}
}
// Hide element if Vue is still working on rendering it fully. // Hide element if Vue is still working on rendering it fully.
[v-cloak='true'] { [v-cloak='true'] {
display: none !important; display: none !important;
......
...@@ -14,12 +14,6 @@ ...@@ -14,12 +14,6 @@
@extend %commit-description-base; @extend %commit-description-base;
} }
.js-details-expand {
&:hover {
text-decoration: none;
}
}
.commit-box { .commit-box {
border-top: 1px solid $border-color; border-top: 1px solid $border-color;
padding: $gl-padding 0; padding: $gl-padding 0;
...@@ -30,17 +24,6 @@ ...@@ -30,17 +24,6 @@
} }
} }
.commit-hash-full {
@include media-breakpoint-down(sm) {
width: 80px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
vertical-align: bottom;
}
}
.pipeline-info { .pipeline-info {
.status-icon-container { .status-icon-container {
display: inline-block; display: inline-block;
......
...@@ -57,12 +57,7 @@ ...@@ -57,12 +57,7 @@
.well-segment.branch-info .well-segment.branch-info
.icon-container.commit-icon .icon-container.commit-icon
= custom_icon("icon_commit") = custom_icon("icon_commit")
= link_to commit.short_id, project_commit_path(@project, @pipeline.sha), class: "commit-sha js-details-short" = link_to commit.short_id, project_commit_path(@project, @pipeline.sha), class: "commit-sha"
= link_to("#", class: "js-details-expand d-none d-md-inline") do
%span.text-expander
= sprite_icon('ellipsis_h', size: 12)
%span.js-details-content.hide
= link_to @pipeline.sha, project_commit_path(@project, @pipeline.sha), class: "commit-sha commit-hash-full"
= clipboard_button(text: @pipeline.sha, title: _("Copy commit SHA")) = clipboard_button(text: @pipeline.sha, title: _("Copy commit SHA"))
.well-segment.related-merge-request-info .well-segment.related-merge-request-info
......
---
title: Remove unnecessary expand sha button in pipelines page
merge_request: 47012
author:
type: fixed
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