diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-07 18:09:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-07 18:09:52 +0300 |
commit | e43077ab4742ba5083a01a1e5341db1a1b7a1701 (patch) | |
tree | c33a00fb176caff735243c484bbd594a3b08bb6e /app | |
parent | 211a8c3361ccf4eb92f36edbdcf15c98fcdcc8b7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/blob/components/blob_header_default_actions.vue | 67 | ||||
-rw-r--r-- | app/assets/javascripts/blob/components/constants.js | 5 | ||||
-rw-r--r-- | app/assets/javascripts/pipelines/components/pipelines_table_row.vue | 12 | ||||
-rw-r--r-- | app/controllers/root_controller.rb | 2 | ||||
-rw-r--r-- | app/models/board.rb | 5 | ||||
-rw-r--r-- | app/policies/project_policy.rb | 2 | ||||
-rw-r--r-- | app/services/projects/overwrite_project_service.rb | 2 |
7 files changed, 85 insertions, 10 deletions
diff --git a/app/assets/javascripts/blob/components/blob_header_default_actions.vue b/app/assets/javascripts/blob/components/blob_header_default_actions.vue new file mode 100644 index 00000000000..b0522c08a65 --- /dev/null +++ b/app/assets/javascripts/blob/components/blob_header_default_actions.vue @@ -0,0 +1,67 @@ +<script> +import { GlButton, GlButtonGroup, GlIcon, GlTooltipDirective } from '@gitlab/ui'; +import { BTN_COPY_CONTENTS_TITLE, BTN_DOWNLOAD_TITLE, BTN_RAW_TITLE } from './constants'; + +export default { + components: { + GlIcon, + GlButtonGroup, + GlButton, + }, + directives: { + GlTooltip: GlTooltipDirective, + }, + props: { + blob: { + type: Object, + required: true, + }, + }, + computed: { + rawUrl() { + return this.blob.rawPath; + }, + downloadUrl() { + return `${this.blob.rawPath}?inline=false`; + }, + }, + methods: { + requestCopyContents() { + this.$emit('copy'); + }, + }, + BTN_COPY_CONTENTS_TITLE, + BTN_DOWNLOAD_TITLE, + BTN_RAW_TITLE, +}; +</script> +<template> + <gl-button-group> + <gl-button + v-gl-tooltip.hover + :aria-label="$options.BTN_COPY_CONTENTS_TITLE" + :title="$options.BTN_COPY_CONTENTS_TITLE" + @click="requestCopyContents" + > + <gl-icon name="copy-to-clipboard" :size="14" /> + </gl-button> + <gl-button + v-gl-tooltip.hover + :aria-label="$options.BTN_RAW_TITLE" + :title="$options.BTN_RAW_TITLE" + :href="rawUrl" + target="_blank" + > + <gl-icon name="doc-code" :size="14" /> + </gl-button> + <gl-button + v-gl-tooltip.hover + :aria-label="$options.BTN_DOWNLOAD_TITLE" + :title="$options.BTN_DOWNLOAD_TITLE" + :href="downloadUrl" + target="_blank" + > + <gl-icon name="download" :size="14" /> + </gl-button> + </gl-button-group> +</template> diff --git a/app/assets/javascripts/blob/components/constants.js b/app/assets/javascripts/blob/components/constants.js new file mode 100644 index 00000000000..fe2ac7b7c51 --- /dev/null +++ b/app/assets/javascripts/blob/components/constants.js @@ -0,0 +1,5 @@ +import { __ } from '~/locale'; + +export const BTN_COPY_CONTENTS_TITLE = __('Copy file contents'); +export const BTN_RAW_TITLE = __('Open raw'); +export const BTN_DOWNLOAD_TITLE = __('Download'); diff --git a/app/assets/javascripts/pipelines/components/pipelines_table_row.vue b/app/assets/javascripts/pipelines/components/pipelines_table_row.vue index 33f5199aabe..e25f8ab4790 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_table_row.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_table_row.vue @@ -75,9 +75,9 @@ export default { * This field needs a lot of verification, because of different possible cases: * * 1. person who is an author of a commit might be a GitLab user - * 2. if person who is an author of a commit is a GitLab user he/she can have a GitLab avatar - * 3. If GitLab user does not have avatar he/she might have a Gravatar - * 4. If committer is not a GitLab User he/she can have a Gravatar + * 2. if person who is an author of a commit is a GitLab user, they can have a GitLab avatar + * 3. If GitLab user does not have avatar they might have a Gravatar + * 4. If committer is not a GitLab User they can have a Gravatar * 5. We do not have consistent API object in this case * 6. We should improve API and the code * @@ -93,17 +93,17 @@ export default { // 1. person who is an author of a commit might be a GitLab user if (this.pipeline.commit.author) { // 2. if person who is an author of a commit is a GitLab user - // he/she can have a GitLab avatar + // they can have a GitLab avatar if (this.pipeline.commit.author.avatar_url) { commitAuthorInformation = this.pipeline.commit.author; - // 3. If GitLab user does not have avatar he/she might have a Gravatar + // 3. If GitLab user does not have avatar, they might have a Gravatar } else if (this.pipeline.commit.author_gravatar_url) { commitAuthorInformation = Object.assign({}, this.pipeline.commit.author, { avatar_url: this.pipeline.commit.author_gravatar_url, }); } - // 4. If committer is not a GitLab User he/she can have a Gravatar + // 4. If committer is not a GitLab User, they can have a Gravatar } else { commitAuthorInformation = { avatar_url: this.pipeline.commit.author_gravatar_url, diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb index 5b06f4f4b51..24452f9a188 100644 --- a/app/controllers/root_controller.rb +++ b/app/controllers/root_controller.rb @@ -52,7 +52,7 @@ class RootController < Dashboard::ProjectsController end def redirect_to_home_page_url? - # If user is not signed-in and tries to access root_path - redirect him to landing page + # If user is not signed-in and tries to access root_path - redirect them to landing page # Don't redirect to the default URL to prevent endless redirections return false unless Gitlab::CurrentSettings.home_page_url.present? diff --git a/app/models/board.rb b/app/models/board.rb index 38bbb550044..a57d101b30a 100644 --- a/app/models/board.rb +++ b/app/models/board.rb @@ -11,7 +11,10 @@ class Board < ApplicationRecord validates :group, presence: true, unless: :project scope :with_associations, -> { preload(:destroyable_lists) } - scope :order_by_name_asc, -> { order(arel_table[:name].lower.asc) } + + # Sort by case-insensitive name, then ascending ids. This ensures that we will always + # get the same list/first board no matter how many other boards are named the same + scope :order_by_name_asc, -> { order(arel_table[:name].lower.asc).order(id: :asc) } scope :first_board, -> { where(id: self.order_by_name_asc.limit(1).select(:id)) } def project_needed? diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index ee22a2d84e7..507e227c952 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -370,7 +370,7 @@ class ProjectPolicy < BasePolicy # There's two separate cases when builds_disabled is true: # 1. When internal CI is disabled - builds_disabled && internal_builds_disabled - # - We do not prevent the user from accessing Pipelines to allow him to access external CI + # - We do not prevent the user from accessing Pipelines to allow them to access external CI # 2. When the user is not allowed to access CI - builds_disabled && ~internal_builds_disabled # - We prevent the user from accessing Pipelines rule { (builds_disabled & ~internal_builds_disabled) | repository_disabled }.policy do diff --git a/app/services/projects/overwrite_project_service.rb b/app/services/projects/overwrite_project_service.rb index 64cc1c3aee3..958a00afbb8 100644 --- a/app/services/projects/overwrite_project_service.rb +++ b/app/services/projects/overwrite_project_service.rb @@ -61,7 +61,7 @@ module Projects def add_source_project_to_fork_network(source_project) return unless @project.fork_network - # Because he have moved all references in the fork network from the source_project + # Because they have moved all references in the fork network from the source_project # we won't be able to query the database (only through its cached data), # for its former relationships. That's why we're adding it to the network # as a fork of the target project |