diff --git a/ee/app/views/shared/credentials_inventory/_project_access_tokens.html.haml b/ee/app/views/shared/credentials_inventory/_project_access_tokens.html.haml index aca0fbb179c1b0ce930cef50cd17a8357382f50a..f7fb60314001e4fbc6b352887b9ac0a6b4bda418 100644 --- a/ee/app/views/shared/credentials_inventory/_project_access_tokens.html.haml +++ b/ee/app/views/shared/credentials_inventory/_project_access_tokens.html.haml @@ -1,12 +1,11 @@ .table-holder .thead-white.gl-white-space-nowrap.gl-responsive-table-row.table-row-header{ role: 'row' } .table-section.section-10{ role: 'rowheader' }= _('Name') - .table-section.section-10{ role: 'rowheader' }= _('Scopes') + .table-section.section-15{ role: 'rowheader' }= _('Scopes') .table-section.section-15{ role: 'rowheader' }= _('Project') .table-section.section-20{ role: 'rowheader' }= _('Creator') - .table-section.section-15{ role: 'rowheader' }= _('Created on') + .table-section.section-10{ role: 'rowheader' }= _('Created on') .table-section.section-10{ role: 'rowheader' }= _('Last used') .table-section.section-10{ role: 'rowheader' }= _('Expires') - .table-section.section-10{ role: 'rowheader' }= _('Revoke') = render partial: 'shared/credentials_inventory/project_access_tokens/project_access_token', collection: credentials diff --git a/ee/app/views/shared/credentials_inventory/project_access_tokens/_project_access_token.html.haml b/ee/app/views/shared/credentials_inventory/project_access_tokens/_project_access_token.html.haml index e6653744340ca9240397d0f611c2c1e11d575f01..36ad7c5b509845083fac2acf3c9f42fdff5bd37d 100644 --- a/ee/app/views/shared/credentials_inventory/project_access_tokens/_project_access_token.html.haml +++ b/ee/app/views/shared/credentials_inventory/project_access_tokens/_project_access_token.html.haml @@ -4,9 +4,9 @@ .table-section.section-10 .table-mobile-header{ role: 'rowheader' } = _('Name') - .table-mobile-content + .table-mobile-content.gl-white-space-normal.gl-word-break-word.gl-pr-5 = project_access_token.name - .table-section.section-10 + .table-section.section-15 .table-mobile-header{ role: 'rowheader' } = _('Scopes') .table-mobile-content.gl-white-space-normal @@ -14,30 +14,29 @@ .table-section.section-15 .table-mobile-header{ role: 'rowheader' } = _('Project') - .table-mobile-content - = link_to project.name, project.full_path + .table-mobile-content.gl-white-space-normal.gl-word-break-word.gl-pr-5 + = link_to project.name, project_url(project) .table-section.section-20 .table-mobile-header{ role: 'rowheader' } = _('Creator') .table-mobile-content = render 'shared/credentials_inventory/users/user_detail', user: project_access_token.user.created_by - .table-section.section-15 + .table-section.section-10 .table-mobile-header{ role: 'rowheader' } = _('Created on') .table-mobile-content - = project_access_token.created_at + = project_access_token.created_at&.to_date .table-section.section-10 .table-mobile-header{ role: 'rowheader' } = _('Last used') .table-mobile-content - = project_access_token.last_used_at || _('Never') + = project_access_token.last_used_at&.to_date || _('Never') .table-section.section-10 .table-mobile-header{ role: 'rowheader' } = _('Expires') .table-mobile-content - = project_access_token.expires_at || _('Never') + = project_access_token.expires_at&.to_date || _('Never') .table-section.section-10 .table-mobile-header{ role: 'rowheader' } - = _('Revoke') .table-mobile-content = link_to _('Revoke'), admin_credential_project_revoke_path(credential_id: project_access_token, project_id: project.id), method: :put, data: { confirm: _('Are you sure you want to revoke this project access token? This action cannot be undone.') }, class: 'btn btn-danger btn-danger-secondary btn-md btn-secondary gl-button' diff --git a/ee/spec/views/shared/credentials_inventory/project_access_tokens/_project_access_token.html.haml_spec.rb b/ee/spec/views/shared/credentials_inventory/project_access_tokens/_project_access_token.html.haml_spec.rb index 4322134e0feddf303570846968c2ee898468496f..f5aa57c0a7a45fd642e2d9256c07793b65a0e5d1 100644 --- a/ee/spec/views/shared/credentials_inventory/project_access_tokens/_project_access_token.html.haml_spec.rb +++ b/ee/spec/views/shared/credentials_inventory/project_access_tokens/_project_access_token.html.haml_spec.rb @@ -32,7 +32,7 @@ end it 'shows the created date' do - expect(rendered).to have_text(project_access_token.created_at.to_s) + expect(rendered).to have_text(project_access_token.created_at.to_date) end context 'last used date' do @@ -48,7 +48,7 @@ let_it_be(:project_access_token) { create(:personal_access_token, user: project_member.user, scopes: %w(read_repository api), last_used_at: DateTime.new(2001, 2, 3, 4, 5, 6)) } it 'displays the time last used' do - expect(rendered).to have_text('2001-02-03 04:05:06 UTC') + expect(rendered).to have_text('2001-02-03') end end end @@ -66,7 +66,7 @@ let_it_be(:project_access_token) { create(:personal_access_token, user: project_member.user, scopes: %w(read_repository api), last_used_at: DateTime.new(2004, 2, 3, 4, 5, 6)) } it 'displays the expiration date' do - expect(rendered).to have_text('2004-02-03 04:05:06 UTC') + expect(rendered).to have_text('2004-02-03') end end end