diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-17 09:08:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-17 09:08:24 +0000 |
commit | 728a207ea6a99a4bddc16dbbe82294d3fdb60fe4 (patch) | |
tree | 4bc3b6a859681de3bbeabd7bf2ec5ffd756f3a0a /app | |
parent | ea20020f71c7226d57b6449b1d9b6c6f1298223e (diff) | |
download | gitlab-ce-728a207ea6a99a4bddc16dbbe82294d3fdb60fe4.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
13 files changed, 75 insertions, 35 deletions
diff --git a/app/assets/javascripts/boards/components/board.js b/app/assets/javascripts/boards/components/board.js index 8ebdfede8f7..a6deb656b37 100644 --- a/app/assets/javascripts/boards/components/board.js +++ b/app/assets/javascripts/boards/components/board.js @@ -3,7 +3,7 @@ import Sortable from 'sortablejs'; import Vue from 'vue'; import { GlButtonGroup, GlButton, GlTooltip } from '@gitlab/ui'; import isWipLimitsOn from 'ee_else_ce/boards/mixins/is_wip_limits'; -import { n__, s__ } from '~/locale'; +import { s__, __, sprintf } from '~/locale'; import Icon from '~/vue_shared/components/icon.vue'; import Tooltip from '~/vue_shared/directives/tooltip'; import AccessorUtilities from '../../lib/utils/accessor'; @@ -67,10 +67,13 @@ export default Vue.extend({ !this.disabled && this.list.type !== ListType.closed && this.list.type !== ListType.blank ); }, - counterTooltip() { + issuesTooltip() { const { issuesSize } = this.list; - return `${n__('%d issue', '%d issues', issuesSize)}`; + + return sprintf(__('%{issuesSize} issues'), { issuesSize }); }, + // Only needed to make karma pass. + weightCountToolTip() {}, // eslint-disable-line vue/return-in-computed-property caretTooltip() { return this.list.isExpanded ? s__('Boards|Collapse') : s__('Boards|Expand'); }, diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue index 1dd4c468ae6..49a5d4657af 100644 --- a/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue @@ -82,7 +82,7 @@ export default { }; </script> <template> - <form name="service-credentials-form" @submit.prevent="createRole({ roleArn, externalId })"> + <form name="service-credentials-form"> <h2>{{ s__('ClusterIntegration|Authenticate with Amazon Web Services') }}</h2> <p> {{ @@ -136,6 +136,7 @@ export default { :disabled="submitButtonDisabled" :loading="isCreatingRole" :label="submitButtonLabel" + @click.prevent="createRole({ roleArn, externalId })" /> </form> </template> diff --git a/app/assets/javascripts/error_tracking/components/error_details.vue b/app/assets/javascripts/error_tracking/components/error_details.vue index 3d3447012db..51a1ae50467 100644 --- a/app/assets/javascripts/error_tracking/components/error_details.vue +++ b/app/assets/javascripts/error_tracking/components/error_details.vue @@ -235,18 +235,23 @@ export default { >{{ error.tags.logger }} </gl-badge> </template> - - <h3>{{ __('Error details') }}</h3> <ul> + <li v-if="GQLerror.gitlabCommit"> + <strong class="bold">{{ __('GitLab commit') }}:</strong> + <gl-link :href="GQLerror.gitlabCommitPath"> + <span>{{ GQLerror.gitlabCommit.substr(0, 10) }}</span> + </gl-link> + </li> <li v-if="error.gitlab_issue"> - <span class="bold">{{ __('GitLab Issue') }}:</span> + <strong class="bold">{{ __('GitLab Issue') }}:</strong> <gl-link :href="error.gitlab_issue"> <span>{{ error.gitlab_issue }}</span> </gl-link> </li> <li> - <span class="bold">{{ __('Sentry event') }}:</span> + <strong class="bold">{{ __('Sentry event') }}:</strong> <gl-link + class="d-inline-flex align-items-center" v-track-event="trackClickErrorLinkToSentryOptions(GQLerror.externalUrl)" :href="GQLerror.externalUrl" target="_blank" @@ -256,25 +261,25 @@ export default { </gl-link> </li> <li v-if="GQLerror.firstReleaseShortVersion"> - <span class="bold">{{ __('First seen') }}:</span> + <strong class="bold">{{ __('First seen') }}:</strong> {{ formatDate(GQLerror.firstSeen) }} <gl-link :href="firstReleaseLink" target="_blank"> - <span>{{ __('Release') }}: {{ GQLerror.firstReleaseShortVersion }}</span> + <span>{{ __('Release') }}: {{ GQLerror.firstReleaseShortVersion.substr(0, 10) }}</span> </gl-link> </li> <li v-if="GQLerror.lastReleaseShortVersion"> - <span class="bold">{{ __('Last seen') }}:</span> + <strong class="bold">{{ __('Last seen') }}:</strong> {{ formatDate(GQLerror.lastSeen) }} <gl-link :href="lastReleaseLink" target="_blank"> - <span>{{ __('Release') }}: {{ GQLerror.lastReleaseShortVersion }}</span> + <span>{{ __('Release') }}: {{ GQLerror.lastReleaseShortVersion.substr(0, 10) }}</span> </gl-link> </li> <li> - <span class="bold">{{ __('Events') }}:</span> + <strong class="bold">{{ __('Events') }}:</strong> <span>{{ GQLerror.count }}</span> </li> <li> - <span class="bold">{{ __('Users') }}:</span> + <strong class="bold">{{ __('Users') }}:</strong> <span>{{ GQLerror.userCount }}</span> </li> </ul> diff --git a/app/assets/javascripts/error_tracking/queries/details.query.graphql b/app/assets/javascripts/error_tracking/queries/details.query.graphql index f65bdb9b968..625ce3030d9 100644 --- a/app/assets/javascripts/error_tracking/queries/details.query.graphql +++ b/app/assets/javascripts/error_tracking/queries/details.query.graphql @@ -13,6 +13,8 @@ query errorDetails($fullPath: ID!, $errorId: ID!) { externalUrl firstReleaseShortVersion lastReleaseShortVersion + gitlabCommit + gitlabCommitPath } } } diff --git a/app/assets/javascripts/ide/components/commit_sidebar/form.vue b/app/assets/javascripts/ide/components/commit_sidebar/form.vue index 002c00599bb..9d5473a1201 100644 --- a/app/assets/javascripts/ide/components/commit_sidebar/form.vue +++ b/app/assets/javascripts/ide/components/commit_sidebar/form.vue @@ -60,6 +60,11 @@ export default { ); } }, + + lastCommitMsg() { + this.isCompact = + this.currentActivityView !== activityBarViews.commit && this.lastCommitMsg === ''; + }, }, methods: { ...mapActions(['updateActivityBarView']), diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 5fc7f5c84f0..c0ba87bf3ed 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -60,7 +60,7 @@ class RegistrationsController < Devise::RegistrationsController end def update_registration - user_params = params.require(:user).permit(:name, :role, :setup_for_company) + user_params = params.require(:user).permit(:role, :setup_for_company) result = ::Users::SignupService.new(current_user, user_params).execute if result[:status] == :success @@ -152,13 +152,7 @@ class RegistrationsController < Devise::RegistrationsController end def sign_up_params - clean_params = params.require(:user).permit(:username, :email, :email_confirmation, :name, :password) - - if experiment_enabled?(:signup_flow) - clean_params[:name] = clean_params[:username] - end - - clean_params + params.require(:user).permit(:username, :email, :email_confirmation, :name, :first_name, :last_name, :password) end def resource_name diff --git a/app/models/user.rb b/app/models/user.rb index 4bba4d47b8f..df54f358ffa 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -164,9 +164,9 @@ class User < ApplicationRecord # Validations # # Note: devise :validatable above adds validations for :email and :password - validates :name, presence: true, length: { maximum: 128 } - validates :first_name, length: { maximum: 255 } - validates :last_name, length: { maximum: 255 } + validates :name, presence: true, length: { maximum: 255 } + validates :first_name, length: { maximum: 127 } + validates :last_name, length: { maximum: 127 } validates :email, confirmation: true validates :notification_email, presence: true validates :notification_email, devise_email: true, if: ->(user) { user.notification_email != user.email } diff --git a/app/presenters/project_presenter.rb b/app/presenters/project_presenter.rb index 45f4668112b..8c24d07675a 100644 --- a/app/presenters/project_presenter.rb +++ b/app/presenters/project_presenter.rb @@ -24,7 +24,8 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated commits_anchor_data, branches_anchor_data, tags_anchor_data, - files_anchor_data + files_anchor_data, + releases_anchor_data ].compact.select(&:is_link) end @@ -153,6 +154,22 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated empty_repo? ? nil : project_tree_path(project)) end + def releases_anchor_data + return unless can?(current_user, :read_release, project) + + releases_count = project.releases.count + return if releases_count < 1 + + AnchorData.new(true, + statistic_icon('rocket') + + n_('%{strong_start}%{release_count}%{strong_end} Release', '%{strong_start}%{release_count}%{strong_end} Releases', releases_count).html_safe % { + release_count: number_with_delimiter(releases_count), + strong_start: '<strong class="project-stat-value">'.html_safe, + strong_end: '</strong>'.html_safe + }, + project_releases_path(project)) + end + def commits_anchor_data AnchorData.new(true, statistic_icon('commit') + diff --git a/app/services/users/build_service.rb b/app/services/users/build_service.rb index ea4d11e728e..d18f20bc1db 100644 --- a/app/services/users/build_service.rb +++ b/app/services/users/build_service.rb @@ -86,6 +86,8 @@ module Users :email_confirmation, :password_automatically_set, :name, + :first_name, + :last_name, :password, :username ] @@ -107,6 +109,12 @@ module Users if user_params[:skip_confirmation].nil? user_params[:skip_confirmation] = skip_user_confirmation_email_from_setting end + + fallback_name = "#{user_params[:first_name]} #{user_params[:last_name]}" + + if user_params[:name].blank? && fallback_name.present? + user_params = user_params.merge(name: fallback_name) + end end if user_default_internal_regex_enabled? && !user_params.key?(:external) diff --git a/app/views/devise/shared/_experimental_separate_sign_up_flow_box.html.haml b/app/views/devise/shared/_experimental_separate_sign_up_flow_box.html.haml index e3142ff96a1..4832861445b 100644 --- a/app/views/devise/shared/_experimental_separate_sign_up_flow_box.html.haml +++ b/app/views/devise/shared/_experimental_separate_sign_up_flow_box.html.haml @@ -1,4 +1,5 @@ - content_for(:page_title, _('Register for GitLab')) +- max_first_name_length = max_last_name_length = 127 - max_username_length = 255 .signup-box.p-3.mb-2 .signup-body @@ -7,9 +8,16 @@ = render "devise/shared/error_messages", resource: resource - if Feature.enabled?(:invisible_captcha) = invisible_captcha + .name.form-row + .col.form-group + = f.label :first_name, _('First name'), for: 'new_user_first_name', class: 'label-bold' + = f.text_field :first_name, class: 'form-control top js-block-emoji js-validate-length', :data => { :max_length => max_first_name_length, :max_length_message => _("First Name is too long (maximum is %{max_length} characters).") % { max_length: max_first_name_length }, :qa_selector => 'new_user_firstname_field' }, required: true, title: _("This field is required.") + .col.form-group + = f.label :last_name, _('Last name'), for: 'new_user_last_name', class: 'label-bold' + = f.text_field :last_name, class: "form-control top js-block-emoji js-validate-length", :data => { :max_length => max_last_name_length, :max_length_message => _("Last Name is too long (maximum is %{max_length} characters).") % { max_length: max_last_name_length }, :qa_selector => 'new_user_lastname_field' }, required: true, title: _("This field is required.") .username.form-group = f.label :username, class: 'label-bold' - = f.text_field :username, class: "form-control middle js-block-emoji js-validate-length js-validate-username", :data => { :max_length => max_username_length, :max_length_message => s_("SignUp|Username is too long (maximum is %{max_length} characters).") % { max_length: max_username_length }, :qa_selector => 'new_user_username_field' }, pattern: Gitlab::PathRegex::NAMESPACE_FORMAT_REGEX_JS, required: true, title: _("Please create a username with only alphanumeric characters.") + = f.text_field :username, class: "form-control middle js-block-emoji js-validate-length js-validate-username", :data => { :max_length => max_username_length, :max_length_message => _("Username is too long (maximum is %{max_length} characters).") % { max_length: max_username_length }, :qa_selector => 'new_user_username_field' }, pattern: Gitlab::PathRegex::NAMESPACE_FORMAT_REGEX_JS, required: true, title: _("Please create a username with only alphanumeric characters.") %p.validation-error.gl-field-error-ignore.field-validation.mt-1.hide.cred= _('Username is already taken.') %p.validation-success.gl-field-error-ignore.field-validation.mt-1.hide.cgreen= _('Username is available.') %p.validation-pending.gl-field-error-ignore.field-validation.mt-1.hide= _('Checking username availability...') diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml index 2cd77af6877..7c5b85c903c 100644 --- a/app/views/devise/shared/_signup_box.html.haml +++ b/app/views/devise/shared/_signup_box.html.haml @@ -1,4 +1,4 @@ -- max_name_length = 128 +- max_name_length = 255 - max_username_length = 255 #register-pane.tab-pane.login-box{ role: 'tabpanel' } .login-body diff --git a/app/views/registrations/welcome.html.haml b/app/views/registrations/welcome.html.haml index 7b92f5070df..bc8d7ed10ef 100644 --- a/app/views/registrations/welcome.html.haml +++ b/app/views/registrations/welcome.html.haml @@ -1,5 +1,4 @@ -- content_for(:page_title, _('Welcome to GitLab @%{username}!') % { username: current_user.username }) -- max_name_length = 128 +- content_for(:page_title, _('Welcome to GitLab %{name}!') % { name: current_user.name }) .text-center.mb-3 = _('In order to tailor your experience with GitLab we<br>would like to know a bit more about you.').html_safe .signup-box.p-3.mb-2 @@ -7,9 +6,6 @@ = form_for(current_user, url: users_sign_up_update_registration_path, html: { class: 'new_new_user gl-show-field-errors', 'aria-live' => 'assertive' }) do |f| .devise-errors.mt-0 = render 'devise/shared/error_messages', resource: current_user - .name.form-group - = f.label :name, _('Full name'), class: 'label-bold' - = f.text_field :name, class: 'form-control top js-block-emoji js-validate-length', :data => { :max_length => max_name_length, :max_length_message => s_('Name is too long (maximum is %{max_length} characters).') % { max_length: max_name_length }, :qa_selector => 'new_user_name_field' }, required: true, title: _('This field is required.') .form-group = f.label :role, _('Role'), class: 'label-bold' = f.select :role, ::User.roles.keys.map { |role| [role.titleize, role] }, {}, class: 'form-control' diff --git a/app/views/shared/boards/components/_board.html.haml b/app/views/shared/boards/components/_board.html.haml index eb9b7f6c48a..a62c385d711 100644 --- a/app/views/shared/boards/components/_board.html.haml +++ b/app/views/shared/boards/components/_board.html.haml @@ -42,9 +42,10 @@ %button.board-delete.no-drag.p-0.border-0.has-tooltip.float-right{ type: "button", title: _("Delete list"), ":class": "{ 'd-none': !list.isExpanded }", "aria-label" => _("Delete list"), data: { placement: "bottom" }, "@click.stop" => "deleteBoard" } = icon("trash") - .issue-count-badge.pr-0.no-drag.text-secondary{ "v-if" => "showBoardListAndBoardInfo", ":title": "counterTooltip", "v-tooltip": true, data: { placement: "top" } } + .issue-count-badge.pr-0.no-drag.text-secondary{ "v-if" => "showBoardListAndBoardInfo" } %span.d-inline-flex - %span.issue-count-badge-count + %gl-tooltip{ ":target" => "() => $refs.issueCount", ":title" => "issuesTooltip" } + %span.issue-count-badge-count{ "ref" => "issueCount" } %icon.mr-1{ name: "issues" } %issue-count{ ":maxIssueCount" => "list.maxIssueCount", ":issuesSize" => "list.issuesSize" } |