From 77831a32e809bbe27a11780c91ace83852b4da90 Mon Sep 17 00:00:00 2001
From: Martin Wortschack <mwortschack@gitlab.com>
Date: Thu, 22 Oct 2020 11:43:29 +0000
Subject: [PATCH] Replace fa-refresh with GitLab SVG

- This replaces the fa-refresh
icon with the retry SVG
---
 .haml-lint_todo.yml                           |  2 --
 .../stylesheets/fontawesome_custom.scss       |  4 ----
 app/assets/stylesheets/framework/spinner.scss |  4 ++++
 .../projects/mirrors/_mirror_repos.html.haml  |  2 +-
 .../_remote_mirror_update_button.html.haml    |  8 ++++----
 .../mw-replace-fa-refresh-icons.yml           |  5 +++++
 .../group_members/_sync_button.html.haml      | 20 +++++++++----------
 .../mirrors/_table_pull_row.html.haml         | 10 +++++-----
 .../shared/_mirror_update_button.html.haml    | 18 ++++++++---------
 locale/gitlab.pot                             |  9 +++++++++
 10 files changed, 47 insertions(+), 35 deletions(-)
 create mode 100644 changelogs/unreleased/mw-replace-fa-refresh-icons.yml

diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml
index 78b5f3fb88b2f..6d6a5d2a813dd 100644
--- a/.haml-lint_todo.yml
+++ b/.haml-lint_todo.yml
@@ -329,7 +329,6 @@ linters:
       - 'ee/app/views/errors/kerberos_denied.html.haml'
       - 'ee/app/views/groups/ee/_settings_nav.html.haml'
       - 'ee/app/views/groups/group_members/_ldap_sync.html.haml'
-      - 'ee/app/views/groups/group_members/_sync_button.html.haml'
       - 'ee/app/views/groups/hooks/edit.html.haml'
       - 'ee/app/views/groups/ldap_group_links/index.html.haml'
       - 'ee/app/views/layouts/nav/ee/admin/_new_monitoring_sidebar.html.haml'
@@ -362,7 +361,6 @@ linters:
       - 'ee/app/views/projects/services/gitlab_slack_application/_help.html.haml'
       - 'ee/app/views/projects/services/gitlab_slack_application/_slack_integration_form.html.haml'
       - 'ee/app/views/projects/settings/slacks/edit.html.haml'
-      - 'ee/app/views/shared/_mirror_update_button.html.haml'
       - 'ee/app/views/shared/epic/_search_bar.html.haml'
       - 'ee/app/views/shared/issuable/_approvals.html.haml'
       - 'ee/app/views/shared/issuable/_board_create_list_dropdown.html.haml'
diff --git a/app/assets/stylesheets/fontawesome_custom.scss b/app/assets/stylesheets/fontawesome_custom.scss
index b5fd314698ebb..7b1953be69d75 100644
--- a/app/assets/stylesheets/fontawesome_custom.scss
+++ b/app/assets/stylesheets/fontawesome_custom.scss
@@ -113,10 +113,6 @@
   content: '\f0da';
 }
 
-.fa-refresh::before {
-  content: '\f021';
-}
-
 .fa-chevron-up::before {
   content: '\f077';
 }
diff --git a/app/assets/stylesheets/framework/spinner.scss b/app/assets/stylesheets/framework/spinner.scss
index a74aeb9f22075..581b7c37b5f81 100644
--- a/app/assets/stylesheets/framework/spinner.scss
+++ b/app/assets/stylesheets/framework/spinner.scss
@@ -56,3 +56,7 @@
     vertical-align: text-bottom;
   }
 }
+
+.spin {
+  animation: spinner-rotate 2s infinite linear;
+}
diff --git a/app/views/projects/mirrors/_mirror_repos.html.haml b/app/views/projects/mirrors/_mirror_repos.html.haml
index ba41243389b36..5b074ff8a28a1 100644
--- a/app/views/projects/mirrors/_mirror_repos.html.haml
+++ b/app/views/projects/mirrors/_mirror_repos.html.haml
@@ -74,4 +74,4 @@
                       - if mirror.ssh_key_auth?
                         = clipboard_button(text: mirror.ssh_public_key, class: 'gl-button btn btn-default', title: _('Copy SSH public key'), qa_selector: 'copy_public_key_button')
                       = render 'shared/remote_mirror_update_button', remote_mirror: mirror
-                    %button.js-delete-mirror.qa-delete-mirror.rspec-delete-mirror.btn.gl-button.btn-danger{ type: 'button', data: { mirror_id: mirror.id, toggle: 'tooltip', container: 'body' }, title: _('Remove') }= sprite_icon('remove')
+                    %button.js-delete-mirror.qa-delete-mirror.rspec-delete-mirror.btn.btn-icon.gl-button.btn-danger{ type: 'button', data: { mirror_id: mirror.id, toggle: 'tooltip', container: 'body' }, title: _('Remove') }= sprite_icon('remove')
diff --git a/app/views/shared/_remote_mirror_update_button.html.haml b/app/views/shared/_remote_mirror_update_button.html.haml
index 54bd4ba04a091..70b72f74ab39e 100644
--- a/app/views/shared/_remote_mirror_update_button.html.haml
+++ b/app/views/shared/_remote_mirror_update_button.html.haml
@@ -1,6 +1,6 @@
 - if remote_mirror.update_in_progress?
-  %button.btn.disabled{ type: 'button', data: { toggle: 'tooltip', container: 'body', qa_selector: 'updating_button' }, title: _('Updating') }
-    = icon("refresh spin")
+  %button.btn.btn-icon.gl-button.disabled{ type: 'button', data: { toggle: 'tooltip', container: 'body', qa_selector: 'updating_button' }, title: _('Updating') }
+    = sprite_icon("retry", css_class: "spin")
 - elsif remote_mirror.enabled?
-  = link_to update_now_project_mirror_path(@project, sync_remote: true), method: :post, class: "btn qa-update-now-button rspec-update-now-button", data: { toggle: 'tooltip', container: 'body' }, title: _('Update now') do
-    = icon("refresh")
+  = link_to update_now_project_mirror_path(@project, sync_remote: true), method: :post, class: "btn btn-icon gl-button qa-update-now-button rspec-update-now-button", data: { toggle: 'tooltip', container: 'body' }, title: _('Update now') do
+    = sprite_icon("retry")
diff --git a/changelogs/unreleased/mw-replace-fa-refresh-icons.yml b/changelogs/unreleased/mw-replace-fa-refresh-icons.yml
new file mode 100644
index 0000000000000..3d4593cc223f0
--- /dev/null
+++ b/changelogs/unreleased/mw-replace-fa-refresh-icons.yml
@@ -0,0 +1,5 @@
+---
+title: Replace fa-refresh icon with GitLab SVG
+merge_request: 45777
+author:
+type: changed
diff --git a/ee/app/views/groups/group_members/_sync_button.html.haml b/ee/app/views/groups/group_members/_sync_button.html.haml
index 17f957854158e..9f28eb27260d6 100644
--- a/ee/app/views/groups/group_members/_sync_button.html.haml
+++ b/ee/app/views/groups/group_members/_sync_button.html.haml
@@ -1,15 +1,15 @@
 - if @group.ldap_sync_started?
-  %span.btn.disabled
-    = icon("refresh spin")
-    Syncing&hellip;
+  %span.btn.gl-button.disabled
+    = sprite_icon("retry", css_class: 'spin gl-mr-2')
+    = _('Syncing…')
 - elsif @group.ldap_sync_pending?
-  %span.btn.disabled
-    = icon("refresh spin")
-    Pending sync&hellip;
+  %span.btn.gl-button.disabled
+    = sprite_icon("retry", css_class: 'spin gl-mr-2')
+    = ('Pending sync…')
 - else
-  = link_to sync_group_ldap_path(@group), method: :put, class: 'btn qa-sync-now-button' do
-    = icon("refresh")
-    Sync now
+  = link_to sync_group_ldap_path(@group), method: :put, class: 'btn btn-default gl-button qa-sync-now-button' do
+    = sprite_icon("retry", css_class: "gl-mr-2")
+    = _('Sync now')
 - if @group.ldap_sync_ready? && @group.ldap_sync_last_successful_update_at
   %p.inline.gl-ml-3
-    Successfully synced #{time_ago_with_tooltip(@group.ldap_sync_last_successful_update_at)}.
+    = _('Successfully synced %{synced_timeago}.').html_safe % { synced_timeago: time_ago_with_tooltip(@group.ldap_sync_last_successful_update_at) }
diff --git a/ee/app/views/projects/mirrors/_table_pull_row.html.haml b/ee/app/views/projects/mirrors/_table_pull_row.html.haml
index 75880a8bdf823..564cd6cd6f17c 100644
--- a/ee/app/views/projects/mirrors/_table_pull_row.html.haml
+++ b/ee/app/views/projects/mirrors/_table_pull_row.html.haml
@@ -21,10 +21,10 @@
       - if ssh_public_key
         = clipboard_button(text: ssh_public_key, class: 'btn btn-default rspec-copy-ssh-public-key', title: _('Copy SSH public key'), qa_selector: 'copy_public_key_button')
       - if import_state.mirror_update_due? || import_state.updating_mirror?
-        %button.btn.disabled{ type: 'button', data: { container: 'body', toggle: 'tooltip', qa_selector: 'updating_button' }, title: _('Updating') }= icon("refresh spin")
+        %button.btn.btn-icon.gl-button.disabled{ type: 'button', data: { container: 'body', toggle: 'tooltip', qa_selector: 'updating_button' }, title: _('Updating') }= sprite_icon("retry", css_class: "spin")
       - elsif @project.archived?
-        %button.btn.disabled{ type: 'button', data: { container: 'body', toggle: 'tooltip', qa_selector: 'update_now_button' }, title: _('This Project is currently archived and read-only. Please unarchive the project first if you want to resume Pull mirroring') }= icon("refresh")
+        %button.btn.btn-icon.gl-button.disabled{ type: 'button', data: { container: 'body', toggle: 'tooltip', qa_selector: 'update_now_button' }, title: _('This Project is currently archived and read-only. Please unarchive the project first if you want to resume Pull mirroring') }= sprite_icon("retry")
       - else
-        = link_to update_now_project_mirror_path(@project), method: :post, class: 'btn js-force-update-mirror', data: { container: 'body', toggle: 'tooltip', qa_selector: 'update_now_button' }, title: _('Update now') do
-          = icon("refresh")
-      %button.js-delete-mirror.js-delete-pull-mirror.btn.btn-danger{ type: 'button', data: { toggle: 'tooltip', container: 'body' }, title: _('Remove') }= sprite_icon('remove')
+        = link_to update_now_project_mirror_path(@project), method: :post, class: 'btn gl-button btn-icon js-force-update-mirror', data: { container: 'body', toggle: 'tooltip', qa_selector: 'update_now_button' }, title: _('Update now') do
+          = sprite_icon("retry")
+      %button.js-delete-mirror.js-delete-pull-mirror.btn.btn-icon.gl-button.btn-danger{ type: 'button', data: { toggle: 'tooltip', container: 'body' }, title: _('Remove') }= sprite_icon('remove')
diff --git a/ee/app/views/shared/_mirror_update_button.html.haml b/ee/app/views/shared/_mirror_update_button.html.haml
index 2600a5c846f42..f42038a944d0f 100644
--- a/ee/app/views/shared/_mirror_update_button.html.haml
+++ b/ee/app/views/shared/_mirror_update_button.html.haml
@@ -2,20 +2,20 @@
   .gl-mb-3
     - if @project.import_state.mirror_update_due?
       %span.btn.disabled
-        = icon("refresh spin")
-        Update Scheduled&hellip;
+        = sprite_icon('retry', css_class: 'spin')
+        = ('Update Scheduled…')
     - elsif @project.import_state.updating_mirror?
       %span.btn.disabled
-        = icon("refresh spin")
-        Updating&hellip;
+        = sprite_icon('retry', css_class: 'spin')
+        = ('Updating…')
     - elsif can?(current_user, :admin_project, @project)
       = link_to update_now_project_mirror_path(@project), method: :post, class: 'btn' do
-        = icon("refresh")
-        Update Now
+        = sprite_icon('retry')
+        = ('Update Now')
     - else
       %span.btn.disabled
-        = icon("refresh")
-        Update Now
+        = sprite_icon('retry')
+        = ('Update Now')
     - if @project.mirror_last_update_succeeded?
       %p.inline.gl-ml-3
-        Successfully updated #{time_ago_with_tooltip(@project.import_state.last_successful_update_at)}.
+        = ('Successfully updated %{last_updated_timeago}.').html_safe % { last_updated_timeago: time_ago_with_tooltip(@project.import_state.last_successful_update_at) }
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 352ccdf4d1e4a..99c51cd2c5e1b 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -25558,6 +25558,9 @@ msgstr ""
 msgid "Successfully scheduled a pipeline to run. Go to the %{pipelines_link_start}Pipelines page%{pipelines_link_end} for details."
 msgstr ""
 
+msgid "Successfully synced %{synced_timeago}."
+msgstr ""
+
 msgid "Successfully unblocked"
 msgstr ""
 
@@ -25693,12 +25696,18 @@ msgstr ""
 msgid "Sync information"
 msgstr ""
 
+msgid "Sync now"
+msgstr ""
+
 msgid "Synced"
 msgstr ""
 
 msgid "Synchronization disabled"
 msgstr ""
 
+msgid "Syncing…"
+msgstr ""
+
 msgid "System"
 msgstr ""
 
-- 
GitLab