Skip to content

RM-237: Claimer switchpanel behavior#97

Merged
BenHall-1 merged 7 commits intoTicketsBot-cloud:masterfrom
biast12:RM-237
Mar 8, 2026
Merged

RM-237: Claimer switchpanel behavior#97
BenHall-1 merged 7 commits intoTicketsBot-cloud:masterfrom
biast12:RM-237

Conversation

@biast12
Copy link
Copy Markdown
Contributor

@biast12 biast12 commented Jan 24, 2026

Description

RM-237
This PR adds the handling for claiming / switch panel behavior, what it should do when a panel is being switched when the ticket is claimed

Other required PRs:
TicketsBot-cloud/dashboard#79
TicketsBot-cloud/database#22
TicketsBot-cloud/locale#144
TicketsBot-cloud/docs#27

THIS PR NEEDS THE DATABASE BUMPLED FOR IT TO WORK

Type of Change

  • Bug fix
  • New feature
  • Breaking change

Testing

You need to test all the 4 options:
You need 2 users and 2 panels, user 1 to open the ticket in panel 1 and and user 2 needs to be in a team in panel 1 but not 2, then user 2 needs to claim the ticket, this needs to be repeated with 4 tickets

    1. Switching the panel should automatically unclaim the ticket and not give access for the claimer to move over
    1. Switching the panel should block the switch so it will stay the same panel
    1. Switching the panel should carry the claimer to the new ticket, when they unclaim the ticket will they be removed from the ticket
    1. Switching the panel should carry the claimer to the new ticket, when they unclaim the ticket will they be stay in the ticket

Checklist

  • My code follows the style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Implements logic to handle claimer access when switching panels or unclaiming tickets, based on the SwitchPanelClaimBehavior setting. Adds permission checks to ensure claimers have access to the new panel, supports auto-unclaim and permission overwrite updates, and introduces new i18n messages for these scenarios. Also fixes a bug in GetAllowedStaffUsersAndRoles and adds HasPermissionForPanel helper.
Refactored HasPermissionForTicket to clarify permission checks and extracted IsAdminForGuild as a separate function. The new structure improves readability and separates admin logic from ticket-specific permission checks.
Copy link
Copy Markdown
Member

@BenHall-1 BenHall-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@BenHall-1 BenHall-1 merged commit ec5c348 into TicketsBot-cloud:master Mar 8, 2026
@biast12 biast12 deleted the RM-237 branch March 8, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants