diff --git a/.rubocop_todo/rspec/context_wording.yml b/.rubocop_todo/rspec/context_wording.yml index 840efa82a2b..e76e33b35a3 100644 --- a/.rubocop_todo/rspec/context_wording.yml +++ b/.rubocop_todo/rspec/context_wording.yml @@ -160,7 +160,6 @@ RSpec/ContextWording: - 'ee/spec/features/projects/settings/push_rules_settings_spec.rb' - 'ee/spec/features/promotion_spec.rb' - 'ee/spec/features/protected_branches_spec.rb' - - 'ee/spec/features/signup_spec.rb' - 'ee/spec/features/users/login_spec.rb' - 'ee/spec/features/users/signup_spec.rb' - 'ee/spec/finders/approval_rules/group_finder_spec.rb' diff --git a/.rubocop_todo/rspec/expect_in_hook.yml b/.rubocop_todo/rspec/expect_in_hook.yml index 4dc66e07f61..eefc37a3070 100644 --- a/.rubocop_todo/rspec/expect_in_hook.yml +++ b/.rubocop_todo/rspec/expect_in_hook.yml @@ -12,7 +12,6 @@ RSpec/ExpectInHook: - 'ee/spec/features/projects/feature_flags/user_creates_feature_flag_spec.rb' - 'ee/spec/features/projects/feature_flags/user_deletes_feature_flag_spec.rb' - 'ee/spec/features/projects/settings/ee/service_desk_setting_spec.rb' - - 'ee/spec/features/signup_spec.rb' - 'ee/spec/finders/license_template_finder_spec.rb' - 'ee/spec/finders/projects/integrations/jira/issues_finder_spec.rb' - 'ee/spec/finders/template_finder_spec.rb' diff --git a/app/assets/javascripts/ci/job_details/components/log/line.vue b/app/assets/javascripts/ci/job_details/components/log/line.vue index eba8727c939..416f75372f9 100644 --- a/app/assets/javascripts/ci/job_details/components/log/line.vue +++ b/app/assets/javascripts/ci/job_details/components/log/line.vue @@ -56,7 +56,7 @@ export default { if (window.location.hash) { const hash = getLocationHash(); - const lineToMatch = `L${line.lineNumber + 1}`; + const lineToMatch = `L${line.lineNumber}`; if (hash === lineToMatch) { applyHashHighlight = true; diff --git a/app/assets/javascripts/ci/job_details/components/log/line_header.vue b/app/assets/javascripts/ci/job_details/components/log/line_header.vue index f2e9e09c334..658a94e6af4 100644 --- a/app/assets/javascripts/ci/job_details/components/log/line_header.vue +++ b/app/assets/javascripts/ci/job_details/components/log/line_header.vue @@ -46,7 +46,7 @@ export default { }, mounted() { const hash = getLocationHash(); - const lineToMatch = `L${this.line.lineNumber + 1}`; + const lineToMatch = `L${this.line.lineNumber}`; if (hash === lineToMatch) { this.applyHashHighlight = true; diff --git a/app/assets/javascripts/ci/job_details/components/log/line_number.vue b/app/assets/javascripts/ci/job_details/components/log/line_number.vue index 7ca9154d2fe..30b4c80f3fa 100644 --- a/app/assets/javascripts/ci/job_details/components/log/line_number.vue +++ b/app/assets/javascripts/ci/job_details/components/log/line_number.vue @@ -14,8 +14,7 @@ export default { render(h, { props }) { const { lineNumber, path } = props; - const parsedLineNumber = lineNumber + 1; - const lineId = `L${parsedLineNumber}`; + const lineId = `L${lineNumber}`; const lineHref = `${path}#${lineId}`; return h( @@ -27,7 +26,7 @@ export default { href: lineHref, }, }, - parsedLineNumber, + lineNumber, ); }, }; diff --git a/app/assets/javascripts/ci/job_details/store/utils.js b/app/assets/javascripts/ci/job_details/store/utils.js index ccd04d52e30..b18a3fa162d 100644 --- a/app/assets/javascripts/ci/job_details/store/utils.js +++ b/app/assets/javascripts/ci/job_details/store/utils.js @@ -19,20 +19,17 @@ export const parseLine = (line = {}, lineNumber) => ({ * @param Number lineNumber */ export const parseHeaderLine = (line = {}, lineNumber, hash) => { + let isClosed = parseBoolean(line.section_options?.collapsed); + // if a hash is present in the URL then we ensure // all sections are visible so we can scroll to the hash // in the DOM if (hash) { - return { - isClosed: false, - isHeader: true, - line: parseLine(line, lineNumber), - lines: [], - }; + isClosed = false; } return { - isClosed: parseBoolean(line.section_options?.collapsed), + isClosed, isHeader: true, line: parseLine(line, lineNumber), lines: [], @@ -80,27 +77,28 @@ export const isCollapsibleSection = (acc = [], last = {}, section = {}) => section.section === last.line.section; /** - * Returns the lineNumber of the last line in - * a parsed log + * Returns the next line number in the parsed log * * @param Array acc * @returns Number */ -export const getIncrementalLineNumber = (acc) => { - let lineNumberValue; - const lastIndex = acc.length - 1; - const lastElement = acc[lastIndex]; +export const getNextLineNumber = (acc) => { + if (!acc?.length) { + return 1; + } + + const lastElement = acc[acc.length - 1]; const nestedLines = lastElement.lines; if (lastElement.isHeader && !nestedLines.length && lastElement.line) { - lineNumberValue = lastElement.line.lineNumber; - } else if (lastElement.isHeader && nestedLines.length) { - lineNumberValue = nestedLines[nestedLines.length - 1].lineNumber; - } else { - lineNumberValue = lastElement.lineNumber; + return lastElement.line.lineNumber + 1; } - return lineNumberValue === 0 ? 1 : lineNumberValue + 1; + if (lastElement.isHeader && nestedLines.length) { + return nestedLines[nestedLines.length - 1].lineNumber + 1; + } + + return lastElement.lineNumber + 1; }; /** @@ -119,31 +117,28 @@ export const getIncrementalLineNumber = (acc) => { * @returns Array parsed log lines */ export const logLinesParser = (lines = [], prevLogLines = [], hash = '') => - lines.reduce( - (acc, line, index) => { - const lineNumber = acc.length > 0 ? getIncrementalLineNumber(acc) : index; + lines.reduce((acc, line) => { + const lineNumber = getNextLineNumber(acc); - const last = acc[acc.length - 1]; + const last = acc[acc.length - 1]; - // If the object is an header, we parse it into another structure - if (line.section_header) { - acc.push(parseHeaderLine(line, lineNumber, hash)); - } else if (isCollapsibleSection(acc, last, line)) { - // if the object belongs to a nested section, we append it to the new `lines` array of the - // previously formatted header - last.lines.push(parseLine(line, lineNumber)); - } else if (line.section_duration) { - // if the line has section_duration, we look for the correct header to add it - addDurationToHeader(acc, line); - } else { - // otherwise it's a regular line - acc.push(parseLine(line, lineNumber)); - } + // If the object is an header, we parse it into another structure + if (line.section_header) { + acc.push(parseHeaderLine(line, lineNumber, hash)); + } else if (isCollapsibleSection(acc, last, line)) { + // if the object belongs to a nested section, we append it to the new `lines` array of the + // previously formatted header + last.lines.push(parseLine(line, lineNumber)); + } else if (line.section_duration) { + // if the line has section_duration, we look for the correct header to add it + addDurationToHeader(acc, line); + } else { + // otherwise it's a regular line + acc.push(parseLine(line, lineNumber)); + } - return acc; - }, - [...prevLogLines], - ); + return acc; + }, prevLogLines); /** * Finds the repeated offset, removes the old one diff --git a/app/assets/javascripts/issues/show/components/description.vue b/app/assets/javascripts/issues/show/components/description.vue index acbba216601..5735a518a3e 100644 --- a/app/assets/javascripts/issues/show/components/description.vue +++ b/app/assets/javascripts/issues/show/components/description.vue @@ -362,7 +362,12 @@ export default { }, }, update: (cache, { data: { workItemCreate } }) => - addHierarchyChild(cache, this.fullPath, String(this.issueIid), workItemCreate.workItem), + addHierarchyChild({ + cache, + fullPath: this.fullPath, + iid: String(this.issueIid), + workItem: workItemCreate.workItem, + }), }); const { workItem, errors } = data.workItemCreate; @@ -392,7 +397,12 @@ export default { mutation: deleteWorkItemMutation, variables: { input: { id } }, update: (cache) => - removeHierarchyChild(cache, this.fullPath, String(this.issueIid), { id }), + removeHierarchyChild({ + cache, + fullPath: this.fullPath, + iid: String(this.issueIid), + workItem: { id }, + }), }); if (data.workItemDelete.errors?.length) { diff --git a/app/assets/javascripts/jira_connect/subscriptions/constants.js b/app/assets/javascripts/jira_connect/subscriptions/constants.js index 72fd25a6230..1a10360ed30 100644 --- a/app/assets/javascripts/jira_connect/subscriptions/constants.js +++ b/app/assets/javascripts/jira_connect/subscriptions/constants.js @@ -37,11 +37,11 @@ export const I18N_OAUTH_FAILED_MESSAGE = s__( export const INTEGRATIONS_DOC_LINK = helpPagePath('integration/jira/development_panel', { anchor: 'use-the-integration', }); -export const OAUTH_SELF_MANAGED_DOC_LINK = helpPagePath('integration/jira/connect-app', { - anchor: 'connect-the-gitlab-for-jira-cloud-app-for-self-managed-instances', +export const OAUTH_SELF_MANAGED_DOC_LINK = helpPagePath('administration/settings/jira_cloud_app', { + anchor: 'set-up-oauth-authentication', }); -export const FAILED_TO_UPDATE_DOC_LINK = helpPagePath('integration/jira/connect-app', { - anchor: 'failed-to-update-the-gitlab-instance-for-self-managed-instances', +export const FAILED_TO_UPDATE_DOC_LINK = helpPagePath('administration/settings/jira_cloud_app', { + anchor: 'failed-to-update-the-gitlab-instance', }); export const GITLAB_COM_BASE_PATH = 'https://gitlab.com'; diff --git a/app/assets/javascripts/members/components/action_dropdowns/remove_member_dropdown_item.vue b/app/assets/javascripts/members/components/action_dropdowns/remove_member_dropdown_item.vue index 920febb0e67..68bfb99a139 100644 --- a/app/assets/javascripts/members/components/action_dropdowns/remove_member_dropdown_item.vue +++ b/app/assets/javascripts/members/components/action_dropdowns/remove_member_dropdown_item.vue @@ -77,7 +77,7 @@ export default {