diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-15 12:11:17 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-15 12:11:17 +0000 |
commit | 0687020509cafe1e24eb0bfa0e0f5c9f6c4799d2 (patch) | |
tree | dd7e5d8e3612a24874ce0c15f2866a82086367a8 /app | |
parent | 260e9dadce54e1bafefa6c34a9f09bf6b70f5c18 (diff) | |
download | gitlab-ce-0687020509cafe1e24eb0bfa0e0f5c9f6c4799d2.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
7 files changed, 29 insertions, 41 deletions
diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_table.vue b/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_table.vue index 12ee82f0390..d64decc81ec 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_table.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_table.vue @@ -1,5 +1,5 @@ <script> -import { GlTable, GlTooltipDirective } from '@gitlab/ui'; +import { GlTableLite, GlTooltipDirective } from '@gitlab/ui'; import { s__ } from '~/locale'; import eventHub from '../../event_hub'; import PipelineMiniGraph from './pipeline_mini_graph.vue'; @@ -18,7 +18,7 @@ const DEFAULT_TH_CLASSES = export default { components: { - GlTable, + GlTableLite, LinkedPipelinesMiniList: () => import('ee_component/vue_shared/components/linked_pipelines_mini_list.vue'), PipelinesCommit, @@ -156,7 +156,7 @@ export default { </script> <template> <div class="ci-table"> - <gl-table + <gl-table-lite :fields="tableFields" :items="pipelines" tbody-tr-class="commit" @@ -225,7 +225,7 @@ export default { <template #cell(actions)="{ item }"> <pipeline-operations :pipeline="item" :canceling-pipeline="cancelingPipeline" /> </template> - </gl-table> + </gl-table-lite> <pipeline-stop-modal :pipeline="pipeline" @submit="onSubmit" /> </div> diff --git a/app/assets/javascripts/vue_merge_request_widget/components/extensions/actions.vue b/app/assets/javascripts/vue_merge_request_widget/components/extensions/actions.vue index 6483875a3d0..33a83aef057 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/extensions/actions.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/extensions/actions.vue @@ -24,6 +24,13 @@ export default { return sprintf(__('%{widget} options'), { widget: this.widget }); }, }, + methods: { + onClickAction(action) { + if (action.onClick) { + action.onClick(); + } + }, + }, }; </script> @@ -47,6 +54,7 @@ export default { :key="index" :href="btn.href" :target="btn.target" + @click="onClickAction(btn)" > {{ btn.text }} </gl-dropdown-item> @@ -57,11 +65,12 @@ export default { :key="index" :href="btn.href" :target="btn.target" - :class="{ 'gl-mr-3': index > 1 }" + :class="{ 'gl-mr-3': index !== tertiaryButtons.length - 1 }" category="tertiary" variant="confirm" size="small" - class="gl-display-none gl-md-display-block" + class="gl-display-none gl-md-display-block gl-float-left" + @click="onClickAction(btn)" > {{ btn.text }} </gl-button> diff --git a/app/assets/javascripts/vue_merge_request_widget/extensions/issues.js b/app/assets/javascripts/vue_merge_request_widget/extensions/issues.js index 3298c09fe24..9cbc0b0e5d1 100644 --- a/app/assets/javascripts/vue_merge_request_widget/extensions/issues.js +++ b/app/assets/javascripts/vue_merge_request_widget/extensions/issues.js @@ -30,7 +30,15 @@ export default { // Tertiary action buttons that will take the user elsewhere // in the GitLab app tertiaryButtons() { - return [{ text: 'Full report', href: this.conflictsDocsPath, target: '_blank' }]; + return [ + { + text: 'Click me', + onClick() { + console.log('Hello world'); + }, + }, + { text: 'Full report', href: this.conflictsDocsPath, target: '_blank' }, + ]; }, }, methods: { diff --git a/app/models/repository.rb b/app/models/repository.rb index c7054b89255..47482f04bca 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -732,9 +732,7 @@ class Repository end def tags_sorted_by(value, pagination_params = nil) - return raw_repository.tags(sort_by: value, pagination_params: pagination_params) if Feature.enabled?(:tags_finder_gitaly, project, default_enabled: :yaml) - - tags_ruby_sort(value) + raw_repository.tags(sort_by: value, pagination_params: pagination_params) end # Params: @@ -1170,34 +1168,6 @@ class Repository @request_store_cache ||= Gitlab::RepositoryCache.new(self, backend: Gitlab::SafeRequestStore) end - # Deprecated: https://gitlab.com/gitlab-org/gitlab/-/issues/339741 - def tags_ruby_sort(value) - case value - when 'name_asc' - VersionSorter.sort(tags) { |tag| tag.name } - when 'name_desc' - VersionSorter.rsort(tags) { |tag| tag.name } - when 'updated_desc' - tags_sorted_by_committed_date.reverse - when 'updated_asc' - tags_sorted_by_committed_date - else - tags - end - end - - # Deprecated: https://gitlab.com/gitlab-org/gitlab/-/issues/339741 - def tags_sorted_by_committed_date - # Annotated tags can point to any object (e.g. a blob), but generally - # tags point to a commit. If we don't have a commit, then just default - # to putting the tag at the end of the list. - default = Time.current - - tags.sort_by do |tag| - tag.dereferenced_target&.committed_date || default - end - end - def repository_event(event, tags = {}) Gitlab::Metrics.add_event(event, tags) end diff --git a/app/presenters/blob_presenter.rb b/app/presenters/blob_presenter.rb index 866b19db145..5835a77d0b9 100644 --- a/app/presenters/blob_presenter.rb +++ b/app/presenters/blob_presenter.rb @@ -137,7 +137,7 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated @transformed_blob ||= blob.data rescue IpynbDiff::InvalidNotebookError => e - Gitlab::ErrorTracking.track_exception(e, issue_url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/344676') + Gitlab::ErrorTracking.log_exception(e) blob.data end end diff --git a/app/services/packages/npm/create_package_service.rb b/app/services/packages/npm/create_package_service.rb index 959e105694f..6945c94e0bb 100644 --- a/app/services/packages/npm/create_package_service.rb +++ b/app/services/packages/npm/create_package_service.rb @@ -21,7 +21,7 @@ module Packages ::Packages::CreateDependencyService.new(package, package_dependencies).execute ::Packages::Npm::CreateTagService.new(package, dist_tag).execute - if Feature.enabled?(:packages_npm_abbreviated_metadata, project) + if Feature.enabled?(:packages_npm_abbreviated_metadata, project, default_enabled: :yaml) package.create_npm_metadatum!(package_json: version_data) end diff --git a/app/views/projects/issues/_service_desk_info_content.html.haml b/app/views/projects/issues/_service_desk_info_content.html.haml index 8fa44c0841f..f0ec68ba54b 100644 --- a/app/views/projects/issues/_service_desk_info_content.html.haml +++ b/app/views/projects/issues/_service_desk_info_content.html.haml @@ -1,6 +1,7 @@ - service_desk_enabled = @project.service_desk_enabled? - can_edit_project_settings = can?(current_user, :admin_project, @project) +- can_admin_issues = can?(current_user, :admin_issue, @project) - title_text = s_("ServiceDesk|Use Service Desk to connect with your users and offer customer support through email right inside GitLab") .non-empty-state.media @@ -10,7 +11,7 @@ .gl-mt-3.gl-ml-3 %h5= title_text - - if can_edit_project_settings && service_desk_enabled + - if can_admin_issues && service_desk_enabled %p = s_("ServiceDesk|Your users can send emails to this address:") %code= @project.service_desk_address |