diff options
Diffstat (limited to 'app/assets')
7 files changed, 44 insertions, 34 deletions
diff --git a/app/assets/javascripts/boards/index.js b/app/assets/javascripts/boards/index.js index 6be3a62ff00..0d10c896a47 100644 --- a/app/assets/javascripts/boards/index.js +++ b/app/assets/javascripts/boards/index.js @@ -166,6 +166,7 @@ export default () => { humanTotalTimeSpent, weight, epic, + assignees, } = convertObjectPropsToCamelCase(data); newIssue.setFetchingState('subscriptions', false); @@ -179,6 +180,7 @@ export default () => { subscribed, weight, epic, + assignees, }); }) .catch(() => { diff --git a/app/assets/javascripts/commit/image_file.js b/app/assets/javascripts/commit/image_file.js index 60c2059a876..a28e17f7a56 100644 --- a/app/assets/javascripts/commit/image_file.js +++ b/app/assets/javascripts/commit/image_file.js @@ -1,4 +1,4 @@ -/* eslint-disable func-names, no-var, no-else-return, consistent-return, one-var, no-return-assign */ +/* eslint-disable func-names, no-else-return, consistent-return, one-var, no-return-assign */ import $ from 'jquery'; @@ -51,7 +51,7 @@ export default class ImageFile { } // eslint-disable-next-line class-methods-use-this initDraggable($el, padding, callback) { - var dragging = false; + let dragging = false; const $body = $('body'); const $offsetEl = $el.parent(); const dragStart = function() { @@ -88,14 +88,12 @@ export default class ImageFile { } static prepareFrames(view) { - var maxHeight, maxWidth; - maxWidth = 0; - maxHeight = 0; + let maxWidth = 0; + let maxHeight = 0; $('.frame', view) .each((index, frame) => { - var height, width; - width = $(frame).width(); - height = $(frame).height(); + const width = $(frame).width(); + const height = $(frame).height(); maxWidth = width > maxWidth ? width : maxWidth; return (maxHeight = height > maxHeight ? height : maxHeight); }) @@ -110,8 +108,7 @@ export default class ImageFile { 'two-up': function() { return $('.two-up.view .wrap', this.file).each((index, wrap) => { $('img', wrap).each(function() { - var currentWidth; - currentWidth = $(this).width(); + const currentWidth = $(this).width(); if (currentWidth > availWidth / 2) { return $(this).width(availWidth / 2); } @@ -124,16 +121,14 @@ export default class ImageFile { }); }, swipe() { - var maxHeight, maxWidth; - maxWidth = 0; - maxHeight = 0; + let maxWidth = 0; + let maxHeight = 0; return $('.swipe.view', this.file).each((index, view) => { - var $swipeWrap, $swipeBar, $swipeFrame, wrapPadding; const ref = ImageFile.prepareFrames(view); [maxWidth, maxHeight] = ref; - $swipeFrame = $('.swipe-frame', view); - $swipeWrap = $('.swipe-wrap', view); - $swipeBar = $('.swipe-bar', view); + const $swipeFrame = $('.swipe-frame', view); + const $swipeWrap = $('.swipe-wrap', view); + const $swipeBar = $('.swipe-bar', view); $swipeFrame.css({ width: maxWidth + 16, @@ -148,7 +143,7 @@ export default class ImageFile { left: 1, }); - wrapPadding = parseInt($swipeWrap.css('right').replace('px', ''), 10); + const wrapPadding = parseInt($swipeWrap.css('right').replace('px', ''), 10); this.initDraggable($swipeBar, wrapPadding, (e, left) => { if (left > 0 && left < $swipeFrame.width() - wrapPadding * 2) { @@ -159,19 +154,17 @@ export default class ImageFile { }); }, 'onion-skin': function() { - var dragTrackWidth, maxHeight, maxWidth; + let maxHeight, maxWidth; maxWidth = 0; maxHeight = 0; - dragTrackWidth = $('.drag-track', this.file).width() - $('.dragger', this.file).width(); + const dragTrackWidth = $('.drag-track', this.file).width() - $('.dragger', this.file).width(); return $('.onion-skin.view', this.file).each((index, view) => { - var $frame, $track, $dragger, $frameAdded, framePadding; - const ref = ImageFile.prepareFrames(view); [maxWidth, maxHeight] = ref; - $frame = $('.onion-skin-frame', view); - $frameAdded = $('.frame.added', view); - $track = $('.drag-track', view); - $dragger = $('.dragger', $track); + const $frame = $('.onion-skin-frame', view); + const $frameAdded = $('.frame.added', view); + const $track = $('.drag-track', view); + const $dragger = $('.dragger', $track); $frame.css({ width: maxWidth + 16, @@ -186,10 +179,10 @@ export default class ImageFile { }); $frameAdded.css('opacity', 1); - framePadding = parseInt($frameAdded.css('right').replace('px', ''), 10); + const framePadding = parseInt($frameAdded.css('right').replace('px', ''), 10); this.initDraggable($dragger, framePadding, (e, left) => { - var opacity = left / dragTrackWidth; + const opacity = left / dragTrackWidth; if (opacity >= 0 && opacity <= 1) { $dragger.css('left', left); diff --git a/app/assets/javascripts/monitoring/components/embed.vue b/app/assets/javascripts/monitoring/components/embed.vue index 86f5559af8f..eb8945c1a57 100644 --- a/app/assets/javascripts/monitoring/components/embed.vue +++ b/app/assets/javascripts/monitoring/components/embed.vue @@ -97,7 +97,6 @@ export default { v-for="(graphData, graphIndex) in charts" :key="`panel-type-${graphIndex}`" class="w-100" - clipboard-text="" :graph-data="graphData" :group-id="dashboardUrl" /> diff --git a/app/assets/javascripts/monitoring/components/panel_type.vue b/app/assets/javascripts/monitoring/components/panel_type.vue index d0dce4f5116..ec6a41d0540 100644 --- a/app/assets/javascripts/monitoring/components/panel_type.vue +++ b/app/assets/javascripts/monitoring/components/panel_type.vue @@ -36,7 +36,8 @@ export default { props: { clipboardText: { type: String, - required: true, + required: false, + default: '', }, graphData: { type: Object, @@ -152,6 +153,7 @@ export default { {{ __('Download CSV') }} </gl-dropdown-item> <gl-dropdown-item + v-if="clipboardText" v-track-event="generateLinkToChartOptions(clipboardText)" class="js-chart-link" :data-clipboard-text="clipboardText" diff --git a/app/assets/javascripts/notes/components/discussion_locked_widget.vue b/app/assets/javascripts/notes/components/discussion_locked_widget.vue index 53f509185a8..8636984c6af 100644 --- a/app/assets/javascripts/notes/components/discussion_locked_widget.vue +++ b/app/assets/javascripts/notes/components/discussion_locked_widget.vue @@ -12,6 +12,9 @@ export default { }, mixins: [Issuable, issuableStateMixin], computed: { + projectArchivedWarning() { + return __('This project is archived and cannot be commented on.'); + }, lockedIssueWarning() { return sprintf( __('This %{issuableDisplayName} is locked. Only project members can comment.'), @@ -26,9 +29,15 @@ export default { <div class="disabled-comment text-center"> <span class="issuable-note-warning inline"> <icon :size="16" name="lock" class="icon" /> - <span> - {{ lockedIssueWarning }} + <span v-if="isProjectArchived"> + {{ projectArchivedWarning }} + <gl-link :href="archivedProjectDocsPath" target="_blank" class="learn-more"> + {{ __('Learn more') }} + </gl-link> + </span> + <span v-else> + {{ lockedIssueWarning }} <gl-link :href="lockedIssueDocsPath" target="_blank" class="learn-more"> {{ __('Learn more') }} </gl-link> diff --git a/app/assets/javascripts/notes/mixins/issuable_state.js b/app/assets/javascripts/notes/mixins/issuable_state.js index d97d9f6850a..0ca8c8c98a3 100644 --- a/app/assets/javascripts/notes/mixins/issuable_state.js +++ b/app/assets/javascripts/notes/mixins/issuable_state.js @@ -3,6 +3,12 @@ import { mapGetters } from 'vuex'; export default { computed: { ...mapGetters(['getNoteableDataByProp']), + isProjectArchived() { + return this.getNoteableDataByProp('is_project_archived'); + }, + archivedProjectDocsPath() { + return this.getNoteableDataByProp('archived_project_docs_path'); + }, lockedIssueDocsPath() { return this.getNoteableDataByProp('locked_discussion_docs_path'); }, diff --git a/app/assets/javascripts/sidebar/components/assignees/assignee_avatar_link.vue b/app/assets/javascripts/sidebar/components/assignees/assignee_avatar_link.vue index aaac812f213..9a60172db2e 100644 --- a/app/assets/javascripts/sidebar/components/assignees/assignee_avatar_link.vue +++ b/app/assets/javascripts/sidebar/components/assignees/assignee_avatar_link.vue @@ -1,7 +1,6 @@ <script> import { GlTooltipDirective, GlLink } from '@gitlab/ui'; import { __, sprintf } from '~/locale'; -import { joinPaths } from '~/lib/utils/url_utility'; import AssigneeAvatar from './assignee_avatar.vue'; export default { @@ -60,7 +59,7 @@ export default { }; }, assigneeUrl() { - return joinPaths(`${this.rootPath}`, `${this.user.username}`); + return this.user.web_url; }, }, }; |