Skip to content

Commit

Permalink
Add latest changes from gitlab-org/gitlab@master
Browse files Browse the repository at this point in the history
  • Loading branch information
GitLab Bot committed Oct 8, 2020
1 parent 028d8ac commit 33882b0
Show file tree
Hide file tree
Showing 81 changed files with 403 additions and 194 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default {
<template>
<div class="design-scaler btn-group" role="group">
<button class="btn" :disabled="disableDecrease" @click="decrementScale">
<span class="d-flex-center gl-icon s16">
<span class="gl-display-flex gl-justify-content-center gl-align-items-center gl-icon s16">
</span>
</button>
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/design_management/components/image.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ export default {
</script>

<template>
<div class="m-auto js-design-image">
<gl-icon v-if="imageError" class="text-secondary-100" name="media-broken" :size="48" />
<div class="gl-mx-auto gl-my-auto js-design-image">
<gl-icon v-if="imageError" class="gl-text-gray-200" name="media-broken" :size="48" />
<img
v-show="!imageError"
ref="contentImg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ import { trackDesignDetailView } from '../../utils/tracking';
import { DESIGNS_ROUTE_NAME } from '../../router/constants';
import { ACTIVE_DISCUSSION_SOURCE_TYPES } from '../../constants';
const DEFAULT_SCALE = 1;
export default {
components: {
ApolloMutation,
Expand All @@ -65,7 +67,7 @@ export default {
comment: '',
annotationCoordinates: null,
errorMessage: '',
scale: 1,
scale: DEFAULT_SCALE,
resolvedDiscussionsExpanded: false,
};
},
Expand Down Expand Up @@ -157,6 +159,11 @@ export default {
beforeDestroy() {
Mousetrap.unbind('esc', this.closeDesign);
},
beforeRouteUpdate(to, from, next) {
// reset scale when the active design changes
this.scale = DEFAULT_SCALE;
next();
},
methods: {
addImageDiffNoteToStore(
store,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const addNewDesignToStore = (store, designManagementUpload, query) => {

const newDesigns = currentDesigns
.map(design => {
return designManagementUpload.designs[design.filename] || design;
return designManagementUpload.designs.find(d => d.filename === design.filename) || design;
})
.concat(difference);

Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/lib/utils/text_markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export function insertMarkdownText({
let editorSelectionEnd;
let lastNewLine;
let textToInsert;
selected = selected.toString();

if (editor) {
const selectionRange = getEditorSelectionRange(editor);
Expand Down
5 changes: 5 additions & 0 deletions app/assets/javascripts/notes/components/timeline_toggle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { mapActions, mapGetters } from 'vuex';
import { s__ } from '~/locale';
import { COMMENTS_ONLY_FILTER_VALUE, DESC } from '../constants';
import notesEventHub from '../event_hub';
import TrackEventDirective from '~/vue_shared/directives/track_event';
import { trackToggleTimelineView } from '../utils';
export const timelineEnabledTooltip = s__('Timeline|Turn timeline view off');
export const timelineDisabledTooltip = s__('Timeline|Turn timeline view on');
Expand All @@ -14,6 +16,7 @@ export default {
},
directives: {
GlTooltip: GlTooltipDirective,
TrackEvent: TrackEventDirective,
},
computed: {
...mapGetters(['timelineEnabled', 'sortDirection']),
Expand All @@ -23,6 +26,7 @@ export default {
},
methods: {
...mapActions(['setTimelineView', 'setDiscussionSortDirection']),
trackToggleTimelineView,
setSort() {
if (this.timelineEnabled && this.sortDirection !== DESC) {
this.setDiscussionSortDirection({ direction: DESC, persist: false });
Expand All @@ -44,6 +48,7 @@ export default {
<template>
<gl-button
v-gl-tooltip
v-track-event="trackToggleTimelineView(timelineEnabled)"
icon="comments"
size="small"
:selected="timelineEnabled"
Expand Down
12 changes: 12 additions & 0 deletions app/assets/javascripts/notes/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable @gitlab/require-i18n-strings */

/**
* Tracks snowplow event when User toggles timeline view
* @param {Boolean} enabled that will be send as a property for the event
*/
export const trackToggleTimelineView = enabled => ({
category: 'Incident Management',
action: 'toggle_incident_comments_into_timeline_view',
label: 'Status',
property: enabled,
});
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<script>
import { mapGetters } from 'vuex';
import { GlTooltipDirective, GlFriendlyWrap, GlIcon } from '@gitlab/ui';
import { GlTooltipDirective, GlFriendlyWrap, GlIcon, GlButton } from '@gitlab/ui';
import { __ } from '~/locale';
export default {
name: 'TestsSuiteTable',
components: {
GlIcon,
GlFriendlyWrap,
GlButton,
},
directives: {
GlTooltip: GlTooltipDirective,
Expand Down Expand Up @@ -45,6 +46,9 @@ export default {
<div role="rowheader" class="table-section section-20">
{{ __('Name') }}
</div>
<div role="rowheader" class="table-section section-10">
{{ __('Filename') }}
</div>
<div role="rowheader" class="table-section section-10 text-center">
{{ __('Status') }}
</div>
Expand All @@ -63,18 +67,30 @@ export default {
>
<div class="table-section section-20 section-wrap">
<div role="rowheader" class="table-mobile-header">{{ __('Suite') }}</div>
<div class="table-mobile-content pr-md-1 gl-overflow-wrap-break">
<div class="table-mobile-content gl-md-pr-2 gl-overflow-wrap-break">
<gl-friendly-wrap :symbols="$options.wrapSymbols" :text="testCase.classname" />
</div>
</div>

<div class="table-section section-20 section-wrap">
<div role="rowheader" class="table-mobile-header">{{ __('Name') }}</div>
<div class="table-mobile-content pr-md-1 gl-overflow-wrap-break">
<gl-friendly-wrap
data-testid="caseName"
:symbols="$options.wrapSymbols"
:text="testCase.name"
<div class="table-mobile-content gl-md-pr-2 gl-overflow-wrap-break">
<gl-friendly-wrap :symbols="$options.wrapSymbols" :text="testCase.name" />
</div>
</div>

<div class="table-section section-10 section-wrap">
<div role="rowheader" class="table-mobile-header">{{ __('Filename') }}</div>
<div class="table-mobile-content gl-md-pr-2 gl-overflow-wrap-break">
<gl-friendly-wrap :symbols="$options.wrapSymbols" :text="testCase.file" />
<gl-button
v-gl-tooltip
size="small"
category="tertiary"
icon="copy-to-clipboard"
:title="__('Copy to clipboard')"
:data-clipboard-text="testCase.file"
:aria-label="__('Copy to clipboard')"
/>
</div>
</div>
Expand Down
28 changes: 14 additions & 14 deletions app/assets/javascripts/sidebar/stores/sidebar_store.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ export default class SidebarStore {
SidebarStore.singleton = this;
}

setAssigneeData(data) {
setAssigneeData({ assignees }) {
this.isFetching.assignees = false;
if (data.assignees) {
this.assignees = data.assignees;
if (assignees) {
this.assignees = assignees;
}
}

setReviewerData(data) {
setReviewerData({ reviewers }) {
this.isFetching.reviewers = false;
if (data.reviewers) {
this.reviewers = data.reviewers;
if (reviewers) {
this.reviewers = reviewers;
}
}

Expand Down Expand Up @@ -91,22 +91,22 @@ export default class SidebarStore {
}

findAssignee(findAssignee) {
return this.assignees.find(assignee => assignee.id === findAssignee.id);
return this.assignees.find(({ id }) => id === findAssignee.id);
}

findReviewer(findReviewer) {
return this.reviewers.find(reviewer => reviewer.id === findReviewer.id);
return this.reviewers.find(({ id }) => id === findReviewer.id);
}

removeAssignee(removeAssignee) {
if (removeAssignee) {
this.assignees = this.assignees.filter(assignee => assignee.id !== removeAssignee.id);
removeAssignee(assignee) {
if (assignee) {
this.assignees = this.assignees.filter(({ id }) => id !== assignee.id);
}
}

removeReviewer(removeReviewer) {
if (removeReviewer) {
this.reviewers = this.reviewers.filter(reviewer => reviewer.id !== removeReviewer.id);
removeReviewer(reviewer) {
if (reviewer) {
this.reviewers = this.reviewers.filter(({ id }) => id !== reviewer.id);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<script>
import { GlIcon } from '@gitlab/ui';
import tooltip from '~/vue_shared/directives/tooltip';
import { __ } from '~/locale';
import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { SQUASH_BEFORE_MERGE } from '../../i18n';
export default {
components: {
GlIcon,
},
directives: {
tooltip,
GlTooltip: GlTooltipDirective,
},
i18n: {
...SQUASH_BEFORE_MERGE,
},
props: {
value: {
Expand All @@ -28,7 +30,10 @@ export default {
},
computed: {
tooltipTitle() {
return this.isDisabled ? __('Required in this project.') : false;
return this.isDisabled ? this.$options.i18n.tooltipTitle : null;
},
tooltipFocusable() {
return this.isDisabled ? '0' : null;
},
},
};
Expand All @@ -37,10 +42,11 @@ export default {
<template>
<div class="inline">
<label
v-tooltip
v-gl-tooltip
:class="{ 'gl-text-gray-400': isDisabled }"
:tabindex="tooltipFocusable"
data-testid="squashLabel"
:data-title="tooltipTitle"
:title="tooltipTitle"
>
<input
:checked="value"
Expand All @@ -50,19 +56,20 @@ export default {
class="qa-squash-checkbox js-squash-checkbox"
@change="$emit('input', $event.target.checked)"
/>
{{ __('Squash commits') }}
{{ $options.i18n.checkboxLabel }}
</label>
<a
v-if="helpPath"
v-tooltip
v-gl-tooltip
:href="helpPath"
data-title="About this feature"
data-placement="bottom"
:title="$options.i18n.helpLabel"
target="_blank"
rel="noopener noreferrer nofollow"
data-container="body"
>
<gl-icon name="question" />
<span class="sr-only">
{{ $options.i18n.helpLabel }}
</span>
</a>
</div>
</template>
7 changes: 7 additions & 0 deletions app/assets/javascripts/vue_merge_request_widget/i18n.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { __ } from '~/locale';

export const SQUASH_BEFORE_MERGE = {
tooltipTitle: __('Required in this project.'),
checkboxLabel: __('Squash commits'),
helpLabel: __('What is squashing?'),
};
2 changes: 1 addition & 1 deletion app/helpers/issuables_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def selected_template(issuable)

def issuable_todo_button_data(issuable, is_collapsed)
{
todo_text: _('Add a To Do'),
todo_text: _('Add a to do'),
mark_text: _('Mark as done'),
todo_icon: sprite_icon('todo-add'),
mark_icon: sprite_icon('todo-done', css_class: 'todo-undone'),
Expand Down
2 changes: 2 additions & 0 deletions app/presenters/snippet_blob_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def renderer
end

def snippet_blob_raw_route(only_path: false)
return gitlab_raw_snippet_url(snippet, only_path: only_path) unless snippet.repository_exists?

gitlab_raw_snippet_blob_url(snippet, blob.path, only_path: only_path)
end
end
2 changes: 1 addition & 1 deletion app/views/dashboard/todos/_todo.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@
- else
.todo-actions
= link_to restore_dashboard_todo_path(todo), method: :patch, class: 'btn btn-loading d-flex align-items-center js-add-todo', data: { href: restore_dashboard_todo_path(todo) } do
Add a To Do
Add a to do
%span.spinner.ml-1
Loading

0 comments on commit 33882b0

Please sign in to comment.