Commit 1e3190b0 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 30 files: 6 of 8

Mandatory not to break master. Automatically created with prettier.
parent 0e334037
...@@ -8,7 +8,7 @@ export default class TreeView { ...@@ -8,7 +8,7 @@ export default class TreeView {
this.initKeyNav(); this.initKeyNav();
// Code browser tree slider // Code browser tree slider
// Make the entire tree-item row clickable, but not if clicking another link (like a commit message) // Make the entire tree-item row clickable, but not if clicking another link (like a commit message)
$('.tree-content-holder .tree-item').on('click', function(e) { $('.tree-content-holder .tree-item').on('click', function (e) {
const $clickedEl = $(e.target); const $clickedEl = $(e.target);
const path = $('.tree-item-file-name a', this).attr('href'); const path = $('.tree-item-file-name a', this).attr('href');
if (!$clickedEl.is('a') && !$clickedEl.is('.str-truncated')) { if (!$clickedEl.is('a') && !$clickedEl.is('.str-truncated')) {
...@@ -20,9 +20,7 @@ export default class TreeView { ...@@ -20,9 +20,7 @@ export default class TreeView {
} }
}); });
// Show the "Loading commit data" for only the first element // Show the "Loading commit data" for only the first element
$('span.log_loading') $('span.log_loading').first().removeClass('hide');
.first()
.removeClass('hide');
} }
initKeyNav() { initKeyNav() {
......
...@@ -75,7 +75,7 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -75,7 +75,7 @@ function UsersSelect(currentUser, els, options = {}) {
selectedId = selectedIdDefault; selectedId = selectedIdDefault;
} }
const assignYourself = function() { const assignYourself = function () {
const unassignedSelected = $dropdown const unassignedSelected = $dropdown
.closest('.selectbox') .closest('.selectbox')
.find(`input[name='${$dropdown.data('fieldName')}'][value=0]`); .find(`input[name='${$dropdown.data('fieldName')}'][value=0]`);
...@@ -108,17 +108,17 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -108,17 +108,17 @@ function UsersSelect(currentUser, els, options = {}) {
$block[0].addEventListener('assignYourself', assignYourself); $block[0].addEventListener('assignYourself', assignYourself);
} }
const getSelectedUserInputs = function() { const getSelectedUserInputs = function () {
return $selectbox.find(`input[name="${$dropdown.data('fieldName')}"]`); return $selectbox.find(`input[name="${$dropdown.data('fieldName')}"]`);
}; };
const getSelected = function() { const getSelected = function () {
return getSelectedUserInputs() return getSelectedUserInputs()
.map((index, input) => parseInt(input.value, 10)) .map((index, input) => parseInt(input.value, 10))
.get(); .get();
}; };
const checkMaxSelect = function() { const checkMaxSelect = function () {
const maxSelect = $dropdown.data('maxSelect'); const maxSelect = $dropdown.data('maxSelect');
if (maxSelect) { if (maxSelect) {
const selected = getSelected(); const selected = getSelected();
...@@ -144,7 +144,7 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -144,7 +144,7 @@ function UsersSelect(currentUser, els, options = {}) {
} }
}; };
const getMultiSelectDropdownTitle = function(selectedUser, isSelected) { const getMultiSelectDropdownTitle = function (selectedUser, isSelected) {
const selectedUsers = getSelected().filter(u => u !== 0); const selectedUsers = getSelected().filter(u => u !== 0);
const firstUser = getSelectedUserInputs() const firstUser = getSelectedUserInputs()
...@@ -201,7 +201,7 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -201,7 +201,7 @@ function UsersSelect(currentUser, els, options = {}) {
return assignTo(userSelect.currentUser.id); return assignTo(userSelect.currentUser.id);
}); });
assignTo = function(selected) { assignTo = function (selected) {
const data = {}; const data = {};
data[abilityName] = {}; data[abilityName] = {};
data[abilityName].assignee_id = selected != null ? selected : null; data[abilityName].assignee_id = selected != null ? selected : null;
...@@ -694,7 +694,7 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -694,7 +694,7 @@ function UsersSelect(currentUser, els, options = {}) {
} }
} }
UsersSelect.prototype.initSelection = function(element, callback) { UsersSelect.prototype.initSelection = function (element, callback) {
const id = $(element).val(); const id = $(element).val();
if (id === '0') { if (id === '0') {
const nullUser = { const nullUser = {
...@@ -706,7 +706,7 @@ UsersSelect.prototype.initSelection = function(element, callback) { ...@@ -706,7 +706,7 @@ UsersSelect.prototype.initSelection = function(element, callback) {
} }
}; };
UsersSelect.prototype.formatResult = function(user) { UsersSelect.prototype.formatResult = function (user) {
let avatar = gon.default_avatar_url; let avatar = gon.default_avatar_url;
if (user.avatar_url) { if (user.avatar_url) {
avatar = user.avatar_url; avatar = user.avatar_url;
...@@ -728,11 +728,11 @@ UsersSelect.prototype.formatResult = function(user) { ...@@ -728,11 +728,11 @@ UsersSelect.prototype.formatResult = function(user) {
`; `;
}; };
UsersSelect.prototype.formatSelection = function(user) { UsersSelect.prototype.formatSelection = function (user) {
return escape(user.name); return escape(user.name);
}; };
UsersSelect.prototype.user = function(user_id, callback) { UsersSelect.prototype.user = function (user_id, callback) {
if (!/^\d+$/.test(user_id)) { if (!/^\d+$/.test(user_id)) {
return false; return false;
} }
...@@ -746,7 +746,7 @@ UsersSelect.prototype.user = function(user_id, callback) { ...@@ -746,7 +746,7 @@ UsersSelect.prototype.user = function(user_id, callback) {
// Return users list. Filtered by query // Return users list. Filtered by query
// Only active users retrieved // Only active users retrieved
UsersSelect.prototype.users = function(query, options, callback) { UsersSelect.prototype.users = function (query, options, callback) {
const url = this.buildUrl(this.usersPath); const url = this.buildUrl(this.usersPath);
const params = { const params = {
search: query, search: query,
...@@ -755,8 +755,8 @@ UsersSelect.prototype.users = function(query, options, callback) { ...@@ -755,8 +755,8 @@ UsersSelect.prototype.users = function(query, options, callback) {
}; };
const isMergeRequest = options.issuableType === 'merge_request'; const isMergeRequest = options.issuableType === 'merge_request';
const isEditMergeRequest = !options.issuableType && (options.iid && options.targetBranch); const isEditMergeRequest = !options.issuableType && options.iid && options.targetBranch;
const isNewMergeRequest = !options.issuableType && (!options.iid && options.targetBranch); const isNewMergeRequest = !options.issuableType && !options.iid && options.targetBranch;
if (isMergeRequest || isEditMergeRequest || isNewMergeRequest) { if (isMergeRequest || isEditMergeRequest || isNewMergeRequest) {
params.merge_request_iid = options.iid || null; params.merge_request_iid = options.iid || null;
...@@ -772,14 +772,14 @@ UsersSelect.prototype.users = function(query, options, callback) { ...@@ -772,14 +772,14 @@ UsersSelect.prototype.users = function(query, options, callback) {
}); });
}; };
UsersSelect.prototype.buildUrl = function(url) { UsersSelect.prototype.buildUrl = function (url) {
if (gon.relative_url_root != null) { if (gon.relative_url_root != null) {
url = gon.relative_url_root.replace(/\/$/, '') + url; url = gon.relative_url_root.replace(/\/$/, '') + url;
} }
return url; return url;
}; };
UsersSelect.prototype.renderRow = function( UsersSelect.prototype.renderRow = function (
issuableType, issuableType,
user, user,
selected, selected,
...@@ -815,7 +815,7 @@ UsersSelect.prototype.renderRow = function( ...@@ -815,7 +815,7 @@ UsersSelect.prototype.renderRow = function(
`; `;
}; };
UsersSelect.prototype.renderRowAvatar = function(issuableType, user, img) { UsersSelect.prototype.renderRowAvatar = function (issuableType, user, img) {
if (user.beforeDivider) { if (user.beforeDivider) {
return img; return img;
} }
...@@ -831,7 +831,7 @@ UsersSelect.prototype.renderRowAvatar = function(issuableType, user, img) { ...@@ -831,7 +831,7 @@ UsersSelect.prototype.renderRowAvatar = function(issuableType, user, img) {
</span>`; </span>`;
}; };
UsersSelect.prototype.renderApprovalRules = function(elsClassName, approvalRules = []) { UsersSelect.prototype.renderApprovalRules = function (elsClassName, approvalRules = []) {
const count = approvalRules.length; const count = approvalRules.length;
if (!gon.features?.reviewerApprovalRules || !elsClassName?.includes('reviewer') || !count) { if (!gon.features?.reviewerApprovalRules || !elsClassName?.includes('reviewer') || !count) {
......
...@@ -145,7 +145,7 @@ export default { ...@@ -145,7 +145,7 @@ export default {
<template #metricsLink="{ content }"> <template #metricsLink="{ content }">
<gl-link :href="metricsMonitoringUrl">{{ content }}</gl-link> <gl-link :href="metricsMonitoringUrl">{{ content }}</gl-link>
</template> </template>
<template #emphasis="{content}"> <template #emphasis="{ content }">
<strong>{{ content }}</strong> <strong>{{ content }}</strong>
</template> </template>
<template #memoryFrom>{{ memoryFrom }}</template> <template #memoryFrom>{{ memoryFrom }}</template>
......
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
data-testid="ci-error-message" data-testid="ci-error-message"
> >
<gl-sprintf :message="$options.errorText"> <gl-sprintf :message="$options.errorText">
<template #link="{content}"> <template #link="{ content }">
<gl-link :href="mrTroubleshootingDocsPath">{{ content }}</gl-link> <gl-link :href="mrTroubleshootingDocsPath">{{ content }}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
......
...@@ -86,12 +86,12 @@ export default { ...@@ -86,12 +86,12 @@ export default {
to create one.`) to create one.`)
" "
> >
<template #prefixToLink="{content}"> <template #prefixToLink="{ content }">
<strong> <strong>
{{ content }} {{ content }}
</strong> </strong>
</template> </template>
<template #addPipelineLink="{content}"> <template #addPipelineLink="{ content }">
<gl-link <gl-link
:href="pipelinePath" :href="pipelinePath"
class="gl-ml-1" class="gl-ml-1"
......
...@@ -113,10 +113,18 @@ export default { ...@@ -113,10 +113,18 @@ export default {
}, },
}, },
}) })
.then(({ data: { mergeRequestSetWip: { mergeRequest: { title } } } }) => { .then(
({
data: {
mergeRequestSetWip: {
mergeRequest: { title },
},
},
}) => {
createFlash(__('The merge request can now be merged.'), 'notice'); createFlash(__('The merge request can now be merged.'), 'notice');
$('.merge-request .detail-page-description .title').text(title); $('.merge-request .detail-page-description .title').text(title);
}) },
)
.catch(() => createFlash(__('Something went wrong. Please try again.'))) .catch(() => createFlash(__('Something went wrong. Please try again.')))
.finally(() => { .finally(() => {
this.isMakingRequest = false; this.isMakingRequest = false;
......
...@@ -166,7 +166,8 @@ export default { ...@@ -166,7 +166,8 @@ export default {
return ( return (
!this.mr.canRemoveSourceBranch && !this.mr.canRemoveSourceBranch &&
this.mr.shouldRemoveSourceBranch && this.mr.shouldRemoveSourceBranch &&
(!this.mr.isNothingToMergeState && !this.mr.isMergedState) !this.mr.isNothingToMergeState &&
!this.mr.isMergedState
); );
}, },
shouldRenderCollaborationStatus() { shouldRenderCollaborationStatus() {
......
...@@ -39,9 +39,7 @@ export default { ...@@ -39,9 +39,7 @@ export default {
<div class="file-content"> <div class="file-content">
<p class="gl-mt-3 file-info"> <p class="gl-mt-3 file-info">
{{ fileName }} {{ fileName }}
<template v-if="fileSize > 0"> <template v-if="fileSize > 0"> ({{ fileSizeReadable }}) </template>
({{ fileSizeReadable }})
</template>
</p> </p>
<a :href="path" class="btn btn-default" rel="nofollow" :download="fileName" target="_blank"> <a :href="path" class="btn btn-default" rel="nofollow" :download="fileName" target="_blank">
<gl-icon :size="16" name="download" class="float-left gl-mr-3" /> <gl-icon :size="16" name="download" class="float-left gl-mr-3" />
......
...@@ -95,9 +95,7 @@ export default { ...@@ -95,9 +95,7 @@ export default {
<template v-if="hasFileSize"> <template v-if="hasFileSize">
{{ fileSizeReadable }} {{ fileSizeReadable }}
</template> </template>
<template v-if="hasFileSize && hasDimensions"> <template v-if="hasFileSize && hasDimensions"> | </template>
|
</template>
<template v-if="hasDimensions"> <template v-if="hasDimensions">
<strong>{{ s__('ImageViewerDimensions|W') }}</strong <strong>{{ s__('ImageViewerDimensions|W') }}</strong
>: {{ width }} | <strong>{{ s__('ImageViewerDimensions|H') }}</strong >: {{ width }} | <strong>{{ s__('ImageViewerDimensions|H') }}</strong
......
...@@ -46,14 +46,10 @@ export default { ...@@ -46,14 +46,10 @@ export default {
}, },
}, },
mounted() { mounted() {
$(this.$el) $(this.$el).on('shown.bs.modal', this.opened).on('hidden.bs.modal', this.closed);
.on('shown.bs.modal', this.opened)
.on('hidden.bs.modal', this.closed);
}, },
beforeDestroy() { beforeDestroy() {
$(this.$el) $(this.$el).off('shown.bs.modal', this.opened).off('hidden.bs.modal', this.closed);
.off('shown.bs.modal', this.opened)
.off('hidden.bs.modal', this.closed);
}, },
methods: { methods: {
emitCancel(event) { emitCancel(event) {
......
...@@ -593,15 +593,6 @@ const fileNameIcons = { ...@@ -593,15 +593,6 @@ const fileNameIcons = {
export default function getIconForFile(name) { export default function getIconForFile(name) {
return ( return (
fileNameIcons[name] || fileNameIcons[name] || fileExtensionIcons[name ? name.split('.').pop().toLowerCase() : ''] || ''
fileExtensionIcons[
name
? name
.split('.')
.pop()
.toLowerCase()
: ''
] ||
''
); );
} }
...@@ -49,10 +49,10 @@ export default { ...@@ -49,10 +49,10 @@ export default {
) )
" "
> >
<template #markdownDocsLink="{content}"> <template #markdownDocsLink="{ content }">
<gl-link :href="markdownDocsPath" target="_blank">{{ content }}</gl-link> <gl-link :href="markdownDocsPath" target="_blank">{{ content }}</gl-link>
</template> </template>
<template #quickActionsDocsLink="{content}"> <template #quickActionsDocsLink="{ content }">
<gl-link :href="quickActionsDocsPath" target="_blank">{{ content }}</gl-link> <gl-link :href="quickActionsDocsPath" target="_blank">{{ content }}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
) )
" "
> >
<template #retryButton="{content}"> <template #retryButton="{ content }">
<gl-button <gl-button
variant="link" variant="link"
category="primary" category="primary"
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
{{ content }} {{ content }}
</gl-button> </gl-button>
</template> </template>
<template #newFileButton="{content}"> <template #newFileButton="{ content }">
<gl-button <gl-button
variant="link" variant="link"
category="primary" category="primary"
......
...@@ -78,16 +78,10 @@ export default { ...@@ -78,16 +78,10 @@ export default {
}, },
// following 2 methods taken from code in `collapseLongCommitList` of notes.js: // following 2 methods taken from code in `collapseLongCommitList` of notes.js:
actionTextHtml() { actionTextHtml() {
return $(this.note.note_html) return $(this.note.note_html).unwrap().html();
.unwrap()
.html();
}, },
hasMoreCommits() { hasMoreCommits() {
return ( return $(this.note.note_html).filter('ul').children().length > MAX_VISIBLE_COMMIT_LIST_COUNT;
$(this.note.note_html)
.filter('ul')
.children().length > MAX_VISIBLE_COMMIT_LIST_COUNT
);
}, },
descriptionVersion() { descriptionVersion() {
return this.descriptionVersions[this.note.description_version_id]; return this.descriptionVersions[this.note.description_version_id];
......
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
data-testid="info-message" data-testid="info-message"
> >
<gl-sprintf :message="message.text"> <gl-sprintf :message="message.text">
<template #docLink="{content}"> <template #docLink="{ content }">
<gl-link :href="message.link" target="_blank">{{ content }}</gl-link> <gl-link :href="message.link" target="_blank">{{ content }}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
......
...@@ -143,7 +143,7 @@ export default { ...@@ -143,7 +143,7 @@ export default {
> >
<slot></slot> <slot></slot>
</dropdown-value> </dropdown-value>
<div v-if="canEdit" class="selectbox js-selectbox" style="display: none;"> <div v-if="canEdit" class="selectbox js-selectbox" style="display: none">
<dropdown-hidden-input <dropdown-hidden-input
v-for="label in context.labels" v-for="label in context.labels"
:key="label.id" :key="label.id"
......
...@@ -86,7 +86,7 @@ const createValidator = (context, feedbackMap) => ({ el, reportInvalidInput = fa ...@@ -86,7 +86,7 @@ const createValidator = (context, feedbackMap) => ({ el, reportInvalidInput = fa
* @param {Object<string, { message: string, isValid: ?function}>} customFeedbackMap * @param {Object<string, { message: string, isValid: ?function}>} customFeedbackMap
* @returns {{ inserted: function, update: function }} validateDirective * @returns {{ inserted: function, update: function }} validateDirective
*/ */
export default function(customFeedbackMap = {}) { export default function (customFeedbackMap = {}) {
const feedbackMap = merge(defaultFeedbackMap, customFeedbackMap); const feedbackMap = merge(defaultFeedbackMap, customFeedbackMap);
const elDataMap = new WeakMap(); const elDataMap = new WeakMap();
......
...@@ -34,13 +34,13 @@ export default { ...@@ -34,13 +34,13 @@ export default {
<template> <template>
<span> <span>
<gl-sprintf :message="message.message"> <gl-sprintf :message="message.message">
<template #total="{content}"> <template #total="{ content }">
<strong>{{ content }}</strong> <strong>{{ content }}</strong>
</template> </template>
</gl-sprintf> </gl-sprintf>
<span v-if="shouldShowCountMessage" class="gl-font-sm"> <span v-if="shouldShowCountMessage" class="gl-font-sm">
<gl-sprintf :message="message.countMessage"> <gl-sprintf :message="message.countMessage">
<template v-for="slotName in $options.slotNames" #[slotName]="{content}"> <template v-for="slotName in $options.slotNames" #[slotName]="{ content }">
<span :key="slotName"> <span :key="slotName">
<strong <strong
v-if="message[slotName] > 0" v-if="message[slotName] > 0"
......
...@@ -48,11 +48,7 @@ export default class ZenMode { ...@@ -48,11 +48,7 @@ export default class ZenMode {
return $(e.currentTarget).trigger('zen_mode:leave'); return $(e.currentTarget).trigger('zen_mode:leave');
}); });
$(document).on('zen_mode:enter', e => { $(document).on('zen_mode:enter', e => {
this.enter( this.enter($(e.target).closest('.md-area').find('.zen-backdrop'));
$(e.target)
.closest('.md-area')
.find('.zen-backdrop'),
);
}); });
$(document).on('zen_mode:leave', () => { $(document).on('zen_mode:leave', () => {
this.exit(); this.exit();
......
...@@ -68,8 +68,6 @@ export default { ...@@ -68,8 +68,6 @@ export default {
> >
<gl-avatar :src="firstApprover.avatar_url" :size="$options.avatarSize" /> <gl-avatar :src="firstApprover.avatar_url" :size="$options.avatarSize" />
</gl-avatar-link> </gl-avatar-link>
<template v-else> <template v-else> &ndash; </template>
&ndash;
</template>
</div> </div>
</template> </template>
...@@ -121,9 +121,7 @@ export default { ...@@ -121,9 +121,7 @@ export default {
<!-- eslint-disable-next-line vue/no-v-html--> <!-- eslint-disable-next-line vue/no-v-html-->
<span v-html="formatReviewTime(value)"></span> <span v-html="formatReviewTime(value)"></span>
</template> </template>
<template v-else> <template v-else> &ndash; </template>
&ndash;
</template>
</template> </template>
<template #cell(author)="{ value }"> <template #cell(author)="{ value }">
......
...@@ -48,8 +48,6 @@ export default { ...@@ -48,8 +48,6 @@ export default {
<template v-if="hasData"> <template v-if="hasData">
{{ calculatedTime.duration }} <span> {{ calculatedTime.units }} </span> {{ calculatedTime.duration }} <span> {{ calculatedTime.units }} </span>
</template> </template>
<template v-else> <template v-else> -- </template>
--
</template>
</span> </span>
</template> </template>
...@@ -40,9 +40,7 @@ export default { ...@@ -40,9 +40,7 @@ export default {
{{ value }} {{ value }}
<span> {{ unit }} </span> <span> {{ unit }} </span>
</template> </template>
<template v-else> <template v-else> &ndash; </template>
&ndash;
</template>
</span> </span>
<span v-if="label" class="d-flex d-md-none text-secondary metric-label">{{ label }}</span> <span v-if="label" class="d-flex d-md-none text-secondary metric-label">{{ label }}</span>
</div> </div>
......
...@@ -11,5 +11,5 @@ export default { ...@@ -11,5 +11,5 @@ export default {
</script> </script>
<template> <template>
<app :is-mr-edit="false"><project-rules slot="rules"/></app> <app :is-mr-edit="false"><project-rules slot="rules" /></app>
</template> </template>
...@@ -32,10 +32,7 @@ const seedUsers = ({ userRecords, ...rule }) => ...@@ -32,10 +32,7 @@ const seedUsers = ({ userRecords, ...rule }) =>
const seedGroups = ({ groupRecords, ...rule }) => const seedGroups = ({ groupRecords, ...rule }) =>
groupRecords ? { ...rule, groups: groupRecords } : rule; groupRecords ? { ...rule, groups: groupRecords } : rule;
const seedLocalRule = rule => const seedLocalRule = rule => seedApprovers(rule).then(seedUsers).then(seedGroups);
seedApprovers(rule)
.then(seedUsers)
.then(seedGroups);
const seedNewRule = rule => { const seedNewRule = rule => {
const name = rule.ruleType === RULE_TYPE_ANY_APPROVER ? '' : rule.name; const name = rule.ruleType === RULE_TYPE_ANY_APPROVER ? '' : rule.name;
......
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
<template> <template>
<audit-filter-token v-bind="{ ...this.$attrs, ...this.$options.tokenMethods }" v-on="$listeners"> <audit-filter-token v-bind="{ ...this.$attrs, ...this.$options.tokenMethods }" v-on="$listeners">
<template #suggestion="{item: group}"> <template #suggestion="{ item: group }">
<p class="m-0">{{ group.full_name }}</p> <p class="m-0">{{ group.full_name }}</p>
<p class="m-0">{{ group.full_path }}</p> <p class="m-0">{{ group.full_path }}</p>
</template> </template>
......
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
<template> <template>
<audit-filter-token v-bind="{ ...this.$attrs, ...this.$options.tokenMethods }" v-on="$listeners"> <audit-filter-token v-bind="{ ...this.$attrs, ...this.$options.tokenMethods }" v-on="$listeners">
<template #suggestion="{item: user}"> <template #suggestion="{ item: user }">
<p class="m-0">{{ user.name }}</p> <p class="m-0">{{ user.name }}</p>
<p class="m-0">@{{ user.username }}</p> <p class="m-0">@{{ user.username }}</p>
</template> </template>
......
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
<template> <template>
<audit-filter-token v-bind="{ ...this.$attrs, ...this.$options.tokenMethods }" v-on="$listeners"> <audit-filter-token v-bind="{ ...this.$attrs, ...this.$options.tokenMethods }" v-on="$listeners">
<template #suggestion="{item: project}"> <template #suggestion="{ item: project }">
<p class="m-0">{{ project.name }}</p> <p class="m-0">{{ project.name }}</p>
<p class="m-0">{{ project.name_with_namespace }}</p> <p class="m-0">{{ project.name_with_namespace }}</p>
</template> </template>
......
...@@ -64,10 +64,7 @@ export default { ...@@ -64,10 +64,7 @@ export default {
return this.suggestions.length > 0; return this.suggestions.length > 0;
}, },
lowerCaseType() { lowerCaseType() {
return this.config.type return this.config.type.replace('_', ' ').trim().toLowerCase();
.replace('_', ' ')
.trim()
.toLowerCase();
}, },
noSuggestionsString() { noSuggestionsString() {
return sprintf(s__('AuditLogs|No matching %{type} found.'), { type: this.lowerCaseType }); return sprintf(s__('AuditLogs|No matching %{type} found.'), { type: this.lowerCaseType });
...@@ -75,7 +72,7 @@ export default { ...@@ -75,7 +72,7 @@ export default {
}, },
watch: { watch: {
// eslint-disable-next-line func-names // eslint-disable-next-line func-names
'value.data': function(term) { 'value.data': function (term) {
this.debouncedLoadSuggestions(term); this.debouncedLoadSuggestions(term);
}, },
active() { active() {
......
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
<template> <template>
<audit-filter-token v-bind="{ ...this.$attrs, ...this.$options.tokenMethods }" v-on="$listeners"> <audit-filter-token v-bind="{ ...this.$attrs, ...this.$options.tokenMethods }" v-on="$listeners">
<template #suggestion="{item: user}"> <template #suggestion="{ item: user }">
<p class="m-0">{{ user.name }}</p> <p class="m-0">{{ user.name }}</p>
<p class="m-0">@{{ user.username }}</p> <p class="m-0">@{{ user.username }}</p>
</template> </template>
......
...@@ -21,10 +21,7 @@ export default class ShortcutsEpic extends ShortcutsIssuable { ...@@ -21,10 +21,7 @@ export default class ShortcutsEpic extends ShortcutsIssuable {
if (parseBoolean(Cookies.get('collapsed_gutter'))) { if (parseBoolean(Cookies.get('collapsed_gutter'))) {
document.dispatchEvent(new Event('toggleSidebarRevealLabelsDropdown')); document.dispatchEvent(new Event('toggleSidebarRevealLabelsDropdown'));
} else { } else {
$block $block.find('.js-sidebar-dropdown-toggle').get(0).dispatchEvent(new Event('click'));
.find('.js-sidebar-dropdown-toggle')
.get(0)
.dispatchEvent(new Event('click'));
} }
} }
} }
...@@ -60,8 +60,6 @@ exports[`ApproversColumn component when a list with two approvers is passed matc ...@@ -60,8 +60,6 @@ exports[`ApproversColumn component when a list with two approvers is passed matc
exports[`ApproversColumn component when an empty list approvers is passed matches the snapshot 1`] = ` exports[`ApproversColumn component when an empty list approvers is passed matches the snapshot 1`] = `
<div> <div>
</div> </div>
`; `;
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`TotalTimeComponent with a blank object to render -- 1`] = ` exports[`TotalTimeComponent with a blank object to render -- 1`] = `"<span class=\\"total-time\\"> -- </span>"`;
"<span class=\\"total-time\\">
--
</span>"
`;
exports[`TotalTimeComponent with a valid time object with {"days": 3, "mins": 47, "seconds": 3} 1`] = ` exports[`TotalTimeComponent with a valid time object with {"days": 3, "mins": 47, "seconds": 3} 1`] = `
"<span class=\\"total-time\\"> "<span class=\\"total-time\\">
......
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