Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Dashboard Menu Manager #2050

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d3e72d7
feat: Dashboard Menu Manager admin settings frontend
aihimel Aug 18, 2023
7985e19
fix: UI Issue fixed.
aihimel Aug 22, 2023
5716594
feat: Several Improvements of Dashboard Menu Manager.
aihimel Aug 29, 2023
9c7958a
feat: Several Improvements of Dashboard Menu Manager.
aihimel Aug 29, 2023
3470332
feat: Several enhancement
aihimel Aug 29, 2023
efba41f
fix: dashboard nav list updated.
aihimel Sep 19, 2023
a71af6a
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Sep 20, 2023
b6c2cc7
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Sep 27, 2023
8dcd573
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Oct 9, 2023
1046706
fix: Design alignment issue fix.
aihimel Oct 11, 2023
68aa1c3
fix: Design fixes.
aihimel Oct 12, 2023
bee52f9
fix: Sorting issue fixed.
aihimel Oct 12, 2023
f1f534e
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Oct 17, 2023
438187f
fix: PHPCS issue fixed.
aihimel Oct 17, 2023
c56a362
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Oct 23, 2023
200b848
refactor: moved dashboard menu-related functions to a separate file.
nurul-umbhiya Nov 7, 2023
6d0936e
refactor: removed unused vue components
nurul-umbhiya Nov 7, 2023
a6c05ca
refactor: removed some unused css codes
nurul-umbhiya Nov 7, 2023
9d2fbbc
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Nov 10, 2023
3d627a3
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Nov 17, 2023
1171356
feat: New filter for query var added for access restriction.
aihimel Nov 22, 2023
40a1957
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Nov 22, 2023
79f2deb
refactor: extra parameter removed.
aihimel Nov 24, 2023
de39000
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Nov 29, 2023
65f0392
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Dec 26, 2023
a72f669
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Jan 15, 2024
21f555d
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Jan 19, 2024
40515db
fix: widgets turned off when menu is deactivated.
aihimel Jan 25, 2024
9e8e228
fix: PHPCS issue fix.
aihimel Jan 25, 2024
2b3f681
chore: Merged develop branch.
aihimel Jan 26, 2024
47493a5
feat: Event listener added to enable/disable save settings button
aihimel Jan 29, 2024
dd2832b
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Jan 30, 2024
f37d4f4
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Jan 30, 2024
11833d3
feat: New filter added.
aihimel Feb 1, 2024
78d9835
fix: Several fixes
aihimel Feb 5, 2024
b73e525
refactor: access restriction template loaded from light.
aihimel Feb 5, 2024
5d98024
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Feb 12, 2024
3d40599
Merge branch 'develop' into feat/pro-2482-dashboard-menu-manager
aihimel Feb 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"WeDevs\\Dokan\\": "includes/"
},
"files": [
"includes/functions-rest-api.php"
"includes/functions-rest-api.php",
"includes/functions-dashboard-navigation.php"
]
},
"scripts": {
Expand Down
18 changes: 17 additions & 1 deletion includes/Dashboard/Templates/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}

/**
* Get Seller Dhasboard Notice
* Get Seller Dashboard Notice
*
* @since 2.4
*
Expand All @@ -55,7 +55,11 @@
* @return void
*/
public function get_big_counter_widgets() {
if ( ! apply_filters( 'dokan_dashboard_widget_applicable', true, 'reports' ) ) {
return;
}

if ( ! current_user_can( 'dokan_view_sales_overview' ) ) {

Check warning on line 62 in includes/Dashboard/Templates/Dashboard.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found unknown capability "dokan_view_sales_overview" in function call to current_user_can(). Please check the spelling of the capability. If this is a custom capability, please verify the capability is registered with WordPress via a call to WP_Role(s)->add_cap(). Custom capabilities can be made known to this sniff by setting the "custom_capabilities" property in the PHPCS ruleset.
return;
}

Expand All @@ -81,7 +85,11 @@
* @return void
*/
public function get_orders_widgets() {
if ( ! apply_filters( 'dokan_dashboard_widget_applicable', true, 'orders' ) ) {
return;
}

if ( ! current_user_can( 'dokan_view_order_report' ) ) {

Check warning on line 92 in includes/Dashboard/Templates/Dashboard.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found unknown capability "dokan_view_order_report" in function call to current_user_can(). Please check the spelling of the capability. If this is a custom capability, please verify the capability is registered with WordPress via a call to WP_Role(s)->add_cap(). Custom capabilities can be made known to this sniff by setting the "custom_capabilities" property in the PHPCS ruleset.
return;
}

Expand Down Expand Up @@ -190,7 +198,11 @@
* @return void
*/
public function get_products_widgets() {
if ( ! apply_filters( 'dokan_dashboard_widget_applicable', true, 'products' ) ) {
return;
}

if ( ! current_user_can( 'dokan_view_product_status_report' ) ) {

Check warning on line 205 in includes/Dashboard/Templates/Dashboard.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found unknown capability "dokan_view_product_status_report" in function call to current_user_can(). Please check the spelling of the capability. If this is a custom capability, please verify the capability is registered with WordPress via a call to WP_Role(s)->add_cap(). Custom capabilities can be made known to this sniff by setting the "custom_capabilities" property in the PHPCS ruleset.
return;
}
$nonce = wp_create_nonce( 'product_listing_filter' );
Expand Down Expand Up @@ -232,7 +244,11 @@
* @return void
*/
public function get_sales_report_chart_widget() {
if ( ! apply_filters( 'dokan_dashboard_widget_applicable', true, 'reports' ) ) {
return;
}

if ( ! current_user_can( 'dokan_view_sales_report_chart' ) ) {

Check warning on line 251 in includes/Dashboard/Templates/Dashboard.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found unknown capability "dokan_view_sales_report_chart" in function call to current_user_can(). Please check the spelling of the capability. If this is a custom capability, please verify the capability is registered with WordPress via a call to WP_Role(s)->add_cap(). Custom capabilities can be made known to this sniff by setting the "custom_capabilities" property in the PHPCS ruleset.
return;
}

Expand Down
2 changes: 1 addition & 1 deletion includes/ReverseWithdrawal/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct() {
add_action( 'woocommerce_order_status_changed', [ $this, 'process_order_status_changed' ], 10, 3 );

// vendor dashboard navigation url
add_filter( 'dokan_get_dashboard_nav', [ $this, 'add_reverse_withdrawal_nav' ], 10, 2 );
add_filter( 'dokan_get_dashboard_nav', [ $this, 'add_reverse_withdrawal_nav' ], 10 );
}

/**
Expand Down
33 changes: 24 additions & 9 deletions includes/Shortcodes/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,23 @@

ob_start();

if ( isset( $wp->query_vars['products'] ) ) {
/**
* Filter query var before rendering dokan vendor shortcode
*/
$query_vars = apply_filters( 'dokan_dashboard_shortcode_query_vars', $wp->query_vars );

if ( is_wp_error( $query_vars ) ) {
dokan_get_template_part(
'global/dokan-error', '', [
'deleted' => false,
'message' => $query_vars->get_error_message(),
]
);
return ob_get_clean();
}

if ( isset( $query_vars['products'] ) ) {
if ( ! current_user_can( 'dokan_view_product_menu' ) ) {

Check warning on line 51 in includes/Shortcodes/Dashboard.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found unknown capability "dokan_view_product_menu" in function call to current_user_can(). Please check the spelling of the capability. If this is a custom capability, please verify the capability is registered with WordPress via a call to WP_Role(s)->add_cap(). Custom capabilities can be made known to this sniff by setting the "custom_capabilities" property in the PHPCS ruleset.
dokan_get_template_part( 'global/no-permission' );
} else {
dokan_get_template_part( 'products/products' );
Expand All @@ -42,8 +57,8 @@
return ob_get_clean();
}

if ( isset( $wp->query_vars['new-product'] ) ) {
if ( isset( $query_vars['new-product'] ) ) {
if ( ! current_user_can( 'dokan_add_product' ) ) {

Check warning on line 61 in includes/Shortcodes/Dashboard.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found unknown capability "dokan_add_product" in function call to current_user_can(). Please check the spelling of the capability. If this is a custom capability, please verify the capability is registered with WordPress via a call to WP_Role(s)->add_cap(). Custom capabilities can be made known to this sniff by setting the "custom_capabilities" property in the PHPCS ruleset.
dokan_get_template_part( 'global/no-permission' );
} else {
do_action( 'dokan_render_new_product_template', $wp->query_vars );
Expand All @@ -52,8 +67,8 @@
return ob_get_clean();
}

if ( isset( $wp->query_vars['orders'] ) ) {
if ( isset( $query_vars['orders'] ) ) {
if ( ! current_user_can( 'dokan_view_order_menu' ) ) {

Check warning on line 71 in includes/Shortcodes/Dashboard.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found unknown capability "dokan_view_order_menu" in function call to current_user_can(). Please check the spelling of the capability. If this is a custom capability, please verify the capability is registered with WordPress via a call to WP_Role(s)->add_cap(). Custom capabilities can be made known to this sniff by setting the "custom_capabilities" property in the PHPCS ruleset.
dokan_get_template_part( 'global/no-permission' );
} else {
dokan_get_template_part( 'orders/orders' );
Expand All @@ -62,8 +77,8 @@
return ob_get_clean();
}

if ( isset( $wp->query_vars['withdraw'] ) ) {
if ( isset( $query_vars['withdraw'] ) ) {
if ( ! current_user_can( 'dokan_view_withdraw_menu' ) ) {

Check warning on line 81 in includes/Shortcodes/Dashboard.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found unknown capability "dokan_view_withdraw_menu" in function call to current_user_can(). Please check the spelling of the capability. If this is a custom capability, please verify the capability is registered with WordPress via a call to WP_Role(s)->add_cap(). Custom capabilities can be made known to this sniff by setting the "custom_capabilities" property in the PHPCS ruleset.
dokan_get_template_part( 'global/no-permission' );
} else {
dokan_get_template_part( 'withdraw/withdraw' );
Expand All @@ -72,8 +87,8 @@
return ob_get_clean();
}

if ( isset( $wp->query_vars['reverse-withdrawal'] ) ) {
if ( isset( $query_vars['reverse-withdrawal'] ) ) {
if ( ! current_user_can( 'dokan_view_withdraw_menu' ) ) {

Check warning on line 91 in includes/Shortcodes/Dashboard.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found unknown capability "dokan_view_withdraw_menu" in function call to current_user_can(). Please check the spelling of the capability. If this is a custom capability, please verify the capability is registered with WordPress via a call to WP_Role(s)->add_cap(). Custom capabilities can be made known to this sniff by setting the "custom_capabilities" property in the PHPCS ruleset.
dokan_get_template_part( 'global/no-permission' );
} else {
dokan_get_template_part( 'reverse-withdrawal/reverse-withdrawal' );
Expand All @@ -82,14 +97,14 @@
return ob_get_clean();
}

if ( isset( $wp->query_vars['settings'] ) ) {
if ( isset( $query_vars['settings'] ) ) {
dokan_get_template_part( 'settings/store' );

return ob_get_clean();
}

if ( isset( $wp->query_vars['page'] ) ) {
if ( isset( $query_vars['page'] ) ) {
if ( ! current_user_can( 'dokan_view_overview_menu' ) ) {

Check warning on line 107 in includes/Shortcodes/Dashboard.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found unknown capability "dokan_view_overview_menu" in function call to current_user_can(). Please check the spelling of the capability. If this is a custom capability, please verify the capability is registered with WordPress via a call to WP_Role(s)->add_cap(). Custom capabilities can be made known to this sniff by setting the "custom_capabilities" property in the PHPCS ruleset.
dokan_get_template_part( 'global/no-permission' );
} else {
dokan_get_template_part( 'dashboard/dashboard' );
Expand All @@ -97,13 +112,13 @@

return ob_get_clean();
}
if ( isset( $wp->query_vars['edit-account'] ) ) {
if ( isset( $query_vars['edit-account'] ) ) {
dokan_get_template_part( 'dashboard/edit-account' );

return ob_get_clean();
}

do_action( 'dokan_load_custom_template', $wp->query_vars );
do_action( 'dokan_load_custom_template', $query_vars );

return ob_get_clean();
}
Expand Down
Loading
Loading