Skip to content
Snippets Groups Projects
Commit eca3cd3a authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 6e81d7f6
No related branches found
No related tags found
No related merge requests found
Showing
with 134 additions and 53 deletions
Loading
Loading
@@ -3,6 +3,7 @@ import commitPipelineStatus from '~/projects/tree/components/commit_pipeline_sta
import BlobViewer from '~/blob/viewer/index';
import initBlob from '~/pages/projects/init_blob';
import GpgBadges from '~/gpg_badges';
import '~/sourcegraph/load';
 
document.addEventListener('DOMContentLoaded', () => {
new BlobViewer(); // eslint-disable-line no-new
Loading
Loading
Loading
Loading
@@ -9,6 +9,7 @@ import initNotes from '~/init_notes';
import initChangesDropdown from '~/init_changes_dropdown';
import initDiffNotes from '~/diff_notes/diff_notes_bundle';
import { fetchCommitMergeRequests } from '~/commit_merge_requests';
import '~/sourcegraph/load';
 
document.addEventListener('DOMContentLoaded', () => {
const hasPerfBar = document.querySelector('.with-performance-bar');
Loading
Loading
Loading
Loading
@@ -5,6 +5,7 @@ import { handleLocationHash } from '~/lib/utils/common_utils';
import howToMerge from '~/how_to_merge';
import initPipelines from '~/commit/pipelines/pipelines_bundle';
import initVueIssuableSidebarApp from '~/issuable_sidebar/sidebar_bundle';
import initSourcegraph from '~/sourcegraph';
import initWidget from '../../../vue_merge_request_widget';
 
export default function() {
Loading
Loading
@@ -19,4 +20,5 @@ export default function() {
handleLocationHash();
howToMerge();
initWidget();
initSourcegraph();
}
import setupToggleButtons from '~/toggle_buttons';
 
function updateVisibility(selector, isVisible) {
Array.from(document.querySelectorAll(selector)).forEach(el => {
if (isVisible) {
el.classList.remove('d-none');
} else {
el.classList.add('d-none');
}
});
}
export default () => {
const toggleContainer = document.querySelector('.js-auto-ssl-toggle-container');
 
if (toggleContainer) {
const onToggleButtonClicked = isAutoSslEnabled => {
Array.from(document.querySelectorAll('.js-shown-unless-auto-ssl')).forEach(el => {
if (isAutoSslEnabled) {
el.classList.add('d-none');
} else {
el.classList.remove('d-none');
}
});
updateVisibility('.js-shown-unless-auto-ssl', !isAutoSslEnabled);
updateVisibility('.js-shown-if-auto-ssl', isAutoSslEnabled);
 
Array.from(document.querySelectorAll('.js-enabled-unless-auto-ssl')).forEach(el => {
if (isAutoSslEnabled) {
Loading
Loading
Loading
Loading
@@ -64,14 +64,14 @@ export default {
v-for="(testSuite, index) in getTestSuites"
:key="index"
role="row"
class="gl-responsive-table-row test-reports-summary-row rounded cursor-pointer js-suite-row"
class="gl-responsive-table-row gl-responsive-table-row-clickable test-reports-summary-row rounded cursor-pointer js-suite-row"
@click="tableRowClick(testSuite)"
>
<div class="table-section section-25">
<div role="rowheader" class="table-mobile-header font-weight-bold">
{{ __('Suite') }}
</div>
<div class="table-mobile-content test-reports-summary-suite cgray pl-3">
<div class="table-mobile-content underline cgray pl-3">
{{ testSuite.name }}
</div>
</div>
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@ import createStore from './store';
export default () => {
const el = document.getElementById('js-edit-release-page');
 
const store = createStore(el.dataset);
const store = createStore();
store.dispatch('setInitialState', el.dataset);
 
return new Vue({
Loading
Loading
Loading
Loading
@@ -109,7 +109,7 @@ export default {
class="text-expander"
@click="toggleShowDescription"
>
<icon name="ellipsis_h" />
<icon name="ellipsis_h" :size="10" />
</gl-button>
<div class="committer">
<gl-link
Loading
Loading
@@ -124,7 +124,7 @@ export default {
</div>
<pre
v-if="commit.description"
v-show="showDescription"
:class="{ 'd-block': showDescription }"
class="commit-row-description append-bottom-8"
>
{{ commit.description }}
Loading
Loading
import axios from '~/lib/utils/axios_utils';
import { normalizeData } from 'ee_else_ce/repository/utils/commit';
import getCommits from './queries/getCommits.query.graphql';
import getProjectPath from './queries/getProjectPath.query.graphql';
import getRef from './queries/getRef.query.graphql';
Loading
Loading
@@ -6,19 +7,6 @@ import getRef from './queries/getRef.query.graphql';
let fetchpromise;
let resolvers = [];
 
export function normalizeData(data) {
return data.map(d => ({
sha: d.commit.id,
message: d.commit.message,
committedDate: d.commit.committed_date,
commitPath: d.commit_path,
fileName: d.file_name,
type: d.type,
lockLabel: d.lock_label,
__typename: 'LogTreeCommit',
}));
}
export function resolveCommit(commits, { resolve, entry }) {
const commit = commits.find(c => c.fileName === entry.name && c.type === entry.type);
 
Loading
Loading
fragment TreeEntryCommit on LogTreeCommit {
sha
message
committedDate
commitPath
fileName
type
}
#import "ee_else_ce/repository/queries/commit.fragment.graphql"
query getCommit($fileName: String!, $type: String!, $path: String!) {
commit(path: $path, fileName: $fileName, type: $type) @client {
sha
message
committedDate
commitPath
fileName
type
lockLabel
...TreeEntryCommit
}
}
#import "ee_else_ce/repository/queries/commit.fragment.graphql"
query getCommits {
commits @client {
sha
message
committedDate
commitPath
fileName
type
lockLabel
...TreeEntryCommit
}
}
Loading
Loading
@@ -5,7 +5,7 @@ query pathLastCommit($projectPath: ID!, $path: String, $ref: String!) {
lastCommit {
sha
title
message
description
webUrl
authoredDate
author {
Loading
Loading
// eslint-disable-next-line import/prefer-default-export
export function normalizeData(data, extra = () => {}) {
return data.map(d => ({
sha: d.commit.id,
message: d.commit.message,
committedDate: d.commit.committed_date,
commitPath: d.commit_path,
fileName: d.file_name,
type: d.type,
__typename: 'LogTreeCommit',
...extra(d),
}));
}
function loadScript(path) {
const script = document.createElement('script');
script.type = 'application/javascript';
script.src = path;
script.defer = true;
document.head.appendChild(script);
}
/**
* Loads the Sourcegraph integration for support for Sourcegraph extensions and
* code intelligence.
*/
export default function initSourcegraph() {
const { url } = gon.sourcegraph || {};
if (!url) {
return;
}
const assetsUrl = new URL('/assets/webpack/sourcegraph/', window.location.href);
const scriptPath = new URL('scripts/integration.bundle.js', assetsUrl).href;
window.SOURCEGRAPH_ASSETS_URL = assetsUrl.href;
window.SOURCEGRAPH_URL = url;
window.SOURCEGRAPH_INTEGRATION = 'gitlab-integration';
loadScript(scriptPath);
}
import initSourcegraph from './index';
/**
* Load sourcegraph in it's own listener so that it's isolated from failures.
*/
document.addEventListener('DOMContentLoaded', initSourcegraph);
Loading
Loading
@@ -168,7 +168,7 @@ export default {
:prepend="true"
tag="* [ ] "
:button-title="__('Add a task list')"
icon="task-done"
icon="list-task"
/>
<toolbar-button
:tag="mdTable"
Loading
Loading
Loading
Loading
@@ -572,3 +572,10 @@ img.emoji {
.gl-font-size-20 { font-size: $gl-font-size-20; }
.gl-font-size-28 { font-size: $gl-font-size-28; }
.gl-font-size-42 { font-size: $gl-font-size-42; }
.border-section {
@include gl-py-6;
@include gl-m-0;
border-top: 1px solid $border-color;
}
Loading
Loading
@@ -20,6 +20,17 @@
@extend .gl-responsive-table-row-layout;
margin-top: 10px;
border: 1px solid $border-color;
color: $gray-700;
&.gl-responsive-table-row-clickable {
&:hover {
background-color: $gray-light;
.underline {
text-decoration: underline;
}
}
}
 
@include media-breakpoint-up(md) {
margin: 0;
Loading
Loading
Loading
Loading
@@ -1084,18 +1084,6 @@ button.mini-pipeline-graph-dropdown-toggle {
}
 
.test-reports-table {
color: $gray-700;
.test-reports-summary-row {
&:hover {
background-color: $gray-light;
.test-reports-summary-suite {
text-decoration: underline;
}
}
}
.build-trace {
@include build-trace();
}
Loading
Loading
# frozen_string_literal: true
module SourcegraphGon
extend ActiveSupport::Concern
included do
before_action :push_sourcegraph_gon, if: :html_request?
end
private
def push_sourcegraph_gon
return unless sourcegraph_enabled?
gon.push({
sourcegraph: { url: Gitlab::CurrentSettings.sourcegraph_url }
})
end
def sourcegraph_enabled?
Gitlab::CurrentSettings.sourcegraph_enabled && sourcegraph_enabled_for_project? && current_user&.sourcegraph_enabled
end
def sourcegraph_enabled_for_project?
return false unless project && Gitlab::Sourcegraph.feature_enabled?(project)
return project.public? if Gitlab::CurrentSettings.sourcegraph_public_only
true
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment