Skip to content

RM-44: Add more ticket permission#100

Merged
BenHall-1 merged 7 commits intomasterfrom
RM-44
Mar 8, 2026
Merged

RM-44: Add more ticket permission#100
BenHall-1 merged 7 commits intomasterfrom
RM-44

Conversation

@biast12
Copy link
Copy Markdown
Contributor

@biast12 biast12 commented Mar 7, 2026

Expose fine-grained ticket permissions for panels so ticket openers can be granted specific capabilities. Backend: add TicketPermissions to panelBody and map its fields to panel TicketPerms* properties in CreatePanel and UpdatePanel. Frontend: initialize/normalize legacy tp_* fields into data.ticket_permissions, add defaults, and add a "Ticket Permissions" collapsible UI with checkboxes in PanelCreationForm; also add corresponding checkboxes in SettingsCard. Misc: enable local replace for the database module in go.mod and bump the locale submodule commit.
Remove the block that constructed data.ticket_permissions from tp_* flags in PanelCreationForm.svelte. This cleans up unused or redundant initialization logic; remaining code (e.g. tempColour assignment) is unchanged.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 7, 2026

Deploying tickets-v2-dashboard with  Cloudflare Pages  Cloudflare Pages

Latest commit: e627fb7
Status: ✅  Deploy successful!
Preview URL: https://384fb7a9.tickets-v2-dashboard.pages.dev
Branch Preview URL: https://rm-44.tickets-v2-dashboard.pages.dev

View logs

biast12 added 3 commits March 8, 2026 00:02
Replace the previous flex/row layout with a responsive CSS grid for ticket permission checkboxes in PanelCreationForm.svelte and SettingsCard.svelte. Checkboxes are now wrapped in a .permissions-grid (grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) with column/row gaps) to improve alignment and responsiveness across screen sizes.
Align the order of ticket permission fields between backend and frontend. Update CreatePanel/UpdatePanel to assign EmbedLinks/AttachFiles/SendVoiceMessages in the new order, and adjust PanelCreationForm and SettingsCard to reflect the same checkbox ordering and default mapping. This is a refactor to keep API and UI consistent; no permission semantics were changed.
Move panel ticket permission handling to a dedicated storage layer. Create and Update endpoints now save TicketPermissions via dbclient.Client.PanelTicketPermissions.Set instead of assigning individual panel fields. List endpoint includes TicketPermissions in the response by fetching them with PanelTicketPermissions.Get. Frontend PanelCreationForm initialization simplified to a default ticket_permissions object (all false) and no longer maps legacy flattened tp_* fields. This centralizes permission data and removes per-field assignments in the handlers.
@BenHall-1
Copy link
Copy Markdown
Member

db merged, pls bump

@biast12
Copy link
Copy Markdown
Contributor Author

biast12 commented Mar 8, 2026

Database bumped!

@BenHall-1 BenHall-1 merged commit ea705a9 into master Mar 8, 2026
@BenHall-1 BenHall-1 deleted the RM-44 branch March 8, 2026 19:58
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