diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /app/assets/javascripts/notes/stores/utils.js | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) | |
download | gitlab-ce-6438df3a1e0fb944485cebf07976160184697d72.tar.gz |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'app/assets/javascripts/notes/stores/utils.js')
-rw-r--r-- | app/assets/javascripts/notes/stores/utils.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/assets/javascripts/notes/stores/utils.js b/app/assets/javascripts/notes/stores/utils.js index 10faac0c32b..6df926e1249 100644 --- a/app/assets/javascripts/notes/stores/utils.js +++ b/app/assets/javascripts/notes/stores/utils.js @@ -6,13 +6,13 @@ import createGqClient, { fetchPolicies } from '~/lib/graphql'; // factory function because global flag makes RegExp stateful const createQuickActionsRegex = () => /^\/\w+.*$/gm; -export const findNoteObjectById = (notes, id) => notes.filter(n => n.id === id)[0]; +export const findNoteObjectById = (notes, id) => notes.filter((n) => n.id === id)[0]; -export const getQuickActionText = note => { +export const getQuickActionText = (note) => { let text = __('Applying command'); const quickActions = AjaxCache.get(gl.GfmAutoComplete.dataSources.commands) || []; - const executedCommands = quickActions.filter(command => { + const executedCommands = quickActions.filter((command) => { const commandRegex = new RegExp(`/${command.name}`); return commandRegex.test(note); }); @@ -29,12 +29,12 @@ export const getQuickActionText = note => { return text; }; -export const hasQuickActions = note => createQuickActionsRegex().test(note); +export const hasQuickActions = (note) => createQuickActionsRegex().test(note); -export const stripQuickActions = note => note.replace(createQuickActionsRegex(), '').trim(); +export const stripQuickActions = (note) => note.replace(createQuickActionsRegex(), '').trim(); -export const prepareDiffLines = diffLines => - diffLines.map(line => ({ ...trimFirstCharOfLineContent(line) })); +export const prepareDiffLines = (diffLines) => + diffLines.map((line) => ({ ...trimFirstCharOfLineContent(line) })); export const gqClient = createGqClient( {}, |