Move status and audit label constants to shared/constants/labels
STATUS_LABELS was defined in the server, AUDIT_LABELS and AUDIT_COLORS in the client. Both layers now import from a single shared source. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -63,29 +63,7 @@ const SEVERITY_OPTIONS = [
|
|||||||
{ value: 5, label: 'SEV 5 — Minimal' },
|
{ value: 5, label: 'SEV 5 — Minimal' },
|
||||||
];
|
];
|
||||||
|
|
||||||
const AUDIT_LABELS: Record<string, string> = {
|
import { AUDIT_LABELS, AUDIT_COLORS } from '../../../shared/constants/labels';
|
||||||
CREATED: 'created this ticket',
|
|
||||||
STATUS_CHANGED: 'changed status',
|
|
||||||
ASSIGNEE_CHANGED: 'changed assignee',
|
|
||||||
SEVERITY_CHANGED: 'changed severity',
|
|
||||||
REROUTED: 'rerouted ticket',
|
|
||||||
TITLE_CHANGED: 'updated title',
|
|
||||||
OVERVIEW_CHANGED: 'updated overview',
|
|
||||||
COMMENT_ADDED: 'added a comment',
|
|
||||||
COMMENT_DELETED: 'deleted a comment',
|
|
||||||
};
|
|
||||||
|
|
||||||
const AUDIT_COLORS: Record<string, string> = {
|
|
||||||
CREATED: 'bg-green-500',
|
|
||||||
STATUS_CHANGED: 'bg-blue-500',
|
|
||||||
ASSIGNEE_CHANGED: 'bg-purple-500',
|
|
||||||
SEVERITY_CHANGED: 'bg-orange-500',
|
|
||||||
REROUTED: 'bg-cyan-500',
|
|
||||||
TITLE_CHANGED: 'bg-gray-500',
|
|
||||||
OVERVIEW_CHANGED: 'bg-gray-500',
|
|
||||||
COMMENT_ADDED: 'bg-gray-500',
|
|
||||||
COMMENT_DELETED: 'bg-red-500',
|
|
||||||
};
|
|
||||||
|
|
||||||
const COMMENT_ACTIONS = new Set(['COMMENT_ADDED', 'COMMENT_DELETED']);
|
const COMMENT_ACTIONS = new Set(['COMMENT_ADDED', 'COMMENT_DELETED']);
|
||||||
|
|
||||||
|
|||||||
@@ -40,12 +40,7 @@ const ticketListInclude = {
|
|||||||
_count: { select: { comments: true, attachments: true } },
|
_count: { select: { comments: true, attachments: true } },
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
const STATUS_LABELS: Record<string, string> = {
|
import { STATUS_LABELS } from '../../../shared/constants/labels';
|
||||||
OPEN: 'Open',
|
|
||||||
IN_PROGRESS: 'In Progress',
|
|
||||||
RESOLVED: 'Resolved',
|
|
||||||
CLOSED: 'Closed',
|
|
||||||
};
|
|
||||||
|
|
||||||
export type TicketFilters = {
|
export type TicketFilters = {
|
||||||
status?: string;
|
status?: string;
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
export const STATUS_LABELS: Record<string, string> = {
|
||||||
|
OPEN: 'Open',
|
||||||
|
IN_PROGRESS: 'In Progress',
|
||||||
|
RESOLVED: 'Resolved',
|
||||||
|
CLOSED: 'Closed',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const AUDIT_LABELS: Record<string, string> = {
|
||||||
|
CREATED: 'created this ticket',
|
||||||
|
STATUS_CHANGED: 'changed status',
|
||||||
|
ASSIGNEE_CHANGED: 'changed assignee',
|
||||||
|
SEVERITY_CHANGED: 'changed severity',
|
||||||
|
REROUTED: 'rerouted ticket',
|
||||||
|
TITLE_CHANGED: 'updated title',
|
||||||
|
OVERVIEW_CHANGED: 'updated overview',
|
||||||
|
COMMENT_ADDED: 'added a comment',
|
||||||
|
COMMENT_DELETED: 'deleted a comment',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const AUDIT_COLORS: Record<string, string> = {
|
||||||
|
CREATED: 'bg-green-500',
|
||||||
|
STATUS_CHANGED: 'bg-blue-500',
|
||||||
|
ASSIGNEE_CHANGED: 'bg-purple-500',
|
||||||
|
SEVERITY_CHANGED: 'bg-orange-500',
|
||||||
|
REROUTED: 'bg-cyan-500',
|
||||||
|
TITLE_CHANGED: 'bg-gray-500',
|
||||||
|
OVERVIEW_CHANGED: 'bg-gray-500',
|
||||||
|
COMMENT_ADDED: 'bg-gray-500',
|
||||||
|
COMMENT_DELETED: 'bg-red-500',
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user