Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-03-26 06:09:26 +00:00
parent 88a161660f
commit 2d40635435
19 changed files with 219 additions and 41 deletions

View File

@ -203,6 +203,7 @@ export default {
:draggable="glFeatures.dragCommentSelection"
type="button"
class="add-diff-note unified-diff-components-diff-note-button note-button js-add-diff-note-button qa-diff-comment"
data-qa-selector="diff_comment_button"
:class="{ 'gl-cursor-grab': dragging }"
:disabled="line.left.commentsDisabled"
@click="handleCommentButton(line.left)"

View File

@ -140,7 +140,6 @@ export default {
ref="addDiffNoteButton"
type="button"
class="add-diff-note note-button js-add-diff-note-button"
data-qa-selector="diff_comment_button"
:disabled="line.commentsDisabled"
@click="handleCommentButton"
>

View File

@ -0,0 +1,81 @@
<script>
import { GlLoadingIcon } from '@gitlab/ui';
import { s__, __, sprintf } from '~/locale';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
/**
* Renders an inline field, whose value can be copied to the clipboard,
* for use in the GitLab sidebar (issues, MRs, etc.).
*/
export default {
name: 'CopyableField',
components: {
GlLoadingIcon,
ClipboardButton,
},
props: {
value: {
type: String,
required: true,
},
name: {
type: String,
required: true,
},
isLoading: {
type: Boolean,
required: false,
default: false,
},
},
computed: {
clipboardProps() {
return {
category: 'tertiary',
tooltipBoundary: 'viewport',
tooltipPlacement: 'left',
text: this.value,
title: sprintf(this.$options.i18n.clipboardTooltip, { name: this.name }),
};
},
loadingIconLabel() {
return sprintf(this.$options.i18n.loadingIconLabel, { name: this.name });
},
templateText() {
return sprintf(this.$options.i18n.templateText, {
name: this.name,
value: this.value,
});
},
},
i18n: {
loadingIconLabel: __('Loading %{name}'),
clipboardTooltip: __('Copy %{name}'),
templateText: s__('Sidebar|%{name}: %{value}'),
},
};
</script>
<template>
<div>
<clipboard-button
v-if="!isLoading"
css-class="sidebar-collapsed-icon dont-change-state"
v-bind="clipboardProps"
/>
<div
class="gl-display-flex gl-align-items-center gl-justify-content-space-between hide-collapsed"
>
<span
class="gl-overflow-hidden gl-text-overflow-ellipsis gl-white-space-nowrap"
:title="value"
>
{{ templateText }}
</span>
<gl-loading-icon v-if="isLoading" inline :label="loadingIconLabel" />
<clipboard-button v-else size="small" v-bind="clipboardProps" />
</div>
</div>
</template>

View File

@ -261,7 +261,6 @@
// migrated to Vue.
.gl-button .award-emoji-block gl-emoji {
top: -1px;
margin-top: -1px;
margin-bottom: -1px;
}

View File

@ -1,10 +1,10 @@
gl-emoji {
font-style: normal;
display: inline-flex;
vertical-align: middle;
vertical-align: baseline;
font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
font-size: 1.4em;
line-height: 1em;
font-size: 1.2em;
line-height: 1;
}
.user-status-emoji {

View File

@ -398,7 +398,6 @@
> svg {
position: absolute;
top: 11px;
right: 6px;
}
}

View File

@ -238,10 +238,6 @@
text-overflow: ellipsis;
}
cite {
font-style: normal;
}
button {
float: right;
padding: 1px 5px;

View File

@ -1,5 +1,5 @@
.dropdown.gl-display-flex.gl-align-items-center.gl-ml-3#js-add-list
%button.gl-button.btn.btn-confirm.btn-confirm-secondary.js-new-board-list{ type: "button", data: board_list_data }
%button.gl-button.btn.btn-confirm.js-new-board-list{ type: "button", data: board_list_data }
Add list
.dropdown-menu.dropdown-extended-height.dropdown-menu-paging.dropdown-menu-right.dropdown-menu-issues-board-new.dropdown-menu-selectable.js-tab-container-labels
= render partial: "shared/issuable/label_page_default", locals: { show_footer: true, show_create: true, show_boards_content: true, title: "Add list" }

View File

@ -165,6 +165,6 @@
.cross-project-reference.hide-collapsed
%span
= s_('MilestoneSidebar|Reference:')
%cite{ title: milestone_ref }
%span{ title: milestone_ref }
= milestone_ref
= clipboard_button(text: milestone_ref, title: s_('MilestoneSidebar|Copy reference'), placement: "left", boundary: 'viewport')

View File

@ -0,0 +1,6 @@
---
title: Update button variants on the project boards controller to better align with
the Pajamas Design System
merge_request: 57129
author:
type: other

View File

@ -0,0 +1,6 @@
---
title: Unify the Docker Image build CI template and use the default branch instead
of hardcoded 'master'
merge_request: 51931
author: dnsmichi
type: changed

View File

@ -98,16 +98,27 @@ class a {
}
```
## Use ParseInt
## Converting Strings to Integers
Use `ParseInt` when converting a numeric string into a number.
When converting strings to integers, `parseInt` has a slight performance advantage over `Number`, but `Number` is semantic and can be more readable. Prefer `parseInt`, but do not discourage `Number` if it significantly helps readability.
**WARNING:** `parseInt` **must** include the [radix argument](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt).
```javascript
// bad
Number('10')
parseInt('10');
// bad
things.map(parseInt)
// ok
Number("106")
// good
parseInt('10', 10);
things.map(Number)
// good
parseInt("106", 10)
```
## CSS Selectors - Use `js-` prefix

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -110,15 +110,17 @@ link in the issue sidebar.
> - Introduced in [GitLab Ultimate](https://about.gitlab.com/pricing/) 10.5.
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/37081) to the [Premium](https://about.gitlab.com/pricing/) tier in GitLab 12.8.
> - Searching by the user's reaction emoji [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/325630) in GitLab 13.11.
You can search for an epic from the list of epics using filtered search bar (similar to
that of Issues and Merge Requests) based on following parameters:
that of issues and merge requests) based on following parameters:
- Title or description
- Author name / username
- Labels
- Reaction emoji
![epics search](img/epics_search.png)
![epics search](img/epics_search_v13_11.png)
To search, go to the list of epics and select the field **Search or filter results**.
It displays a dropdown menu, from which you can add an author. You can also enter plain

View File

@ -1,27 +1,31 @@
docker-build-master:
# Official docker image.
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE"
only:
- master
# Build a Docker image with CI/CD and push to the GitLab registry.
# Docker-in-Docker documentation: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
#
# This template uses one generic job with conditional builds
# for the default branch and all other (MR) branches.
docker-build:
# Official docker image.
# Use the official docker image.
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# Default branch leaves tag empty (= latest tag)
# All other branches are tagged with the escaped branch name (commit ref slug)
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
except:
- master
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag=""
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
- docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" .
- docker push "$CI_REGISTRY_IMAGE${tag}"
# Run this job in a branch where a Dockerfile exists
rules:
- if: $CI_COMMIT_BRANCH
exists:
- Dockerfile

View File

@ -8542,6 +8542,9 @@ msgstr ""
msgid "Copy %{http_label} clone URL"
msgstr ""
msgid "Copy %{name}"
msgstr ""
msgid "Copy %{protocol} clone URL"
msgstr ""
@ -18482,6 +18485,9 @@ msgstr ""
msgid "Loading"
msgstr ""
msgid "Loading %{name}"
msgstr ""
msgid "Loading contribution stats for group members"
msgstr ""
@ -25276,9 +25282,6 @@ msgstr ""
msgid "Reference"
msgstr ""
msgid "Reference:"
msgstr ""
msgid "References"
msgstr ""
@ -28181,6 +28184,9 @@ msgstr ""
msgid "Side-by-side"
msgstr ""
msgid "Sidebar|%{name}: %{value}"
msgstr ""
msgid "Sidebar|Assign health status"
msgstr ""

View File

@ -67,8 +67,11 @@ module QA
element :edit_in_ide_button
end
view 'app/assets/javascripts/diffs/components/inline_diff_table_row.vue' do
view 'app/assets/javascripts/diffs/components/diff_row.vue' do
element :diff_comment_button
end
view 'app/assets/javascripts/diffs/components/inline_diff_table_row.vue' do
element :new_diff_line_link
end

View File

@ -0,0 +1,65 @@
import { GlLoadingIcon } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import CopyableField from '~/vue_shared/components/sidebar/copyable_field.vue';
describe('SidebarCopyableField', () => {
let wrapper;
const defaultProps = {
value: 'Gl-1',
name: 'Reference',
};
const createComponent = (propsData = defaultProps) => {
wrapper = shallowMount(CopyableField, {
propsData,
});
};
afterEach(() => {
wrapper.destroy();
});
const findClipboardButton = () => wrapper.findComponent(ClipboardButton);
const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon);
describe('template', () => {
describe('when `isLoading` prop is `false`', () => {
beforeEach(() => {
createComponent();
});
it('renders copyable field', () => {
expect(wrapper.text()).toContain('Reference: Gl-1');
});
it('renders ClipboardButton with correct props', () => {
const clipboardButton = findClipboardButton();
expect(clipboardButton.exists()).toBe(true);
expect(clipboardButton.props('title')).toBe(`Copy ${defaultProps.name}`);
expect(clipboardButton.props('text')).toBe(defaultProps.value);
});
it('does not render loading icon', () => {
expect(findLoadingIcon().exists()).toBe(false);
});
});
describe('when `isLoading` prop is `true`', () => {
beforeEach(() => {
createComponent({ ...defaultProps, isLoading: true });
});
it('renders loading icon', () => {
expect(findLoadingIcon().exists()).toBe(true);
expect(findLoadingIcon().props('label')).toBe('Loading Reference');
});
it('does not render clipboard button', () => {
expect(findClipboardButton().exists()).toBe(false);
});
});
});
});