diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 7d879d18e79..d01b3fb91da 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -18,17 +18,6 @@ Capybara/CurrentPathExpectation: Layout/ArgumentAlignment: Enabled: false -# Offense count: 13 -# Cop supports --auto-correct. -Layout/ClosingParenthesisIndentation: - Exclude: - - 'db/post_migrate/20180704145007_update_project_indexes.rb' - - 'ee/db/geo/migrate/20180405074130_add_partial_index_project_repository_verification.rb' - - 'spec/services/issues/resolve_discussions_spec.rb' - - 'spec/services/projects/update_service_spec.rb' - - 'spec/support/helpers/stub_object_storage.rb' - - 'spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb' - # Offense count: 72 # Cop supports --auto-correct. Layout/EmptyLinesAroundArguments: @@ -57,17 +46,6 @@ Layout/FirstArrayElementIndentation: Layout/FirstHashElementIndentation: Enabled: false -# Offense count: 4 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, IndentationWidth. -# SupportedStyles: consistent, align_parentheses -Layout/FirstParameterIndentation: - Exclude: - - 'lib/gitlab/cross_project_access.rb' - - 'lib/gitlab/data_builder/push.rb' - - 'spec/support/helpers/repo_helpers.rb' - - 'spec/support/helpers/stub_object_storage.rb' - # Offense count: 2164 # Cop supports --auto-correct. # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. @@ -91,33 +69,11 @@ Layout/LineLength: Layout/MultilineOperationIndentation: Enabled: false -# Offense count: 9 -# Cop supports --auto-correct. -Layout/RescueEnsureAlignment: - Exclude: - - 'app/models/blob_viewer/dependency_manager.rb' - - 'app/models/project.rb' - - 'app/services/prometheus/proxy_service.rb' - - 'app/workers/delete_stored_files_worker.rb' - - 'config/initializers/1_settings.rb' - - 'config/initializers/trusted_proxies.rb' - - 'lib/gitlab/background_migration/archive_legacy_traces.rb' - - 'lib/gitlab/highlight.rb' - - 'lib/tasks/gitlab/lfs/migrate.rake' - # Offense count: 36 # Cop supports --auto-correct. Layout/SpaceAroundMethodCallOperator: Enabled: false -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: AllowForAlignment. -Layout/SpaceBeforeFirstArg: - Exclude: - - 'spec/requests/api/runner_spec.rb' - - 'spec/support/shared_examples/requests/api/custom_attributes_shared_examples.rb' - # Offense count: 642 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. @@ -153,15 +109,6 @@ Lint/NonDeterministicRequireOrder: - 'qa/spec/spec_helper.rb' - 'spec/spec_helper.rb' -# Offense count: 3 -# Configuration parameters: AllowedImplicitNamespaces. -# AllowedImplicitNamespaces: Gem -Lint/RaiseException: - Exclude: - - 'db/migrate/20190402150158_backport_enterprise_schema.rb' - - 'ee/spec/requests/api/helpers_spec.rb' - - 'spec/requests/api/helpers_spec.rb' - # Offense count: 27 # Cop supports --auto-correct. Lint/RedundantCopDisableDirective: @@ -818,14 +765,6 @@ Style/RescueModifier: Style/RescueStandardError: Enabled: false -# Offense count: 4 -# Cop supports --auto-correct. -Style/SelfAssignment: - Exclude: - - 'app/models/concerns/bulk_member_access_load.rb' - - 'app/serializers/base_serializer.rb' - - 'spec/support/import_export/configuration_helper.rb' - # Offense count: 50 # Cop supports --auto-correct. # Configuration parameters: AllowIfMethodIsEmpty. diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 0d9079f6165..acaadbc3902 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -12dcff902c9a2178fa6f4992d9d562ad9b422dd2 +12d115c50517935dc8e7e2e1248aa450bf00710e diff --git a/app/assets/javascripts/integrations/edit/components/jira_issues_fields.vue b/app/assets/javascripts/integrations/edit/components/jira_issues_fields.vue index 5a1f86718b0..1baa2b440b0 100644 --- a/app/assets/javascripts/integrations/edit/components/jira_issues_fields.vue +++ b/app/assets/javascripts/integrations/edit/components/jira_issues_fields.vue @@ -37,6 +37,11 @@ export default { required: false, default: null, }, + gitlabIssuesEnabled: { + type: Boolean, + required: false, + default: true, + }, upgradePlanPath: { type: String, required: false, @@ -133,7 +138,7 @@ export default { :disabled="!enableJiraIssues" /> -

+

${__('Read more')}`; + const serviceDeskSupportedTitle = __( + 'Use Service Desk to connect with your users (e.g. to offer customer support) through email right inside GitLab', + ); - if (emptyStateMeta.canEditProjectSettings && emptyStateMeta.isServiceDeskEnabled) { - return { - title, - svgPath, - description: `

${__('Have your users email')} ${ - emptyStateMeta.serviceDeskAddress - }

${commonDescription}`, - }; - } + const serviceDeskSupportedMessage = __( + 'Those emails automatically become issues (with the comments becoming the email conversation) listed here.', + ); - if (emptyStateMeta.canEditProjectSettings && !emptyStateMeta.isServiceDeskEnabled) { - return { - title, - svgPath, - description: commonDescription, - primaryLink: emptyStateMeta.editProjectPage, - primaryText: __('Turn on Service Desk'), - }; - } - - return { - title, - svgPath, - description: commonDescription, - }; - } + const commonDescription = ` + ${serviceDeskSupportedMessage} + ${__('Read more')}`; return { - title: __('Service Desk is enabled but not yet active'), - svgPath, - description: __('You must set up incoming email before it becomes active.'), - primaryLink: emptyStateMeta.incomingEmailHelpPage, - primaryText: __('More information'), + serviceDeskEnabledAndCanEditProjectSettings: { + title: serviceDeskSupportedTitle, + svgPath, + description: `

${__('Have your users email')} + ${serviceDeskAddress} +

+ ${commonDescription}`, + }, + serviceDeskEnabledAndCannotEditProjectSettings: { + title: serviceDeskSupportedTitle, + svgPath, + description: commonDescription, + }, + serviceDeskDisabledAndCanEditProjectSettings: { + title: serviceDeskSupportedTitle, + svgPath, + description: commonDescription, + primaryLink: editProjectPage, + primaryText: __('Turn on Service Desk'), + }, + serviceDeskDisabledAndCannotEditProjectSettings: { + title: serviceDeskSupportedTitle, + svgPath, + description: commonDescription, + }, + serviceDeskIsNotSupported: { + title: __('Service Desk is not supported'), + svgPath, + description: __( + 'In order to enable Service Desk for your instance, you must first set up incoming email.', + ), + primaryLink: incomingEmailHelpPage, + primaryText: __('More information'), + }, + serviceDeskIsNotEnabled: { + title: __('Service Desk is not enabled'), + svgPath, + description: __( + 'For help setting up the Service Desk for your instance, please contact an administrator.', + ), + }, }; } + +/** + * Returns the attributes used for gl-empty-state in the Service Desk issues list. + * + * @param {Object} emptyStateMeta - Meta data used to generate empty state messages + * @returns {Object} + */ +export function emptyStateHelper(emptyStateMeta) { + const messages = generateMessages(emptyStateMeta); + + const { isServiceDeskSupported, canEditProjectSettings, isServiceDeskEnabled } = emptyStateMeta; + + if (isServiceDeskSupported) { + if (isServiceDeskEnabled && canEditProjectSettings) { + return messages.serviceDeskEnabledAndCanEditProjectSettings; + } + + if (isServiceDeskEnabled && !canEditProjectSettings) { + return messages.serviceDeskEnabledAndCannotEditProjectSettings; + } + + // !isServiceDeskEnabled && canEditProjectSettings + if (canEditProjectSettings) { + return messages.serviceDeskDisabledAndCanEditProjectSettings; + } + + // !isServiceDeskEnabled && !canEditProjectSettings + return messages.serviceDeskDisabledAndCannotEditProjectSettings; + } + + // !serviceDeskSupported && canEditProjectSettings + if (canEditProjectSettings) { + return messages.serviceDeskIsNotSupported; + } + + // !serviceDeskSupported && !canEditProjectSettings + return messages.serviceDeskIsNotEnabled; +} diff --git a/app/assets/javascripts/issue_show/components/description.vue b/app/assets/javascripts/issue_show/components/description.vue index 9cf46be5345..4c586f6c3a6 100644 --- a/app/assets/javascripts/issue_show/components/description.vue +++ b/app/assets/javascripts/issue_show/components/description.vue @@ -48,11 +48,16 @@ export default { return { preAnimation: false, pulseAnimation: false, + initialUpdate: true, }; }, watch: { - descriptionHtml() { - this.animateChange(); + descriptionHtml(newDescription, oldDescription) { + if (!this.initialUpdate && newDescription !== oldDescription) { + this.animateChange(); + } else { + this.initialUpdate = false; + } this.$nextTick(() => { this.renderGFM(); diff --git a/app/assets/javascripts/issue_show/components/pinned_links.vue b/app/assets/javascripts/issue_show/components/pinned_links.vue index 36375ca743b..d38189307bd 100644 --- a/app/assets/javascripts/issue_show/components/pinned_links.vue +++ b/app/assets/javascripts/issue_show/components/pinned_links.vue @@ -20,20 +20,25 @@ export default { }, computed: { pinnedLinks() { - return [ - { + const links = []; + if (this.publishedIncidentUrl) { + links.push({ id: 'publishedIncidentUrl', url: this.publishedIncidentUrl, text: STATUS_PAGE_PUBLISHED, icon: 'tanuki', - }, - { + }); + } + if (this.zoomMeetingUrl) { + links.push({ id: 'zoomMeetingUrl', url: this.zoomMeetingUrl, text: JOIN_ZOOM_MEETING, icon: 'brand-zoom', - }, - ]; + }); + } + + return links; }, }, methods: { @@ -45,7 +50,7 @@ export default {