wedocs-plugin
wedocs-plugin copied to clipboard
Fix contributor upgrade buttons and permission management link behavior
This PR removes the upgrade button overlays from contributors feature in the free plugin and restores the Permission Management link functionality to match v1.1.8 behavior. Close issue
Changes:
Free Plugin (wedocs):
-
Removed contributor upgrade buttons (ProPreviews/index.js):
- Removed
wedocs_article_contributorsfilter (article pages) - Removed
wedocs_documentation_contributorsfilter (documentation list) - Removed unused
Contributorsimport - Contributors now only show when Pro is active with actual data
- Removed
-
Fixed Permission Management link (ProPreviews/index.js):
- Removed
wedocs_article_restriction_menufilter that wrapped link with upgrade popup - Changed from upgrade popup to functional link pointing to
/settings/permission - Link now opens the Permission Settings demo page in free plugin
- Removed
-
Added Permission Management demo route (App.js):
- Added
settings/permissionroute usingPermissionSettingsDemocomponent - Route shows permission manager UI as preview/demo (same layout as Pro)
- Added
settings/:panelroute for general settings subpages
- Added
Behavior:
Free Plugin Only:
- Contributors: No upgrade buttons shown (clean UI)
- Permission Management: Opens
/settings/permissiondemo page - Demo page shows permission manager interface with disabled save button
With Pro Active:
- Contributors: Show actual contributor data (no upgrade buttons)
- Permission Management: Opens
/manager/{doc_id}with full functionality - Pro's routes and components take precedence via filter priority
Fixes:
- Issue where contributor upgrade buttons appeared even with Pro active
- 404 error on
/settings/permissionroute in free plugin - Permission Management link wrapped in non-functional upgrade popup
Tested:
- ✅ Free plugin builds successfully
- ✅ Pro plugin builds successfully
- ✅ No route conflicts between free and Pro
- ✅ Contributors feature works correctly in both plugins
- ✅ Permission Management link opens correct page in both plugins
Summary by CodeRabbit
-
New Features
- Added permission settings page.
-
Removed Features
- Removed contributor previews.
- Removed article restriction menu preview.
-
Improvements
- Updated permission management UI to use direct links instead of popups.
Walkthrough
Added two settings routes to the app, removed several Pro preview filter registrations and Contributors usage, changed an article preview UI item to link directly to permission settings, and imported ProPreviews in the app entry for its side-effects.
Changes
| Cohort / File(s) | Summary |
|---|---|
Routing changes src/components/App.js |
Added settings/permission route mapping to PermissionSettingsDemo and dynamic settings/:panel route mapping to SettingsPage; preserved routes order and NotFound fallback; removed a local ProPreviews import reference. |
Pro previews removal & UI tweak src/components/ProPreviews/index.js |
Removed public filter registrations wedocs_documentation_contributors_preview, wedocs_article_contributors_preview, and wedocs_article_restriction_menu_preview; dropped Contributors usage; replaced UpgradePopup-based article restriction menu preview with a direct anchor link to permission settings. |
Module import for side-effects src/index.js |
Added import './components/ProPreviews' and wrapped App render in a deferred renderApp to conditionally render immediately when window.weDocsPro_Vars exists or defer via setTimeout; moved root creation/App render inside renderApp. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~25 minutes
- Verify
PermissionSettingsDemoandSettingsPageimports/exports and route behavior (static and dynamic). - Ensure removal of preview filter registrations does not break consumers expecting those hooks.
- Confirm the direct anchor link in article doc-type preview navigates correctly and that removing UpgradePopup has no unintended UI regressions.
- Validate
src/index.jsside-effect import does not introduce circular imports or change initialization timing unexpectedly.
Possibly related PRs
- weDevsOfficial/wedocs-plugin#214 — modifies
src/components/ProPreviews/index.jsand contributors preview logic; likely overlaps with contributor-preview removals. - weDevsOfficial/wedocs-plugin#242 — touches routing and permission-settings surface; may conflict with added PermissionSettingsDemo routes.
- weDevsOfficial/wedocs-plugin#255 — adjusts Pro preview filter registrations that this change removes; closely related to preview registration behavior.
Suggested labels
QA Approved, Ready To Merge
Suggested reviewers
- iftakharul-islam
Poem
🐰 I hopped through routes both new and bright,
I nudged some previews out of sight,
A link now points where popups stood,
Side-effect imports to keep the hood,
Tiny paws applaud the tidy flight.
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately describes the main changes: removing contributor upgrade buttons and fixing permission management link behavior, which aligns with the core modifications across App.js, ProPreviews, and index.js. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✨ Finishing touches
- [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Without pro activation, no pro feature is showing. after activating pro, license not needed to use profeatures @arifulhoque7 vai https://www.dropbox.com/scl/fi/bq6d93agqthtu1esimu0q/Screen-Recording-2025-11-10-at-4.41.05-PM.mov?rlkey=9puhafpjsuml0925fpebll6l1&dl=0
check now, it should work @Rubaiyat-E-Mohammad vai