Open osmansufy opened 3 days ago
The changes in this pull request introduce new functionality for handling admin notices within the Dokan plugin. A new JavaScript file is added to manage these notices, while modifications to the AdminNoticeController
class enhance the retrieval and filtering of notices based on a specified scope. Additionally, a new Vue component is created to display the notices, and the Webpack configuration is updated to include this new component in the build process. Overall, these enhancements aim to improve the admin interface without altering existing functionalities.
File | Change Summary |
---|---|
includes/Assets.php |
Added new JavaScript file dokan-admin-notice-js , updated methods load_dokan_admin_notices_scripts and get_scripts to enqueue and register the new script. |
includes/REST/AdminNoticeController.php |
Updated dokan_get_admin_notices method to accept WP_REST_Request , added scope parameter, and created filtering for notices. |
src/admin/components/AdminNotice.vue |
Introduced new prop scope to the AdminNotice component, modifying AJAX request URL to include scope . |
src/admin/notice/App.vue |
Added a new Vue component App.vue that uses AdminNotice with props for scope , interval , and endpoint . |
src/admin/notice/main.js |
Imported App component, initialized Vue instance if #dokan-admin-notices exists. |
webpack.config.js |
Added new entry point for dokan-admin-notice in the Webpack configuration. |
includes/Upgrade/AdminNotice.php |
Updated show_notice method to include a new key 'scope' with value 'global' in the returned notice array. |
includes/Assets.php
file, which is directly related to the changes in the main PR that also involves updates to the Assets
class, specifically in script registration and localization.includes/Assets.php
file, focusing on the localization of scripts, which aligns with the changes made in the main PR regarding script handling in the Assets
class.includes/Assets.php
file, particularly in the registration and localization of scripts, indicating a direct relationship with the changes made in the main PR.QA approved
, Needs: Testing
🐰 In the land of code, where rabbits hop,
New scripts are added, and notices pop!
With scopes now filtering, and Vue on the scene,
Admins rejoice, it's a developer's dream!
So let’s celebrate with a joyful cheer,
For changes that bring us all good cheer! 🎉
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@getdokan/product, We may need to update the content of the Dokan data migration notice.
@mrabbani vai,
Kindly direct to change the text on Dokan Data Update Required announcement according to below.
"Updating your Dokan data is required to continue functional operations."
Issue: Clicking on upgrader button doesn't work if notice is set to global scope
$notices[] = [
'type' => 'info',
'title' => __( 'Dokan Data Update Required', 'dokan-lite' ),
'description' => __( 'We need to update your install to the latest version', 'dokan-lite' ),
'priority' => 1,
'scope' => 'global',
'actions' => [
[
'type' => 'primary',
'text' => __( 'Update', 'dokan-lite' ),
'loading_text' => __( 'Updating...', 'dokan-lite' ),
'competed_text' => __( 'Updated', 'dokan-lite' ),
'reload' => true,
'confirm_message' => __( 'It is strongly recommended that you backup your database before proceeding. Are you sure you wish to run the updater now?', 'dokan-lite' ),
'ajax_data' => [
'action' => 'dokan_do_upgrade',
'_wpnonce' => wp_create_nonce( 'dokan_admin' ),
],
],
],
];
Please refer to the video attached
https://jam.dev/c/db9e3cf0-3a63-4bbb-b705-afef35d1ce6a
@mralaminahamed bhai
@StalinDurjo vai, issue fix kore diachi. let check the update
All Submissions:
Changes proposed in this Pull Request:
Related Pull Request(s)
Closes
How to test the changes in this Pull Request:
Changelog entry
Title
Detailed Description of the pull request. What was previous behaviour and what will be changed in this PR.
Before Changes
Describe the issue before changes with screenshots(s).
After Changes
Describe the issue after changes with screenshot(s).
Feature Video (optional)
Link of detailed video if this PR is for a feature.
PR Self Review Checklist:
FOR PR REVIEWER ONLY:
Summary by CodeRabbit
Release Notes
New Features
scope
prop to filter admin notices based on context.scope
parameter for REST API requests.Bug Fixes
Documentation
Chores