diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/artifacts_settings/keep_latest_artifact_checkbox.vue | 18 | ||||
-rw-r--r-- | app/assets/javascripts/clone_panel.js | 1 | ||||
-rw-r--r-- | app/assets/javascripts/vue_shared/alert_details/components/alert_details.vue | 2 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 2 | ||||
-rw-r--r-- | app/models/repository.rb | 14 | ||||
-rw-r--r-- | app/services/issues/export_csv_service.rb | 10 | ||||
-rw-r--r-- | app/views/projects/settings/ci_cd/show.html.haml | 21 |
7 files changed, 30 insertions, 38 deletions
diff --git a/app/assets/javascripts/artifacts_settings/keep_latest_artifact_checkbox.vue b/app/assets/javascripts/artifacts_settings/keep_latest_artifact_checkbox.vue index 92f1cc8117a..d797469dd53 100644 --- a/app/assets/javascripts/artifacts_settings/keep_latest_artifact_checkbox.vue +++ b/app/assets/javascripts/artifacts_settings/keep_latest_artifact_checkbox.vue @@ -2,7 +2,6 @@ import { GlAlert, GlFormCheckbox, GlLink } from '@gitlab/ui'; import { __ } from '~/locale'; import UpdateKeepLatestArtifactProjectSetting from './graphql/mutations/update_keep_latest_artifact_project_setting.mutation.graphql'; -import GetKeepLatestArtifactApplicationSetting from './graphql/queries/get_keep_latest_artifact_application_setting.query.graphql'; import GetKeepLatestArtifactProjectSetting from './graphql/queries/get_keep_latest_artifact_project_setting.query.graphql'; export default { @@ -14,7 +13,6 @@ export default { enabledHelpText: __( 'The latest artifacts created by jobs in the most recent successful pipeline will be stored.', ), - disabledHelpText: __('This feature is disabled at the instance level.'), helpLinkText: __('More information'), checkboxText: __('Keep artifacts from most recent successful jobs'), }, @@ -46,19 +44,12 @@ export default { this.reportError(this.$options.errors.fetchError); }, }, - projectSettingDisabled: { - query: GetKeepLatestArtifactApplicationSetting, - update(data) { - return !data.ciApplicationSettings?.keepLatestArtifact; - }, - }, }, data() { return { keepLatestArtifact: null, errorMessage: '', isAlertDismissed: false, - projectSettingDisabled: true, }; }, computed: { @@ -66,9 +57,7 @@ export default { return this.errorMessage && !this.isAlertDismissed; }, helpText() { - return this.projectSettingDisabled - ? this.$options.i18n.disabledHelpText - : this.$options.i18n.enabledHelpText; + return this.$options.i18n.enabledHelpText; }, }, methods: { @@ -106,10 +95,7 @@ export default { @dismiss="isAlertDismissed = true" >{{ errorMessage }}</gl-alert > - <gl-form-checkbox - v-model="keepLatestArtifact" - :disabled="projectSettingDisabled" - @change="updateSetting" + <gl-form-checkbox v-model="keepLatestArtifact" @change="updateSetting" ><strong class="gl-mr-3">{{ $options.i18n.checkboxText }}</strong> <gl-link :href="helpPagePath">{{ $options.i18n.helpLinkText }}</gl-link> <template v-if="!$apollo.loading" #help>{{ helpText }}</template> diff --git a/app/assets/javascripts/clone_panel.js b/app/assets/javascripts/clone_panel.js index c9fae8f17a4..ec831a77bde 100644 --- a/app/assets/javascripts/clone_panel.js +++ b/app/assets/javascripts/clone_panel.js @@ -15,7 +15,6 @@ export default function initClonePanel() { } $('a', $cloneOptions).on('click', (e) => { - e.preventDefault(); const $this = $(e.currentTarget); const url = $this.attr('href'); if (url && (url.startsWith('vscode://') || url.startsWith('xcode://'))) { diff --git a/app/assets/javascripts/vue_shared/alert_details/components/alert_details.vue b/app/assets/javascripts/vue_shared/alert_details/components/alert_details.vue index bcea7ca654e..0af5d028a2a 100644 --- a/app/assets/javascripts/vue_shared/alert_details/components/alert_details.vue +++ b/app/assets/javascripts/vue_shared/alert_details/components/alert_details.vue @@ -368,7 +368,7 @@ export default { <alert-details-table :alert="alert" :loading="loading" /> </gl-tab> <gl-tab - v-if="isThreatMonitoringPage" + v-if="!isThreatMonitoringPage" :data-testid="$options.tabsConfig[1].id" :title="$options.tabsConfig[1].title" > diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8268ab1ad56..9af45daaca4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -280,7 +280,7 @@ module ApplicationHelper def page_class class_names = [] - class_names << 'issue-boards-page gl-overflow-hidden' if current_controller?(:boards) + class_names << 'issue-boards-page gl-overflow-auto' if current_controller?(:boards) class_names << 'environment-logs-page' if current_controller?(:logs) class_names << 'with-performance-bar' if performance_bar_enabled? class_names << system_message_class diff --git a/app/models/repository.rb b/app/models/repository.rb index 06a13194e1a..84ca8f0c12a 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -43,7 +43,7 @@ class Repository changelog license_blob license_key gitignore gitlab_ci_yml branch_names tag_names branch_count tag_count avatar exists? root_ref merged_branch_names - has_visible_content? issue_template_names_by_category merge_request_template_names_by_category + has_visible_content? issue_template_names_hash merge_request_template_names_hash user_defined_metrics_dashboard_paths xcode_project? has_ambiguous_refs?).freeze # Methods that use cache_method but only memoize the value @@ -60,8 +60,8 @@ class Repository gitignore: :gitignore, gitlab_ci: :gitlab_ci_yml, avatar: :avatar, - issue_template: :issue_template_names_by_category, - merge_request_template: :merge_request_template_names_by_category, + issue_template: :issue_template_names_hash, + merge_request_template: :merge_request_template_names_hash, metrics_dashboard: :user_defined_metrics_dashboard_paths, xcode_config: :xcode_project? }.freeze @@ -573,15 +573,15 @@ class Repository cache_method :avatar # store issue_template_names as hash - def issue_template_names_by_category + def issue_template_names_hash Gitlab::Template::IssueTemplate.repository_template_names(project) end - cache_method :issue_template_names_by_category, fallback: {} + cache_method :issue_template_names_hash, fallback: {} - def merge_request_template_names_by_category + def merge_request_template_names_hash Gitlab::Template::MergeRequestTemplate.repository_template_names(project) end - cache_method :merge_request_template_names_by_category, fallback: {} + cache_method :merge_request_template_names_hash, fallback: {} def user_defined_metrics_dashboard_paths Gitlab::Metrics::Dashboard::RepoDashboardFinder.list_dashboards(project) diff --git a/app/services/issues/export_csv_service.rb b/app/services/issues/export_csv_service.rb index 2181c46c90d..dd43c77adfa 100644 --- a/app/services/issues/export_csv_service.rb +++ b/app/services/issues/export_csv_service.rb @@ -5,6 +5,12 @@ module Issues include Gitlab::Routing.url_helpers include GitlabRoutingHelper + def initialize(issuables_relation, project) + super + + @labels = @issuables.labels_hash.transform_values { |labels| labels.sort.join(',').presence } + end + def email(user) Notify.issues_csv_email(user, project, csv_data, csv_builder.status).deliver_now end @@ -12,7 +18,7 @@ module Issues private def associations_to_preload - %i(author assignees timelogs milestone) + %i(author assignees timelogs milestone project) end def header_to_value_hash @@ -41,7 +47,7 @@ module Issues end def issue_labels(issue) - issuables.labels_hash[issue.id].sort.join(',').presence + @labels[issue.id] end # rubocop: disable CodeReuse/ActiveRecord diff --git a/app/views/projects/settings/ci_cd/show.html.haml b/app/views/projects/settings/ci_cd/show.html.haml index ee49377595b..51abb8ed791 100644 --- a/app/views/projects/settings/ci_cd/show.html.haml +++ b/app/views/projects/settings/ci_cd/show.html.haml @@ -45,16 +45,17 @@ .settings-content = render 'projects/runners/index' -%section.settings.no-animate#js-artifacts-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _("Artifacts") - %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _("A job artifact is an archive of files and directories saved by a job when it finishes.") - .settings-content - #js-artifacts-settings-app{ data: { full_path: @project.full_path, help_page_path: help_page_path('ci/pipelines/job_artifacts', anchor: 'keep-artifacts-from-most-recent-successful-jobs') } } +- if Gitlab::CurrentSettings.current_application_settings.keep_latest_artifact? + %section.settings.no-animate#js-artifacts-settings{ class: ('expanded' if expanded) } + .settings-header + %h4 + = _("Artifacts") + %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } + = expanded ? _('Collapse') : _('Expand') + %p + = _("A job artifact is an archive of files and directories saved by a job when it finishes.") + .settings-content + #js-artifacts-settings-app{ data: { full_path: @project.full_path, help_page_path: help_page_path('ci/pipelines/job_artifacts', anchor: 'keep-artifacts-from-most-recent-successful-jobs') } } %section.qa-variables-settings.settings.no-animate#js-cicd-variables-settings{ class: ('expanded' if expanded), data: { qa_selector: 'variables_settings_content' } } .settings-header |