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

Add latest changes from gitlab-org/gitlab@master

parent 196ada08
No related branches found
No related tags found
No related merge requests found
Showing
with 171 additions and 62 deletions
# For DEVELOPMENT only. Production uses Runit in
# https://gitlab.com/gitlab-org/omnibus-gitlab or the init scripts in
# lib/support/init.d, which call scripts in bin/ .
#
web: RAILS_ENV=development bin/web start_foreground
worker: RAILS_ENV=development bin/background_jobs start_foreground
Loading
Loading
@@ -24,10 +24,12 @@ export default class DropdownOperator extends FilteredSearchDropdown {
 
if (selected.tagName === 'LI') {
if (selected.hasAttribute('data-value')) {
const name = FilteredSearchVisualTokens.getLastTokenPartial();
const operator = selected.dataset.value;
FilteredSearchVisualTokens.removeLastTokenPartial();
FilteredSearchDropdownManager.addWordToInput({
tokenName: this.filter,
tokenName: name,
tokenOperator: operator,
clicked: false,
});
Loading
Loading
@@ -38,8 +40,6 @@ export default class DropdownOperator extends FilteredSearchDropdown {
}
 
renderContent(forceShowList = false) {
this.filter = FilteredSearchVisualTokens.getLastTokenPartial();
const dropdownData = [
{
tag: 'equal',
Loading
Loading
Loading
Loading
@@ -35,7 +35,7 @@ export default {
</script>
 
<template>
<ul class="content-list group-list-tree">
<ul class="groups-list group-list-tree">
<group-item
v-for="(group, index) in groups"
:key="index"
Loading
Loading
Loading
Loading
@@ -8,7 +8,7 @@ export const ACTIVE_TAB_ARCHIVED = 'archived';
 
export const GROUPS_LIST_HOLDER_CLASS = '.js-groups-list-holder';
export const GROUPS_FILTER_FORM_CLASS = '.js-group-filter-form';
export const CONTENT_LIST_CLASS = '.content-list';
export const CONTENT_LIST_CLASS = '.groups-list';
 
export const COMMON_STR = {
FAILURE: __('An error occurred. Please try again.'),
Loading
Loading
Loading
Loading
@@ -10,9 +10,30 @@ export default () => {
const $broadcastMessageType = $('.js-broadcast-message-type');
const $broadcastBannerMessagePreview = $('.js-broadcast-banner-message-preview');
const $broadcastMessage = $('.js-broadcast-message-message');
const previewPath = $broadcastMessage.data('previewPath');
const $jsBroadcastMessagePreview = $('.js-broadcast-message-preview');
 
const reloadPreview = function reloadPreview() {
const previewPath = $broadcastMessage.data('previewPath');
const message = $broadcastMessage.val();
const type = $broadcastMessageType.val();
if (message === '') {
$jsBroadcastMessagePreview.text(__('Your message here'));
} else {
axios
.post(previewPath, {
broadcast_message: {
message,
broadcast_type: type,
},
})
.then(({ data }) => {
$jsBroadcastMessagePreview.html(data.message);
})
.catch(() => flash(__('An error occurred while rendering preview broadcast message')));
}
};
$broadcastMessageColor.on('input', function onMessageColorInput() {
const previewColor = $(this).val();
$broadcastBannerMessagePreview.css('background-color', previewColor);
Loading
Loading
@@ -32,26 +53,14 @@ export default () => {
$broadcastMessageDismissableFormGroup.toggleClass('hidden');
$broadcastBannerMessagePreview.toggleClass('hidden');
$broadcastNotificationMessagePreview.toggleClass('hidden');
reloadPreview();
});
 
$broadcastMessage.on(
'input',
debounce(function onMessageInput() {
const message = $(this).val();
if (message === '') {
$jsBroadcastMessagePreview.text(__('Your message here'));
} else {
axios
.post(previewPath, {
broadcast_message: {
message,
},
})
.then(({ data }) => {
$jsBroadcastMessagePreview.html(data.message);
})
.catch(() => flash(__('An error occurred while rendering preview broadcast message')));
}
debounce(() => {
reloadPreview();
}, 250),
);
 
Loading
Loading
Loading
Loading
@@ -27,9 +27,9 @@ export function fetchLogsTree(client, path, offset, resolver = null) {
 
fetchpromise = axios
.get(
`${gon.relative_url_root}/${projectPath}/-/refs/${escape(ref)}/logs_tree/${encodeURIComponent(
path.replace(/^\//, ''),
)}`,
`${gon.relative_url_root}/${projectPath}/-/refs/${encodeURIComponent(
ref,
)}/logs_tree/${encodeURIComponent(path.replace(/^\//, ''))}`,
{
params: { format: 'json', offset },
},
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ export default function createRouter(base, baseRef) {
base: joinPaths(gon.relative_url_root || '', base),
routes: [
{
path: `(/-)?/tree/${escape(baseRef)}/:path*`,
path: `(/-)?/tree/(${encodeURIComponent(baseRef)}|${baseRef})/:path*`,
name: 'treePath',
component: TreePage,
props: route => ({
Loading
Loading
Loading
Loading
@@ -8,6 +8,32 @@
}
}
 
.groups-list {
@include basic-list;
display: flex;
flex-direction: column;
margin: 0;
.group-row-contents .controls > .btn:last-child {
margin: 0;
}
li {
.title {
font-weight: 600;
}
a {
color: $gray-900;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}
}
.group-root-path {
max-width: 40vw;
overflow: hidden;
Loading
Loading
@@ -15,11 +41,6 @@
word-wrap: nowrap;
}
 
.content-list .group-name {
font-weight: $gl-font-weight-bold;
color: $pages-group-name-color;
}
.group-row {
@include basic-list-stats;
 
Loading
Loading
@@ -322,10 +343,6 @@ table.pipeline-project-metrics tr td {
}
}
 
.content-list li:last-child {
padding-bottom: 0;
}
.group-list-tree {
margin-bottom: 0;
margin-left: 30px;
Loading
Loading
Loading
Loading
@@ -4,6 +4,11 @@ module SnippetsActions
extend ActiveSupport::Concern
 
def edit
# We need to load some info from the existing blob
snippet.content = blob.data
snippet.file_name = blob.path
render 'edit'
end
 
def raw
Loading
Loading
@@ -25,6 +30,18 @@ module SnippetsActions
 
private
 
# rubocop:disable Gitlab/ModuleWithInstanceVariables
def blob
return unless snippet
@blob ||= if Feature.enabled?(:version_snippets, current_user) && !snippet.repository.empty?
snippet.blobs.first
else
snippet.blob
end
end
# rubocop:enable Gitlab/ModuleWithInstanceVariables
def convert_line_endings(content)
params[:line_ending] == 'raw' ? content : content.gsub(/\r\n/, "\n")
end
Loading
Loading
Loading
Loading
@@ -121,16 +121,6 @@ class Projects::SnippetsController < Projects::ApplicationController
alias_method :awardable, :snippet
alias_method :spammable, :snippet
 
def blob
return unless snippet
@blob ||= if Feature.enabled?(:version_snippets, current_user) && !snippet.repository.empty?
snippet.blobs.first
else
snippet.blob
end
end
def spammable_path
project_snippet_path(@project, @snippet)
end
Loading
Loading
Loading
Loading
@@ -126,16 +126,6 @@ class SnippetsController < ApplicationController
alias_method :awardable, :snippet
alias_method :spammable, :snippet
 
def blob
return unless snippet
@blob ||= if Feature.enabled?(:version_snippets, current_user) && !snippet.repository.empty?
snippet.blobs.first
else
snippet.blob
end
end
def spammable_path
snippet_path(@snippet)
end
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
.empty-state.hidden
= render "shared/groups/empty_state"
 
%ul.content-list{ data: { hide_projects: 'false', group_id: group.id, path: group_path(group) } }
%section{ data: { hide_projects: 'false', group_id: group.id, path: group_path(group) } }
.js-groups-list-holder
.loading-container.text-center.prepend-top-20
.spinner.spinner-md
---
title: Add a DB column to track external issue and epic ids when importing from external sources
merge_request: 27522
author:
type: added
---
title: Fix filtered search tokenization
merge_request: 27648
author:
type: fixed
---
title: Show the proper information in snippet edit form
merge_request: 27479
author:
type: fixed
---
title: Fixes the repository Vue router not working with Chinese characters
merge_request: 27494
author:
type: fixed
# frozen_string_literal: true
class AddExternalKeyToIssuesTable < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
with_lock_retries do
add_column :issues, :external_key, :string, limit: 255
end
end
def down
with_lock_retries do
remove_column :issues, :external_key
end
end
end
# frozen_string_literal: true
class AddIndexOnExternalKeyToIssuesTable < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index(:issues, [:project_id, :external_key], unique: true, where: 'external_key IS NOT NULL')
end
def down
remove_concurrent_index(:issues, [:project_id, :external_key])
end
end
# frozen_string_literal: true
class AddExternalKeyToEpicsTable < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
with_lock_retries do
add_column :epics, :external_key, :string, limit: 255
end
end
def down
with_lock_retries do
remove_column :epics, :external_key
end
end
end
# frozen_string_literal: true
class AddIndexOnExternalKeyToEpicsTable < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index(:epics, [:group_id, :external_key], unique: true, where: 'external_key IS NOT NULL')
end
def down
remove_concurrent_index(:epics, [:group_id, :external_key])
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