diff --git a/changelog/fix-navigation-feature b/changelog/fix-navigation-feature new file mode 100644 index 00000000000..ba7d74538a6 --- /dev/null +++ b/changelog/fix-navigation-feature @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Remove WooCommerce Navigation integration diff --git a/client/index.js b/client/index.js index 9a530a54010..9cde793e28d 100644 --- a/client/index.js +++ b/client/index.js @@ -38,20 +38,11 @@ addFilter( ( pages ) => { const { menuID, rootLink } = getMenuSettings(); - const isNavigationEnabled = - window.wcAdminFeatures && window.wcAdminFeatures.navigation; - const connectionPageTitle = isNavigationEnabled - ? 'WooPayments' - : __( 'Connect', 'woocommerce-payments' ); - pages.push( { container: ConnectAccountPage, path: '/payments/connect', wpOpenMenu: menuID, - breadcrumbs: [ rootLink, connectionPageTitle ], - navArgs: { - id: 'wc-payments', - }, + breadcrumbs: [ rootLink, __( 'Connect', 'woocommerce-payments' ) ], capability: 'manage_woocommerce', } ); @@ -63,9 +54,6 @@ addFilter( rootLink, __( 'Onboarding', 'woocommerce-payments' ), ], - navArgs: { - id: 'wc-payments-onboarding', - }, capability: 'manage_woocommerce', } ); @@ -74,9 +62,6 @@ addFilter( path: '/payments/overview', wpOpenMenu: menuID, breadcrumbs: [ rootLink, __( 'Overview', 'woocommerce-payments' ) ], - navArgs: { - id: 'wc-payments-overview', - }, capability: 'manage_woocommerce', } ); @@ -85,9 +70,6 @@ addFilter( path: '/payments/deposits', wpOpenMenu: menuID, breadcrumbs: [ rootLink, __( 'Deposits', 'woocommerce-payments' ) ], - navArgs: { - id: 'wc-payments-deposits', - }, capability: 'manage_woocommerce', } ); pages.push( { @@ -102,10 +84,6 @@ addFilter( ], __( 'Deposit details', 'woocommerce-payments' ), ], - navArgs: { - id: 'wc-payments-deposit-details', - parentPath: '/payments/deposits', - }, capability: 'manage_woocommerce', } ); pages.push( { @@ -116,9 +94,6 @@ addFilter( rootLink, __( 'Transactions', 'woocommerce-payments' ), ], - navArgs: { - id: 'wc-payments-transactions', - }, capability: 'manage_woocommerce', } ); pages.push( { @@ -133,10 +108,6 @@ addFilter( ], __( 'Payment details', 'woocommerce-payments' ), ], - navArgs: { - id: 'wc-payments-transaction-details', - parentPath: '/payments/transactions', - }, capability: 'manage_woocommerce', } ); pages.push( { @@ -144,9 +115,6 @@ addFilter( path: '/payments/disputes', wpOpenMenu: menuID, breadcrumbs: [ rootLink, __( 'Disputes', 'woocommerce-payments' ) ], - navArgs: { - id: 'wc-payments-disputes', - }, capability: 'manage_woocommerce', } ); @@ -162,10 +130,6 @@ addFilter( ], __( 'Dispute details', 'woocommerce-payments' ), ], - navArgs: { - id: 'wc-payments-disputes-details-legacy-redirect', - parentPath: '/payments/disputes', - }, capability: 'manage_woocommerce', } ); @@ -181,10 +145,6 @@ addFilter( ], __( 'Challenge dispute', 'woocommerce-payments' ), ], - navArgs: { - id: 'wc-payments-disputes-challenge', - parentPath: '/payments/disputes', - }, capability: 'manage_woocommerce', } ); pages.push( { @@ -215,9 +175,6 @@ addFilter( rootLink, __( 'Card readers', 'woocommerce-payments' ), ], - navArgs: { - id: 'wc-payments-card-readers', - }, capability: 'manage_woocommerce', } ); pages.push( { @@ -228,9 +185,6 @@ addFilter( rootLink, __( 'Capital Loans', 'woocommerce-payments' ), ], - navArgs: { - id: 'wc-payments-capital', - }, capability: 'manage_woocommerce', } ); if ( wcpaySettings && wcpaySettings.featureFlags.documents ) { @@ -242,9 +196,6 @@ addFilter( rootLink, __( 'Documents', 'woocommerce-payments' ), ], - navArgs: { - id: 'wc-payments-documents', - }, capability: 'manage_woocommerce', } ); } diff --git a/includes/admin/class-wc-payments-admin.php b/includes/admin/class-wc-payments-admin.php index 864a315768a..54d0de819a0 100644 --- a/includes/admin/class-wc-payments-admin.php +++ b/includes/admin/class-wc-payments-admin.php @@ -147,44 +147,28 @@ public function __construct( $this->admin_child_pages = [ 'wc-payments-overview' => [ - 'id' => 'wc-payments-overview', - 'title' => __( 'Overview', 'woocommerce-payments' ), - 'parent' => 'wc-payments', - 'path' => '/payments/overview', - 'nav_args' => [ - 'parent' => 'wc-payments', - 'order' => 10, - ], + 'id' => 'wc-payments-overview', + 'title' => __( 'Overview', 'woocommerce-payments' ), + 'parent' => 'wc-payments', + 'path' => '/payments/overview', ], 'wc-payments-deposits' => [ - 'id' => 'wc-payments-deposits', - 'title' => __( 'Deposits', 'woocommerce-payments' ), - 'parent' => 'wc-payments', - 'path' => '/payments/deposits', - 'nav_args' => [ - 'parent' => 'wc-payments', - 'order' => 20, - ], + 'id' => 'wc-payments-deposits', + 'title' => __( 'Deposits', 'woocommerce-payments' ), + 'parent' => 'wc-payments', + 'path' => '/payments/deposits', ], 'wc-payments-transactions' => [ - 'id' => 'wc-payments-transactions', - 'title' => __( 'Transactions', 'woocommerce-payments' ), - 'parent' => 'wc-payments', - 'path' => '/payments/transactions', - 'nav_args' => [ - 'parent' => 'wc-payments', - 'order' => 30, - ], + 'id' => 'wc-payments-transactions', + 'title' => __( 'Transactions', 'woocommerce-payments' ), + 'parent' => 'wc-payments', + 'path' => '/payments/transactions', ], 'wc-payments-disputes' => [ - 'id' => 'wc-payments-disputes', - 'title' => __( 'Disputes', 'woocommerce-payments' ), - 'parent' => 'wc-payments', - 'path' => '/payments/disputes', - 'nav_args' => [ - 'parent' => 'wc-payments', - 'order' => 40, - ], + 'id' => 'wc-payments-disputes', + 'title' => __( 'Disputes', 'woocommerce-payments' ), + 'parent' => 'wc-payments', + 'path' => '/payments/disputes', ], ]; } @@ -317,12 +301,6 @@ public function add_payments_menu() { 'path' => $top_level_link, 'position' => '55.7', // After WooCommerce & Product menu items. 'icon' => $menu_icon, - 'nav_args' => [ - 'title' => 'WooPayments', - 'is_category' => $should_render_full_menu, - 'menuId' => 'plugins', - 'is_top_level' => true, - ], ] ); @@ -344,9 +322,6 @@ public function add_payments_menu() { 'parent' => 'wc-payments', 'path' => '/payments/onboarding', 'capability' => 'manage_woocommerce', - 'nav_args' => [ - 'parent' => 'wc-payments', - ], ] ); remove_submenu_page( 'wc-admin&path=/payments/connect', 'wc-admin&path=/payments/onboarding' ); @@ -356,40 +331,28 @@ public function add_payments_menu() { if ( $should_render_full_menu ) { if ( $this->account->is_card_present_eligible() && $this->account->has_card_readers_available() ) { $this->admin_child_pages['wc-payments-card-readers'] = [ - 'id' => 'wc-payments-card-readers', - 'title' => __( 'Card Readers', 'woocommerce-payments' ), - 'parent' => 'wc-payments', - 'path' => '/payments/card-readers', - 'nav_args' => [ - 'parent' => 'wc-payments', - 'order' => 50, - ], + 'id' => 'wc-payments-card-readers', + 'title' => __( 'Card Readers', 'woocommerce-payments' ), + 'parent' => 'wc-payments', + 'path' => '/payments/card-readers', ]; } if ( $this->account->get_capital()['has_previous_loans'] ) { $this->admin_child_pages['wc-payments-capital'] = [ - 'id' => 'wc-payments-capital', - 'title' => __( 'Capital Loans', 'woocommerce-payments' ), - 'parent' => 'wc-payments', - 'path' => '/payments/loans', - 'nav_args' => [ - 'parent' => 'wc-payments', - 'order' => 60, - ], + 'id' => 'wc-payments-capital', + 'title' => __( 'Capital Loans', 'woocommerce-payments' ), + 'parent' => 'wc-payments', + 'path' => '/payments/loans', ]; } if ( WC_Payments_Features::is_documents_section_enabled() ) { $this->admin_child_pages['wc-payments-documents'] = [ - 'id' => 'wc-payments-documents', - 'title' => __( 'Documents', 'woocommerce-payments' ), - 'parent' => 'wc-payments', - 'path' => '/payments/documents', - 'nav_args' => [ - 'parent' => 'wc-payments', - 'order' => 50, - ], + 'id' => 'wc-payments-documents', + 'title' => __( 'Documents', 'woocommerce-payments' ), + 'parent' => 'wc-payments', + 'path' => '/payments/documents', ]; } @@ -409,12 +372,6 @@ public function add_payments_menu() { 'parent' => 'woocommerce-settings-payments', 'screen_id' => 'woocommerce_page_wc-settings-checkout-woocommerce_payments', 'title' => 'WooPayments', - 'nav_args' => [ - 'parent' => 'wc-payments', - 'title' => __( 'Settings', 'woocommerce-payments' ), - 'url' => 'wc-settings&tab=checkout§ion=woocommerce_payments', - 'order' => 99, - ], ] ); // Add the Settings submenu directly to the array, it's the only way to make it link to an absolute URL.