From 73b9847b56e3c7346f88be0bbab928a29eadfb4d Mon Sep 17 00:00:00 2001 From: Nate Weller Date: Mon, 22 Apr 2024 13:42:46 -0600 Subject: [PATCH] A4A: Add "wp-admin-url" query parameter to dashboard link. (#36994) --- .../changelog/add-a4a-wp-admin-url-query-param | 5 +++++ .../src/js/components/connected-card/index.jsx | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 projects/plugins/automattic-for-agencies-client/changelog/add-a4a-wp-admin-url-query-param diff --git a/projects/plugins/automattic-for-agencies-client/changelog/add-a4a-wp-admin-url-query-param b/projects/plugins/automattic-for-agencies-client/changelog/add-a4a-wp-admin-url-query-param new file mode 100644 index 0000000000000..08d35a392ce6d --- /dev/null +++ b/projects/plugins/automattic-for-agencies-client/changelog/add-a4a-wp-admin-url-query-param @@ -0,0 +1,5 @@ +Significance: patch +Type: added +Comment: Added additional query parameter when redirecting to A4A dashboard. + + diff --git a/projects/plugins/automattic-for-agencies-client/src/js/components/connected-card/index.jsx b/projects/plugins/automattic-for-agencies-client/src/js/components/connected-card/index.jsx index dd5309c47f3c1..c7843b9d8c462 100644 --- a/projects/plugins/automattic-for-agencies-client/src/js/components/connected-card/index.jsx +++ b/projects/plugins/automattic-for-agencies-client/src/js/components/connected-card/index.jsx @@ -18,7 +18,8 @@ import styles from './styles.module.scss'; */ function SiteConnectedContent() { const navigateToDashboard = useCallback( () => { - window.location.href = 'https://agencies.automattic.com?source=client-plugin'; + const currentUrl = encodeURIComponent( window.location.href ); + window.location.href = `https://agencies.automattic.com?source=client-plugin&wp-admin-url=${ currentUrl }`; }, [] ); return (