Repository navigation
feat: 2026.08 release - #38
Merged
Merged
Conversation
Signed-off-by: Ben <ben@tickets.bot>
Change Panel.ButtonStyle json tag in panels.go to `"button_style,string"` so the int field is encoded/decoded as a JSON string. This ensures compatibility with APIs that represent button_style as a string and avoids unmarshal errors.
Signed-off-by: Ben <ben@tickets.bot>
Introduce a new AuditActionType constant AuditActionTicketCloseRequest (value 94) in auditlog.go to represent ticket close request actions in the audit log. This distinguishes user-initiated close requests from direct ticket close events for clearer auditing.
Signed-off-by: Ben <ben@tickets.bot>
Signed-off-by: Ben <ben@tickets.bot>
Introduce Panel.ShowInOpenCommand and persist it: add the show_in_open_command column to the panels table, include it in SELECTs, INSERT/UPDATE parameter lists, scans and field pointers, and expose it in multi-panel target queries. Remove the unused ArchiveChannel.GetByPanel method. Simplify and trim Settings by removing several deprecated fields and database columns (hide_claim_button, disable_open_command, use_threads, ticket_notification_channel, exit_survey_form_id, hide_close_button, hide_close_with_reason_button) along with their helper methods; update the settings schema, default values, and Get/Set queries/parameters to match the reduced settings surface. General cleanup to align code and DB schema with current features.
Signed-off-by: Ben <ben@tickets.bot>
Signed-off-by: Ben <ben@tickets.bot>
Move several guild-level settings into panel scope and add per-panel auto-close. Removed legacy global tables (auto_close, close_confirmation, feedback_enabled, users_can_close) and their code. Added panelautoclose.go implementing PanelAutoCloseTable and registered it in database.go. Expanded panels schema and Panel struct with fields (store_transcripts, thread_archive_duration, overflow_enabled, overflow_category_id, users_can_close, close_confirmation, feedback_enabled, support_can_view, support_can_type), updated all related SQL queries, inserts and updates, and added SetOverflow. Simplified ClaimSettings by removing deprecated fields and adjusted its schema/queries. Removed global overflow/transcript settings from settings.go (migrated to panel-level). Updated guild purge and multipanel targets to reflect removed/added columns.
Signed-off-by: Ben <ben@tickets.bot>
Remove the ThreadArchiveDuration property from the Panel struct and all related DB usages. This deletes the column from CREATE TABLE, removes it from SELECT/INSERT/UPDATE statements (and adjusts VALUES parameter counts), and drops the field from fieldPtrs and other references (including multipaneltargets). Updates keep parameter ordering and counts consistent after removal.
Rename the Panel field DeleteMentions (bool) to MentionBehaviour (string) and update all SQL schema/queries and Go mappings accordingly. The DB column is now mention_behaviour varchar(20) DEFAULT 'none', and all SELECT/INSERT/UPDATE statements and fieldPtrs were updated to use the new name. Also fixed a query to join forms by custom_id instead of form_id and added several panel fields to the SELECT (store_transcripts, overflow_enabled, overflow_category_id, users_can_close, close_confirmation, feedback_enabled, support_can_view, support_can_type). This change allows representing mention handling as a behaviour string rather than a boolean.
Remove several legacy database table wrappers (archivechannel.go, namingscheme.go, ticketlimit.go, ticketpermissions.go, welcomemessage.go) and strip their references from Database, NewDatabase and CreateTables so those tables are no longer initialized by the app. Add a TicketPermissions struct into panelticketpermissions.go (consolidating permission fields). Add an EmojiAnimated bool field to Panel (panels.go) and update the SQL schema, SELECT/INSERT/UPDATE statements, parameter ordering/counts and field pointers to include the new emoji_animated column (default false). This change consolidates permission code and introduces support for animated emojis in panels; note that the removed table wrappers mean those DB tables will no longer be managed by CreateTables and related helpers.
Signed-off-by: Ben <ben@tickets.bot>
Signed-off-by: Ben <ben@tickets.bot>
Signed-off-by: Ben <ben@tickets.bot>
Add panels.emoji_animated to the SELECT list in multipanel targets so the query returns the emoji animation flag for panels. This allows the application to correctly handle animated emojis when loading panel records.
Make SQL enum creation idempotent and avoid duplicate_object errors by wrapping ticket_status creation in a DO $$ block in category_update_queue schema and tickets schema; also make guild_ticket_counters CREATE TABLE IF NOT EXISTS. Propagate context in cmd/viewrefresher: create a context, pass it to pgxpool.Connect and doRefresh, and update doRefresh/view.Refresh to accept ctx. Close rows in CategoryUpdateQueue.GetReadyForUpdate to prevent leaks. Alias encoding/json to stdjson in adminanalytics and use stdjson.Unmarshal to avoid naming conflicts. Minor formatting and ordering tweaks in Database initialization and CreateTables (including adding AdminAnalytics to the creation list).
Signed-off-by: Ben <ben@tickets.bot>
Signed-off-by: Ben <ben@tickets.bot>
Add a table helper that returns distinct owner IDs for integrations marked public, so public-integration authors can stay cached.
Adds a new `AuditActionWhitelabelResync` constant with ID 215 for logging whitelabel resync events.
Signed-off-by: Ben <ben@tickets.bot>
Signed-off-by: Ben <ben@tickets.bot>
Introduce `WhitelabelBotTable.GetAll` to fetch every row from the `whitelabel` table and map results into `[]WhitelabelBot`. This adds a straightforward way to list all whitelabel bots without sharder filtering.
Introduce `TryClaim` for ticket claims so claim attempts are atomic and return the existing claimer when the ticket is already claimed. Also add audit log action IDs for ticket claim and unclaim events.
Adds the `AuditActionTicketTransfer` constant with ID 97 to support logging ticket transfer events.
Update notification listing and counting to accept a category slice instead of a single category. The SQL now matches any category in the provided array while still returning all notifications when the filter is nil.
Update the daily ticket stats query to sort by date ascending instead of descending. This returns results in chronological order, which is more suitable for time-series display and processing.
Signed-off-by: Ben <ben@tickets.bot>
Signed-off-by: Ben <ben@tickets.bot>
Extend `GetTopCloseReasonsWithCount` with a `caseInsensitive` flag and build the SQL expression dynamically so close reasons can be grouped by `LOWER(close_reason)` when requested. This ensures top-close-reason counts can treat casing variants as the same reason while preserving existing behavior by default.
Extend KB articles with `show_helpful_count`, `helpful_count`, and `not_helpful_count` fields in the model and schema (including ALTER TABLE backfill for existing installs). Wire the new columns into scans and column lists, persist `show_helpful_count` in create/update queries, and add an atomic `IncrementFeedback` update to safely record anonymous web votes without exposing counts to editor overwrites.
Introduce `SetPositions` on `KBArticlesTable` to reorder KB articles in one SQL statement. It no-ops on empty input and updates each article’s `position` for a guild using an `unnest`/`generate_subscripts` mapping from the ordered ID array.
Introduce `CountAvailableIntegrations` on `CustomIntegrationGuildsTable` to count integrations using the same WHERE logic as `GetAvailableIntegrationsWithActive`. This keeps pagination totals aligned with the listed results by including active guild integrations plus public/approved or owner-accessible ones.
Signed-off-by: Ben <ben@tickets.bot>
Extends `FormInputApiConfig` persistence to support a new optional `body_template` field end-to-end: schema migration, struct field, select/scan paths, and create/update (including Tx variants). Also refactors duplicated row-scanning into a shared helper, introduces a shared column list constant, adds `GetTx`, and reuses `Get` in `GetByFormInputId` for consistency.
Extends bot staff persistence with a new `global_view` flag (schema migration, model field, and read/write methods), restricted to admin-tier users in SQL. Tier upserts/updates now automatically clear `global_view` when a user is not admin, and audit action constants are updated to include `AuditActionBotStaffGlobalViewUpdate` while removing unused ticket/transcript content view action IDs.
Introduces a canonical `StaffAuditActionTypes` list for admin API actions and extends `AuditLogQueryOptions` with `GlobalOnly` and `ActionTypes`. Query building now supports `guild_id IS NULL` filtering when requested and `action_type = ANY(...)` filtering that combines with existing `ActionType` conditions instead of replacing them.
Introduces a `SortBy` option in `TicketQueryOptions` with allowed values for rating and close reason. Query building now conditionally joins `service_ratings` and `close_reason` when sorting by those fields, and switches these joins to `LEFT JOIN` so tickets without related rows are still returned. `ORDER BY` now supports the selected sort field with `NULLS LAST` and a ticket ID tie-breaker for stable pagination, while preserving safe SQL by restricting sortable values to constants.
Update participant count queries to join `tickets` and ignore rows where `participant.user_id` matches `tickets.user_id`. This prevents ticket owners from being counted as participants in both total and duration-based participation metrics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
2026.08 Release
Type of Change
Testing
Checklist