From 9dc93a4519d9d5d7be48ff274127136236a3adb3 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 20 Apr 2021 23:50:22 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-11-stable-ee --- app/views/profiles/keys/_form.html.haml | 7 ++++--- app/views/profiles/keys/_key.html.haml | 16 +++++++--------- app/views/profiles/keys/index.html.haml | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) (limited to 'app/views/profiles/keys') diff --git a/app/views/profiles/keys/_form.html.haml b/app/views/profiles/keys/_form.html.haml index 81a543de7a3..35335f3ef80 100644 --- a/app/views/profiles/keys/_form.html.haml +++ b/app/views/profiles/keys/_form.html.haml @@ -15,13 +15,14 @@ .col.form-group = f.label :expires_at, s_('Profiles|Expires at'), class: 'label-bold' = f.date_field :expires_at, class: "form-control input-lg", min: Date.tomorrow, data: { qa_selector: 'key_expiry_date_field' } + %p.form-text.text-muted{ data: { qa_selector: 'key_expiry_date_field_description' } }= ssh_key_expires_field_description .js-add-ssh-key-validation-warning.hide .bs-callout.bs-callout-warning{ role: 'alert', aria_live: 'assertive' } %strong= _('Oops, are you sure?') - %p= s_("Profiles|This doesn't look like a public SSH key, are you sure you want to add it? It will be publicly visible.") + %p= s_("Profiles|Publicly visible private SSH keys can compromise your system.") - %button.btn.gl-button.btn-success.js-add-ssh-key-validation-confirm-submit= _("Yes, add it") + %button.btn.gl-button.btn-confirm.js-add-ssh-key-validation-confirm-submit= _("Yes, add it") .gl-mt-3 - = f.submit s_('Profiles|Add key'), class: "gl-button btn btn-success js-add-ssh-key-validation-original-submit qa-add-key-button" + = f.submit s_('Profiles|Add key'), class: "gl-button btn btn-confirm js-add-ssh-key-validation-original-submit qa-add-key-button" diff --git a/app/views/profiles/keys/_key.html.haml b/app/views/profiles/keys/_key.html.haml index cc2e2a30052..4eb321050ad 100644 --- a/app/views/profiles/keys/_key.html.haml +++ b/app/views/profiles/keys/_key.html.haml @@ -1,3 +1,5 @@ +- icon_classes = 'settings-list-icon gl-display-none gl-sm-display-block' + %li.key-list-item .gl-display-flex.gl-align-items-flex-start .key-list-item-info.gl-w-full.float-none @@ -5,15 +7,11 @@ = key.title .gl-display-flex.gl-align-items-center.gl-mt-2 - - if key.valid? - - if key.expired? - %span.gl-display-inline-block.has-tooltip{ title: s_('Profiles|Your key has expired') } - = sprite_icon('warning-solid', css_class: 'settings-list-icon gl-display-none gl-sm-display-block') - - else - = sprite_icon('key', css_class: 'settings-list-icon gl-display-none gl-sm-display-block') + - if key.valid? && !key.expired? + = sprite_icon('key', css_class: icon_classes) - else - %span.gl-display-inline-block.has-tooltip{ title: key.errors.full_messages.join(', ') } - = sprite_icon('warning-solid', css_class: 'settings-list-icon gl-display-none gl-sm-display-block') + %span.gl-display-inline-block.has-tooltip{ title: ssh_key_expiration_tooltip(key) } + = sprite_icon('warning-solid', css_class: icon_classes) %span.gl-text-truncate.gl-sm-ml-3 = key.fingerprint @@ -25,7 +23,7 @@ = s_('Profiles|Last used:') = key.last_used_at ? time_ago_with_tooltip(key.last_used_at) : _('Never') %span.expires.gl-mr-3 - = s_('Profiles|Expires:') + = key.expired? ? s_('Profiles|Expired:') : s_('Profiles|Expires:') = key.expires_at ? key.expires_at.to_date : _('Never') %span.key-created-at.gl-display-flex.gl-align-items-center - if key.can_delete? diff --git a/app/views/profiles/keys/index.html.haml b/app/views/profiles/keys/index.html.haml index 80027cdfed0..69b8d2ddafe 100644 --- a/app/views/profiles/keys/index.html.haml +++ b/app/views/profiles/keys/index.html.haml @@ -19,6 +19,6 @@ = render 'form' %hr %h5 - = _('Your SSH keys (%{count})') % { count:@keys.count } + = _('Your SSH keys (%{count})') % { count: @keys.count } .gl-mb-3 = render 'key_table' -- cgit v1.2.1