diff --git a/app/assets/javascripts/add_context_commits_modal/index.js b/app/assets/javascripts/add_context_commits_modal/index.js index 110677781a7..2cdb49eed45 100644 --- a/app/assets/javascripts/add_context_commits_modal/index.js +++ b/app/assets/javascripts/add_context_commits_modal/index.js @@ -38,12 +38,8 @@ export default function initAddContextCommitsTriggers() { el: addContextCommitsModalWrapperEl, store, data() { - const { - contextCommitsPath, - targetBranch, - mergeRequestIid, - projectId, - } = this.$options.el.dataset; + const { contextCommitsPath, targetBranch, mergeRequestIid, projectId } = + this.$options.el.dataset; return { contextCommitsPath, targetBranch, diff --git a/app/assets/javascripts/admin/broadcast_messages/index.js b/app/assets/javascripts/admin/broadcast_messages/index.js index 29021043b1a..e69a0bb827a 100644 --- a/app/assets/javascripts/admin/broadcast_messages/index.js +++ b/app/assets/javascripts/admin/broadcast_messages/index.js @@ -3,14 +3,8 @@ import BroadcastMessagesBase from './components/base.vue'; export default () => { const el = document.querySelector('#js-broadcast-messages'); - const { - page, - targetAccessLevelOptions, - messagesPath, - previewPath, - messagesCount, - messages, - } = el.dataset; + const { page, targetAccessLevelOptions, messagesPath, previewPath, messagesCount, messages } = + el.dataset; return new Vue({ el, diff --git a/app/assets/javascripts/admin/users/components/actions/delete.vue b/app/assets/javascripts/admin/users/components/actions/delete.vue index 455f35aa8c1..d280e1077f2 100644 --- a/app/assets/javascripts/admin/users/components/actions/delete.vue +++ b/app/assets/javascripts/admin/users/components/actions/delete.vue @@ -38,7 +38,8 @@ export default { i18n: { title: s__('AdminUsers|Delete User %{username}?'), primaryButtonLabel: s__('AdminUsers|Delete user'), - messageBody: s__(`AdminUsers|You are about to permanently delete the user %{username}. Issues, merge requests, + messageBody: + s__(`AdminUsers|You are about to permanently delete the user %{username}. Issues, merge requests, and groups linked to them will be transferred to a system-wide "Ghost-user". To avoid data loss, consider using the %{strongStart}block user%{strongEnd} feature instead. Once you %{strongStart}Delete user%{strongEnd}, it cannot be undone or recovered.`), diff --git a/app/assets/javascripts/admin/users/components/actions/delete_with_contributions.vue b/app/assets/javascripts/admin/users/components/actions/delete_with_contributions.vue index 24f0cac73f5..e97d041caf5 100644 --- a/app/assets/javascripts/admin/users/components/actions/delete_with_contributions.vue +++ b/app/assets/javascripts/admin/users/components/actions/delete_with_contributions.vue @@ -59,7 +59,8 @@ export default { i18n: { title: s__('AdminUsers|Delete User %{username} and contributions?'), primaryButtonLabel: s__('AdminUsers|Delete user and contributions'), - messageBody: s__(`AdminUsers|You are about to permanently delete the user %{username}. This will delete all issues, + messageBody: + s__(`AdminUsers|You are about to permanently delete the user %{username}. This will delete all issues, merge requests, groups, and projects linked to them. To avoid data loss, consider using the %{strongStart}Block user%{strongEnd} feature instead. After you %{strongStart}Delete user%{strongEnd}, you cannot undo this action or recover the data.`), diff --git a/app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue b/app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue index 144c04f6ff9..7d0017417eb 100644 --- a/app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue +++ b/app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue @@ -186,8 +186,13 @@ export default { ); }, isFormDirty() { - const { type, active, name, payloadAlertFields = [], payloadAttributeMappings = [] } = - this.currentIntegration || {}; + const { + type, + active, + name, + payloadAlertFields = [], + payloadAttributeMappings = [], + } = this.currentIntegration || {}; const { name: formName, active: formActive, type: formType } = this.integrationForm; const isDirty = diff --git a/app/assets/javascripts/alerts_settings/utils/cache_updates.js b/app/assets/javascripts/alerts_settings/utils/cache_updates.js index e03ebffd17a..4e64a67b6e7 100644 --- a/app/assets/javascripts/alerts_settings/utils/cache_updates.js +++ b/app/assets/javascripts/alerts_settings/utils/cache_updates.js @@ -15,9 +15,8 @@ const deleteIntegrationFromStore = (store, query, { httpIntegrationDestroy }, va }); const data = produce(sourceData, (draftData) => { - draftData.project.alertManagementIntegrations.nodes = draftData.project.alertManagementIntegrations.nodes.filter( - ({ id }) => id !== integration.id, - ); + draftData.project.alertManagementIntegrations.nodes = + draftData.project.alertManagementIntegrations.nodes.filter(({ id }) => id !== integration.id); }); store.writeQuery({ diff --git a/app/assets/javascripts/analytics/cycle_analytics/index.js b/app/assets/javascripts/analytics/cycle_analytics/index.js index 470d00c0d66..8b8bc51ef0f 100644 --- a/app/assets/javascripts/analytics/cycle_analytics/index.js +++ b/app/assets/javascripts/analytics/cycle_analytics/index.js @@ -18,12 +18,8 @@ export default () => { const initialData = buildCycleAnalyticsInitialData({ ...el.dataset, gon }); const pagination = extractPaginationQueryParameters(window.location.search); - const { - selectedAuthor, - selectedMilestone, - selectedAssigneeList, - selectedLabelList, - } = extractFilterQueryParameters(window.location.search); + const { selectedAuthor, selectedMilestone, selectedAssigneeList, selectedLabelList } = + extractFilterQueryParameters(window.location.search); store.dispatch('initializeVsa', { ...initialData, diff --git a/app/assets/javascripts/authentication/password/index.js b/app/assets/javascripts/authentication/password/index.js index ee147e4eace..44921c82ebe 100644 --- a/app/assets/javascripts/authentication/password/index.js +++ b/app/assets/javascripts/authentication/password/index.js @@ -10,15 +10,8 @@ export const initPasswordInput = () => { const { form } = el; - const { - title, - id, - minimumPasswordLength, - testid, - trackActionForErrors, - autocomplete, - name, - } = el.dataset; + const { title, id, minimumPasswordLength, testid, trackActionForErrors, autocomplete, name } = + el.dataset; // eslint-disable-next-line no-new new Vue({ diff --git a/app/assets/javascripts/batch_comments/stores/modules/batch_comments/getters.js b/app/assets/javascripts/batch_comments/stores/modules/batch_comments/getters.js index 28b9100c5f3..15106ffe0ff 100644 --- a/app/assets/javascripts/batch_comments/stores/modules/batch_comments/getters.js +++ b/app/assets/javascripts/batch_comments/stores/modules/batch_comments/getters.js @@ -65,16 +65,18 @@ export const shouldRenderDraftRowInDiscussion = (state, getters) => (discussionI export const draftForDiscussion = (state, getters) => (discussionId) => getters.draftsPerDiscussionId[discussionId] || {}; -export const draftsForLine = (state, getters) => (diffFileSha, line, side = null) => { - const draftsForFile = getters.draftsPerFileHashAndLine[diffFileSha]; - const key = side !== null ? parallelLineKey(line, side) : line.line_code; - const showDraftsForThisSide = showDraftOnSide(line, side); +export const draftsForLine = + (state, getters) => + (diffFileSha, line, side = null) => { + const draftsForFile = getters.draftsPerFileHashAndLine[diffFileSha]; + const key = side !== null ? parallelLineKey(line, side) : line.line_code; + const showDraftsForThisSide = showDraftOnSide(line, side); - if (showDraftsForThisSide && draftsForFile?.[key]) { - return draftsForFile[key].filter((d) => d.position.position_type === 'text'); - } - return []; -}; + if (showDraftsForThisSide && draftsForFile?.[key]) { + return draftsForFile[key].filter((d) => d.position.position_type === 'text'); + } + return []; + }; export const draftsForFile = (state) => (diffFileSha) => state.drafts.filter((draft) => draft.file_hash === diffFileSha); diff --git a/app/assets/javascripts/behaviors/markdown/render_json_table.js b/app/assets/javascripts/behaviors/markdown/render_json_table.js index aa0e7d38113..3bc497dc86f 100644 --- a/app/assets/javascripts/behaviors/markdown/render_json_table.js +++ b/app/assets/javascripts/behaviors/markdown/render_json_table.js @@ -4,8 +4,8 @@ import { __ } from '~/locale'; import { createAlert } from '~/alert'; // Async import component since we might not need it... -const JSONTable = memoize(() => - import(/* webpackChunkName: 'gfm_json_table' */ '../components/json_table.vue'), +const JSONTable = memoize( + () => import(/* webpackChunkName: 'gfm_json_table' */ '../components/json_table.vue'), ); const mountParseError = (element) => { diff --git a/app/assets/javascripts/boards/components/board_list.vue b/app/assets/javascripts/boards/components/board_list.vue index 7eda83d8707..490bc43dc8e 100644 --- a/app/assets/javascripts/boards/components/board_list.vue +++ b/app/assets/javascripts/boards/components/board_list.vue @@ -648,7 +648,8 @@ export default { :data-board="list.id" :data-board-type="list.listType" :class="{ - 'gl-bg-red-50 gl-rounded-bottom-left-base gl-rounded-bottom-right-base': boardItemsSizeExceedsMax, + 'gl-bg-red-50 gl-rounded-bottom-left-base gl-rounded-bottom-right-base': + boardItemsSizeExceedsMax, 'gl-overflow-hidden': disableScrollingWhenMutationInProgress, 'gl-overflow-y-auto': !disableScrollingWhenMutationInProgress, }" diff --git a/app/assets/javascripts/boards/components/board_list_header.vue b/app/assets/javascripts/boards/components/board_list_header.vue index 8c39e47c07d..9a5534a474c 100644 --- a/app/assets/javascripts/boards/components/board_list_header.vue +++ b/app/assets/javascripts/boards/components/board_list_header.vue @@ -330,7 +330,8 @@ export default { :class="{ 'gl-h-full': list.collapsed, 'gl-bg-gray-50': isSwimlanesHeader, - 'gl-border-t-solid gl-border-4 gl-rounded-top-left-base gl-rounded-top-right-base': isLabelList, + 'gl-border-t-solid gl-border-4 gl-rounded-top-left-base gl-rounded-top-right-base': + isLabelList, 'gl-bg-red-50 gl-rounded-top-left-base gl-rounded-top-right-base': boardItemsSizeExceedsMax, }" :style="headerStyle" diff --git a/app/assets/javascripts/ci/jobs_page/index.js b/app/assets/javascripts/ci/jobs_page/index.js index 7e99157289b..3bf7832b515 100644 --- a/app/assets/javascripts/ci/jobs_page/index.js +++ b/app/assets/javascripts/ci/jobs_page/index.js @@ -25,13 +25,8 @@ export default (containerId = 'js-jobs-table') => { return false; } - const { - fullPath, - jobStatuses, - pipelineEditorPath, - emptyStateSvgPath, - admin, - } = containerEl.dataset; + const { fullPath, jobStatuses, pipelineEditorPath, emptyStateSvgPath, admin } = + containerEl.dataset; return new Vue({ el: containerEl, diff --git a/app/assets/javascripts/ci/pipeline_details/dag/components/dag_graph.vue b/app/assets/javascripts/ci/pipeline_details/dag/components/dag_graph.vue index 94cfb1f138c..b81bdbf8da3 100644 --- a/app/assets/javascripts/ci/pipeline_details/dag/components/dag_graph.vue +++ b/app/assets/javascripts/ci/pipeline_details/dag/components/dag_graph.vue @@ -216,14 +216,8 @@ export default { }, drawGraph({ maxNodesPerLayer, linksAndNodes }) { - const { - baseWidth, - baseHeight, - minNodeHeight, - nodeWidth, - nodePadding, - paddingForLabels, - } = this.$options.viewOptions; + const { baseWidth, baseHeight, minNodeHeight, nodeWidth, nodePadding, paddingForLabels } = + this.$options.viewOptions; this.width = baseWidth; this.height = baseHeight + maxNodesPerLayer * minNodeHeight; diff --git a/app/assets/javascripts/ci/pipeline_details/graph/components/graph_component.vue b/app/assets/javascripts/ci/pipeline_details/graph/components/graph_component.vue index 2ee647fde67..e9bf0ed3762 100644 --- a/app/assets/javascripts/ci/pipeline_details/graph/components/graph_component.vue +++ b/app/assets/javascripts/ci/pipeline_details/graph/components/graph_component.vue @@ -180,7 +180,8 @@ export default { ref="mainPipelineContainer" class="pipeline-graph gl-display-flex gl-position-relative gl-whitespace-nowrap gl-rounded-lg" :class="{ - 'pipeline-graph-container gl-bg-gray-10 gl-pipeline-min-h gl-align-items-flex-start gl-pt-3 gl-pb-8 gl-mt-3 gl-overflow-auto': !isLinkedPipeline, + 'pipeline-graph-container gl-bg-gray-10 gl-pipeline-min-h gl-align-items-flex-start gl-pt-3 gl-pb-8 gl-mt-3 gl-overflow-auto': + !isLinkedPipeline, 'gl-bg-gray-50 gl-sm-ml-5': isLinkedPipeline, }" data-testid="pipeline-container" diff --git a/app/assets/javascripts/ci/pipeline_editor/components/header/pipeline_status.vue b/app/assets/javascripts/ci/pipeline_editor/components/header/pipeline_status.vue index e3df8e783b8..db9b360b66b 100644 --- a/app/assets/javascripts/ci/pipeline_editor/components/header/pipeline_status.vue +++ b/app/assets/javascripts/ci/pipeline_editor/components/header/pipeline_status.vue @@ -65,8 +65,14 @@ export default { }; }, update(data) { - const { id, iid, commit = {}, detailedStatus = {}, stages, status } = - data.project?.pipeline || {}; + const { + id, + iid, + commit = {}, + detailedStatus = {}, + stages, + status, + } = data.project?.pipeline || {}; return { id, diff --git a/app/assets/javascripts/ci/pipeline_mini_graph/legacy_pipeline_mini_graph/legacy_job_item.vue b/app/assets/javascripts/ci/pipeline_mini_graph/legacy_pipeline_mini_graph/legacy_job_item.vue index 1e25c5de7ab..5b80504cd0b 100644 --- a/app/assets/javascripts/ci/pipeline_mini_graph/legacy_pipeline_mini_graph/legacy_job_item.vue +++ b/app/assets/javascripts/ci/pipeline_mini_graph/legacy_pipeline_mini_graph/legacy_job_item.vue @@ -172,7 +172,8 @@ export default { :class="[ cssClassJobName, { - 'gl-text-gray-900 gl-active-text-decoration-none gl-focus-text-decoration-none gl-hover-text-decoration-none': hasDetails, + 'gl-text-gray-900 gl-active-text-decoration-none gl-focus-text-decoration-none gl-hover-text-decoration-none': + hasDetails, 'js-job-component-tooltip non-details-job-component': !hasDetails, }, ]" diff --git a/app/assets/javascripts/ci/reports/components/issues_list.vue b/app/assets/javascripts/ci/reports/components/issues_list.vue index ababd4b5e49..7fc362c9ce6 100644 --- a/app/assets/javascripts/ci/reports/components/issues_list.vue +++ b/app/assets/javascripts/ci/reports/components/issues_list.vue @@ -3,11 +3,13 @@ import ReportItem from '~/ci/reports/components/report_item.vue'; import { STATUS_FAILED, STATUS_NEUTRAL, STATUS_SUCCESS } from '~/ci/reports/constants'; import SmartVirtualList from '~/vue_shared/components/smart_virtual_list.vue'; -const wrapIssueWithState = (status, isNew = false) => (issue) => ({ - status: issue.status || status, - isNew, - issue, -}); +const wrapIssueWithState = + (status, isNew = false) => + (issue) => ({ + status: issue.status || status, + isNew, + issue, + }); /** * Renders block of issues diff --git a/app/assets/javascripts/ci/runner/admin_runners/index.js b/app/assets/javascripts/ci/runner/admin_runners/index.js index 1e03e78487a..cf306090983 100644 --- a/app/assets/javascripts/ci/runner/admin_runners/index.js +++ b/app/assets/javascripts/ci/runner/admin_runners/index.js @@ -33,12 +33,8 @@ export const initAdminRunners = (selector = '#js-admin-runners') => { return null; } - const { - newRunnerPath, - allowRegistrationToken, - registrationToken, - tagSuggestionsPath, - } = el.dataset; + const { newRunnerPath, allowRegistrationToken, registrationToken, tagSuggestionsPath } = + el.dataset; const { cacheConfig, typeDefs, localMutations } = createLocalState(); const apolloProvider = new VueApollo({ diff --git a/app/assets/javascripts/ci/runner/components/registration/utils.js b/app/assets/javascripts/ci/runner/components/registration/utils.js index c1885be9585..6f9927a8ee0 100644 --- a/app/assets/javascripts/ci/runner/components/registration/utils.js +++ b/app/assets/javascripts/ci/runner/components/registration/utils.js @@ -109,8 +109,9 @@ export const platformArchitectures = ({ platform }) => { }; export const installScript = ({ platform, architecture }) => { - const downloadLocation = DOWNLOAD_LOCATIONS[platform].find(({ arch }) => arch === architecture) - .url; + const downloadLocation = DOWNLOAD_LOCATIONS[platform].find( + ({ arch }) => arch === architecture, + ).url; return importInstallScript({ platform }) .replace( diff --git a/app/assets/javascripts/ci/runner/group_runners/index.js b/app/assets/javascripts/ci/runner/group_runners/index.js index 49aa5db8462..db5239f6329 100644 --- a/app/assets/javascripts/ci/runner/group_runners/index.js +++ b/app/assets/javascripts/ci/runner/group_runners/index.js @@ -19,13 +19,8 @@ export const initGroupRunners = (selector = '#js-group-runners') => { return null; } - const { - allowRegistrationToken, - registrationToken, - newRunnerPath, - groupId, - groupFullPath, - } = el.dataset; + const { allowRegistrationToken, registrationToken, newRunnerPath, groupId, groupFullPath } = + el.dataset; const { cacheConfig, typeDefs, localMutations } = createLocalState(); diff --git a/app/assets/javascripts/clusters/agents/graphql/cache_update.js b/app/assets/javascripts/clusters/agents/graphql/cache_update.js index 8db79c82708..5a284814748 100644 --- a/app/assets/javascripts/clusters/agents/graphql/cache_update.js +++ b/app/assets/javascripts/clusters/agents/graphql/cache_update.js @@ -31,9 +31,8 @@ export function removeTokenFromStore(store, revokeToken, query, variables) { }); const data = produce(sourceData, (draftData) => { - draftData.project.clusterAgent.tokens.nodes = draftData.project.clusterAgent.tokens.nodes.filter( - ({ id }) => id !== revokeToken.id, - ); + draftData.project.clusterAgent.tokens.nodes = + draftData.project.clusterAgent.tokens.nodes.filter(({ id }) => id !== revokeToken.id); draftData.project.clusterAgent.tokens.count -= 1; }); diff --git a/app/assets/javascripts/clusters_list/graphql/cache_update.js b/app/assets/javascripts/clusters_list/graphql/cache_update.js index 1c58652744d..af9b8f2f6f0 100644 --- a/app/assets/javascripts/clusters_list/graphql/cache_update.js +++ b/app/assets/javascripts/clusters_list/graphql/cache_update.js @@ -44,12 +44,14 @@ export function removeAgentFromStore(store, deleteClusterAgent, query, variables draftData.project.clusterAgents.nodes = draftData.project.clusterAgents.nodes.filter( ({ id }) => id !== deleteClusterAgent.id, ); - draftData.project.ciAccessAuthorizedAgents.nodes = draftData.project.ciAccessAuthorizedAgents.nodes.filter( - ({ agent }) => agent.id !== deleteClusterAgent.id, - ); - draftData.project.userAccessAuthorizedAgents.nodes = draftData.project.userAccessAuthorizedAgents.nodes.filter( - ({ agent }) => agent.id !== deleteClusterAgent.id, - ); + draftData.project.ciAccessAuthorizedAgents.nodes = + draftData.project.ciAccessAuthorizedAgents.nodes.filter( + ({ agent }) => agent.id !== deleteClusterAgent.id, + ); + draftData.project.userAccessAuthorizedAgents.nodes = + draftData.project.userAccessAuthorizedAgents.nodes.filter( + ({ agent }) => agent.id !== deleteClusterAgent.id, + ); }); store.writeQuery({ diff --git a/app/assets/javascripts/code_review/signals.js b/app/assets/javascripts/code_review/signals.js index a9c71b0a77e..7d8ad63a4e1 100644 --- a/app/assets/javascripts/code_review/signals.js +++ b/app/assets/javascripts/code_review/signals.js @@ -13,7 +13,11 @@ function required(name) { } async function observeMergeRequestFinishingPreparation({ apollo, signaler }) { - const { namespace, project, id: iid } = getDerivedMergeRequestInformation({ + const { + namespace, + project, + id: iid, + } = getDerivedMergeRequestInformation({ endpoint: document.location.pathname, }); const projectPath = `${namespace}/${project}`; diff --git a/app/assets/javascripts/content_editor/extensions/attachment.js b/app/assets/javascripts/content_editor/extensions/attachment.js index e7a6af30266..70b2aa749ef 100644 --- a/app/assets/javascripts/content_editor/extensions/attachment.js +++ b/app/assets/javascripts/content_editor/extensions/attachment.js @@ -29,17 +29,19 @@ export default Extension.create({ addCommands() { return { - uploadAttachment: ({ file }) => () => { - const { uploadsPath, renderMarkdown, eventHub } = this.options; + uploadAttachment: + ({ file }) => + () => { + const { uploadsPath, renderMarkdown, eventHub } = this.options; - return handleFileEvent({ - file, - uploadsPath, - renderMarkdown, - editor: this.editor, - eventHub, - }); - }, + return handleFileEvent({ + file, + uploadsPath, + renderMarkdown, + editor: this.editor, + eventHub, + }); + }, }; }, addProseMirrorPlugins() { diff --git a/app/assets/javascripts/content_editor/extensions/code_suggestion.js b/app/assets/javascripts/content_editor/extensions/code_suggestion.js index 33e0dd13289..ab9201c9f90 100644 --- a/app/assets/javascripts/content_editor/extensions/code_suggestion.js +++ b/app/assets/javascripts/content_editor/extensions/code_suggestion.js @@ -34,32 +34,34 @@ export default CodeBlockHighlight.extend({ const ext = this; return { - insertCodeSuggestion: (attributes) => async ({ editor }) => { - // do not insert a new suggestion if already inside a suggestion - if (editor.isActive('codeSuggestion')) return false; + insertCodeSuggestion: + (attributes) => + async ({ editor }) => { + // do not insert a new suggestion if already inside a suggestion + if (editor.isActive('codeSuggestion')) return false; - const rawPath = ext.options.codeSuggestionsConfig.diffFile.view_path.replace( - '/blob/', - '/raw/', - ); - const allLines = (await memoizedGet(rawPath)).split('\n'); - const { line } = ext.options.codeSuggestionsConfig; - let { lines } = ext.options.codeSuggestionsConfig; + const rawPath = ext.options.codeSuggestionsConfig.diffFile.view_path.replace( + '/blob/', + '/raw/', + ); + const allLines = (await memoizedGet(rawPath)).split('\n'); + const { line } = ext.options.codeSuggestionsConfig; + let { lines } = ext.options.codeSuggestionsConfig; - if (!lines.length) lines = [line]; + if (!lines.length) lines = [line]; - const content = lines.map((l) => allLines[l.new_line - 1]).join('\n'); - const lineNumbers = `-${lines.length - 1}+0`; + const content = lines.map((l) => allLines[l.new_line - 1]).join('\n'); + const lineNumbers = `-${lines.length - 1}+0`; - editor.commands.insertContent({ - type: 'codeSuggestion', - attrs: { langParams: lineNumbers, ...attributes }, - // empty strings are not allowed in text nodes - content: [{ type: 'text', text: content || ' ' }], - }); + editor.commands.insertContent({ + type: 'codeSuggestion', + attrs: { langParams: lineNumbers, ...attributes }, + // empty strings are not allowed in text nodes + content: [{ type: 'text', text: content || ' ' }], + }); - return true; - }, + return true; + }, }; }, diff --git a/app/assets/javascripts/content_editor/extensions/copy_paste.js b/app/assets/javascripts/content_editor/extensions/copy_paste.js index 446e9197fa8..e60e68ee38d 100644 --- a/app/assets/javascripts/content_editor/extensions/copy_paste.js +++ b/app/assets/javascripts/content_editor/extensions/copy_paste.js @@ -43,62 +43,68 @@ export default Extension.create({ }, addCommands() { return { - pasteContent: (content = '', processMarkdown = true) => () => { - const { editor, options } = this; - const { renderMarkdown, eventHub } = options; - const deserializer = createMarkdownDeserializer({ render: renderMarkdown }); + pasteContent: + (content = '', processMarkdown = true) => + () => { + const { editor, options } = this; + const { renderMarkdown, eventHub } = options; + const deserializer = createMarkdownDeserializer({ render: renderMarkdown }); - const pasteSchemaSpec = { ...editor.schema.spec }; - pasteSchemaSpec.marks = OrderedMap.from(pasteSchemaSpec.marks).remove('span'); - pasteSchemaSpec.nodes = OrderedMap.from(pasteSchemaSpec.nodes).remove('div').remove('pre'); - const pasteSchema = new Schema(pasteSchemaSpec); + const pasteSchemaSpec = { ...editor.schema.spec }; + pasteSchemaSpec.marks = OrderedMap.from(pasteSchemaSpec.marks).remove('span'); + pasteSchemaSpec.nodes = OrderedMap.from(pasteSchemaSpec.nodes) + .remove('div') + .remove('pre'); + const pasteSchema = new Schema(pasteSchemaSpec); - const promise = processMarkdown - ? deserializer.deserialize({ schema: pasteSchema, markdown: content }) - : Promise.resolve(parseHTML(pasteSchema, content)); - const loaderId = uniqueId('loading'); + const promise = processMarkdown + ? deserializer.deserialize({ schema: pasteSchema, markdown: content }) + : Promise.resolve(parseHTML(pasteSchema, content)); + const loaderId = uniqueId('loading'); - Promise.resolve() - .then(() => { - editor - .chain() - .deleteSelection() - .setMeta(loadingPlugin, { - add: { loaderId, pos: editor.state.selection.from }, - }) - .run(); + Promise.resolve() + .then(() => { + editor + .chain() + .deleteSelection() + .setMeta(loadingPlugin, { + add: { loaderId, pos: editor.state.selection.from }, + }) + .run(); - return promise; - }) - .then(async ({ document }) => { - if (!document) return; + return promise; + }) + .then(async ({ document }) => { + if (!document) return; - const pos = findLoader(editor.state, loaderId); - if (!pos) return; + const pos = findLoader(editor.state, loaderId); + if (!pos) return; - const { firstChild, childCount } = document.content; - const toPaste = - childCount === 1 && firstChild.type.name === 'paragraph' - ? firstChild.content - : document.content; + const { firstChild, childCount } = document.content; + const toPaste = + childCount === 1 && firstChild.type.name === 'paragraph' + ? firstChild.content + : document.content; - editor - .chain() - .setMeta(loadingPlugin, { remove: { loaderId } }) - .insertContentAt(pos, toPaste.toJSON(), { - updateSelection: false, - }) - .run(); - }) - .catch(() => { - eventHub.$emit(ALERT_EVENT, { - message: __('An error occurred while pasting text in the editor. Please try again.'), - variant: VARIANT_DANGER, + editor + .chain() + .setMeta(loadingPlugin, { remove: { loaderId } }) + .insertContentAt(pos, toPaste.toJSON(), { + updateSelection: false, + }) + .run(); + }) + .catch(() => { + eventHub.$emit(ALERT_EVENT, { + message: __( + 'An error occurred while pasting text in the editor. Please try again.', + ), + variant: VARIANT_DANGER, + }); }); - }); - return true; - }, + return true; + }, }; }, addProseMirrorPlugins() { diff --git a/app/assets/javascripts/content_editor/extensions/details.js b/app/assets/javascripts/content_editor/extensions/details.js index 46c906d45b1..939fbd7a2e9 100644 --- a/app/assets/javascripts/content_editor/extensions/details.js +++ b/app/assets/javascripts/content_editor/extensions/details.js @@ -28,8 +28,14 @@ export default Node.create({ addCommands() { return { - setDetails: () => ({ commands }) => commands.wrapInList('details'), - toggleDetails: () => ({ commands }) => commands.toggleList('details', 'detailsContent'), + setDetails: + () => + ({ commands }) => + commands.wrapInList('details'), + toggleDetails: + () => + ({ commands }) => + commands.toggleList('details', 'detailsContent'), }; }, }); diff --git a/app/assets/javascripts/content_editor/extensions/frontmatter.js b/app/assets/javascripts/content_editor/extensions/frontmatter.js index 428171a9389..abe88f6e781 100644 --- a/app/assets/javascripts/content_editor/extensions/frontmatter.js +++ b/app/assets/javascripts/content_editor/extensions/frontmatter.js @@ -31,12 +31,16 @@ export default CodeBlockHighlight.extend({ }, addCommands() { return { - setFrontmatter: (attributes) => ({ commands }) => { - return commands.setNode(this.name, attributes); - }, - toggleFrontmatter: (attributes) => ({ commands }) => { - return commands.toggleNode(this.name, 'paragraph', attributes); - }, + setFrontmatter: + (attributes) => + ({ commands }) => { + return commands.setNode(this.name, attributes); + }, + toggleFrontmatter: + (attributes) => + ({ commands }) => { + return commands.toggleNode(this.name, 'paragraph', attributes); + }, }; }, diff --git a/app/assets/javascripts/content_editor/extensions/link.js b/app/assets/javascripts/content_editor/extensions/link.js index d70674f4f37..166db64eaa5 100644 --- a/app/assets/javascripts/content_editor/extensions/link.js +++ b/app/assets/javascripts/content_editor/extensions/link.js @@ -77,9 +77,11 @@ export default Link.extend({ addCommands() { return { ...this.parent?.(), - editLink: (attrs) => ({ chain }) => { - chain().setMeta('creatingLink', true).setLink(attrs).run(); - }, + editLink: + (attrs) => + ({ chain }) => { + chain().setMeta('creatingLink', true).setLink(attrs).run(); + }, }; }, diff --git a/app/assets/javascripts/content_editor/extensions/reference.js b/app/assets/javascripts/content_editor/extensions/reference.js index 0c385481ac5..f1601b99375 100644 --- a/app/assets/javascripts/content_editor/extensions/reference.js +++ b/app/assets/javascripts/content_editor/extensions/reference.js @@ -65,14 +65,18 @@ export default Node.create({ addCommands() { return { - insertQuickAction: () => ({ commands }) => commands.insertContent('
/
'), + insertQuickAction: + () => + ({ commands }) => + commands.insertContent('/
'), }; }, addInputRules() { const { editor } = this; const { assetResolver } = this.options; - const referenceInputRegex = /(?:^|\s)([\w/]*([#!&%$@~]|\[vulnerability:)[\w.]+(\+?s?\]?))(?:\s|\n)/m; + const referenceInputRegex = + /(?:^|\s)([\w/]*([#!&%$@~]|\[vulnerability:)[\w.]+(\+?s?\]?))(?:\s|\n)/m; const referenceTypes = { '#': 'issue', '!': 'merge_request', @@ -95,13 +99,8 @@ export default Node.create({ const [, referenceId, referenceSymbol, expansionType] = match; const referenceType = referenceTypes[referenceSymbol]; - const { - href, - text, - expandedText, - fullyExpandedText, - backgroundColor, - } = await assetResolver.resolveReference(referenceId); + const { href, text, expandedText, fullyExpandedText, backgroundColor } = + await assetResolver.resolveReference(referenceId); if (!text) return; diff --git a/app/assets/javascripts/content_editor/extensions/table_header.js b/app/assets/javascripts/content_editor/extensions/table_header.js index ca2a0eb5cfd..b38dc824249 100644 --- a/app/assets/javascripts/content_editor/extensions/table_header.js +++ b/app/assets/javascripts/content_editor/extensions/table_header.js @@ -20,23 +20,36 @@ export default TableHeader.extend({ addCommands() { return { ...this.parent?.(), - alignColumn: (pos, align) => ({ commands }) => { - commands.selectColumn(pos); - commands.updateAttributes('tableHeader', { align }); - commands.updateAttributes('tableCell', { align }); - }, - alignColumnLeft: (pos) => ({ commands }) => commands.alignColumn(pos, 'left'), - alignColumnCenter: (pos) => ({ commands }) => commands.alignColumn(pos, 'center'), - alignColumnRight: (pos) => ({ commands }) => commands.alignColumn(pos, 'right'), - selectColumn: (pos) => ({ tr, dispatch }) => { - if (dispatch) { - const position = tr.doc.resolve(pos); - const colSelection = CellSelection.colSelection(position); - tr.setSelection(colSelection); - } + alignColumn: + (pos, align) => + ({ commands }) => { + commands.selectColumn(pos); + commands.updateAttributes('tableHeader', { align }); + commands.updateAttributes('tableCell', { align }); + }, + alignColumnLeft: + (pos) => + ({ commands }) => + commands.alignColumn(pos, 'left'), + alignColumnCenter: + (pos) => + ({ commands }) => + commands.alignColumn(pos, 'center'), + alignColumnRight: + (pos) => + ({ commands }) => + commands.alignColumn(pos, 'right'), + selectColumn: + (pos) => + ({ tr, dispatch }) => { + if (dispatch) { + const position = tr.doc.resolve(pos); + const colSelection = CellSelection.colSelection(position); + tr.setSelection(colSelection); + } - return true; - }, + return true; + }, }; }, diff --git a/app/assets/javascripts/content_editor/extensions/table_of_contents.js b/app/assets/javascripts/content_editor/extensions/table_of_contents.js index f64ed67199f..204426464ff 100644 --- a/app/assets/javascripts/content_editor/extensions/table_of_contents.js +++ b/app/assets/javascripts/content_editor/extensions/table_of_contents.js @@ -36,7 +36,10 @@ export default Node.create({ addCommands() { return { - insertTableOfContents: () => ({ commands }) => commands.insertContent({ type: this.name }), + insertTableOfContents: + () => + ({ commands }) => + commands.insertContent({ type: this.name }), }; }, diff --git a/app/assets/javascripts/content_editor/services/serialization_helpers.js b/app/assets/javascripts/content_editor/services/serialization_helpers.js index bfcbbca8037..710ea00fd1d 100644 --- a/app/assets/javascripts/content_editor/services/serialization_helpers.js +++ b/app/assets/javascripts/content_editor/services/serialization_helpers.js @@ -426,9 +426,8 @@ const expandPreserveUnchangedConfig = (configOrRender) => export function preserveUnchanged(configOrRender) { return (state, node, parent, index) => { - const { render, overwriteSourcePreservationStrategy, inline } = expandPreserveUnchangedConfig( - configOrRender, - ); + const { render, overwriteSourcePreservationStrategy, inline } = + expandPreserveUnchangedConfig(configOrRender); const { sourceMarkdown } = node.attrs; const same = state.options.changeTracker.get(node); diff --git a/app/assets/javascripts/content_editor/services/track_input_rules_and_shortcuts.js b/app/assets/javascripts/content_editor/services/track_input_rules_and_shortcuts.js index b844b414343..1167c6da480 100644 --- a/app/assets/javascripts/content_editor/services/track_input_rules_and_shortcuts.js +++ b/app/assets/javascripts/content_editor/services/track_input_rules_and_shortcuts.js @@ -8,13 +8,15 @@ import { INPUT_RULE_TRACKING_ACTION, } from '../constants'; -const trackKeyboardShortcut = (contentType, commandFn, shortcut) => (...args) => { - Tracking.event(undefined, KEYBOARD_SHORTCUT_TRACKING_ACTION, { - label: CONTENT_EDITOR_TRACKING_LABEL, - property: `${contentType}.${shortcut}`, - }); - return commandFn(...args); -}; +const trackKeyboardShortcut = + (contentType, commandFn, shortcut) => + (...args) => { + Tracking.event(undefined, KEYBOARD_SHORTCUT_TRACKING_ACTION, { + label: CONTENT_EDITOR_TRACKING_LABEL, + property: `${contentType}.${shortcut}`, + }); + return commandFn(...args); + }; const trackInputRule = (contentType, inputRule) => { return new InputRule({ diff --git a/app/assets/javascripts/design_management/components/design_notes/design_note.vue b/app/assets/javascripts/design_management/components/design_notes/design_note.vue index 41e537d2f9f..2b3e2874dfd 100644 --- a/app/assets/javascripts/design_management/components/design_notes/design_note.vue +++ b/app/assets/javascripts/design_management/components/design_notes/design_note.vue @@ -248,11 +248,10 @@ export default { const sourceData = cache.readQuery(query); const newData = produce(sourceData, (draftState) => { - const { - awardEmoji, - } = draftState.project.issue.designCollection.designs.nodes[0].discussions.nodes - .find((d) => d.id === this.note.discussion.id) - .notes.nodes.find((n) => n.id === this.note.id); + const { awardEmoji } = + draftState.project.issue.designCollection.designs.nodes[0].discussions.nodes + .find((d) => d.id === this.note.discussion.id) + .notes.nodes.find((n) => n.id === this.note.id); awardEmoji.nodes = this.getAwardEmojiNodes(name, toggledOn); }); diff --git a/app/assets/javascripts/design_management/index.js b/app/assets/javascripts/design_management/index.js index e4d3f1a3341..2251db7a5af 100644 --- a/app/assets/javascripts/design_management/index.js +++ b/app/assets/javascripts/design_management/index.js @@ -8,14 +8,8 @@ import createRouter from './router'; export default () => { const el = document.querySelector('.js-design-management'); - const { - issueIid, - projectPath, - issuePath, - registerPath, - signInPath, - newCommentTemplatePaths, - } = el.dataset; + const { issueIid, projectPath, issuePath, registerPath, signInPath, newCommentTemplatePaths } = + el.dataset; const router = createRouter(issuePath); apolloProvider.clients.defaultClient.cache.writeQuery({ diff --git a/app/assets/javascripts/diffs/components/diff_line_note_form.vue b/app/assets/javascripts/diffs/components/diff_line_note_form.vue index 287b2fc1973..4c2592ba7b4 100644 --- a/app/assets/javascripts/diffs/components/diff_line_note_form.vue +++ b/app/assets/javascripts/diffs/components/diff_line_note_form.vue @@ -191,30 +191,29 @@ export default { 'saveDiffDiscussion', 'setSuggestPopoverDismissed', ]), - handleCancelCommentForm: ignoreWhilePending(async function handleCancelCommentForm( - shouldConfirm, - isDirty, - ) { - if (shouldConfirm && isDirty) { - const msg = s__('Notes|Are you sure you want to cancel creating this comment?'); + handleCancelCommentForm: ignoreWhilePending( + async function handleCancelCommentForm(shouldConfirm, isDirty) { + if (shouldConfirm && isDirty) { + const msg = s__('Notes|Are you sure you want to cancel creating this comment?'); - const confirmed = await confirmAction(msg, { - primaryBtnText: __('Discard changes'), - cancelBtnText: __('Continue editing'), - }); + const confirmed = await confirmAction(msg, { + primaryBtnText: __('Discard changes'), + cancelBtnText: __('Continue editing'), + }); - if (!confirmed) { - return; + if (!confirmed) { + return; + } } - } - this.cancelCommentForm({ - lineCode: this.line.line_code, - fileHash: this.diffFileHash, - }); - nextTick(() => { - clearDraft(this.autosaveKey); - }); - }), + this.cancelCommentForm({ + lineCode: this.line.line_code, + fileHash: this.diffFileHash, + }); + nextTick(() => { + clearDraft(this.autosaveKey); + }); + }, + ), handleSaveNote(note, parentElement, errorCallback) { return this.saveDiffDiscussion({ note, formData: this.formData }) .then(() => this.handleCancelCommentForm()) diff --git a/app/assets/javascripts/diffs/components/diff_row_utils.js b/app/assets/javascripts/diffs/components/diff_row_utils.js index 6ae60449aea..059be9a0d36 100644 --- a/app/assets/javascripts/diffs/components/diff_row_utils.js +++ b/app/assets/javascripts/diffs/components/diff_row_utils.js @@ -153,67 +153,68 @@ export const shouldShowCommentButton = (hover, context, meta, discussions) => { return hover && !context && !meta && !discussions; }; -export const mapParallel = ({ - diffFile, - hasParallelDraftLeft, - hasParallelDraftRight, - draftsForLine, -}) => (line) => { - let { left, right } = line; +export const mapParallel = + ({ diffFile, hasParallelDraftLeft, hasParallelDraftRight, draftsForLine }) => + (line) => { + let { left, right } = line; - // Dicussions/Comments - const hasExpandedDiscussionOnLeft = - left?.discussions?.length > 0 ? left?.discussionsExpanded : false; - const hasExpandedDiscussionOnRight = - right?.discussions?.length > 0 ? right?.discussionsExpanded : false; + // Dicussions/Comments + const hasExpandedDiscussionOnLeft = + left?.discussions?.length > 0 ? left?.discussionsExpanded : false; + const hasExpandedDiscussionOnRight = + right?.discussions?.length > 0 ? right?.discussionsExpanded : false; - const renderCommentRow = - hasExpandedDiscussionOnLeft || hasExpandedDiscussionOnRight || left?.hasForm || right?.hasForm; + const renderCommentRow = + hasExpandedDiscussionOnLeft || + hasExpandedDiscussionOnRight || + left?.hasForm || + right?.hasForm; - if (left) { - left = { - ...left, - renderDiscussion: hasExpandedDiscussionOnLeft, - hasDraft: hasParallelDraftLeft(diffFile.file_hash, line), - lineDrafts: draftsForLine(diffFile.file_hash, line, 'left'), - hasCommentForm: left.hasForm, - isConflictMarker: - line.left.type === CONFLICT_MARKER_OUR || line.left.type === CONFLICT_MARKER_THEIR, - emptyCellClassMap: { conflict_our: line.right?.type === CONFLICT_THEIR }, - addCommentTooltip: addCommentTooltip(line.left), + if (left) { + left = { + ...left, + renderDiscussion: hasExpandedDiscussionOnLeft, + hasDraft: hasParallelDraftLeft(diffFile.file_hash, line), + lineDrafts: draftsForLine(diffFile.file_hash, line, 'left'), + hasCommentForm: left.hasForm, + isConflictMarker: + line.left.type === CONFLICT_MARKER_OUR || line.left.type === CONFLICT_MARKER_THEIR, + emptyCellClassMap: { conflict_our: line.right?.type === CONFLICT_THEIR }, + addCommentTooltip: addCommentTooltip(line.left), + }; + } + if (right) { + right = { + ...right, + renderDiscussion: Boolean( + hasExpandedDiscussionOnRight && right.type && right.type !== EXPANDED_LINE_TYPE, + ), + hasDraft: hasParallelDraftRight(diffFile.file_hash, line), + lineDrafts: draftsForLine(diffFile.file_hash, line, 'right'), + hasCommentForm: Boolean(right.hasForm && right.type && right.type !== EXPANDED_LINE_TYPE), + emptyCellClassMap: { conflict_their: line.left?.type === CONFLICT_OUR }, + addCommentTooltip: addCommentTooltip(line.right), + }; + } + + return { + ...line, + left, + right, + isMatchLineLeft: isMatchLine(left?.type), + isMatchLineRight: isMatchLine(right?.type), + isContextLineLeft: isContextLine(left?.type), + isContextLineRight: isContextLine(right?.type), + hasDiscussionsLeft: hasDiscussions(left), + hasDiscussionsRight: hasDiscussions(right), + lineHrefOld: lineHref(left, diffFile), + lineHrefNew: lineHref(right, diffFile), + lineCode: lineCode(line), + isMetaLineLeft: isMetaLine(left?.type), + isMetaLineRight: isMetaLine(right?.type), + draftRowClasses: left?.hasDraft || right?.hasDraft ? '' : 'js-temp-notes-holder', + renderCommentRow, + commentRowClasses: + hasDiscussions(left) || hasDiscussions(right) ? '' : 'js-temp-notes-holder', }; - } - if (right) { - right = { - ...right, - renderDiscussion: Boolean( - hasExpandedDiscussionOnRight && right.type && right.type !== EXPANDED_LINE_TYPE, - ), - hasDraft: hasParallelDraftRight(diffFile.file_hash, line), - lineDrafts: draftsForLine(diffFile.file_hash, line, 'right'), - hasCommentForm: Boolean(right.hasForm && right.type && right.type !== EXPANDED_LINE_TYPE), - emptyCellClassMap: { conflict_their: line.left?.type === CONFLICT_OUR }, - addCommentTooltip: addCommentTooltip(line.right), - }; - } - - return { - ...line, - left, - right, - isMatchLineLeft: isMatchLine(left?.type), - isMatchLineRight: isMatchLine(right?.type), - isContextLineLeft: isContextLine(left?.type), - isContextLineRight: isContextLine(right?.type), - hasDiscussionsLeft: hasDiscussions(left), - hasDiscussionsRight: hasDiscussions(right), - lineHrefOld: lineHref(left, diffFile), - lineHrefNew: lineHref(right, diffFile), - lineCode: lineCode(line), - isMetaLineLeft: isMetaLine(left?.type), - isMetaLineRight: isMetaLine(right?.type), - draftRowClasses: left?.hasDraft || right?.hasDraft ? '' : 'js-temp-notes-holder', - renderCommentRow, - commentRowClasses: hasDiscussions(left) || hasDiscussions(right) ? '' : 'js-temp-notes-holder', }; -}; diff --git a/app/assets/javascripts/editor/extensions/source_editor_markdown_ext.js b/app/assets/javascripts/editor/extensions/source_editor_markdown_ext.js index 0a5843ec631..5acb4f387bf 100644 --- a/app/assets/javascripts/editor/extensions/source_editor_markdown_ext.js +++ b/app/assets/javascripts/editor/extensions/source_editor_markdown_ext.js @@ -83,8 +83,12 @@ export class EditorMarkdownExtension { instance.setPosition(pos); }, insertMarkdown: (instance, e) => { - const { mdTag: tag, mdBlock: blockTag, mdPrepend, mdSelect: select } = - e.currentTarget?.dataset || e; + const { + mdTag: tag, + mdBlock: blockTag, + mdPrepend, + mdSelect: select, + } = e.currentTarget?.dataset || e; insertMarkdownText({ tag, diff --git a/app/assets/javascripts/emoji/support/unicode_support_map.js b/app/assets/javascripts/emoji/support/unicode_support_map.js index 9642993bd7d..efb16cf055c 100644 --- a/app/assets/javascripts/emoji/support/unicode_support_map.js +++ b/app/assets/javascripts/emoji/support/unicode_support_map.js @@ -76,8 +76,10 @@ const chromeVersion = chromeMatches && chromeMatches[1] && parseInt(chromeMatche const fontSize = 16; function generateUnicodeSupportMap(testMap) { const testMapKeys = Object.keys(testMap); - const numTestEntries = testMapKeys.reduce((list, testKey) => list.concat(testMap[testKey]), []) - .length; + const numTestEntries = testMapKeys.reduce( + (list, testKey) => list.concat(testMap[testKey]), + [], + ).length; const canvas = document.createElement('canvas'); (window.gl || window).testEmojiUnicodeSupportMapCanvas = canvas; @@ -106,8 +108,12 @@ function generateUnicodeSupportMap(testMap) { // keep the `readIndex` in sync from the writes by running all entries const isTestSatisfied = [].concat(testEntry).reduce((isSatisfied) => { // Sample along the vertical-middle for a couple of characters - const imageData = ctx.getImageData(0, readIndex * fontSize + fontSize / 2, 2 * fontSize, 1) - .data; + const imageData = ctx.getImageData( + 0, + readIndex * fontSize + fontSize / 2, + 2 * fontSize, + 1, + ).data; let isValidEmoji = false; for (let currentPixel = 0; currentPixel < 64; currentPixel += 1) { diff --git a/app/assets/javascripts/environments/components/rollback_modal_manager.vue b/app/assets/javascripts/environments/components/rollback_modal_manager.vue index 3a8b9ebcb84..3e66004859e 100644 --- a/app/assets/javascripts/environments/components/rollback_modal_manager.vue +++ b/app/assets/javascripts/environments/components/rollback_modal_manager.vue @@ -22,13 +22,8 @@ export default { document.querySelectorAll(this.selector).forEach((button) => { button.addEventListener('click', (e) => { e.preventDefault(); - const { - environmentName, - commitShortSha, - commitUrl, - isLastDeployment, - retryPath, - } = button.dataset; + const { environmentName, commitShortSha, commitUrl, isLastDeployment, retryPath } = + button.dataset; this.environment = { name: environmentName, diff --git a/app/assets/javascripts/environments/environment_details/components/deployment_history.vue b/app/assets/javascripts/environments/environment_details/components/deployment_history.vue index d2a05c5292d..5b533e6ab19 100644 --- a/app/assets/javascripts/environments/environment_details/components/deployment_history.vue +++ b/app/assets/javascripts/environments/environment_details/components/deployment_history.vue @@ -104,12 +104,8 @@ export default { try { // TLDR: when we load a page, if there's next and/or previous pages existing, we'll load their data as well to improve percepted performance. - const { - endCursor, - hasPreviousPage, - hasNextPage, - startCursor, - } = newProject.environment.deployments.pageInfo; + const { endCursor, hasPreviousPage, hasNextPage, startCursor } = + newProject.environment.deployments.pageInfo; // At the moment we have a limit of deployments being requested only from a signle environment entity per query, // and apparently two batched queries count as one on server-side diff --git a/app/assets/javascripts/environments/helpers/deployment_data_transformation_helper.js b/app/assets/javascripts/environments/helpers/deployment_data_transformation_helper.js index 3714d94443c..3b966a5412f 100644 --- a/app/assets/javascripts/environments/helpers/deployment_data_transformation_helper.js +++ b/app/assets/javascripts/environments/helpers/deployment_data_transformation_helper.js @@ -94,12 +94,10 @@ const getDeploymentApprovalFromDeploymentNode = (deploymentNode, environment) => const hasRequiredApprovals = protectedEnvironmentInfo.requiredApprovalCount > 0; const isApprovalActionAvailable = hasRequiredApprovals || hasApprovalRules; - const requiredMultipleApprovalRulesApprovals = protectedEnvironmentInfo.approvalRules.nodes.reduce( - (requiredApprovals, rule) => { + const requiredMultipleApprovalRulesApprovals = + protectedEnvironmentInfo.approvalRules.nodes.reduce((requiredApprovals, rule) => { return requiredApprovals + rule.requiredApprovals; - }, - 0, - ); + }, 0); const requiredApprovalCount = hasRequiredApprovals ? protectedEnvironmentInfo.requiredApprovalCount diff --git a/app/assets/javascripts/error_tracking/details.js b/app/assets/javascripts/error_tracking/details.js index 04bb50ab733..fb6876c841b 100644 --- a/app/assets/javascripts/error_tracking/details.js +++ b/app/assets/javascripts/error_tracking/details.js @@ -12,13 +12,8 @@ export default () => { const selector = '#js-error_details'; const domEl = document.querySelector(selector); - const { - issueId, - projectPath, - issueUpdatePath, - issueStackTracePath, - projectIssuesPath, - } = domEl.dataset; + const { issueId, projectPath, issueUpdatePath, issueStackTracePath, projectIssuesPath } = + domEl.dataset; let { integratedErrorTrackingEnabled } = domEl.dataset; integratedErrorTrackingEnabled = parseBoolean(integratedErrorTrackingEnabled); diff --git a/app/assets/javascripts/error_tracking/list.js b/app/assets/javascripts/error_tracking/list.js index 9805aed681d..3a2e5c90c1f 100644 --- a/app/assets/javascripts/error_tracking/list.js +++ b/app/assets/javascripts/error_tracking/list.js @@ -7,13 +7,8 @@ export default () => { const selector = '#js-error_tracking'; const domEl = document.querySelector(selector); - const { - indexPath, - enableErrorTrackingLink, - illustrationPath, - projectPath, - listPath, - } = domEl.dataset; + const { indexPath, enableErrorTrackingLink, illustrationPath, projectPath, listPath } = + domEl.dataset; let { errorTrackingEnabled, userCanEnableErrorTracking, diff --git a/app/assets/javascripts/filtered_search/dropdown_utils.js b/app/assets/javascripts/filtered_search/dropdown_utils.js index 38909db0555..62cbff9023b 100644 --- a/app/assets/javascripts/filtered_search/dropdown_utils.js +++ b/app/assets/javascripts/filtered_search/dropdown_utils.js @@ -163,9 +163,8 @@ export default class DropdownUtils { values.push(name.innerText); } } else if (token.classList.contains('input-token')) { - const { - isLastVisualTokenValid, - } = FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(); + const { isLastVisualTokenValid } = + FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(); const input = FilteredSearchContainer.container.querySelector('.filtered-search'); const inputValue = input && input.value; diff --git a/app/assets/javascripts/filtered_search/filtered_search_dropdown.js b/app/assets/javascripts/filtered_search/filtered_search_dropdown.js index 9de291b7809..45304d8f7cb 100644 --- a/app/assets/javascripts/filtered_search/filtered_search_dropdown.js +++ b/app/assets/javascripts/filtered_search/filtered_search_dropdown.js @@ -35,9 +35,8 @@ export default class FilteredSearchDropdown { itemClicked(e, getValueFunction) { const { selected } = e.detail; if (selected.tagName === 'LI' && selected.innerHTML) { - const { - lastVisualToken: visualToken, - } = FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(); + const { lastVisualToken: visualToken } = + FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(); const { tokenOperator } = DropdownUtils.getVisualTokenValues(visualToken); const dataValueSet = DropdownUtils.setDataValueIfSelected( diff --git a/app/assets/javascripts/filtered_search/filtered_search_manager.js b/app/assets/javascripts/filtered_search/filtered_search_manager.js index 5b39434c312..816d09a94f9 100644 --- a/app/assets/javascripts/filtered_search/filtered_search_manager.js +++ b/app/assets/javascripts/filtered_search/filtered_search_manager.js @@ -62,11 +62,8 @@ export default class FilteredSearchManager { this.placeholder = placeholder; this.anchor = anchor; - const { - multipleAssignees, - epicsEndpoint, - iterationsEndpoint, - } = this.filteredSearchInput.dataset; + const { multipleAssignees, epicsEndpoint, iterationsEndpoint } = + this.filteredSearchInput.dataset; if (multipleAssignees && this.filteredSearchTokenKeys.enableMultipleAssignees) { this.filteredSearchTokenKeys.enableMultipleAssignees(); @@ -546,7 +543,8 @@ export default class FilteredSearchManager { } } else { // Keep listening to token until we determine that the user is done typing the token value - const valueCompletedRegex = /([~%@]{0,1}".+")|([~%@]{0,1}'.+')|^((?![~%@]')(?![~%@]")(?!')(?!")).*/g; + const valueCompletedRegex = + /([~%@]{0,1}".+")|([~%@]{0,1}'.+')|^((?![~%@]')(?![~%@]")(?!')(?!")).*/g; if (searchToken.match(valueCompletedRegex) && input.value[input.value.length - 1] === ' ') { const tokenKey = FilteredSearchVisualTokens.getLastTokenPartial(); diff --git a/app/assets/javascripts/filtered_search/filtered_search_visual_tokens.js b/app/assets/javascripts/filtered_search/filtered_search_visual_tokens.js index 390f38670c3..ad0a75d5566 100644 --- a/app/assets/javascripts/filtered_search/filtered_search_visual_tokens.js +++ b/app/assets/javascripts/filtered_search/filtered_search_visual_tokens.js @@ -156,10 +156,8 @@ export default class FilteredSearchVisualTokens { } static addValueToPreviousVisualTokenElement(value) { - const { - lastVisualToken, - isLastVisualTokenValid, - } = FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(); + const { lastVisualToken, isLastVisualTokenValid } = + FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(); if (!isLastVisualTokenValid && lastVisualToken.classList.contains('filtered-search-token')) { const name = FilteredSearchVisualTokens.getLastTokenPartial(); @@ -181,10 +179,8 @@ export default class FilteredSearchVisualTokens { tokenValue, { canEdit, uppercaseTokenName = false, capitalizeTokenValue = false } = {}, ) { - const { - lastVisualToken, - isLastVisualTokenValid, - } = FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(); + const { lastVisualToken, isLastVisualTokenValid } = + FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(); const { addVisualTokenElement } = FilteredSearchVisualTokens; if (isLastVisualTokenValid) { diff --git a/app/assets/javascripts/gitlab_version_check/index.js b/app/assets/javascripts/gitlab_version_check/index.js index abfef943b11..9a3193c0212 100644 --- a/app/assets/javascripts/gitlab_version_check/index.js +++ b/app/assets/javascripts/gitlab_version_check/index.js @@ -35,11 +35,8 @@ const mountSecurityPatchUpgradeAlertModal = (el) => { const { currentVersion, version } = el.dataset; try { - const { - details, - latestStableVersions, - latestStableVersionOfMinor, - } = convertObjectPropsToCamelCase(JSON.parse(version)); + const { details, latestStableVersions, latestStableVersionOfMinor } = + convertObjectPropsToCamelCase(JSON.parse(version)); return new Vue({ el, diff --git a/app/assets/javascripts/groups/init_groups_explore.js b/app/assets/javascripts/groups/init_groups_explore.js index ee45022312b..9a7457e8361 100644 --- a/app/assets/javascripts/groups/init_groups_explore.js +++ b/app/assets/javascripts/groups/init_groups_explore.js @@ -30,12 +30,8 @@ export const initGroupsExplore = () => { const { dataset: { appData }, } = el; - const { - groupsEmptyStateIllustration, - emptySearchIllustration, - endpoint, - initialSort, - } = convertObjectPropsToCamelCase(JSON.parse(appData)); + const { groupsEmptyStateIllustration, emptySearchIllustration, endpoint, initialSort } = + convertObjectPropsToCamelCase(JSON.parse(appData)); Vue.use(VueRouter); const router = createRouter(); diff --git a/app/assets/javascripts/groups/init_invite_members_banner.js b/app/assets/javascripts/groups/init_invite_members_banner.js index 38ab4122dab..81386d82e64 100644 --- a/app/assets/javascripts/groups/init_invite_members_banner.js +++ b/app/assets/javascripts/groups/init_invite_members_banner.js @@ -8,14 +8,8 @@ export default function initInviteMembersBanner() { return false; } - const { - svgPath, - inviteMembersPath, - trackLabel, - calloutsPath, - calloutsFeatureId, - groupId, - } = el.dataset; + const { svgPath, inviteMembersPath, trackLabel, calloutsPath, calloutsFeatureId, groupId } = + el.dataset; return new Vue({ el, diff --git a/app/assets/javascripts/groups_projects/components/transfer_locations.vue b/app/assets/javascripts/groups_projects/components/transfer_locations.vue index bce0a217deb..741764b2d25 100644 --- a/app/assets/javascripts/groups_projects/components/transfer_locations.vue +++ b/app/assets/javascripts/groups_projects/components/transfer_locations.vue @@ -144,13 +144,11 @@ export default { }, async getGroupTransferLocations() { try { - const { - data: groupTransferLocations, - headers, - } = await this.groupTransferLocationsApiMethod(this.resourceId, { - page: this.page, - search: this.searchTerm, - }); + const { data: groupTransferLocations, headers } = + await this.groupTransferLocationsApiMethod(this.resourceId, { + page: this.page, + search: this.searchTerm, + }); const { totalPages } = parseIntPagination(normalizeHeaders(headers)); this.totalPages = totalPages; diff --git a/app/assets/javascripts/ide/components/commit_sidebar/actions.vue b/app/assets/javascripts/ide/components/commit_sidebar/actions.vue index 8765808cf0c..82e25d2a30d 100644 --- a/app/assets/javascripts/ide/components/commit_sidebar/actions.vue +++ b/app/assets/javascripts/ide/components/commit_sidebar/actions.vue @@ -12,9 +12,8 @@ import { import NewMergeRequestOption from './new_merge_request_option.vue'; import RadioGroup from './radio_group.vue'; -const { mapState: mapCommitState, mapActions: mapCommitActions } = createNamespacedHelpers( - 'commit', -); +const { mapState: mapCommitState, mapActions: mapCommitActions } = + createNamespacedHelpers('commit'); export default { components: { diff --git a/app/assets/javascripts/ide/components/commit_sidebar/new_merge_request_option.vue b/app/assets/javascripts/ide/components/commit_sidebar/new_merge_request_option.vue index 462dab3d1cf..f231d461104 100644 --- a/app/assets/javascripts/ide/components/commit_sidebar/new_merge_request_option.vue +++ b/app/assets/javascripts/ide/components/commit_sidebar/new_merge_request_option.vue @@ -4,9 +4,8 @@ import { GlTooltipDirective, GlFormCheckbox } from '@gitlab/ui'; import { createNamespacedHelpers } from 'vuex'; import { s__ } from '~/locale'; -const { mapActions: mapCommitActions, mapGetters: mapCommitGetters } = createNamespacedHelpers( - 'commit', -); +const { mapActions: mapCommitActions, mapGetters: mapCommitGetters } = + createNamespacedHelpers('commit'); export default { components: { GlFormCheckbox }, diff --git a/app/assets/javascripts/ide/lib/languages/hcl.js b/app/assets/javascripts/ide/lib/languages/hcl.js index bbb2ca66f33..78c9fea7ffe 100644 --- a/app/assets/javascripts/ide/lib/languages/hcl.js +++ b/app/assets/javascripts/ide/lib/languages/hcl.js @@ -77,7 +77,8 @@ const language = { symbols: /[=> { ); }; -const fetchReposFactory = ({ reposPath = isRequired() }) => ({ state, commit }) => { - commit(types.REQUEST_REPOS); +const fetchReposFactory = + ({ reposPath = isRequired() }) => + ({ state, commit }) => { + commit(types.REQUEST_REPOS); - const { provider, filter } = state; + const { provider, filter } = state; + + return axios + .get( + pathWithParams({ + path: reposPath, + ...filter, + ...paginationParams({ state }), + }), + ) + .then(({ data }) => { + const camelData = convertObjectPropsToCamelCase(data, { deep: true }); + commitPaginationData({ state, commit, data: camelData }); + commit(types.RECEIVE_REPOS_SUCCESS, camelData); + }) + .catch((e) => { + if (hasRedirectInError(e)) { + redirectToUrlInError(e); + } else if (tooManyRequests(e)) { + createAlert({ + message: sprintf( + s__('ImportProjects|%{provider} rate limit exceeded. Try again later'), + { + provider: capitalizeFirstCharacter(provider), + }, + ), + }); + + commit(types.RECEIVE_REPOS_ERROR); + } else { + createAlert({ + message: sprintf( + s__('ImportProjects|Requesting your %{provider} repositories failed'), + { + provider, + }, + ), + }); + + commit(types.RECEIVE_REPOS_ERROR); + } + }); + }; + +const fetchImportFactory = + (importPath = isRequired()) => + ({ state, commit, getters }, { repoId, optionalStages }) => { + const { ciCdOnly } = state; + const importTarget = getters.getImportTarget(repoId); + + commit(types.REQUEST_IMPORT, { repoId, importTarget }); + + const { newName, targetNamespace } = importTarget; + return axios + .post(importPath, { + repo_id: repoId, + ci_cd_only: ciCdOnly, + new_name: newName, + target_namespace: targetNamespace, + ...(Object.keys(optionalStages).length ? { optional_stages: optionalStages } : {}), + }) + .then(({ data }) => { + commit(types.RECEIVE_IMPORT_SUCCESS, { + importedProject: convertObjectPropsToCamelCase(data, { deep: true }), + repoId, + }); + }) + .catch((e) => { + const serverErrorMessage = e?.response?.data?.errors; + const alertMessage = serverErrorMessage + ? sprintf( + s__('ImportProjects|Importing the project failed: %{reason}'), + { + reason: serverErrorMessage, + }, + false, + ) + : s__('ImportProjects|Importing the project failed'); - return axios - .get( - pathWithParams({ - path: reposPath, - ...filter, - ...paginationParams({ state }), - }), - ) - .then(({ data }) => { - const camelData = convertObjectPropsToCamelCase(data, { deep: true }); - commitPaginationData({ state, commit, data: camelData }); - commit(types.RECEIVE_REPOS_SUCCESS, camelData); - }) - .catch((e) => { - if (hasRedirectInError(e)) { - redirectToUrlInError(e); - } else if (tooManyRequests(e)) { createAlert({ - message: sprintf(s__('ImportProjects|%{provider} rate limit exceeded. Try again later'), { - provider: capitalizeFirstCharacter(provider), - }), + message: alertMessage, }); - commit(types.RECEIVE_REPOS_ERROR); - } else { - createAlert({ - message: sprintf(s__('ImportProjects|Requesting your %{provider} repositories failed'), { - provider, - }), - }); - - commit(types.RECEIVE_REPOS_ERROR); - } - }); -}; - -const fetchImportFactory = (importPath = isRequired()) => ( - { state, commit, getters }, - { repoId, optionalStages }, -) => { - const { ciCdOnly } = state; - const importTarget = getters.getImportTarget(repoId); - - commit(types.REQUEST_IMPORT, { repoId, importTarget }); - - const { newName, targetNamespace } = importTarget; - return axios - .post(importPath, { - repo_id: repoId, - ci_cd_only: ciCdOnly, - new_name: newName, - target_namespace: targetNamespace, - ...(Object.keys(optionalStages).length ? { optional_stages: optionalStages } : {}), - }) - .then(({ data }) => { - commit(types.RECEIVE_IMPORT_SUCCESS, { - importedProject: convertObjectPropsToCamelCase(data, { deep: true }), - repoId, + commit(types.RECEIVE_IMPORT_ERROR, repoId); }); - }) - .catch((e) => { - const serverErrorMessage = e?.response?.data?.errors; - const alertMessage = serverErrorMessage - ? sprintf( - s__('ImportProjects|Importing the project failed: %{reason}'), - { - reason: serverErrorMessage, - }, - false, - ) - : s__('ImportProjects|Importing the project failed'); + }; - createAlert({ - message: alertMessage, - }); +export const cancelImportFactory = + (cancelImportPath) => + ({ state, commit }, { repoId }) => { + const existingRepo = state.repositories.find((r) => r.importSource.id === repoId); - commit(types.RECEIVE_IMPORT_ERROR, repoId); - }); -}; - -export const cancelImportFactory = (cancelImportPath) => ({ state, commit }, { repoId }) => { - const existingRepo = state.repositories.find((r) => r.importSource.id === repoId); - - if (!existingRepo?.importedProject) { - throw new Error(`Attempting to cancel project which is not started: ${repoId}`); - } - - const { id } = existingRepo.importedProject; - - return axios - .post(cancelImportPath, { - project_id: id, - }) - .then(() => { - commit(types.CANCEL_IMPORT_SUCCESS, { - repoId, - }); - }) - .catch((e) => { - const serverErrorMessage = e?.response?.data?.errors; - const alertMessage = serverErrorMessage - ? sprintf( - s__('ImportProjects|Cancelling project import failed: %{reason}'), - { - reason: serverErrorMessage, - }, - false, - ) - : s__('ImportProjects|Cancelling project import failed'); - - createAlert({ - message: alertMessage, - }); - }); -}; - -export const fetchJobsFactory = (jobsPath = isRequired()) => ({ state, commit, dispatch }) => { - if (eTagPoll) { - stopJobsPolling(); - clearJobsEtagPoll(); - } - - eTagPoll = new Poll({ - resource: { - fetchJobs: () => axios.get(pathWithParams({ path: jobsPath, ...state.filter })), - }, - method: 'fetchJobs', - successCallback: ({ data }) => - commit(types.RECEIVE_JOBS_SUCCESS, convertObjectPropsToCamelCase(data, { deep: true })), - errorCallback: (e) => { - if (hasRedirectInError(e)) { - redirectToUrlInError(e); - } else { - createAlert({ - message: s__('ImportProjects|Update of imported projects with realtime changes failed'), - }); - } - }, - }); - - if (!Visibility.hidden()) { - eTagPoll.makeRequest(); - } - - Visibility.change(() => { - if (!Visibility.hidden()) { - dispatch('restartJobsPolling'); - } else { - dispatch('stopJobsPolling'); + if (!existingRepo?.importedProject) { + throw new Error(`Attempting to cancel project which is not started: ${repoId}`); } - }); -}; + + const { id } = existingRepo.importedProject; + + return axios + .post(cancelImportPath, { + project_id: id, + }) + .then(() => { + commit(types.CANCEL_IMPORT_SUCCESS, { + repoId, + }); + }) + .catch((e) => { + const serverErrorMessage = e?.response?.data?.errors; + const alertMessage = serverErrorMessage + ? sprintf( + s__('ImportProjects|Cancelling project import failed: %{reason}'), + { + reason: serverErrorMessage, + }, + false, + ) + : s__('ImportProjects|Cancelling project import failed'); + + createAlert({ + message: alertMessage, + }); + }); + }; + +export const fetchJobsFactory = + (jobsPath = isRequired()) => + ({ state, commit, dispatch }) => { + if (eTagPoll) { + stopJobsPolling(); + clearJobsEtagPoll(); + } + + eTagPoll = new Poll({ + resource: { + fetchJobs: () => axios.get(pathWithParams({ path: jobsPath, ...state.filter })), + }, + method: 'fetchJobs', + successCallback: ({ data }) => + commit(types.RECEIVE_JOBS_SUCCESS, convertObjectPropsToCamelCase(data, { deep: true })), + errorCallback: (e) => { + if (hasRedirectInError(e)) { + redirectToUrlInError(e); + } else { + createAlert({ + message: s__('ImportProjects|Update of imported projects with realtime changes failed'), + }); + } + }, + }); + + if (!Visibility.hidden()) { + eTagPoll.makeRequest(); + } + + Visibility.change(() => { + if (!Visibility.hidden()) { + dispatch('restartJobsPolling'); + } else { + dispatch('stopJobsPolling'); + } + }); + }; const setFilter = ({ commit, dispatch }, filter) => { commit(types.SET_FILTER, filter); diff --git a/app/assets/javascripts/integrations/gitlab_slack_application/index.js b/app/assets/javascripts/integrations/gitlab_slack_application/index.js index 8bbb81df997..032641ea243 100644 --- a/app/assets/javascripts/integrations/gitlab_slack_application/index.js +++ b/app/assets/javascripts/integrations/gitlab_slack_application/index.js @@ -7,14 +7,8 @@ export default () => { if (!el) return null; - const { - projects, - isSignedIn, - signInPath, - slackLinkPath, - gitlabLogoPath, - slackLogoPath, - } = el.dataset; + const { projects, isSignedIn, signInPath, slackLinkPath, gitlabLogoPath, slackLogoPath } = + el.dataset; return new Vue({ el, diff --git a/app/assets/javascripts/invite_members/init_import_project_members_modal.js b/app/assets/javascripts/invite_members/init_import_project_members_modal.js index 18902d77dc5..57c8782a079 100644 --- a/app/assets/javascripts/invite_members/init_import_project_members_modal.js +++ b/app/assets/javascripts/invite_members/init_import_project_members_modal.js @@ -9,13 +9,8 @@ export default function initImportProjectMembersModal() { return false; } - const { - projectId, - projectName, - reloadPageOnSubmit, - usersLimitDataset, - addSeatsHref, - } = el.dataset; + const { projectId, projectName, reloadPageOnSubmit, usersLimitDataset, addSeatsHref } = + el.dataset; return new Vue({ el, diff --git a/app/assets/javascripts/issues/related_merge_requests/components/related_merge_requests.vue b/app/assets/javascripts/issues/related_merge_requests/components/related_merge_requests.vue index bcea921cd46..f78a2e9207d 100644 --- a/app/assets/javascripts/issues/related_merge_requests/components/related_merge_requests.vue +++ b/app/assets/javascripts/issues/related_merge_requests/components/related_merge_requests.vue @@ -36,9 +36,8 @@ export default { const prevMergeRequests = previousResult.project.issue.relatedMergeRequests.nodes; return produce(fetchMoreResult, (draftData) => { - draftData.project.issue.relatedMergeRequests.nodes = prevMergeRequests.concat( - newMergeRequests, - ); + draftData.project.issue.relatedMergeRequests.nodes = + prevMergeRequests.concat(newMergeRequests); }); }, }); diff --git a/app/assets/javascripts/jira_connect/subscriptions/components/sign_in_oauth_button.vue b/app/assets/javascripts/jira_connect/subscriptions/components/sign_in_oauth_button.vue index 1bf8af523a9..c55fcfbb0a6 100644 --- a/app/assets/javascripts/jira_connect/subscriptions/components/sign_in_oauth_button.vue +++ b/app/assets/javascripts/jira_connect/subscriptions/components/sign_in_oauth_button.vue @@ -168,10 +168,8 @@ export default { this.$emit('error'); }, async getOAuthToken(code) { - const { - oauth_token_payload: oauthTokenPayload, - oauth_token_path: oauthTokenPath, - } = this.oauthMetadata; + const { oauth_token_payload: oauthTokenPayload, oauth_token_path: oauthTokenPath } = + this.oauthMetadata; const { data } = await fetchOAuthToken(oauthTokenPath, { ...oauthTokenPayload, code, diff --git a/app/assets/javascripts/kubernetes_dashboard/components/workload_details_item.vue b/app/assets/javascripts/kubernetes_dashboard/components/workload_details_item.vue index ed1fbd0b876..3726eb5af64 100644 --- a/app/assets/javascripts/kubernetes_dashboard/components/workload_details_item.vue +++ b/app/assets/javascripts/kubernetes_dashboard/components/workload_details_item.vue @@ -47,7 +47,8 @@ export default {Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
', current_user: { can_edit: true, can_award_emoji: true }, @@ -742,8 +741,7 @@ export const notesWithDescriptionChanges = [ noteable_type: 'Issue', resolvable: false, noteable_iid: 12, - note: - 'Varius vel pharetra vel turpis nunc eget lorem. Ipsum dolor sit amet consectetur adipiscing.', + note: 'Varius vel pharetra vel turpis nunc eget lorem. Ipsum dolor sit amet consectetur adipiscing.', note_html: 'Varius vel pharetra vel turpis nunc eget lorem. Ipsum dolor sit amet consectetur adipiscing.
', current_user: { can_edit: true, can_award_emoji: true }, @@ -969,8 +967,7 @@ export const collapsedSystemNotes = [ noteable_type: 'Issue', resolvable: false, noteable_iid: 12, - note: - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + note: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', note_html: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
', current_user: { can_edit: true, can_award_emoji: true }, @@ -1016,8 +1013,7 @@ export const collapsedSystemNotes = [ noteable_type: 'Issue', resolvable: false, noteable_iid: 12, - note: - 'Varius vel pharetra vel turpis nunc eget lorem. Ipsum dolor sit amet consectetur adipiscing.', + note: 'Varius vel pharetra vel turpis nunc eget lorem. Ipsum dolor sit amet consectetur adipiscing.', note_html: 'Varius vel pharetra vel turpis nunc eget lorem. Ipsum dolor sit amet consectetur adipiscing.
', current_user: { can_edit: true, can_award_emoji: true }, diff --git a/spec/frontend/organizations/shared/components/groups_view_spec.js b/spec/frontend/organizations/shared/components/groups_view_spec.js index 2cb3b160357..79a1e6e78aa 100644 --- a/spec/frontend/organizations/shared/components/groups_view_spec.js +++ b/spec/frontend/organizations/shared/components/groups_view_spec.js @@ -1,6 +1,7 @@ import VueApollo from 'vue-apollo'; import Vue from 'vue'; import { GlLoadingIcon, GlKeysetPagination } from '@gitlab/ui'; +import MockAdapter from 'axios-mock-adapter'; import organizationGroupsGraphQlResponse from 'test_fixtures/graphql/organizations/groups.query.graphql.json'; import GroupsView from '~/organizations/shared/components/groups_view.vue'; import { SORT_DIRECTION_ASC, SORT_ITEM_NAME } from '~/organizations/shared/constants'; @@ -11,13 +12,13 @@ import { deleteParams, formatGroups, } from 'ee_else_ce/organizations/shared/utils'; -import { deleteGroup } from 'ee_else_ce/api/groups_api'; import groupsQuery from '~/organizations/shared/graphql/queries/groups.query.graphql'; import GroupsList from '~/vue_shared/components/groups_list/groups_list.vue'; import { TIMESTAMP_TYPE_CREATED_AT } from '~/vue_shared/components/resource_lists/constants'; import { ACTION_DELETE } from '~/vue_shared/components/list_actions/constants'; import { createAlert } from '~/alert'; import { DEFAULT_PER_PAGE } from '~/api'; +import axios from '~/lib/utils/axios_utils'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; @@ -52,10 +53,12 @@ Vue.use(VueApollo); describe('GroupsView', () => { let wrapper; let mockApollo; + let mockAxios; const defaultProvide = { groupsEmptyStateSvgPath: 'illustrations/empty-state/empty-groups-md.svg', newGroupPath: '/groups/new', + groupsPath: '/-/organizations/default/groups', organizationGid: 'gid://gitlab/Organizations::Organization/1', }; @@ -82,6 +85,7 @@ describe('GroupsView', () => { const createComponent = ({ handler = successHandler, propsData = {} } = {}) => { mockApollo = createMockApollo([[groupsQuery, handler]]); + mockAxios = new MockAdapter(axios); wrapper = shallowMountExtended(GroupsView, { apolloProvider: mockApollo, @@ -103,6 +107,7 @@ describe('GroupsView', () => { afterEach(() => { mockApollo = null; + mockAxios.restore(); }); describe('when API call is loading', () => { @@ -328,23 +333,25 @@ describe('GroupsView', () => { describe('when API call is successful', () => { beforeEach(async () => { - deleteGroup.mockResolvedValueOnce(Promise.resolve()); - createComponent(); + mockAxios.onDelete(defaultProvide.groupsPath).reply(200, {}); await waitForPromises(); }); it('calls deleteGroup, properly sets loading state, and refetches list when promise resolves', async () => { findGroupsList().vm.$emit('delete', MOCK_GROUP); - expect(deleteParams).toHaveBeenCalledWith(MOCK_GROUP); - expect(deleteGroup).toHaveBeenCalledWith(MOCK_GROUP.id, MOCK_DELETE_PARAMS); expect(findGroupsListByGroupId(MOCK_GROUP.id).actionLoadingStates[ACTION_DELETE]).toBe( true, ); await waitForPromises(); + expect(deleteParams).toHaveBeenCalledWith(MOCK_GROUP); + expect(mockAxios.history.delete[0].params).toEqual({ + id: MOCK_GROUP.fullPath, + ...MOCK_DELETE_PARAMS, + }); expect(findGroupsListByGroupId(MOCK_GROUP.id).actionLoadingStates[ACTION_DELETE]).toBe( false, @@ -369,12 +376,9 @@ describe('GroupsView', () => { }); describe('when API call is not successful', () => { - const error = new Error(); - beforeEach(async () => { - deleteGroup.mockRejectedValue(error); - createComponent(); + mockAxios.onDelete(defaultProvide.groupsPath).networkError(); await waitForPromises(); }); @@ -382,13 +386,16 @@ describe('GroupsView', () => { it('calls deleteGroup, properly sets loading state, and shows error alert', async () => { findGroupsList().vm.$emit('delete', MOCK_GROUP); - expect(deleteParams).toHaveBeenCalledWith(MOCK_GROUP); - expect(deleteGroup).toHaveBeenCalledWith(MOCK_GROUP.id, MOCK_DELETE_PARAMS); expect(findGroupsListByGroupId(MOCK_GROUP.id).actionLoadingStates[ACTION_DELETE]).toBe( true, ); await waitForPromises(); + expect(deleteParams).toHaveBeenCalledWith(MOCK_GROUP); + expect(mockAxios.history.delete[0].params).toEqual({ + id: MOCK_GROUP.fullPath, + ...MOCK_DELETE_PARAMS, + }); expect(findGroupsListByGroupId(MOCK_GROUP.id).actionLoadingStates[ACTION_DELETE]).toBe( false, @@ -398,7 +405,7 @@ describe('GroupsView', () => { expect(successHandler).toHaveBeenCalledTimes(1); expect(createAlert).toHaveBeenCalledWith({ message: 'An error occurred deleting the group. Please refresh the page to try again.', - error, + error: new Error('Network Error'), captureError: true, }); }); diff --git a/spec/frontend/packages_and_registries/dependency_proxy/app_spec.js b/spec/frontend/packages_and_registries/dependency_proxy/app_spec.js index dd70fca9dd2..f4f6d8d10aa 100644 --- a/spec/frontend/packages_and_registries/dependency_proxy/app_spec.js +++ b/spec/frontend/packages_and_registries/dependency_proxy/app_spec.js @@ -280,9 +280,8 @@ describe('DependencyProxyApp', () => { it('shows the clear cache dropdown list', () => { expect(findClearCacheDropdownList().exists()).toBe(true); - const clearCacheDropdownItem = findClearCacheDropdownList().findComponent( - GlDisclosureDropdownItem, - ); + const clearCacheDropdownItem = + findClearCacheDropdownList().findComponent(GlDisclosureDropdownItem); expect(clearCacheDropdownItem.text()).toBe('Clear cache'); }); diff --git a/spec/frontend/packages_and_registries/settings/group/components/package_settings_spec.js b/spec/frontend/packages_and_registries/settings/group/components/package_settings_spec.js index e2cace0e1ac..91b225df779 100644 --- a/spec/frontend/packages_and_registries/settings/group/components/package_settings_spec.js +++ b/spec/frontend/packages_and_registries/settings/group/components/package_settings_spec.js @@ -292,10 +292,8 @@ describe('Packages Settings', () => { it('renders ExceptionsInput and assigns duplication allowness and exception props', () => { mountComponent({ mountFn: mountExtended }); - const { - terraformModuleDuplicatesAllowed, - terraformModuleDuplicateExceptionRegex, - } = packageSettings; + const { terraformModuleDuplicatesAllowed, terraformModuleDuplicateExceptionRegex } = + packageSettings; expect(findTerraformModuleDuplicatedSettingsExceptionsInput().props()).toMatchObject({ duplicatesAllowed: terraformModuleDuplicatesAllowed, diff --git a/spec/frontend/packages_and_registries/settings/project/settings/components/container_protection_rule_form_spec.js b/spec/frontend/packages_and_registries/settings/project/settings/components/container_protection_rule_form_spec.js index babe7308eda..02345ea2bd0 100644 --- a/spec/frontend/packages_and_registries/settings/project/settings/components/container_protection_rule_form_spec.js +++ b/spec/frontend/packages_and_registries/settings/project/settings/components/container_protection_rule_form_spec.js @@ -198,8 +198,9 @@ describe('container Protection Rule Form', () => { await submitForm(); expect(wrapper.emitted('submit')).toBeDefined(); - const expectedEventSubmitPayload = createContainerProtectionRuleMutationPayload().data - .createContainerRegistryProtectionRule.containerRegistryProtectionRule; + const expectedEventSubmitPayload = + createContainerProtectionRuleMutationPayload().data.createContainerRegistryProtectionRule + .containerRegistryProtectionRule; expect(wrapper.emitted('submit')[0]).toEqual([expectedEventSubmitPayload]); expect(wrapper.emitted()).not.toHaveProperty('cancel'); diff --git a/spec/frontend/packages_and_registries/settings/project/settings/components/packages_protection_rule_form_spec.js b/spec/frontend/packages_and_registries/settings/project/settings/components/packages_protection_rule_form_spec.js index 9c34f3d31e9..e5ddef1ef24 100644 --- a/spec/frontend/packages_and_registries/settings/project/settings/components/packages_protection_rule_form_spec.js +++ b/spec/frontend/packages_and_registries/settings/project/settings/components/packages_protection_rule_form_spec.js @@ -184,8 +184,9 @@ describe('Packages Protection Rule Form', () => { await submitForm(); expect(wrapper.emitted('submit')).toBeDefined(); - const expectedEventSubmitPayload = createPackagesProtectionRuleMutationPayload().data - .createPackagesProtectionRule.packageProtectionRule; + const expectedEventSubmitPayload = + createPackagesProtectionRuleMutationPayload().data.createPackagesProtectionRule + .packageProtectionRule; expect(wrapper.emitted('submit')[0]).toEqual([expectedEventSubmitPayload]); expect(wrapper.emitted()).not.toHaveProperty('cancel'); diff --git a/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js b/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js index 1551b05394b..04c2377ce84 100644 --- a/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js +++ b/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js @@ -54,61 +54,63 @@ describe('ForkForm component', () => { Vue.use(VueApollo); - const createComponentFactory = (mountFn) => (provide = {}, data = {}) => { - const queryResponse = { - project: { - id: 'gid://gitlab/Project/1', - forkTargets: { - nodes: [ - { - id: 'gid://gitlab/Group/21', - fullPath: 'flightjs', - name: 'Flight JS', - visibility: 'public', - }, - { - id: 'gid://gitlab/Namespace/4', - fullPath: 'root', - name: 'Administrator', - visibility: 'public', - }, - ], + const createComponentFactory = + (mountFn) => + (provide = {}, data = {}) => { + const queryResponse = { + project: { + id: 'gid://gitlab/Project/1', + forkTargets: { + nodes: [ + { + id: 'gid://gitlab/Group/21', + fullPath: 'flightjs', + name: 'Flight JS', + visibility: 'public', + }, + { + id: 'gid://gitlab/Namespace/4', + fullPath: 'root', + name: 'Administrator', + visibility: 'public', + }, + ], + }, }, - }, + }; + + mockQueryResponse = jest.fn().mockResolvedValue({ data: queryResponse }); + const requestHandlers = [[searchQuery, mockQueryResponse]]; + const apolloProvider = createMockApollo(requestHandlers); + + apolloProvider.clients.defaultClient.cache.writeQuery({ + query: searchQuery, + data: { + ...queryResponse, + }, + }); + + wrapper = mountFn(ForkForm, { + apolloProvider, + provide: { + ...DEFAULT_PROVIDE, + ...provide, + }, + data() { + return { + ...data, + }; + }, + stubs: { + GlFormInputGroup, + GlFormInput, + GlFormRadioGroup, + GlFormRadio, + GlSprintf, + }, + }); }; - mockQueryResponse = jest.fn().mockResolvedValue({ data: queryResponse }); - const requestHandlers = [[searchQuery, mockQueryResponse]]; - const apolloProvider = createMockApollo(requestHandlers); - - apolloProvider.clients.defaultClient.cache.writeQuery({ - query: searchQuery, - data: { - ...queryResponse, - }, - }); - - wrapper = mountFn(ForkForm, { - apolloProvider, - provide: { - ...DEFAULT_PROVIDE, - ...provide, - }, - data() { - return { - ...data, - }; - }, - stubs: { - GlFormInputGroup, - GlFormInput, - GlFormRadioGroup, - GlFormRadio, - GlSprintf, - }, - }); - }; - const createComponent = createComponentFactory(shallowMount); const createFullComponent = createComponentFactory(mount); @@ -546,13 +548,8 @@ describe('ForkForm component', () => { setupComponent(); await submitForm(); - const { - projectId, - projectDescription, - projectName, - projectPath, - projectVisibility, - } = DEFAULT_PROVIDE; + const { projectId, projectDescription, projectName, projectPath, projectVisibility } = + DEFAULT_PROVIDE; const url = `/api/${GON_API_VERSION}/projects/${projectId}/fork`; const project = { diff --git a/spec/frontend/pages/projects/shared/permissions/components/settings_panel_spec.js b/spec/frontend/pages/projects/shared/permissions/components/settings_panel_spec.js index 3e5f1e0c228..404942b10a4 100644 --- a/spec/frontend/pages/projects/shared/permissions/components/settings_panel_spec.js +++ b/spec/frontend/pages/projects/shared/permissions/components/settings_panel_spec.js @@ -556,7 +556,8 @@ describe('Settings Panel', () => { await findPackageRegistryEnabledInput().vm.$emit('change', packageRegistryEnabled); - const packageRegistryApiForEveryoneEnabledInput = findPackageRegistryApiForEveryoneEnabledInput(); + const packageRegistryApiForEveryoneEnabledInput = + findPackageRegistryApiForEveryoneEnabledInput(); if (packageRegistryApiForEveryoneEnabled === 'hidden') { expect(packageRegistryApiForEveryoneEnabledInput.exists()).toBe(false); diff --git a/spec/frontend/projects/pipelines/charts/mock_data.js b/spec/frontend/projects/pipelines/charts/mock_data.js index 0e3e43835d0..26de7389522 100644 --- a/spec/frontend/projects/pipelines/charts/mock_data.js +++ b/spec/frontend/projects/pipelines/charts/mock_data.js @@ -119,69 +119,11 @@ export const mockPipelineStatistics = { '01 December', ], monthPipelinesTotals: [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 2, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], monthPipelinesSuccessful: [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], yearPipelinesLabels: [ @@ -234,36 +176,7 @@ export const mockPipelineStatistics = { '02d95fb2', ], pipelineTimesValues: [ - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 2, - 1, - 0, - 1, - 2, - 2, - 0, - 4, - 2, - 1, - 2, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 5, - 2, - 0, - 0, - 0, + 1, 0, 0, 0, 0, 1, 1, 2, 1, 0, 1, 2, 2, 0, 4, 2, 1, 2, 1, 1, 0, 1, 1, 0, 1, 5, 2, 0, 0, 0, ], __typename: 'Analytics', }, diff --git a/spec/frontend/projects/settings/branch_rules/components/view/index_spec.js b/spec/frontend/projects/settings/branch_rules/components/view/index_spec.js index 83bb22a1fb7..ccc2c0c4042 100644 --- a/spec/frontend/projects/settings/branch_rules/components/view/index_spec.js +++ b/spec/frontend/projects/settings/branch_rules/components/view/index_spec.js @@ -205,7 +205,8 @@ describe('View branch rules', () => { 'renders force push section with the correct title and description', async ({ allowForcePush, iconTitle, description }) => { const mockResponse = branchProtectionsMockResponse; - mockResponse.data.project.branchRules.nodes[0].branchProtection.allowForcePush = allowForcePush; + mockResponse.data.project.branchRules.nodes[0].branchProtection.allowForcePush = + allowForcePush; await createComponent({ glFeatures: { editBranchRules: true }, branchRulesQueryHandler: jest.fn().mockResolvedValue(mockResponse), @@ -461,7 +462,8 @@ describe('View branch rules', () => { 'renders force push section with the correct title and description, when rule is `$allowForcePush`', async ({ allowForcePush, title, description }) => { const mockResponse = branchProtectionsMockResponse; - mockResponse.data.project.branchRules.nodes[0].branchProtection.allowForcePush = allowForcePush; + mockResponse.data.project.branchRules.nodes[0].branchProtection.allowForcePush = + allowForcePush; await createComponent({ glFeatures: { editBranchRules: false }, diff --git a/spec/frontend/repository/components/delete_blob_modal_spec.js b/spec/frontend/repository/components/delete_blob_modal_spec.js index e1723a091c4..d3af39425db 100644 --- a/spec/frontend/repository/components/delete_blob_modal_spec.js +++ b/spec/frontend/repository/components/delete_blob_modal_spec.js @@ -25,22 +25,24 @@ const { i18n } = DeleteBlobModal; describe('DeleteBlobModal', () => { let wrapper; - const createComponentFactory = (mountFn) => (props = {}) => { - wrapper = mountFn(DeleteBlobModal, { - propsData: { - ...initialProps, - ...props, - }, - attrs: { - static: true, - visible: true, - }, - stubs: { - GlSprintf, - GlModal: stubComponent(GlModal, { template: RENDER_ALL_SLOTS_TEMPLATE }), - }, - }); - }; + const createComponentFactory = + (mountFn) => + (props = {}) => { + wrapper = mountFn(DeleteBlobModal, { + propsData: { + ...initialProps, + ...props, + }, + attrs: { + static: true, + visible: true, + }, + stubs: { + GlSprintf, + GlModal: stubComponent(GlModal, { template: RENDER_ALL_SLOTS_TEMPLATE }), + }, + }); + }; const createComponent = createComponentFactory(shallowMountExtended); const createFullComponent = createComponentFactory(mount); diff --git a/spec/frontend/repository/components/new_directory_modal_spec.js b/spec/frontend/repository/components/new_directory_modal_spec.js index 55a24089d48..eed8cc5599a 100644 --- a/spec/frontend/repository/components/new_directory_modal_spec.js +++ b/spec/frontend/repository/components/new_directory_modal_spec.js @@ -138,13 +138,8 @@ describe('NewDirectoryModal', () => { }); it('passes the formData', async () => { - const { - dirName, - branchName, - commitMessage, - originalBranch, - createNewMr, - } = defaultFormValue; + const { dirName, branchName, commitMessage, originalBranch, createNewMr } = + defaultFormValue; mock.onPost(initialProps.path).reply(HTTP_STATUS_OK, {}); await fillForm(); await submitForm(); diff --git a/spec/frontend/repository/components/tree_content_spec.js b/spec/frontend/repository/components/tree_content_spec.js index 311e5ca86f8..5b396152fb9 100644 --- a/spec/frontend/repository/components/tree_content_spec.js +++ b/spec/frontend/repository/components/tree_content_spec.js @@ -82,9 +82,8 @@ describe('Repository table component', () => { await nextTick(); await waitForPromises(); - const [ - paginatedTreeNode, - ] = paginatedTreeResponseFactory().data.project.repository.paginatedTree.nodes; + const [paginatedTreeNode] = + paginatedTreeResponseFactory().data.project.repository.paginatedTree.nodes; const { blobs: { nodes: blobs }, diff --git a/spec/frontend/repository/mock_data.js b/spec/frontend/repository/mock_data.js index c60b6ace598..a5d374c234e 100644 --- a/spec/frontend/repository/mock_data.js +++ b/spec/frontend/repository/mock_data.js @@ -152,8 +152,7 @@ export const paginatedTreeResponseFactory = ({ __typename: 'TreeEntryConnection', nodes: new Array(numberOfTrees).fill({ __typename: 'TreeEntry', - id: - 'gid://gitlab/Gitlab::Graphql::Representation::TreeEntry/dc36320ac91aca2f890a31458c9e9920159e68a3', + id: 'gid://gitlab/Gitlab::Graphql::Representation::TreeEntry/dc36320ac91aca2f890a31458c9e9920159e68a3', sha: 'dc36320ac91aca2f890a31458c9e9920159e68ae', name: 'gitlab-resize-image', flatPath: 'workhorse/cmd/gitlab-resize-image', @@ -169,8 +168,7 @@ export const paginatedTreeResponseFactory = ({ __typename: 'BlobConnection', nodes: new Array(numberOfBlobs).fill({ __typename: 'Blob', - id: - 'gid://gitlab/Gitlab::Graphql::Representation::TreeEntry/99712dbc6b26ff92c15bf93449ea09df38adfb10', + id: 'gid://gitlab/Gitlab::Graphql::Representation::TreeEntry/99712dbc6b26ff92c15bf93449ea09df38adfb10', sha: '99712dbc6b26ff92c15bf93449ea09df38adfb1b', name: blobHasReadme ? 'README.md' : 'fakeBlob', flatPath: blobHasReadme ? 'README.md' : 'fakeBlob', diff --git a/spec/frontend/usage_quotas/storage/components/namespace_storage_app_spec.js b/spec/frontend/usage_quotas/storage/components/namespace_storage_app_spec.js index a3c649debf0..6a7ea636491 100644 --- a/spec/frontend/usage_quotas/storage/components/namespace_storage_app_spec.js +++ b/spec/frontend/usage_quotas/storage/components/namespace_storage_app_spec.js @@ -112,10 +112,8 @@ describe('NamespaceStorageApp', () => { }); it('will receive relevant props', () => { - const { - containerRegistrySize, - containerRegistrySizeIsEstimated, - } = namespace.rootStorageStatistics; + const { containerRegistrySize, containerRegistrySizeIsEstimated } = + namespace.rootStorageStatistics; expect(findContainerRegistry().props()).toEqual({ containerRegistrySize, diff --git a/spec/frontend/usage_quotas/storage/project/utils_spec.js b/spec/frontend/usage_quotas/storage/project/utils_spec.js index cabe42833e1..b542a89c718 100644 --- a/spec/frontend/usage_quotas/storage/project/utils_spec.js +++ b/spec/frontend/usage_quotas/storage/project/utils_spec.js @@ -6,10 +6,8 @@ import { import { mockGetProjectStorageStatisticsGraphQLResponse } from 'jest/usage_quotas/storage/mock_data'; describe('getStorageTypesFromProjectStatistics', () => { - const { - statistics: projectStatistics, - statisticsDetailsPaths, - } = mockGetProjectStorageStatisticsGraphQLResponse.data.project; + const { statistics: projectStatistics, statisticsDetailsPaths } = + mockGetProjectStorageStatisticsGraphQLResponse.data.project; describe('matches project statistics value with matching storage type', () => { const typesWithStats = getStorageTypesFromProjectStatistics( diff --git a/spec/frontend/vue_merge_request_widget/extensions/security_reports/mr_widget_security_reports_spec.js b/spec/frontend/vue_merge_request_widget/extensions/security_reports/mr_widget_security_reports_spec.js index a59016d7995..5fd9b92aad4 100644 --- a/spec/frontend/vue_merge_request_widget/extensions/security_reports/mr_widget_security_reports_spec.js +++ b/spec/frontend/vue_merge_request_widget/extensions/security_reports/mr_widget_security_reports_spec.js @@ -46,8 +46,7 @@ describe('vue_merge_request_widget/extensions/security_reports/mr_widget_securit content: { learnMorePath: '/help/user/application_security/index#view-security-scan-information-in-merge-requests', - text: - 'New vulnerabilities are vulnerabilities that the security scan detects in the merge request that are different to existing vulnerabilities in the default branch.', + text: 'New vulnerabilities are vulnerabilities that the security scan detects in the merge request that are different to existing vulnerabilities in the default branch.', }, options: { title: 'Security scan results', diff --git a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js index f68619d7c6f..98c149f43df 100644 --- a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js +++ b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js @@ -359,8 +359,9 @@ describe('BaseToken', () => { it(`${ shouldRenderFilteredSearchSuggestion ? 'should' : 'should not' } render GlFilteredSearchSuggestion`, () => { - const filteredSearchSuggestions = wrapper.findAllComponents(GlFilteredSearchSuggestion) - .wrappers; + const filteredSearchSuggestions = wrapper.findAllComponents( + GlFilteredSearchSuggestion, + ).wrappers; if (shouldRenderFilteredSearchSuggestion) { expect(filteredSearchSuggestions.map((c) => c.props())).toMatchObject( diff --git a/spec/frontend/vue_shared/components/user_callout_dismisser_spec.js b/spec/frontend/vue_shared/components/user_callout_dismisser_spec.js index a4efbda06ce..fc6d0ab1c4e 100644 --- a/spec/frontend/vue_shared/components/user_callout_dismisser_spec.js +++ b/spec/frontend/vue_shared/components/user_callout_dismisser_spec.js @@ -31,8 +31,10 @@ describe('UserCalloutDismisser', () => { const MOCK_FEATURE_NAME = 'mock_feature_name'; // Query handlers - const successHandlerFactory = (dismissedCallouts = []) => () => - Promise.resolve(userCalloutsResponse(dismissedCallouts)); + const successHandlerFactory = + (dismissedCallouts = []) => + () => + Promise.resolve(userCalloutsResponse(dismissedCallouts)); const anonUserHandler = () => Promise.resolve(anonUserCalloutsResponse()); const errorHandler = () => Promise.reject(new Error('query error')); const pendingHandler = () => new Promise(() => {}); diff --git a/spec/frontend/vue_shared/security_reports/components/apollo_mocks.js b/spec/frontend/vue_shared/security_reports/components/apollo_mocks.js index 066f9a57bc6..79909c2c98a 100644 --- a/spec/frontend/vue_shared/security_reports/components/apollo_mocks.js +++ b/spec/frontend/vue_shared/security_reports/components/apollo_mocks.js @@ -1,12 +1,11 @@ -export const buildConfigureSecurityFeatureMockFactory = (mutationType) => ({ - successPath = 'testSuccessPath', - errors = [], -} = {}) => ({ - data: { - [mutationType]: { - successPath, - errors, - __typename: `${mutationType}Payload`, +export const buildConfigureSecurityFeatureMockFactory = + (mutationType) => + ({ successPath = 'testSuccessPath', errors = [] } = {}) => ({ + data: { + [mutationType]: { + successPath, + errors, + __typename: `${mutationType}Payload`, + }, }, - }, -}); + }); diff --git a/spec/frontend/vue_shared/security_reports/components/manage_via_mr_spec.js b/spec/frontend/vue_shared/security_reports/components/manage_via_mr_spec.js index 7b660ccabfc..91a629c4504 100644 --- a/spec/frontend/vue_shared/security_reports/components/manage_via_mr_spec.js +++ b/spec/frontend/vue_shared/security_reports/components/manage_via_mr_spec.js @@ -76,9 +76,8 @@ describe('ManageViaMr component', () => { describe.each(supportedReportTypes)( '%s', (featureName, featureType, mutation, mutationId, mutationVariables) => { - const buildConfigureSecurityFeatureMock = buildConfigureSecurityFeatureMockFactory( - mutationId, - ); + const buildConfigureSecurityFeatureMock = + buildConfigureSecurityFeatureMockFactory(mutationId); const successHandler = jest.fn().mockResolvedValue(buildConfigureSecurityFeatureMock()); const noSuccessPathHandler = jest.fn().mockResolvedValue( buildConfigureSecurityFeatureMock({ diff --git a/spec/frontend/work_items/components/notes/work_item_discussion_spec.js b/spec/frontend/work_items/components/notes/work_item_discussion_spec.js index 609e19f146d..4f4ffe7bb1c 100644 --- a/spec/frontend/work_items/components/notes/work_item_discussion_spec.js +++ b/spec/frontend/work_items/components/notes/work_item_discussion_spec.js @@ -11,9 +11,10 @@ import { } from 'jest/work_items/mock_data'; import { WIDGET_TYPE_NOTES } from '~/work_items/constants'; -const mockWorkItemNotesWidgetResponseWithComments = mockWorkItemNotesResponseWithComments.data.workspace.workItem.widgets.find( - (widget) => widget.type === WIDGET_TYPE_NOTES, -); +const mockWorkItemNotesWidgetResponseWithComments = + mockWorkItemNotesResponseWithComments.data.workspace.workItem.widgets.find( + (widget) => widget.type === WIDGET_TYPE_NOTES, + ); describe('Work Item Discussion', () => { let wrapper; diff --git a/spec/frontend/work_items/components/work_item_assignees_spec.js b/spec/frontend/work_items/components/work_item_assignees_spec.js index cba431d6912..ef5458e0024 100644 --- a/spec/frontend/work_items/components/work_item_assignees_spec.js +++ b/spec/frontend/work_items/components/work_item_assignees_spec.js @@ -269,10 +269,8 @@ describe('WorkItemAssignees component', () => { }); it('sorts selected assignees first', async () => { - const [ - unselected, - selected, - ] = projectMembersAutocompleteResponseWithCurrentUser.data.workspace.users; + const [unselected, selected] = + projectMembersAutocompleteResponseWithCurrentUser.data.workspace.users; createComponent({ assignees: [selected], diff --git a/spec/frontend/work_items/components/work_item_notes_spec.js b/spec/frontend/work_items/components/work_item_notes_spec.js index 8c1477142fc..639866e0be9 100644 --- a/spec/frontend/work_items/components/work_item_notes_spec.js +++ b/spec/frontend/work_items/components/work_item_notes_spec.js @@ -36,13 +36,15 @@ const mockNotesWidgetResponse = mockWorkItemNotesResponse.data.workItem.widgets. (widget) => widget.type === WIDGET_TYPE_NOTES, ); -const mockMoreNotesWidgetResponse = mockMoreWorkItemNotesResponse.data.workspace.workItem.widgets.find( - (widget) => widget.type === WIDGET_TYPE_NOTES, -); +const mockMoreNotesWidgetResponse = + mockMoreWorkItemNotesResponse.data.workspace.workItem.widgets.find( + (widget) => widget.type === WIDGET_TYPE_NOTES, + ); -const mockWorkItemNotesWidgetResponseWithComments = mockWorkItemNotesResponseWithComments.data.workspace.workItem.widgets.find( - (widget) => widget.type === WIDGET_TYPE_NOTES, -); +const mockWorkItemNotesWidgetResponseWithComments = + mockWorkItemNotesResponseWithComments.data.workspace.workItem.widgets.find( + (widget) => widget.type === WIDGET_TYPE_NOTES, + ); const firstSystemNodeId = mockNotesWidgetResponse.discussions.nodes[0].notes.nodes[0].id; diff --git a/spec/frontend/work_items/mock_data.js b/spec/frontend/work_items/mock_data.js index 09907b5a16e..e561db31c61 100644 --- a/spec/frontend/work_items/mock_data.js +++ b/spec/frontend/work_items/mock_data.js @@ -2995,8 +2995,7 @@ export const mockWorkItemNotesByIidResponse = { nodes: [ { id: 'gid://gitlab/IterationNote/addbc177f7664699a135130ab05ffb78c57e4db3', - body: - 'changed iteration to Et autem debitis nam suscipit eos ut. Jul 13, 2022 - Jul 19, 2022', + body: 'changed iteration to Et autem debitis nam suscipit eos ut. Jul 13, 2022 - Jul 19, 2022', bodyHtml: '\u003cp data-sourcepos="1:1-1:36" dir="auto"\u003echanged iteration to \u003ca href="/groups/flightjs/-/iterations/5352" data-reference-type="iteration" data-original="*iteration:5352" data-link="false" data-link-reference="false" data-project="6" data-iteration="5352" data-container="body" data-placement="top" title="Iteration" class="gfm gfm-iteration has-tooltip"\u003eEt autem debitis nam suscipit eos ut. Jul 13, 2022 - Jul 19, 2022\u003c/a\u003e\u003c/p\u003e', systemNoteIconName: 'iteration', @@ -3941,8 +3940,7 @@ export const workItemNotesWithSystemNotesWithChangedDescription = { descriptionVersion: { id: 'gid://gitlab/DescriptionVersion/199', description: 'Desc2', - diff: - 'Desc12', + diff: 'Desc12', diffPath: '/gnuwget/Wget2/-/issues/79/descriptions/199/diff', deletePath: '/gnuwget/Wget2/-/issues/79/descriptions/199', canDelete: true, @@ -4007,8 +4005,7 @@ export const workItemNotesWithSystemNotesWithChangedDescription = { descriptionVersion: { id: 'gid://gitlab/DescriptionVersion/200', description: 'Desc3', - diff: - 'Desc23', + diff: 'Desc23', diffPath: '/gnuwget/Wget2/-/issues/79/descriptions/200/diff', deletePath: '/gnuwget/Wget2/-/issues/79/descriptions/200', canDelete: true, diff --git a/spec/frontend_integration/diffs/diffs_interopability_spec.js b/spec/frontend_integration/diffs/diffs_interopability_spec.js index 470419e9f87..57d8726cd02 100644 --- a/spec/frontend_integration/diffs/diffs_interopability_spec.js +++ b/spec/frontend_integration/diffs/diffs_interopability_spec.js @@ -98,13 +98,15 @@ describe('diffs third party interoperability', () => { document.body.innerHTML = ''; }); - const tryOrErrorMessage = (fn) => (...args) => { - try { - return fn(...args); - } catch (e) { - return e.message; - } - }; + const tryOrErrorMessage = + (fn) => + (...args) => { + try { + return fn(...args); + } catch (e) { + return e.message; + } + }; const findDiffFile = () => document.querySelector(`.diff-file[data-path="${TEST_DIFF_FILE}"]`); const hasLines = (sel = 'tr.line_holder') => findDiffFile().querySelectorAll(sel).length > 0; diff --git a/spec/frontend_integration/test_helpers/mock_server/routes/repository.js b/spec/frontend_integration/test_helpers/mock_server/routes/repository.js index ba36463cad8..42b8f893b03 100644 --- a/spec/frontend_integration/test_helpers/mock_server/routes/repository.js +++ b/spec/frontend_integration/test_helpers/mock_server/routes/repository.js @@ -32,9 +32,11 @@ export default (server) => { }); server.post('/api/v4/projects/:id/repository/commits', (schema, request) => { - const { branch: branchName, commit_message: message, actions } = JSON.parse( - request.requestBody, - ); + const { + branch: branchName, + commit_message: message, + actions, + } = JSON.parse(request.requestBody); const branch = schema.branches.findBy({ name: branchName }); const prevCommit = branch diff --git a/spec/frontend_integration/test_helpers/utils/obj_spec.js b/spec/frontend_integration/test_helpers/utils/obj_spec.js index 614250ccddc..0ad7b4a1a4c 100644 --- a/spec/frontend_integration/test_helpers/utils/obj_spec.js +++ b/spec/frontend_integration/test_helpers/utils/obj_spec.js @@ -3,9 +3,9 @@ import { withKeys, withValues } from './obj'; describe('frontend_integration/test_helpers/utils/obj', () => { describe('withKeys', () => { it('picks and maps keys', () => { - expect( - withKeys({ a: '123', b: 456, c: 'd' }, { b: 'lorem', c: 'ipsum', z: 'zed ' }), - ).toEqual({ lorem: 456, ipsum: 'd' }); + expect(withKeys({ a: '123', b: 456, c: 'd' }, { b: 'lorem', c: 'ipsum', z: 'zed ' })).toEqual( + { lorem: 456, ipsum: 'd' }, + ); }); }); diff --git a/spec/helpers/organizations/organization_helper_spec.rb b/spec/helpers/organizations/organization_helper_spec.rb index 0f218d0997e..96e05d1e184 100644 --- a/spec/helpers/organizations/organization_helper_spec.rb +++ b/spec/helpers/organizations/organization_helper_spec.rb @@ -6,8 +6,11 @@ RSpec.describe Organizations::OrganizationHelper, feature_category: :cell do include Devise::Test::ControllerHelpers let_it_be(:user) { build_stubbed(:user, organization_groups_projects_sort: 'name_asc') } - let_it_be(:organization_detail) { build_stubbed(:organization_detail, description_html: 'description') } - let_it_be(:organization) { organization_detail.organization } + let_it_be(:organization) { build_stubbed(:organization, :default) } + let_it_be(:organization_detail) do + build_stubbed(:organization_detail, organization: organization, description_html: 'description') + end + let_it_be(:organization_gid) { 'gid://gitlab/Organizations::Organization/1' } let_it_be(:new_group_path) { '/-/organizations/default/groups/new' } let_it_be(:new_project_path) { '/projects/new' } @@ -31,7 +34,6 @@ RSpec.describe Organizations::OrganizationHelper, feature_category: :cell do end before do - allow(organization).to receive(:to_global_id).and_return(organization_gid) allow(helper).to receive(:new_groups_organization_path).with(organization).and_return(new_group_path) allow(helper).to receive(:new_project_path).and_return(new_project_path) allow(helper).to receive(:image_path).with(organizations_empty_state_svg_path) @@ -46,9 +48,6 @@ RSpec.describe Organizations::OrganizationHelper, feature_category: :cell do allow(finder).to receive(:execute).and_return(stubbed_results) end allow(helper).to receive(:restricted_visibility_levels).and_return([]) - allow(helper).to receive(:groups_organization_path) - .with(organization) - .and_return(groups_organization_path) end shared_examples 'includes that the user can create a group' do |method| @@ -161,6 +160,7 @@ RSpec.describe Organizations::OrganizationHelper, feature_category: :cell do 'groups_and_projects_organization_path' => groups_and_projects_organization_path, 'users_organization_path' => users_organization_path, 'new_group_path' => new_group_path, + 'groups_path' => groups_organization_path, 'new_project_path' => new_project_path, 'groups_empty_state_svg_path' => groups_empty_state_svg_path, 'projects_empty_state_svg_path' => projects_empty_state_svg_path, @@ -206,6 +206,7 @@ RSpec.describe Organizations::OrganizationHelper, feature_category: :cell do { 'organization_gid' => organization_gid, 'new_group_path' => new_group_path, + 'groups_path' => groups_organization_path, 'new_project_path' => new_project_path, 'groups_empty_state_svg_path' => groups_empty_state_svg_path, 'projects_empty_state_svg_path' => projects_empty_state_svg_path, diff --git a/spec/requests/api/markdown_uploads_spec.rb b/spec/requests/api/markdown_uploads_spec.rb new file mode 100644 index 00000000000..b7262970347 --- /dev/null +++ b/spec/requests/api/markdown_uploads_spec.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe API::MarkdownUploads, feature_category: :team_planning do + let_it_be(:project) { create(:project, :private) } + let_it_be(:user) { create(:user, guest_of: project) } + + describe "POST /projects/:id/uploads/authorize" do + include WorkhorseHelpers + + let(:headers) { workhorse_internal_api_request_header.merge({ 'HTTP_GITLAB_WORKHORSE' => 1 }) } + let(:path) { "/projects/#{project.id}/uploads/authorize" } + + context 'with authorized user' do + it "returns 200" do + post api(path, user), headers: headers + + expect(response).to have_gitlab_http_status(:ok) + expect(json_response['MaximumSize']).to eq(project.max_attachment_size) + end + end + + context 'with unauthorized user' do + it "returns 404" do + post api(path, create(:user)), headers: headers + + expect(response).to have_gitlab_http_status(:not_found) + end + end + + context 'with no Workhorse headers' do + it "returns 403" do + post api(path, user) + + expect(response).to have_gitlab_http_status(:forbidden) + end + end + end + + describe "POST /projects/:id/uploads" do + let(:file) { fixture_file_upload("spec/fixtures/dk.png", "image/png") } + let(:path) { "/projects/#{project.id}/uploads" } + + before do + project + end + + it "uploads the file and returns its info" do + post api(path, user), params: { file: file } + + expect(response).to have_gitlab_http_status(:created) + expect(json_response['alt']).to eq("dk") + expect(json_response['url']).to start_with("/uploads/") + expect(json_response['url']).to end_with("/dk.png") + expect(json_response['full_path']).to start_with("/-/project/#{project.id}/uploads") + end + + it "does not leave the temporary file in place after uploading, even when the tempfile reaper does not run" do + tempfile = Tempfile.new('foo') + path = tempfile.path + + # rubocop: disable RSpec/AnyInstanceOf -- allow_next_instance_of does not work here because TempfileReaper is a middleware that is initialized early + allow_any_instance_of(Rack::TempfileReaper).to receive(:call) do |instance, env| + instance.instance_variable_get(:@app).call(env) + end + # rubocop: enable RSpec/AnyInstanceOf + + expect(path).not_to be(nil) + expect(Rack::Multipart::Parser::TEMPFILE_FACTORY).to receive(:call).and_return(tempfile) + + post api(path, user), params: { file: fixture_file_upload("spec/fixtures/dk.png", "image/png") } + + expect(tempfile.path).to be(nil) + expect(File.exist?(path)).to be(false) + end + end +end diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 0a3934bc3b5..ff47129ff77 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -2279,119 +2279,6 @@ RSpec.describe API::Projects, :aggregate_failures, feature_category: :groups_and end end - describe "POST /projects/:id/uploads/authorize" do - let(:headers) { workhorse_internal_api_request_header.merge({ 'HTTP_GITLAB_WORKHORSE' => 1 }) } - let(:path) { "/projects/#{project.id}/uploads/authorize" } - - context 'with authorized user' do - it "returns 200" do - post api(path, user), headers: headers - - expect(response).to have_gitlab_http_status(:ok) - expect(json_response['MaximumSize']).to eq(project.max_attachment_size) - end - end - - context 'with unauthorized user' do - it "returns 404" do - post api(path, user2), headers: headers - - expect(response).to have_gitlab_http_status(:not_found) - end - end - - context 'with exempted project' do - before do - stub_env('GITLAB_UPLOAD_API_ALLOWLIST', project.id) - end - - it "returns 200" do - post api(path, user), headers: headers - - expect(response).to have_gitlab_http_status(:ok) - expect(json_response['MaximumSize']).to eq(1.gigabyte) - end - end - - context 'with no Workhorse headers' do - it "returns 403" do - post api(path, user) - - expect(response).to have_gitlab_http_status(:forbidden) - end - end - end - - describe "POST /projects/:id/uploads" do - let(:file) { fixture_file_upload("spec/fixtures/dk.png", "image/png") } - let(:path) { "/projects/#{project.id}/uploads" } - - before do - project - end - - it "uploads the file and returns its info" do - expect_next_instance_of(UploadService) do |instance| - expect(instance).to receive(:override_max_attachment_size=).with(project.max_attachment_size).and_call_original - end - - post api(path, user), params: { file: file } - - expect(response).to have_gitlab_http_status(:created) - expect(json_response['alt']).to eq("dk") - expect(json_response['url']).to start_with("/uploads/") - expect(json_response['url']).to end_with("/dk.png") - expect(json_response['full_path']).to start_with("/-/project/#{project.id}/uploads") - end - - it "does not leave the temporary file in place after uploading, even when the tempfile reaper does not run" do - tempfile = Tempfile.new('foo') - path = tempfile.path - - allow_any_instance_of(Rack::TempfileReaper).to receive(:call) do |instance, env| - instance.instance_variable_get(:@app).call(env) - end - - expect(path).not_to be(nil) - expect(Rack::Multipart::Parser::TEMPFILE_FACTORY).to receive(:call).and_return(tempfile) - - post api(path, user), params: { file: fixture_file_upload("spec/fixtures/dk.png", "image/png") } - - expect(tempfile.path).to be(nil) - expect(File.exist?(path)).to be(false) - end - - shared_examples 'capped upload attachments' do |upload_allowed| - it "limits the upload to 1 GiB" do - expect_next_instance_of(UploadService) do |instance| - expect(instance).to receive(:override_max_attachment_size=).with(1.gigabyte).and_call_original - end - - post api(path, user), params: { file: file } - - expect(response).to have_gitlab_http_status(:created) - end - - it "logs a warning if file exceeds attachment size" do - allow(Gitlab::CurrentSettings).to receive(:max_attachment_size).and_return(0) - - expect(Gitlab::AppLogger).to receive(:info).with( - hash_including(message: 'File exceeds maximum size', upload_allowed: upload_allowed)) - .and_call_original - - post api(path, user), params: { file: file } - end - end - - context 'with exempted project' do - before do - stub_env('GITLAB_UPLOAD_API_ALLOWLIST', project.id) - end - - it_behaves_like 'capped upload attachments', true - end - end - describe "GET /projects/:id/groups" do let_it_be(:root_group) { create(:group, :public, name: 'root group') } let_it_be(:project_group) { create(:group, :public, parent: root_group, name: 'project group') } diff --git a/spec/services/upload_service_spec.rb b/spec/services/upload_service_spec.rb index 4a8cd46172d..226b2a2b016 100644 --- a/spec/services/upload_service_spec.rb +++ b/spec/services/upload_service_spec.rb @@ -67,29 +67,6 @@ RSpec.describe UploadService, feature_category: :shared do it { expect(@link_to_file).to eq({}) } end - - describe '#override_max_attachment_size' do - let(:txt) { fixture_file_upload('spec/fixtures/doc_sample.txt', 'text/plain') } - let(:service) { described_class.new(@project, txt, FileUploader) } - - subject { service.execute.to_h } - - before do - allow(txt).to receive(:size) { 100.megabytes.to_i } - end - - it 'allows the upload' do - service.override_max_attachment_size = 101.megabytes - - expect(subject.keys).to eq(%i[alt url markdown]) - end - - it 'disallows the upload' do - service.override_max_attachment_size = 99.megabytes - - expect(subject).to eq({}) - end - end end def upload_file(project, file) diff --git a/yarn.lock b/yarn.lock index ee7e8fe11cd..513da1e0be1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11399,11 +11399,21 @@ pretender@^3.4.3: fake-xml-http-request "^2.1.1" route-recognizer "^0.3.3" -prettier@2.2.1, "prettier@^1.18.2 || ^2.0.0", prettier@^2.0.0: +prettier-plugin-tailwindcss@^0.6.5: + version "0.6.5" + resolved "https://registry.yarnpkg.com/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.6.5.tgz#e05202784a3f41889711ae38c75c5b8cad72f368" + integrity sha512-axfeOArc/RiGHjOIy9HytehlC0ZLeMaqY09mm8YCkMzznKiDkwFzOpBvtuhuv3xG5qB73+Mj7OCe2j/L1ryfuQ== + +"prettier@^1.18.2 || ^2.0.0", prettier@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== +prettier@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.2.tgz#03ff86dc7c835f2d2559ee76876a3914cec4a90a" + integrity sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA== + pretty-format@^26.4.2: version "26.6.2" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93"