From 095e6ebd99c7fe285dadd166ab49f635ba6d5aee Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Fri, 26 Apr 2024 16:37:10 +0600 Subject: [PATCH 01/40] enhance: Update dokan admin logo & add logo update notice. --- assets/src/less/admin.less | 1 + assets/src/less/global-admin.less | 2 +- includes/Admin/Menu.php | 2 +- includes/Admin/Notices/Manager.php | 69 +++++++++++++++++++++++++++--- 4 files changed, 65 insertions(+), 9 deletions(-) diff --git a/assets/src/less/admin.less b/assets/src/less/admin.less index f9b43d347b..d0e330b323 100644 --- a/assets/src/less/admin.less +++ b/assets/src/less/admin.less @@ -12,6 +12,7 @@ .dokan-admin-header-logo { display: flex; + align-items: center; img { height: 25px; diff --git a/assets/src/less/global-admin.less b/assets/src/less/global-admin.less index 027c13c30b..3c713b857c 100644 --- a/assets/src/less/global-admin.less +++ b/assets/src/less/global-admin.less @@ -111,7 +111,7 @@ .dokan-logo { width: 60px; height: 60px; - background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 62 62' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='.90723' y='.79541' width='61' height='61' rx='30.5' fill='%23F16982'/%3E%3Cpath d='m19.688 25.014v-6.1614c1.4588-0.0303 7.7804 0.0301 13.407 3.6546-0.5844-0.2658-1.2264-0.4219-1.8846-0.4584-0.6581-0.0364-1.3177 0.0477-1.9361 0.2469-1.4936 0.5135-2.7441 1.8122-2.8483 3.2016-0.1737 2.3861 0 4.8627 0 7.2488v7.2186c-1.1115 0.0906-2.2577 0.1208-3.2649 0.1208-1.0768 0.0302-2.1188 0.0302-2.9524 0.1208l-0.521 0.0907v-15.283z' fill='%23fff'/%3E%3Cpath d='m17.848 43.77s-0.278-2.3257 2.5007-2.6579c2.7787-0.3323 8.0583 0.302 11.532-1.6008 0 0 2.0494-0.9363 2.4662-1.3893l-0.5558 1.6309s-1.6325 4.9534-6.5994 5.5876c-4.967 0.6041-5.9048-1.7517-9.3434-1.5705z' fill='%23fff'/%3E%3Cpath d='m28.546 45.824c3.9596-0.8457 8.4404-3.3828 8.4404-16.159 0-12.776-17.02-11.689-17.02-11.689 4.0639-2.084 25.008-4.6815 25.008 13.32 0 17.971-16.429 14.528-16.429 14.528z' fill='%23fff'/%3E%3C/svg%3E"); + background-image: url("data:image/svg+xml,%3Csvg width='201' height='201' viewBox='0 0 201 201' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0.944824' y='0.286865' width='200' height='200' rx='100' fill='url(%23paint0_linear_1000_463)'/%3E%3Crect x='0.944824' y='0.286865' width='200' height='200' rx='100' fill='url(%23paint1_linear_1000_463)'/%3E%3Cpath opacity='0.5' d='M120.094 97.8397C120.017 116.945 111.818 136.669 94.8784 145.642C82.9666 151.984 54.8115 156.857 54.8115 136.205C54.8115 136.205 54.8115 59.3972 54.8115 59.3198C54.8115 47.8721 64.4802 44.082 74.1488 44.6235C88.5358 45.397 102.304 52.1263 110.658 64.5022C115.995 72.3919 118.934 81.9058 119.862 91.4971C119.94 93.6629 120.094 95.7513 120.094 97.8397Z' fill='white'/%3E%3Cpath d='M146.78 91.1102C145.155 75.331 135.487 62.1042 122.105 54.1373C113.842 49.1791 103.642 47.6922 97.5842 56.0645C96.6338 57.3779 95.8894 58.8748 95.1173 60.3003C88.6566 72.2286 57.2433 129.954 57.2093 130.017C57.2081 130.019 57.2087 130.018 57.2075 130.02C53.8062 136.284 54.5799 141.465 57.6734 145.719C62.3143 152.061 71.5189 154.923 79.0217 155.697C85.9832 156.47 93.022 155.697 99.7514 154.15C120.094 149.509 138.117 135.663 144.227 115.553C146.625 107.663 147.631 99.3866 146.78 91.1102Z' fill='white'/%3E%3Cdefs%3E%3ClinearGradient id='paint0_linear_1000_463' x1='100.945' y1='0.286865' x2='100.945' y2='200.287' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23FF7D92'/%3E%3Cstop offset='0.229167' stop-color='%23E3397D'/%3E%3Cstop offset='0.635417' stop-color='%23800CD2'/%3E%3Cstop offset='1' stop-color='%235812D0'/%3E%3C/linearGradient%3E%3ClinearGradient id='paint1_linear_1000_463' x1='100.945' y1='0.286865' x2='100.945' y2='200.287' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23FF7D92'/%3E%3Cstop offset='0.229167' stop-color='%23E3397D'/%3E%3Cstop offset='0.635417' stop-color='%23800CD2'/%3E%3Cstop offset='1' stop-color='%235812D0'/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: cover; background-position: center; diff --git a/includes/Admin/Menu.php b/includes/Admin/Menu.php index 87b7e01fc4..8ef39e3673 100644 --- a/includes/Admin/Menu.php +++ b/includes/Admin/Menu.php @@ -40,7 +40,7 @@ public function add_admin_menu() { $withdraw_text = sprintf( __( 'Withdraw %s', 'dokan-lite' ), '' . $withdraw['pending'] . '' ); } - $dashboard = add_menu_page( __( 'Dokan', 'dokan-lite' ), __( 'Dokan', 'dokan-lite' ), $capability, $slug, [ $this, 'dashboard' ], 'data:image/svg+xml;base64,' . base64_encode( '' ), $menu_position ); + $dashboard = add_menu_page( __( 'Dokan', 'dokan-lite' ), __( 'Dokan', 'dokan-lite' ), $capability, $slug, [ $this, 'dashboard' ], 'data:image/svg+xml;base64,' . base64_encode( '' ), $menu_position ); if ( current_user_can( $capability ) ) { $submenu[ $slug ][] = [ __( 'Dashboard', 'dokan-lite' ), $capability, 'admin.php?page=' . $slug . '#/' ]; diff --git a/includes/Admin/Notices/Manager.php b/includes/Admin/Notices/Manager.php index 2eac5e9bea..1deeba8dcf 100644 --- a/includes/Admin/Notices/Manager.php +++ b/includes/Admin/Notices/Manager.php @@ -48,7 +48,9 @@ private function init_hooks() { add_action( 'admin_notices', [ $this, 'render_missing_woocommerce_notice' ] ); add_action( 'admin_notices', [ $this, 'render_global_admin_notices_html' ] ); add_filter( 'dokan_admin_notices', [ $this, 'show_permalink_setting_notice' ] ); + add_filter( 'dokan_admin_notices', [ $this, 'show_admin_logo_update_notice' ] ); add_filter( 'dokan_admin_notices', [ $this, 'show_one_step_product_add_notice' ] ); + add_action( 'wp_ajax_dismiss_dokan_admin_logo_update_notice', [ $this, 'dismiss_dokan_admin_logo_update_notice' ] ); add_action( 'wp_ajax_dismiss_dokan_one_step_product_notice', [ $this, 'dismiss_dokan_one_step_product_notice' ] ); } @@ -139,12 +141,12 @@ public function show_permalink_setting_notice( $notices ) { public function show_one_step_product_add_notice( $notices ) { if ( 'yes' !== get_option( 'dismiss_dokan_one_step_product_nonce', 'no' ) ) { $notices[] = [ - 'type' => 'alert', - 'title' => __( 'New One-Step Product Form', 'dokan-lite' ), - 'description' => __( 'Try it now to enhance your vendor\'s product upload experience, the older two-step version will be retired in one month.', 'dokan-lite' ), - 'priority' => 1, + 'priority' => 1, 'show_close_button' => true, - 'ajax_data' => [ + 'type' => 'alert', + 'title' => __( 'New One-Step Product Form', 'dokan-lite' ), + 'description' => __( 'Try it now to enhance your vendor\'s product upload experience, the older two-step version will be retired in one month.', 'dokan-lite' ), + 'ajax_data' => [ 'action' => 'dismiss_dokan_one_step_product_notice', 'nonce' => wp_create_nonce( 'dismiss_dokan_one_step_product_nonce' ), ], @@ -154,6 +156,33 @@ public function show_one_step_product_add_notice( $notices ) { return $notices; } + /** + * Display dokan admin logo update notice. + * + * @since DOKAN_SINCE + * + * @param array $notices + * + * @return array + */ + public function show_admin_logo_update_notice( array $notices ): array { + if ( 'yes' !== get_option( 'dismiss_dokan_admin_logo_nonce', 'no' ) ) { + $notices[] = [ + 'priority' => 1, + 'show_close_button' => true, + 'type' => 'info', + 'title' => __( 'New Dokan Logo!', 'dokan-lite' ), + 'description' => __( 'Introducing our fresh new logo! Keep an eye for out for it in your admin dashboard.', 'dokan-lite' ), + 'ajax_data' => [ + 'action' => 'dismiss_dokan_admin_logo_update_notice', + 'nonce' => wp_create_nonce( 'dismiss_dokan_admin_logo_nonce' ), + ], + ]; + } + + return $notices; + } + /** * Dismisses one-step product create notice. * @@ -162,7 +191,33 @@ public function show_one_step_product_add_notice( $notices ) { * @return void */ public function dismiss_dokan_one_step_product_notice() { - if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), 'dismiss_dokan_one_step_product_nonce' ) ) { + // Check nonce actions, permissions & dismiss dokan admin logo notice. + $this->dismiss_notice( 'dismiss_dokan_one_step_product_nonce' ); + } + + /** + * Dismisses dokan admin logo update notice. + * + * @since DOKAN_SINCE + * + * @return void + */ + public function dismiss_dokan_admin_logo_update_notice() { + // Check nonce actions, permissions & dismiss dokan admin logo notice. + $this->dismiss_notice( 'dismiss_dokan_admin_logo_nonce' ); + } + + /** + * Dismisses dokan notice. + * + * @since DOKAN_SINCE + * + * @param string $option_name The name of the option to update. + * + * @return void + */ + private function dismiss_notice( string $option_name ) { + if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), $option_name ) ) { wp_send_json_error( __( 'Invalid nonce', 'dokan-lite' ) ); } @@ -171,7 +226,7 @@ public function dismiss_dokan_one_step_product_notice() { wp_send_json_error( __( 'You have no permission to do that', 'dokan-lite' ) ); } - update_option( 'dismiss_dokan_one_step_product_nonce', 'yes' ); + update_option( $option_name, 'yes' ); wp_send_json_success(); } } From 6775f6de6e22d79b93d63d76ebb203a4347d349b Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Fri, 26 Apr 2024 16:45:24 +0600 Subject: [PATCH 02/40] add: updated admin dashboard logo png --- assets/images/dokan-logo.png | Bin 3613 -> 3578 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/assets/images/dokan-logo.png b/assets/images/dokan-logo.png index ea81c5bb1c9bc55a69a31d6511b0a5cf1d45e90c..ba298c67cdd3c7a92fd8f94fc15a2d8e18017bba 100644 GIT binary patch literal 3578 zcmVAaoV^A` zQBJInC`dM!$Q+P+6D1--iI+qoVu1C*aP0N_tkSe>|pNjl{(g&hY_`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I)LUi*!=;tJ;t}lyxvLYyG=Q;i z=xD26%YrlC)grD;41;3x9#vhMu!X@e&Eg~+rodWRTZ)Cgvlfd5!?Z}F!l8hGWHSp{ jl(oWJGcrs_2qFFtdXkJ`8G9aT00000NkvXXu0mjfdA-n_ From 0da43369d67e7e1107ec8d2102f29784245233bb Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Thu, 2 May 2024 12:36:46 +0600 Subject: [PATCH 03/40] update: logo update nonce name, comments position, update notice description & remove one-step notice. --- includes/Admin/Notices/Manager.php | 56 +++++------------------------- 1 file changed, 8 insertions(+), 48 deletions(-) diff --git a/includes/Admin/Notices/Manager.php b/includes/Admin/Notices/Manager.php index 1deeba8dcf..b8c5e7176b 100644 --- a/includes/Admin/Notices/Manager.php +++ b/includes/Admin/Notices/Manager.php @@ -49,9 +49,7 @@ private function init_hooks() { add_action( 'admin_notices', [ $this, 'render_global_admin_notices_html' ] ); add_filter( 'dokan_admin_notices', [ $this, 'show_permalink_setting_notice' ] ); add_filter( 'dokan_admin_notices', [ $this, 'show_admin_logo_update_notice' ] ); - add_filter( 'dokan_admin_notices', [ $this, 'show_one_step_product_add_notice' ] ); add_action( 'wp_ajax_dismiss_dokan_admin_logo_update_notice', [ $this, 'dismiss_dokan_admin_logo_update_notice' ] ); - add_action( 'wp_ajax_dismiss_dokan_one_step_product_notice', [ $this, 'dismiss_dokan_one_step_product_notice' ] ); } /** @@ -129,33 +127,6 @@ public function show_permalink_setting_notice( $notices ) { return $notices; } - /** - * Display single page product page create notice. - * - * @since 3.8.2 - * - * @param array $notices - * - * @return array - */ - public function show_one_step_product_add_notice( $notices ) { - if ( 'yes' !== get_option( 'dismiss_dokan_one_step_product_nonce', 'no' ) ) { - $notices[] = [ - 'priority' => 1, - 'show_close_button' => true, - 'type' => 'alert', - 'title' => __( 'New One-Step Product Form', 'dokan-lite' ), - 'description' => __( 'Try it now to enhance your vendor\'s product upload experience, the older two-step version will be retired in one month.', 'dokan-lite' ), - 'ajax_data' => [ - 'action' => 'dismiss_dokan_one_step_product_notice', - 'nonce' => wp_create_nonce( 'dismiss_dokan_one_step_product_nonce' ), - ], - ]; - } - - return $notices; - } - /** * Display dokan admin logo update notice. * @@ -166,16 +137,16 @@ public function show_one_step_product_add_notice( $notices ) { * @return array */ public function show_admin_logo_update_notice( array $notices ): array { - if ( 'yes' !== get_option( 'dismiss_dokan_admin_logo_nonce', 'no' ) ) { + if ( 'yes' !== get_option( 'dismiss_dokan_admin_logo_update_notice', 'no' ) ) { $notices[] = [ 'priority' => 1, 'show_close_button' => true, 'type' => 'info', 'title' => __( 'New Dokan Logo!', 'dokan-lite' ), - 'description' => __( 'Introducing our fresh new logo! Keep an eye for out for it in your admin dashboard.', 'dokan-lite' ), + 'description' => __( 'Introducing the new freshly designed Dokan Logo. Keep an eye on your admin dashboard!!', 'dokan-lite' ), 'ajax_data' => [ 'action' => 'dismiss_dokan_admin_logo_update_notice', - 'nonce' => wp_create_nonce( 'dismiss_dokan_admin_logo_nonce' ), + 'nonce' => wp_create_nonce( 'dismiss_dokan_admin_logo_update_notice_nonce' ), ], ]; } @@ -183,18 +154,6 @@ public function show_admin_logo_update_notice( array $notices ): array { return $notices; } - /** - * Dismisses one-step product create notice. - * - * @since 3.8.2 - * - * @return void - */ - public function dismiss_dokan_one_step_product_notice() { - // Check nonce actions, permissions & dismiss dokan admin logo notice. - $this->dismiss_notice( 'dismiss_dokan_one_step_product_nonce' ); - } - /** * Dismisses dokan admin logo update notice. * @@ -203,8 +162,7 @@ public function dismiss_dokan_one_step_product_notice() { * @return void */ public function dismiss_dokan_admin_logo_update_notice() { - // Check nonce actions, permissions & dismiss dokan admin logo notice. - $this->dismiss_notice( 'dismiss_dokan_admin_logo_nonce' ); + $this->dismiss_notice( 'dismiss_dokan_admin_logo_update_notice' ); } /** @@ -217,15 +175,17 @@ public function dismiss_dokan_admin_logo_update_notice() { * @return void */ private function dismiss_notice( string $option_name ) { - if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), $option_name ) ) { + // Check nonce actions. + if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), $option_name . '_nonce' ) ) { wp_send_json_error( __( 'Invalid nonce', 'dokan-lite' ) ); } - // phpcs:ignore + // Check permission. if ( ! current_user_can( 'manage_woocommerce' ) ) { wp_send_json_error( __( 'You have no permission to do that', 'dokan-lite' ) ); } + // Dismiss dokan admin logo notice. update_option( $option_name, 'yes' ); wp_send_json_success(); } From 30faf7a7751463bac12714852b47998455321b6c Mon Sep 17 00:00:00 2001 From: MdAsifHossainNadim Date: Thu, 2 May 2024 13:01:02 +0600 Subject: [PATCH 04/40] fix: add phpcs for unknown capability --- includes/Admin/Notices/Manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Admin/Notices/Manager.php b/includes/Admin/Notices/Manager.php index b8c5e7176b..5d5bf7db09 100644 --- a/includes/Admin/Notices/Manager.php +++ b/includes/Admin/Notices/Manager.php @@ -181,7 +181,7 @@ private function dismiss_notice( string $option_name ) { } // Check permission. - if ( ! current_user_can( 'manage_woocommerce' ) ) { + if ( ! current_user_can( 'manage_woocommerce' ) ) { // phpcs:ignore wp_send_json_error( __( 'You have no permission to do that', 'dokan-lite' ) ); } From 885c541a7d3ebe6fdc9b60fb085067423752263e Mon Sep 17 00:00:00 2001 From: osman sufy Date: Fri, 25 Oct 2024 17:33:26 +0600 Subject: [PATCH 05/40] [Update] default color of dokan admin & vendor settings --- assets/src/less/admin.less | 14 +++++++------- assets/src/less/setup.less | 2 +- src/admin/components/ModuleUpgradePopup.vue | 6 +++--- src/admin/pages/ChangeLog.vue | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/assets/src/less/admin.less b/assets/src/less/admin.less index d0e330b323..1471500280 100644 --- a/assets/src/less/admin.less +++ b/assets/src/less/admin.less @@ -161,13 +161,13 @@ } &.active { - color: #dd452c; + color: #7047EB; .dokan-icon { - background-color: rgba(221, 69, 44, 0.15); + background-color: rgba(239, 234, 255, 1); svg path { - fill: #f1634c; + fill: #7047EB; } } @@ -175,7 +175,7 @@ content: ""; width: 6px; height: 6px; - background-color: #dd452c; + background-color: #7047EB; border-radius: 53px; margin-left: 10px; } @@ -194,13 +194,13 @@ } &:hover { - color: #dd452c; + color: #7047EB; .dokan-icon { - background-color: rgba(221, 69, 44, 0.15); + background-color: rgba(239, 234, 255, 1); svg path { - fill: #f1634c; + fill:#7047EB; } } } diff --git a/assets/src/less/setup.less b/assets/src/less/setup.less index bff507e0ba..6d99e851ef 100644 --- a/assets/src/less/setup.less +++ b/assets/src/less/setup.less @@ -1,7 +1,7 @@ @import 'mixins.less'; /* Variables */ -@dokan-color: #f2624d; +@dokan-color: #7047EB; @dokan-color-darken: darken(@dokan-color, 10%); /* Toggle switch */ diff --git a/src/admin/components/ModuleUpgradePopup.vue b/src/admin/components/ModuleUpgradePopup.vue index add89e26f1..d850f9d31b 100644 --- a/src/admin/components/ModuleUpgradePopup.vue +++ b/src/admin/components/ModuleUpgradePopup.vue @@ -178,7 +178,7 @@ export default { margin-top: 5px; .unlock { - color: #FF5722; + color: #7047EB; font-size: 1rem; font-weight: normal; font-family: "SF Pro Text", sans-serif; @@ -212,12 +212,12 @@ export default { font-family: "SF Pro Text", sans-serif; strong { - color: #ff5722; + color: #7047EB; } } .upgrade-button { - background: #FF5722; + background: #7047EB; border-radius: 3px; padding: 10px 18px; font-weight: 400; diff --git a/src/admin/pages/ChangeLog.vue b/src/admin/pages/ChangeLog.vue index ae36365a21..b4e233e4bb 100644 --- a/src/admin/pages/ChangeLog.vue +++ b/src/admin/pages/ChangeLog.vue @@ -365,7 +365,7 @@ ul { background: none; border-radius: 27px; border: none; - color: #cc7376; + color: #5C626A; display: inline-block; position: relative; transition: all .2s ease; @@ -376,7 +376,7 @@ ul { } .active { - background: #FF5722; + background: #7047EB; border-radius: 30px; position: absolute; top: 0; @@ -768,7 +768,7 @@ ul { width: 40px; height: 40px; color: #ffffff; - background: #ff5722; + background: #7047EB; border: 0; position: fixed; right: 10px; From ed0022c2d58972705284294a55ffcd9318a3defe Mon Sep 17 00:00:00 2001 From: osman sufy Date: Mon, 28 Oct 2024 10:55:08 +0600 Subject: [PATCH 06/40] [variables] dokan use for default color. --- assets/src/less/admin.less | 11 ++++++----- assets/src/less/variables.less | 1 + src/admin/components/ModuleUpgradePopup.vue | 8 ++++---- src/admin/pages/ChangeLog.vue | 9 +++++---- 4 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 assets/src/less/variables.less diff --git a/assets/src/less/admin.less b/assets/src/less/admin.less index 1471500280..c4b11af33f 100644 --- a/assets/src/less/admin.less +++ b/assets/src/less/admin.less @@ -1,5 +1,6 @@ @import "mixins.less"; @import "tooltip.less"; +@import "variables.less"; .dokan-admin-header { background: #fff; @@ -161,13 +162,13 @@ } &.active { - color: #7047EB; + color: @dokan-color; .dokan-icon { background-color: rgba(239, 234, 255, 1); svg path { - fill: #7047EB; + fill: @dokan-color; } } @@ -175,7 +176,7 @@ content: ""; width: 6px; height: 6px; - background-color: #7047EB; + background-color: @dokan-color; border-radius: 53px; margin-left: 10px; } @@ -194,13 +195,13 @@ } &:hover { - color: #7047EB; + color: @dokan-color; .dokan-icon { background-color: rgba(239, 234, 255, 1); svg path { - fill:#7047EB; + fill:@dokan-color; } } } diff --git a/assets/src/less/variables.less b/assets/src/less/variables.less new file mode 100644 index 0000000000..1f368211f1 --- /dev/null +++ b/assets/src/less/variables.less @@ -0,0 +1 @@ +@dokan-color: #7047EB; diff --git a/src/admin/components/ModuleUpgradePopup.vue b/src/admin/components/ModuleUpgradePopup.vue index d850f9d31b..4e028fca04 100644 --- a/src/admin/components/ModuleUpgradePopup.vue +++ b/src/admin/components/ModuleUpgradePopup.vue @@ -128,7 +128,7 @@ export default { diff --git a/src/admin/pages/VendorCapabilities.vue b/src/admin/pages/VendorCapabilities.vue index fba37edd52..1ff3ce327d 100644 --- a/src/admin/pages/VendorCapabilities.vue +++ b/src/admin/pages/VendorCapabilities.vue @@ -1,7 +1,7 @@ - - -