8000 🎯 fix: General section under admin settings wasn't expanding by default after activating wePOS Pro by devAsadNur · Pull Request #165 · getdokan/wepos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

🎯 fix: General section under admin settings wasn't expanding by default after activating wePOS Pro #165

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

Conversation

devAsadNur
Copy link
Member
@devAsadNur devAsadNur commented Feb 25, 2025

Before:

Screenshot at Jun 05 15-59-09

After:

Screenshot

Summary by CodeRabbit

  • Bug Fixes
    • Improved the settings panel behavior by ensuring that a previously saved tab preference is only applied when multiple settings sections are available. This change prevents an incorrect tab activation when only one section exists, enhancing the admin interface consistency.

@devAsadNur devAsadNur added Needs Dev Review This PR needs review by a developer Needs Testing This requires further testing labels Feb 25, 2025
@devAsadNur devAsadNur self-assigned this Feb 25, 2025
Copy link
coderabbitai bot commented Feb 25, 2025

Walkthrough

This change updates the logic in the Vue component’s created lifecycle hook for initializing the currentTab property. Instead of relying solely on the active tab value from localStorage, it now also checks if there are multiple settings sections available. If both conditions (active tab exists and more than one settings section) are met, currentTab is set from localStorage; otherwise, it defaults to 'wepos_general'.

Changes

File Summary
assets/.../components/Settings.vue Modified the created hook to conditionally restore currentTab based on localStorage active tab and the count of settings sections.

Sequence Diagram(s)

sequenceDiagram
    participant VC as Vue Component
    participant LS as localStorage
    participant WS as Settings Sections

    VC->>LS: Retrieve active tab value
    LS-->>VC: Return active tab (if exists)
    VC->>WS: Check settings sections length
    WS-->>VC: Return number of sections
    alt Active tab exists AND sections > 1
        VC->>VC: Set currentTab from localStorage
    else
        VC->>VC: Set currentTab to 'wepos_general'
    end
Loading

Poem

I'm a coding rabbit, quick and light,
Hopping through changes day and night.
Local storage meets condition's test,
In settings, only the multiple pass the quest.
With a hop and a skip, code feels just right!
🌟🐇 Happy coding, every byte in sight!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between babdb26 and 31c818d.

📒 Files selected for processing (1)
  • assets/src/admin/components/Settings.vue (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: e2e_api tests
🔇 Additional comments (1)
assets/src/admin/components/Settings.vue (1)

185-185: Clean fix for the default section expansion issue!

This change effectively addresses the issue where the General section wasn't expanding by default after activating wePOS Pro. By adding the condition wepos.settings_sections.length > 1, the code now ensures that when there's only one settings section available (which happens right after activation), it will always default to 'wepos_general' regardless of what might be stored in localStorage from previous sessions.


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?

❤️ Share
🪧 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>, please review it.
    • 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 @coderabbitai in 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 @coderabbitai in 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file 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.

@devAsadNur devAsadNur changed the title fix: General section under admin settings wasn't expanding by default after activating wePOS Pro 🎯 fix: General section under admin settings wasn't expanding by default after activating wePOS Pro Feb 25, 2025
@devAsadNur devAsadNur requested a review from mrabbani March 3, 2025 03:38
@mrabbani mrabbani added Dev Review Done and removed Needs Dev Review This PR needs review by a developer labels May 22, 2025
@dev-shahed dev-shahed added QA Approved This PR is approved by the QA team and removed Needs Testing This requires further testing labels Jun 16, 2025
@devAsadNur devAsadNur merged commit 7ac45cc into develop Jun 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dev Review Done QA Approved This PR is approved by the QA team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0