diff --git a/CHANGELOG.md b/CHANGELOG.md
index a78064d6f..d044af970 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -47,6 +47,7 @@
- Fix a bug: theme colors must be selected twice before the changes became effective
- Fix a bug: datepicker does not work in profile completion screen
- Fix a bug: unable to select a group in profile completion screen
+- Fix a bug: in some cases, bogus admin notification on profile completed
- Fix a security issue: updated loofah to fix [CVE-2019-15587](https://github.com/advisories/GHSA-c3gv-9cxf-6f57)
- Fix a security issue: updated angular to 1.7.9 to fix [CVE-2019-10768](https://github.com/advisories/GHSA-89mq-4x47-5v83)
- Fix a security issue: updated puma to 3.12.2 to fix [GHSA-7xx3-m584-x994](https://github.com/advisories/GHSA-7xx3-m584-x994)
diff --git a/app/assets/javascripts/controllers/home.js b/app/assets/javascripts/controllers/home.js
index 9c514f0ea..1c514bf91 100644
--- a/app/assets/javascripts/controllers/home.js
+++ b/app/assets/javascripts/controllers/home.js
@@ -39,6 +39,12 @@ Application.Controllers.controller('HomeController', ['$scope', '$stateParams',
window.removeEventListener('keydown', handleF1);
});
}
+
+ $scope.$watch('currentUser', function (newValue, oldValue) {
+ if (!oldValue && newValue && newValue.role === 'admin') {
+ setupWelcomeTour();
+ }
+ });
};
/**
diff --git a/app/views/api/notifications/_notify_admin_profile_complete.json.jbuilder b/app/views/api/notifications/_notify_admin_profile_complete.json.jbuilder
index c74035df5..d82ef7a54 100644
--- a/app/views/api/notifications/_notify_admin_profile_complete.json.jbuilder
+++ b/app/views/api/notifications/_notify_admin_profile_complete.json.jbuilder
@@ -1,5 +1,8 @@
+# frozen_string_literal: true
+
+default_provider = AuthProvider.find_by(providable_type: DatabaseProvider.name).name
json.title notification.notification_type
json.description t('.account_imported_from_PROVIDER_UID_has_completed_its_information_html',
- PROVIDER: notification.attached_object.provider,
- UID: notification.attached_object.uid)
+ PROVIDER: notification.attached_object.provider || default_provider,
+ UID: notification.attached_object.uid || notification.attached_object.id)
json.url notification_url(notification, format: :json)
diff --git a/config/locales/en.yml b/config/locales/en.yml
index c54560d8d..c3c72b118 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -247,7 +247,7 @@ en:
notify_admin_member_create_reservation:
a_RESERVABLE_reservation_was_made_by_USER_html: "A %{RESERVABLE} reservation was made by %{USER}."
notify_admin_profile_complete:
- account_imported_from_PROVIDER_UID_has_completed_its_information_html: "Account imported from %{PROVIDER} (%{UID}) has completed its information."
+ account_imported_from_PROVIDER_UID_has_completed_its_information_html: "Account imported from %{PROVIDER} (%{UID}) has completed its information."
notify_admin_slot_is_canceled:
USER_s_reservation_on_the_DATE_was_cancelled_remember_to_generate_a_refund_invoice_if_applicable_html: "%{USER}'s reservation, on the %{DATE}, was cancelled. Remember to generate a refund invoice if applicable."
notify_admin_slot_is_modified:
diff --git a/config/locales/es.yml b/config/locales/es.yml
index a577f14df..b6d320d1d 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -252,7 +252,7 @@ es:
notify_admin_member_create_reservation:
a_RESERVABLE_reservation_was_made_by_USER_html: "Una reserva de %{RESERVABLE} fue hecha por %{USER}."
notify_admin_profile_complete:
- account_imported_from_PROVIDER_UID_has_completed_its_information_html: "Cuenta importada desde %{PROVIDER} (%{UID}) ha completado su información."
+ account_imported_from_PROVIDER_UID_has_completed_its_information_html: "Cuenta importada desde %{PROVIDER} (%{UID}) ha completado su información."
notify_admin_slot_is_canceled:
USER_s_reservation_on_the_DATE_was_cancelled_remember_to_generate_a_refund_invoice_if_applicable_html: "La reserva de %{USER}, hecha el %{DATE} ha sido cancelada. Recuerda reclamar una devolución si está disponible."
notify_admin_slot_is_modified:
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index 44585e45b..8baea7e30 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -247,7 +247,7 @@ fr:
notify_admin_member_create_reservation:
a_RESERVABLE_reservation_was_made_by_USER_html: "Une réservation %{RESERVABLE} a été effectuée par %{USER}."
notify_admin_profile_complete:
- account_imported_from_PROVIDER_UID_has_completed_its_information_html: "Le compte importé depuis %{PROVIDER} (%{UID}) a complété ses informations."
+ account_imported_from_PROVIDER_UID_has_completed_its_information_html: "Le compte importé depuis %{PROVIDER} (%{UID}) a complété ses informations."
notify_admin_slot_is_canceled:
USER_s_reservation_on_the_DATE_was_cancelled_remember_to_generate_a_refund_invoice_if_applicable_html: "La réservation de %{USER}, le %{DATE}, a été annulée. Pensez a générer un avoir le cas échéant."
notify_admin_slot_is_modified:
diff --git a/config/locales/pt.yml b/config/locales/pt.yml
index 38c33962f..c4ae9729a 100755
--- a/config/locales/pt.yml
+++ b/config/locales/pt.yml
@@ -247,7 +247,7 @@ pt:
notify_admin_member_create_reservation:
a_RESERVABLE_reservation_was_made_by_USER_html: "A %{RESERVABLE} reserva foi feita por %{USER}."
notify_admin_profile_complete:
- account_imported_from_PROVIDER_UID_has_completed_its_information_html: "Conta importada para %{PROVIDER} (%{UID}) completou a sua informação."
+ account_imported_from_PROVIDER_UID_has_completed_its_information_html: "Conta importada para %{PROVIDER} (%{UID}) completou a sua informação."
notify_admin_slot_is_canceled:
USER_s_reservation_on_the_DATE_was_cancelled_remember_to_generate_a_refund_invoice_if_applicable_html: "A reserva de %{USER} , na %{DATE}, foi cancelada. Lembre-se de gerar uma fatura de reembolso, se aplicável."
notify_admin_slot_is_modified: