From a0a81eee1c9a376e6aacbacc83d53cd19d3dfb3c Mon Sep 17 00:00:00 2001
From: Giga Chubinidze <gchubinidze@unisens.ge>
Date: Thu, 26 Jan 2023 17:01:54 +0400
Subject: [PATCH] My profile page updates of user data [SCI-7627]

---
 app/assets/stylesheets/settings/users.scss         | 14 ++++++++++++--
 app/views/users/registrations/edit.html.erb        |  2 +-
 .../registrations/edit_partials/_2fa.html.erb      |  5 ++++-
 .../registrations/edit_partials/_email.html.erb    |  2 +-
 .../edit_partials/_external_id.html.erb            |  2 +-
 .../edit_partials/_full_name.html.erb              |  2 +-
 .../registrations/edit_partials/_initials.html.erb |  2 +-
 .../registrations/edit_partials/_password.html.erb |  2 +-
 config/locales/en.yml                              |  2 +-
 9 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/app/assets/stylesheets/settings/users.scss b/app/assets/stylesheets/settings/users.scss
index 58bf693da..f1984281b 100644
--- a/app/assets/stylesheets/settings/users.scss
+++ b/app/assets/stylesheets/settings/users.scss
@@ -22,12 +22,10 @@
 
 
   .two-factor-container {
-    border: $border-default;
     column-gap: 1em;
     display: grid;
     grid-template-columns:  auto fit-content;
     margin: 1em 0;
-    padding: 1em;
     row-gap: .5em;
 
 
@@ -39,6 +37,13 @@
       .enabled {
         @include font-button;
         color: $brand-success;
+        position: relative;
+        left: 10px;
+
+        .fa-check-circle {
+          position: relative;
+          right: 2px;
+        }
       }
     }
 
@@ -46,6 +51,11 @@
       align-self: end;
     }
   }
+
+  .two-factor-auth-button {
+    padding-top: 20px;
+    padding-bottom: 30px;
+  }
 }
 
 
diff --git a/app/views/users/registrations/edit.html.erb b/app/views/users/registrations/edit.html.erb
index 94c500ae7..f7eacf745 100644
--- a/app/views/users/registrations/edit.html.erb
+++ b/app/views/users/registrations/edit.html.erb
@@ -43,7 +43,7 @@
     <div class="col-md-12">
       <div class="row user-statistics">
         <div class="col-md-12">
-          <h2><%=t "users.statistics.title" %></h2>
+          <h3><%=t "users.statistics.title" %></h3>
           <ul class="list-inline">
             <li class="label label-primary">
               <h2><%= @user.statistics[:number_of_teams]%></h2>
diff --git a/app/views/users/registrations/edit_partials/_2fa.html.erb b/app/views/users/registrations/edit_partials/_2fa.html.erb
index b9d9480e5..5d083d512 100644
--- a/app/views/users/registrations/edit_partials/_2fa.html.erb
+++ b/app/views/users/registrations/edit_partials/_2fa.html.erb
@@ -3,7 +3,7 @@
     <b><%= t("users.registrations.edit.2fa_title") %></b>
     <% if current_user.two_factor_auth_enabled? %>
       <span class="enabled">
-        <i class="fas fa-shield-alt"></i>
+        <i class="fas fa-check-circle"></i>
         <%= t("users.registrations.edit.2fa_enabled") %>
       </span>
     <% end %>
@@ -11,6 +11,9 @@
   <div class="description">
     <%= t("users.registrations.edit.2fa_description") %>
   </div>
+</div>
+
+<div class="two-factor-auth-button">
   <% if current_user.two_factor_auth_enabled? %>
     <button class="btn btn-secondary" id="twoFactorAuthenticationDisable"><%= t("users.registrations.edit.2fa_button_disable") %></button>
   <% else %>
diff --git a/app/views/users/registrations/edit_partials/_email.html.erb b/app/views/users/registrations/edit_partials/_email.html.erb
index 7e7323b30..6f5bfd660 100644
--- a/app/views/users/registrations/edit_partials/_email.html.erb
+++ b/app/views/users/registrations/edit_partials/_email.html.erb
@@ -5,7 +5,7 @@
              html: { method: :put, "data-for" => "email", class: 'settings-page-email', id: 'user-email-field' }) do |f| %>
   <div data-part="view">
     <div class="form-group">
-      <%= f.label t("users.registrations.edit.email_label") %>
+      <h3><%= t("users.registrations.edit.email_label") %></h3>
       <div class="user-attribute">
         <%= @user.email %>
         <a href="#" class="btn btn-default" data-action="edit"><%= t("general.change") %></a>
diff --git a/app/views/users/registrations/edit_partials/_external_id.html.erb b/app/views/users/registrations/edit_partials/_external_id.html.erb
index 24b3e6c07..ce972f532 100644
--- a/app/views/users/registrations/edit_partials/_external_id.html.erb
+++ b/app/views/users/registrations/edit_partials/_external_id.html.erb
@@ -1,5 +1,5 @@
 <span class="settings-external-id user-settings-block">
-  <label><%= t("users.registrations.edit.external_id_label") %></label>
+  <h3><%= t("users.registrations.edit.external_id_label") %></h3>
   <%= render partial: "shared/inline_editing",
              locals: {
                initial_value: @user.external_id,
diff --git a/app/views/users/registrations/edit_partials/_full_name.html.erb b/app/views/users/registrations/edit_partials/_full_name.html.erb
index e69f58e54..783f941f6 100644
--- a/app/views/users/registrations/edit_partials/_full_name.html.erb
+++ b/app/views/users/registrations/edit_partials/_full_name.html.erb
@@ -1,5 +1,5 @@
 <span class="settings-page-full-name user-settings-block">
-  <label><%= t("users.registrations.edit.name_label") %></label>
+  <h3><%= t("users.registrations.edit.name_label") %></h3>
   <%= render partial: "shared/inline_editing",
              locals: {
                initial_value: @user.full_name,
diff --git a/app/views/users/registrations/edit_partials/_initials.html.erb b/app/views/users/registrations/edit_partials/_initials.html.erb
index d938d8d00..b8434b60a 100644
--- a/app/views/users/registrations/edit_partials/_initials.html.erb
+++ b/app/views/users/registrations/edit_partials/_initials.html.erb
@@ -1,5 +1,5 @@
 <span class="settings-page-initials user-settings-block">
-  <label><%= t("users.registrations.edit.initials_label") %></label>
+  <h3><%= t("users.registrations.edit.initials_label") %></h3>
   <%= render partial: "shared/inline_editing",
              locals: {
                initial_value: @user.initials,
diff --git a/app/views/users/registrations/edit_partials/_password.html.erb b/app/views/users/registrations/edit_partials/_password.html.erb
index e99b6fa47..fe420838c 100644
--- a/app/views/users/registrations/edit_partials/_password.html.erb
+++ b/app/views/users/registrations/edit_partials/_password.html.erb
@@ -6,7 +6,7 @@
   <%= hidden_field_tag "user[change_password]", "true" %>
   <div data-part="view">
     <div class="form-group">
-      <%= f.label t("users.registrations.edit.password_label") %>
+      <h3><%= t("users.registrations.edit.password_label") %></h3>
       <div class="user-attribute">
         ••••••••••••
         <a href="#" class="btn btn-default" data-action="edit"><%=t("general.change") %></a>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 74b3377df..93f2264d5 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -2279,7 +2279,7 @@ en:
         email_label: "Email"
         email_title: "Change email"
         new_email_label: "New email"
-        external_id_label: 'External Id'
+        external_id_label: 'External ID'
         external_id_title: 'External Id'
         current_password_label: "Current password"
         password_explanation: "(we need your current password to confirm your changes)"