From ac90bb736bbb26204a22a36ad847227ad4205791 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Loi=CC=88c=20Delmaire?=
Date: Fri, 15 Nov 2024 12:21:35 +0100
Subject: [PATCH] Remove token ids from dashboard view
Not really important, confuse users, so flip it
---
app/views/shared/tokens/_detail.html.erb | 11 ++++-------
app/views/shared/tokens/_detail_short.html.erb | 8 ++------
.../authorization_request_show_spec.rb | 2 --
3 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/app/views/shared/tokens/_detail.html.erb b/app/views/shared/tokens/_detail.html.erb
index 1ffafdff0..516de4c52 100644
--- a/app/views/shared/tokens/_detail.html.erb
+++ b/app/views/shared/tokens/_detail.html.erb
@@ -3,25 +3,22 @@
">
<%= t(".status.label.#{token.status}") %>
-
- idenfitiant: <%= token.id %>
-
| <%= t('.call_for_a_week', count: token.access_logs.since(7.days.ago).count) %>
<%= link_to t('.links.stats'), token_stats_path(token), id: dom_id(token, :stats_link), class: %w(fr-link fr-link--sm fr-icon-arrow-right-line fr-link--icon-right pull-right) %>
- <%= t(".remaining_time.#{token.status}",
+ <%= t(".remaining_time.#{token.status}",
remaining_time: distance_of_time_in_words(Time.zone.now, token.end_timestamp)
).html_safe %>
+
<%= friendly_date_from_timestamp(token.created_at)%>
<%= friendly_date_from_timestamp(token.end_timestamp)%>
diff --git a/app/views/shared/tokens/_detail_short.html.erb b/app/views/shared/tokens/_detail_short.html.erb
index d3fc72657..fd5592461 100644
--- a/app/views/shared/tokens/_detail_short.html.erb
+++ b/app/views/shared/tokens/_detail_short.html.erb
@@ -9,16 +9,12 @@
">
<%= t(".status.label.#{token.status}") %>
-
+
- | <%= t(".expiration_date",
+ | <%= t(".expiration_date",
expiration_date: friendly_date_from_timestamp(token.end_timestamp)
).html_safe %>
-
- ID: <%= token.id %>
-
<% end %>
diff --git a/spec/features/api_particulier/authorization_request_show_spec.rb b/spec/features/api_particulier/authorization_request_show_spec.rb
index f07a1a484..cd7416f4e 100644
--- a/spec/features/api_particulier/authorization_request_show_spec.rb
+++ b/spec/features/api_particulier/authorization_request_show_spec.rb
@@ -124,13 +124,11 @@
expect(page).to have_content('Jeton principal :')
expect(page).to have_content('Actif')
- expect(page).to have_content(token.id)
expect(page).to have_content('4 appels les 7 derniers jours')
expect(page).to have_content(distance_of_time_in_words(Time.zone.now, token.exp))
expect(page).to have_css('#' << dom_id(token, :stats_link))
- expect(page).to have_content(banned_token.id)
expect(page).to have_content('Banni')
expect(page).to have_content(distance_of_time_in_words(Time.zone.now, banned_token.blacklisted_at))
expect(page).to have_content('0 appel les 7 derniers jours')