wedocs-plugin
wedocs-plugin copied to clipboard
Grant delete capability to admin and editor by default, also to roles selected on wedocs pro global permission settings
…so to roles selected on wedocs pro global permission settings
Issue: https://github.com/weDevsOfficial/wedocs-pro/issues/90
Summary by CodeRabbit
-
New Features
- Enhanced the
wedocssearch block with customizable attributes, improving user control over its appearance and behavior. - Introduced a new method to grant delete capabilities to specific user roles, enhancing security and role management.
- Enhanced the
-
Bug Fixes
- Updated asset versioning to reflect recent improvements and ensure compatibility.
-
Style
- Revamped CSS for the
wedocssearch block, improving responsiveness and aesthetics with new styles and variables.
- Revamped CSS for the
-
Documentation
- Added comments in CSS files for better clarity on the source of the styles and debugging assistance.
Walkthrough
The recent updates to the wedocs plugin in WordPress introduce several enhancements, including improved user capability management for document deletion, a modular structure for the Redux store, and extensive customization options for the search block. Changes include the addition of a new Capability class to manage user roles, refined CSS for better aesthetics, and updates to various asset files to ensure compatibility and performance.
Changes
| Files | Change Summary |
|---|---|
assets/build/block.asset.php |
Removed 'react' dependency; updated version from a9f22e2f040c1e4bfcd8 to d05819f3aa7353dc2183. |
assets/build/block.js |
Enhanced wedocs search block with new attributes for customization; improved rendering logic in edit and save functions. |
assets/build/frontend.asset.php |
Updated version from 9452b96fb7f339eb0d86 to a20f12fe6b47034f5721. |
assets/build/frontend.css |
Added comments about CSS source and included source mapping for easier debugging. |
assets/build/frontend.js |
Introduced module system setup for the frontend and integrated CSS extraction via Webpack. |
assets/build/index.asset.php |
Updated version from 43de68933e801be37f9f to ab7a5beedef1700a147e. |
assets/build/index.css |
Added comments and integrated styles from an external carousel library, enhancing existing styles. |
assets/build/print.asset.php |
Updated version from dc9757ca31eec222b3ea to 9585c2e16bdeda6a19a1. |
assets/build/print.js |
Introduced module system and properly marked exports for Webpack compatibility. |
assets/build/store.asset.php |
Updated version from 743cb5f33b454f204fb0 to bd6e30c242bf00a67efe. |
assets/build/store.js |
Restructured Redux store into modular files for actions, reducers, selectors, controls, and resolvers, enhancing maintainability. |
assets/build/style-block.css |
Comprehensive updates to styling for the wedocs search block, improving responsiveness and aesthetics. |
includes/Post_Types.php |
Added grant_delete_capability_to_specific_roles method to manage user capabilities for delete operations based on roles. |
includes/Capability.php |
Introduced new Capability class to manage document deletion permissions based on user roles, with a method to grant capabilities dynamically. |
wedocs.php |
Updated init_classes to include instantiation of the Capability class, enhancing user capability management within the application. |
Sequence Diagram(s)
sequenceDiagram
participant User
participant Editor
participant SearchBlock
participant ReduxStore
participant Capability
User->>Editor: Opens search block
Editor->>SearchBlock: Configure attributes (e.g., color, width)
SearchBlock-->>Editor: Update preview
User->>SearchBlock: Submits search
SearchBlock->>ReduxStore: Fetch results
ReduxStore-->>SearchBlock: Return results
SearchBlock-->>User: Display results
User->>Capability: Attempts to delete document
Capability->>User: Validate permissions
Capability-->>User: Grant or deny delete capabilities
🐰 In the meadow where rabbits hop,
Changes frolic, they never stop!
With search blocks that dance and play,
User roles now hold sway!
CSS shines, oh so bright,
In our burrow, all feels right! 🌟
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?
Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai generate interesting stats about this repository and render them as a table.@coderabbitai show all the console.log statements in this repository.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (invoked as PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
The Move To Trash button for an "Editor" works now but is getting some errors in the debug log. Can you give a feedback regarding this? @haideralibd vai
[09-Aug-2024 09:14:26 UTC] PHP Notice: Undefined offset: 0 in /Users/RubaiyatQA/Sites/wedocs/wp-content/plugins/wedocs-plugin/includes/Capability.php on line 39
@Rubaiyat-E-Mohammad bhai, i have fixed the issue. Please take a pull and test. Thanks.
NIcely fixed