Commit 1dfecf3e authored by Fatih Acet's avatar Fatih Acet

Merge branch 'prettify-all-the-things-6' into 'master'

Prettify all the things (part 6)

See merge request gitlab-org/gitlab-ce!22256
parents 3e3f8ac8 3271c5f0
......@@ -22,9 +22,7 @@ export default {
directives: {
tooltip,
},
mixins: [
timeagoMixin,
],
mixins: [timeagoMixin],
props: {
deployment: {
type: Object,
......@@ -50,7 +48,7 @@ export default {
return !!(this.deployment.url && this.deployment.name);
},
hasMetrics() {
return !!(this.deployment.metrics_url);
return !!this.deployment.metrics_url;
},
},
methods: {
......@@ -63,7 +61,7 @@ export default {
MRWidgetService.stopEnvironment(this.deployment.stop_url)
.then(res => res.data)
.then((data) => {
.then(data => {
if (data.redirect_url) {
visitUrl(data.redirect_url);
}
......
......@@ -60,11 +60,29 @@ export default {
let memoryUsageMsg = '';
if (memoryTo > memoryFrom) {
memoryUsageMsg = sprintf(s__('mrWidget|%{metricsLinkStart} Memory %{metricsLinkEnd} usage %{emphasisStart} increased %{emphasisEnd} from %{memoryFrom}MB to %{memoryTo}MB'), messageProps, false);
memoryUsageMsg = sprintf(
s__(
'mrWidget|%{metricsLinkStart} Memory %{metricsLinkEnd} usage %{emphasisStart} increased %{emphasisEnd} from %{memoryFrom}MB to %{memoryTo}MB',
),
messageProps,
false,
);
} else if (memoryTo < memoryFrom) {
memoryUsageMsg = sprintf(s__('mrWidget|%{metricsLinkStart} Memory %{metricsLinkEnd} usage %{emphasisStart} decreased %{emphasisEnd} from %{memoryFrom}MB to %{memoryTo}MB'), messageProps, false);
memoryUsageMsg = sprintf(
s__(
'mrWidget|%{metricsLinkStart} Memory %{metricsLinkEnd} usage %{emphasisStart} decreased %{emphasisEnd} from %{memoryFrom}MB to %{memoryTo}MB',
),
messageProps,
false,
);
} else {
memoryUsageMsg = sprintf(s__('mrWidget|%{metricsLinkStart} Memory %{metricsLinkEnd} usage is %{emphasisStart} unchanged %{emphasisEnd} at %{memoryFrom}MB'), messageProps, false);
memoryUsageMsg = sprintf(
s__(
'mrWidget|%{metricsLinkStart} Memory %{metricsLinkEnd} usage is %{emphasisStart} unchanged %{emphasisEnd} at %{memoryFrom}MB',
),
messageProps,
false,
);
}
return memoryUsageMsg;
......@@ -77,7 +95,7 @@ export default {
methods: {
getMegabytes(bytesString) {
const valueInBytes = Number(bytesString).toFixed(2);
return (bytesToMiB(valueInBytes)).toFixed(2);
return bytesToMiB(valueInBytes).toFixed(2);
},
computeGraphData(metrics, deploymentTime) {
this.loadingMetrics = false;
......@@ -103,7 +121,7 @@ export default {
loadMetrics() {
backOff((next, stop) => {
MRWidgetService.fetchMetrics(this.metricsUrl)
.then((res) => {
.then(res => {
if (res.status === statusCodes.NO_CONTENT) {
this.backOffRequestCounter += 1;
/* eslint-disable no-unused-expressions */
......@@ -114,14 +132,14 @@ export default {
})
.catch(stop);
})
.then((res) => {
.then(res => {
if (res.status === statusCodes.NO_CONTENT) {
return res;
}
return res.data;
})
.then((data) => {
.then(data => {
this.computeGraphData(data.metrics, data.deployment_time);
return data;
})
......
<script>
import tooltip from '../../vue_shared/directives/tooltip';
import tooltip from '../../vue_shared/directives/tooltip';
export default {
export default {
name: 'MrWidgetAuthor',
directives: {
tooltip,
......@@ -30,7 +30,7 @@
return this.author.avatarUrl || this.author.avatar_url;
},
},
};
};
</script>
<template>
<a
......
<script>
import tooltip from '~/vue_shared/directives/tooltip';
import MrWidgetAuthor from './mr_widget_author.vue';
import tooltip from '~/vue_shared/directives/tooltip';
import MrWidgetAuthor from './mr_widget_author.vue';
export default {
export default {
name: 'MrWidgetAuthorTime',
components: {
MrWidgetAuthor,
......@@ -28,7 +28,7 @@
required: true,
},
},
};
};
</script>
<template>
<h4 class="js-mr-widget-author">
......
<script>
import { sprintf, s__ } from '~/locale';
import { sprintf, s__ } from '~/locale';
export default {
export default {
name: 'MRWidgetMergeHelp',
props: {
missingBranch: {
......@@ -13,12 +13,14 @@
computed: {
missingBranchInfo() {
return sprintf(
s__('mrWidget|If the %{branch} branch exists in your local repository, you can merge this merge request manually using the'),
s__(
'mrWidget|If the %{branch} branch exists in your local repository, you can merge this merge request manually using the',
),
{ branch: this.missingBranch },
);
},
},
};
};
</script>
<template>
<section class="mr-widget-help">
......
<script>
import { s__ } from '~/locale';
import { s__ } from '~/locale';
export default {
export default {
name: 'MRWidgetRelatedLinks',
props: {
relatedLinks: {
......@@ -26,7 +26,7 @@
return s__('mrWidget|Closes');
},
},
};
};
</script>
<template>
<section class="mr-info-list mr-links">
......
<script>
import ciIcon from '../../vue_shared/components/ci_icon.vue';
import ciIcon from '../../vue_shared/components/ci_icon.vue';
export default {
export default {
components: {
ciIcon,
},
......@@ -27,7 +27,7 @@
};
},
},
};
};
</script>
<template>
<div class="space-children d-flex append-right-10 widget-status-icon">
......
<script>
import tooltip from '../../vue_shared/directives/tooltip';
import { __ } from '../../locale';
import tooltip from '../../vue_shared/directives/tooltip';
import { __ } from '../../locale';
export default {
export default {
directives: {
tooltip,
},
......@@ -10,7 +10,7 @@
this.removesBranchText = __('<strong>Removes</strong> source branch');
this.tooltipTitle = __('A user with write access to the source branch selected this option');
},
};
};
</script>
<template>
......
<script>
import statusIcon from '../mr_widget_status_icon.vue';
import statusIcon from '../mr_widget_status_icon.vue';
export default {
export default {
name: 'MRWidgetArchived',
components: {
statusIcon,
},
};
};
</script>
<template>
<div class="mr-widget-body media">
......
<script>
import eventHub from '../../event_hub';
import statusIcon from '../mr_widget_status_icon.vue';
import eventHub from '../../event_hub';
import statusIcon from '../mr_widget_status_icon.vue';
export default {
export default {
name: 'MRWidgetAutoMergeFailed',
components: {
statusIcon,
......@@ -26,7 +26,7 @@
});
},
},
};
};
</script>
<template>
<div class="mr-widget-body media">
......
<script>
import statusIcon from '../mr_widget_status_icon.vue';
import statusIcon from '../mr_widget_status_icon.vue';
export default {
export default {
name: 'MRWidgetChecking',
components: {
statusIcon,
},
};
};
</script>
<template>
<div class="mr-widget-body media">
......
<script>
import MrWidgetAuthorTime from '../../components/mr_widget_author_time.vue';
import statusIcon from '../mr_widget_status_icon.vue';
import MrWidgetAuthorTime from '../../components/mr_widget_author_time.vue';
import statusIcon from '../mr_widget_status_icon.vue';
export default {
export default {
name: 'MRWidgetClosed',
components: {
MrWidgetAuthorTime,
......@@ -17,7 +17,7 @@
default: () => ({}),
},
},
};
};
</script>
<template>
<div class="mr-widget-body media">
......
<script>
import statusIcon from '../mr_widget_status_icon.vue';
import statusIcon from '../mr_widget_status_icon.vue';
export default {
export default {
name: 'MRWidgetConflicts',
components: {
statusIcon,
......@@ -15,7 +15,7 @@
default: () => ({}),
},
},
};
};
</script>
<template>
<div class="mr-widget-body media">
......
<script>
import Flash from '../../../flash';
import statusIcon from '../mr_widget_status_icon.vue';
import MrWidgetAuthor from '../../components/mr_widget_author.vue';
import eventHub from '../../event_hub';
import Flash from '../../../flash';
import statusIcon from '../mr_widget_status_icon.vue';
import MrWidgetAuthor from '../../components/mr_widget_author.vue';
import eventHub from '../../event_hub';
export default {
export default {
name: 'MRWidgetMergeWhenPipelineSucceeds',
components: {
MrWidgetAuthor,
......@@ -37,17 +37,16 @@
currentUserId,
} = this.mr;
return !shouldRemoveSourceBranch &&
canRemoveSourceBranch &&
mergeUserId === currentUserId;
return !shouldRemoveSourceBranch && canRemoveSourceBranch && mergeUserId === currentUserId;
},
},
methods: {
cancelAutomaticMerge() {
this.isCancellingAutoMerge = true;
this.service.cancelAutomaticMerge()
this.service
.cancelAutomaticMerge()
.then(res => res.data)
.then((data) => {
.then(data => {
eventHub.$emit('UpdateWidgetData', data);
})
.catch(() => {
......@@ -63,9 +62,10 @@
};
this.isRemovingSourceBranch = true;
this.service.merge(options)
this.service
.merge(options)
.then(res => res.data)
.then((data) => {
.then(data => {
if (data.status === 'merge_when_pipeline_succeeds') {
eventHub.$emit('MRWidgetUpdateRequested');
}
......@@ -76,7 +76,7 @@
});
},
},
};
};
</script>
<template>
<div class="mr-widget-body media">
......
<script>
import Flash from '~/flash';
import tooltip from '~/vue_shared/directives/tooltip';
import { s__, __ } from '~/locale';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import MrWidgetAuthorTime from '../../components/mr_widget_author_time.vue';
import statusIcon from '../mr_widget_status_icon.vue';
import eventHub from '../../event_hub';
import Flash from '~/flash';
import tooltip from '~/vue_shared/directives/tooltip';
import { s__, __ } from '~/locale';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import MrWidgetAuthorTime from '../../components/mr_widget_author_time.vue';
import statusIcon from '../mr_widget_status_icon.vue';
import eventHub from '../../event_hub';
export default {
export default {
name: 'MRWidgetMerged',
directives: {
tooltip,
......@@ -36,24 +36,18 @@
},
computed: {
shouldShowRemoveSourceBranch() {
const {
sourceBranchRemoved,
isRemovingSourceBranch,
canRemoveSourceBranch,
} = this.mr;
const { sourceBranchRemoved, isRemovingSourceBranch, canRemoveSourceBranch } = this.mr;
return !sourceBranchRemoved &&
return (
!sourceBranchRemoved &&
canRemoveSourceBranch &&
!this.isMakingRequest &&
!isRemovingSourceBranch;
!isRemovingSourceBranch
);
},
shouldShowSourceBranchRemoving() {
const {
sourceBranchRemoved,
isRemovingSourceBranch,
} = this.mr;
return !sourceBranchRemoved &&
(isRemovingSourceBranch || this.isMakingRequest);
const { sourceBranchRemoved, isRemovingSourceBranch } = this.mr;
return !sourceBranchRemoved && (isRemovingSourceBranch || this.isMakingRequest);
},
shouldShowMergedButtons() {
const {
......@@ -63,10 +57,9 @@
cherryPickInForkPath,
} = this.mr;
return canRevertInCurrentMR ||
canCherryPickInCurrentMR ||
revertInForkPath ||
cherryPickInForkPath;
return (
canRevertInCurrentMR || canCherryPickInCurrentMR || revertInForkPath || cherryPickInForkPath
);
},
revertTitle() {
return s__('mrWidget|Revert this merge request in a new merge request');
......@@ -85,9 +78,10 @@
removeSourceBranch() {
this.isMakingRequest = true;
this.service.removeSourceBranch()
this.service
.removeSourceBranch()
.then(res => res.data)
.then((data) => {
.then(data => {
if (data.message === 'Branch was removed') {
eventHub.$emit('MRWidgetUpdateRequested', () => {
this.isMakingRequest = false;
......@@ -100,7 +94,7 @@
});
},
},
};
};
</script>
<template>
<div class="mr-widget-body media">
......
<script>
import statusIcon from '../mr_widget_status_icon.vue';
import statusIcon from '../mr_widget_status_icon.vue';
export default {
export default {
name: 'MRWidgetMerging',
components: {
statusIcon,
......@@ -13,7 +13,7 @@
default: () => ({}),
},
},
};
};
</script>
<template>
<div class="mr-widget-body mr-state-locked media">
......
<script>
import { sprintf, s__ } from '~/locale';
import tooltip from '~/vue_shared/directives/tooltip';
import statusIcon from '../mr_widget_status_icon.vue';
import mrWidgetMergeHelp from '../../components/mr_widget_merge_help.vue';
import { sprintf, s__ } from '~/locale';
import tooltip from '~/vue_shared/directives/tooltip';
import statusIcon from '../mr_widget_status_icon.vue';
import mrWidgetMergeHelp from '../../components/mr_widget_merge_help.vue';
export default {
export default {
name: 'MRWidgetMissingBranch',
directives: {
tooltip,
......@@ -24,17 +24,25 @@
return this.mr.sourceBranchRemoved ? 'source' : 'target';
},
missingBranchNameMessage() {
return sprintf(s__('mrWidget| Please restore it or use a different %{missingBranchName} branch'), {
return sprintf(
s__('mrWidget| Please restore it or use a different %{missingBranchName} branch'),
{
missingBranchName: this.missingBranchName,
});
},
);
},
message() {
return sprintf(s__('mrWidget|If the %{missingBranchName} branch exists in your local repository, you can merge this merge request manually using the command line'), {
return sprintf(
s__(
'mrWidget|If the %{missingBranchName} branch exists in your local repository, you can merge this merge request manually using the command line',
),
{
missingBranchName: this.missingBranchName,
});
},
);
},
},
};
};
</script>
<template>
<div class="mr-widget-body media">
......
<script>
import StatusIcon from '../mr_widget_status_icon.vue';
import StatusIcon from '../mr_widget_status_icon.vue';
export default {
export default {
name: 'MRWidgetNotAllowed',
components: {
StatusIcon,
},
};
};
</script>
<template>
......
<script>
import StatusIcon from '../mr_widget_status_icon.vue';
import StatusIcon from '../mr_widget_status_icon.vue';
export default {
export default {
name: 'MRWidgetPipelineBlocked',
components: {
StatusIcon,
},
};
};
</script>
<template>
<div class="mr-widget-body media">
......
<script>
import simplePoll from '../../../lib/utils/simple_poll';
import eventHub from '../../event_hub';
import statusIcon from '../mr_widget_status_icon.vue';
import Flash from '../../../flash';
import simplePoll from '../../../lib/utils/simple_poll';
import eventHub from '../../event_hub';
import statusIcon from '../mr_widget_status_icon.vue';
import Flash from '../../../flash';
export default {
export default {
name: 'MRWidgetRebase',
components: {
statusIcon,
......@@ -44,20 +44,22 @@
this.isMakingRequest = true;
this.rebasingError = null;
this.service.rebase()
this.service
.rebase()
.then(() => {
simplePoll(this.checkRebaseStatus);
})
.catch((error) => {
.catch(error => {
this.rebasingError = error.merge_error;
this.isMakingRequest = false;
Flash('Something went wrong. Please try again.');
});
},
checkRebaseStatus(continuePolling, stopPolling) {
this.service.poll()
this.service
.poll()
.then(res => res.data)
.then((res) => {
.then(res => {
if (res.rebase_in_progress) {
continuePolling();
} else {
......@@ -79,7 +81,7 @@
});
},
},
};
};
</script>
<template>
<div class="mr-widget-body media">
......
......@@ -24,9 +24,10 @@ export default {
methods: {
removeWIP() {
this.isMakingRequest = true;
this.service.removeWIP()
this.service
.removeWIP()
.then(res => res.data)
.then((data) => {
.then(data => {
eventHub.$emit('UpdateWidgetData', data);
new window.Flash('The merge request can now be merged.', 'notice'); // eslint-disable-line
$('.merge-request .detail-page-description .title').text(this.mr.title);
......
<script>
import Project from '~/pages/projects/project';
import SmartInterval from '~/smart_interval';
import createFlash from '../flash';
......@@ -100,8 +99,11 @@ export default {
return !!this.mr.relatedLinks && !this.mr.isNothingToMergeState;
},
shouldRenderSourceBranchRemovalStatus() {
return !this.mr.canRemoveSourceBranch && this.mr.shouldRemoveSourceBranch &&
(!this.mr.isNothingToMergeState && !this.mr.isMergedState);
return (
!this.mr.canRemoveSourceBranch &&
this.mr.shouldRemoveSourceBranch &&
(!this.mr.isNothingToMergeState && !this.mr.isMergedState)
);
},
},
created() {
......@@ -133,9 +135,10 @@ export default {
return new MRWidgetService(endpoints);
},
checkStatus(cb) {
return this.service.checkStatus()
return this.service
.checkStatus()
.then(res => res.data)
.then((data) => {
.then(data => {
this.handleNotification(data);
this.mr.setData(data);
this.setFaviconHelper();
......@@ -172,20 +175,24 @@ export default {
return Promise.resolve();
},
fetchDeployments() {
return this.service.fetchDeployments()
return this.service
.fetchDeployments()
.then(res => res.data)
.then((data) => {
.then(data => {
if (data.length) {
this.mr.deployments = data;
}
})
.catch(() => {
createFlash('Something went wrong while fetching the environments for this merge request. Please try again.');
createFlash(
'Something went wrong while fetching the environments for this merge request. Please try again.',
);
});
},
fetchActionsContent() {
this.service.fetchMergeActionsContent()
.then((res) => {
this.service
.fetchMergeActionsContent()
.then(res => {
if (res.data) {
const el = document.createElement('div');
el.innerHTML = res.data;
......@@ -212,22 +219,22 @@ export default {
this.pollingInterval.stopTimer();
},
bindEventHubListeners() {
eventHub.$on('MRWidgetUpdateRequested', (cb) => {
eventHub.$on('MRWidgetUpdateRequested', cb => {
this.checkStatus(cb);
});
// `params` should be an Array contains a Boolean, like `[true]`
// Passing parameter as Boolean didn't work.
eventHub.$on('SetBranchRemoveFlag', (params) => {
eventHub.$on('SetBranchRemoveFlag', params => {
[this.mr.isRemovingSourceBranch] = params;
});
eventHub.$on('FailedToMerge', (mergeError) => {
eventHub.$on('FailedToMerge', mergeError => {
this.mr.state = 'failedToMerge';
this.mr.mergeError = mergeError;
});
eventHub.$on('UpdateWidgetData', (data) => {
eventHub.$on('UpdateWidgetData', data => {
this.mr.setData(data);
});
......
......@@ -118,7 +118,9 @@ export default {
this.rectYAxisLabelDims.height != null ? this.rectYAxisLabelDims.height / 2 : 0;
const yCoord = this.vbHeight / 2 + rectWidth - 5;
return `translate(${this.minX + this.yAxisTextTransformPadding}, ${yCoord}) rotate(-${this.yAxisTextRotation})`;
return `translate(${this.minX + this.yAxisTextTransformPadding}, ${yCoord}) rotate(-${
this.yAxisTextRotation
})`;
},
},
mounted() {
......@@ -207,8 +209,7 @@ export default {
renderedYAxis.selectAll('.tick').each(function createTickLines(d, i) {
if (i > 0) {
d3
.select(this)
d3.select(this)
.select('line')
.attr('x2', width)
.attr('class', 'axis-tick');
......@@ -217,8 +218,7 @@ export default {
// Add the panning capabilities
if (this.isPanAvailable) {
d3
.select(this.$refs.baseSvg)
d3.select(this.$refs.baseSvg)
.call(this.zoom)
.on('wheel.zoom', null); // This disables the pan of the graph with the scroll of the mouse wheel
}
......
<script>
/* eslint-disable vue/require-default-prop */
export default {
/* eslint-disable vue/require-default-prop */
export default {
name: 'DeprecatedModal', // use GlModal instead
props: {
......@@ -79,7 +79,7 @@
this.$emit('submit', event);
},
},
};
};
</script>
<template>
......
......@@ -583,7 +583,5 @@ const fileNameIcons = {
};
export default function getIconForFile(name) {
return fileNameIcons[name] ||
fileExtensionIcons[name ? name.split('.').pop() : ''] ||
'';
return fileNameIcons[name] || fileExtensionIcons[name ? name.split('.').pop() : ''] || '';
}
<script>
// only allow classes in images.scss e.g. s12
const validSizes = [8, 10, 12, 16, 18, 24, 32, 48, 72];
let iconValidator = () => true;
......
<script>
import icon from '../../../vue_shared/components/icon.vue';
import icon from '../../../vue_shared/components/icon.vue';
export default {
export default {
components: {
icon,
},
......@@ -28,7 +28,7 @@
return this.isConfidential && this.isLocked;
},
},
};
};
</script>
<template>
<div class="issuable-note-warning">
......
<script>
/* eslint-disable vue/require-default-prop */
/* This is a re-usable vue component for rendering a button
/* eslint-disable vue/require-default-prop */
/* This is a re-usable vue component for rendering a button
that will probably be sending off ajax requests and need
to show the loading status by setting the `loading` option.
This can also be used for initial page load when you don't
......@@ -17,7 +17,7 @@
*/
export default {
export default {
props: {
loading: {
type: Boolean,
......@@ -44,7 +44,7 @@
this.$emit('click', e);
},
},
};
};
</script>
<template>
......
<script>
import $ from 'jquery';
import { s__ } from '~/locale';
import Flash from '../../../flash';
import GLForm from '../../../gl_form';
import markdownHeader from './header.vue';
import markdownToolbar from './toolbar.vue';
import icon from '../icon.vue';
import $ from 'jquery';
import { s__ } from '~/locale';
import Flash from '../../../flash';
import GLForm from '../../../gl_form';
import markdownHeader from './header.vue';
import markdownToolbar from './toolbar.vue';
import icon from '../icon.vue';
export default {
export default {
components: {
markdownHeader,
markdownToolbar,
......@@ -135,7 +135,7 @@
}markdown_version=${markdownVersion}`;
},
},
};
};
</script>
<template>
......
<script>
import $ from 'jquery';
import tooltip from '../../directives/tooltip';
import toolbarButton from './toolbar_button.vue';
import icon from '../icon.vue';
import $ from 'jquery';
import tooltip from '../../directives/tooltip';
import toolbarButton from './toolbar_button.vue';
import icon from '../icon.vue';
export default {
export default {
directives: {
tooltip,
},
......@@ -38,9 +38,10 @@
},
methods: {
isValid(form) {
return !form ||
form.find('.js-vue-markdown-field').length &&
$(this.$el).closest('form')[0] === form[0];
return (
!form ||
(form.find('.js-vue-markdown-field').length && $(this.$el).closest('form')[0] === form[0])
);
},
previewMarkdownTab(event, form) {
......@@ -57,7 +58,7 @@
this.$emit('write-markdown');
},
},
};
};
</script>
<template>
......
<script>
import { Link } from '@gitlab-org/gitlab-ui';
import { Link } from '@gitlab-org/gitlab-ui';
export default {
export default {
components: {
'gl-link': Link,
},
......@@ -26,7 +26,7 @@
return this.quickActionsDocsPath !== '';
},
},
};
};
</script>
<template>
......
<script>
import tooltip from '../../directives/tooltip';
import icon from '../icon.vue';
import tooltip from '../../directives/tooltip';
import icon from '../icon.vue';
export default {
export default {
components: {
icon,
},
......@@ -38,7 +38,7 @@
default: false,
},
},
};
};
</script>
<template>
......
......@@ -41,7 +41,8 @@ export default {
// Find metric timestamp which is closest to deploymentTime
timestampDiff = Math.abs(metricTimestamps[0] - median);
metricTimestamps.forEach((timestamp, index) => {
if (index === 0) { // Skip first element
if (index === 0) {
// Skip first element
return;
}
......
<script>
/**
/**
* Common component to render a placeholder note and user information.
*
* This component needs to be used with a vuex store.
......@@ -16,10 +16,10 @@
* :note="{body: 'This is a note'}"
* />
*/
import { mapGetters } from 'vuex';
import userAvatarLink from '../user_avatar/user_avatar_link.vue';
import { mapGetters } from 'vuex';
import userAvatarLink from '../user_avatar/user_avatar_link.vue';
export default {
export default {
name: 'PlaceholderNote',
components: {
userAvatarLink,
......@@ -31,11 +31,9 @@
},
},
computed: {
...mapGetters([
'getUserData',
]),
...mapGetters(['getUserData']),
},
};
};
</script>
<template>
......
<script>
/**
/**
* Common component to render a placeholder system note.
*
* @example
......@@ -7,7 +7,7 @@
* :note="{ body: 'Commands are being applied'}"
* />
*/
export default {
export default {
name: 'PlaceholderSystemNote',
props: {
note: {
......@@ -15,7 +15,7 @@
required: true,
},
},
};
};
</script>
<template>
......
<script>
export default {
export default {
props: {
startSize: {
type: Number,
......@@ -84,7 +84,7 @@
this.$emit('resize-end', this.size);
},
},
};
};
</script>
<template>
......
<script>
import Pikaday from 'pikaday';
import { parsePikadayDate, pikadayToString } from '../../lib/utils/datefix';
import Pikaday from 'pikaday';
import { parsePikadayDate, pikadayToString } from '../../lib/utils/datefix';
export default {
export default {
name: 'DatePicker',
props: {
label: {
......@@ -56,7 +56,7 @@
this.$emit('hidePicker');
},
},
};
};
</script>
<template>
......
<script>
/* This is a re-usable vue component for rendering a project avatar that
/* This is a re-usable vue component for rendering a project avatar that
does not need to link to the project's profile. The image and an optional
tooltip can be configured by props passed to this component.
......@@ -16,11 +15,11 @@
*/
import defaultAvatarUrl from 'images/no_avatar.png';
import { placeholderImage } from '../../../lazy_loader';
import tooltip from '../../directives/tooltip';
import defaultAvatarUrl from 'images/no_avatar.png';
import { placeholderImage } from '../../../lazy_loader';
import tooltip from '../../directives/tooltip';
export default {
export default {
name: 'ProjectAvatarImage',
directives: {
tooltip,
......@@ -79,7 +78,7 @@
return `s${this.size}`;
},
},
};
};
</script>
<template>
......
<script>
import DeprecatedModal from './deprecated_modal.vue';
import DeprecatedModal from './deprecated_modal.vue';
export default {
export default {
name: 'RecaptchaModal',
components: {
......@@ -61,7 +61,7 @@
this.$el.querySelector('form').submit();
},
},
};
};
</script>
<template>
......
<script>
import datePicker from '../pikaday.vue';
import toggleSidebar from './toggle_sidebar.vue';
import collapsedCalendarIcon from './collapsed_calendar_icon.vue';
import { dateInWords } from '../../../lib/utils/datetime_utility';
import datePicker from '../pikaday.vue';
import toggleSidebar from './toggle_sidebar.vue';
import collapsedCalendarIcon from './collapsed_calendar_icon.vue';
import { dateInWords } from '../../../lib/utils/datetime_utility';
export default {
export default {
name: 'SidebarDatePicker',
components: {
datePicker,
......@@ -90,7 +90,7 @@
this.$emit('toggleCollapse');
},
},
};
};
</script>
<template>
......
<script>
import { s__ } from '../../locale';
import { s__ } from '../../locale';
const PAGINATION_UI_BUTTON_LIMIT = 4;
const UI_LIMIT = 6;
const SPREAD = '...';
const PREV = s__('Pagination|Prev');
const NEXT = s__('Pagination|Next');
const FIRST = s__('Pagination|« First');
const LAST = s__('Pagination|Last »');
const PAGINATION_UI_BUTTON_LIMIT = 4;
const UI_LIMIT = 6;
const SPREAD = '...';
const PREV = s__('Pagination|Prev');
const NEXT = s__('Pagination|Next');
const FIRST = s__('Pagination|« First');
const LAST = s__('Pagination|Last »');
export default {
export default {
props: {
/**
This function will take the information given by the pagination component
......@@ -128,7 +128,7 @@
return !item.first && !item.last && !item.next && !item.prev && !item.active;
},
},
};
};
</script>
<template>
<div
......
......@@ -11,9 +11,7 @@ export default {
directives: {
tooltip,
},
mixins: [
timeagoMixin,
],
mixins: [timeagoMixin],
props: {
time: {
type: String,
......
<script>
import { s__ } from '../../locale';
import icon from './icon.vue';
import { s__ } from '../../locale';
import icon from './icon.vue';
const ICON_ON = 'status_success_borderless';
const ICON_OFF = 'status_failed_borderless';
const LABEL_ON = s__('ToggleButton|Toggle Status: ON');
const LABEL_OFF = s__('ToggleButton|Toggle Status: OFF');
const ICON_ON = 'status_success_borderless';
const ICON_OFF = 'status_failed_borderless';
const LABEL_ON = s__('ToggleButton|Toggle Status: ON');
const LABEL_OFF = s__('ToggleButton|Toggle Status: OFF');
export default {
export default {
components: {
icon,
},
......@@ -54,7 +54,7 @@
if (!this.disabledInput) this.$emit('change', !this.value);
},
},
};
};
</script>
<template>
......
<script>
/* This is a re-usable vue component for rendering a user avatar wrapped in
a clickable link (likely to the user's profile). The link, image, and
tooltip can be configured by props passed to this component.
......
<script>
/* This is a re-usable vue component for rendering a user avatar svg (typically
for a blank state). It will receive styles comparable to the user avatar,
but no image is loaded, it isn't wrapped in a link, and tooltips aren't supported.
......@@ -42,4 +41,3 @@ export default {
v-html="svg"
/>
</template>
......@@ -4,10 +4,7 @@
*
* Components need to have `scope`, `page` and `requestData`
*/
import {
historyPushState,
buildUrlWithCurrentLocation,
} from '../../lib/utils/common_utils';
import { historyPushState, buildUrlWithCurrentLocation } from '../../lib/utils/common_utils';
export default {
methods: {
......@@ -24,12 +21,14 @@ export default {
// stop polling
this.poll.stop();
const queryString = Object.keys(parameters).map((parameter) => {
const queryString = Object.keys(parameters)
.map(parameter => {
const value = parameters[parameter];
// update internal state for UI
this[parameter] = value;
return `${parameter}=${encodeURIComponent(value)}`;
}).join('&');
})
.join('&');
// update polling parameters
this.requestData = parameters;
......
......@@ -6,7 +6,7 @@ export default class ListLabel {
this.color = obj.color;
this.textColor = obj.text_color;
this.description = obj.description;
this.priority = (obj.priority !== null) ? obj.priority : Infinity;
this.priority = obj.priority !== null ? obj.priority : Infinity;
}
}
......
import {
__,
n__,
s__,
sprintf,
} from '../locale';
import { __, n__, s__, sprintf } from '../locale';
export default (Vue) => {
export default Vue => {
Vue.mixin({
methods: {
/**
......
......@@ -21,7 +21,7 @@ Vue.http.interceptors.push((request, next) => {
Vue.http.interceptors.push((request, next) => {
request.headers.set(csrf.headerKey, csrf.token);
next((response) => {
next(response => {
// Headers object has a `forEach` property that iterates through all values.
const headers = {};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment