feat(settings): Jira config UI — admin config tab + per-user token in Profile
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled

- backend: add parent_ticket field to JiraConfigOut/JiraConfigUpdate/_JIRA_KEYS
- backend: add get_jira_parent_ticket() helper in jira_service; use it in auto_create_test_issue() to set issue parent
- frontend/api: add jira_token_set to UserMeOut, jira_api_token to UserPreferencesUpdate, and full JiraConfigOut/Update types with getJiraConfig/updateJiraConfig/testJiraConnection functions
- frontend: expand ProfileSection with Jira API token password field (show/hide), token status badge, and account-id field
- frontend: add JiraConfigSection component (admin): enabled toggle, URL, project key, parent ticket, save + test connection
- frontend: add Jira tab (admin-only) with Link2 icon in SettingsPage sidebar
This commit is contained in:
kitos
2026-05-26 16:23:24 +02:00
parent 2675a4b7c2
commit f316a249cc
4 changed files with 320 additions and 29 deletions

View File

@@ -120,6 +120,7 @@ export interface NotificationPreferences {
export interface UserPreferencesUpdate {
notification_preferences?: Partial<NotificationPreferences>;
jira_account_id?: string | null;
jira_api_token?: string | null;
}
export interface UserMeOut {
@@ -133,6 +134,7 @@ export interface UserMeOut {
last_login: string | null;
notification_preferences: NotificationPreferences | null;
jira_account_id: string | null;
jira_token_set: boolean;
}
export async function getMe(): Promise<UserMeOut> {
@@ -145,3 +147,36 @@ export async function updateMyPreferences(payload: UserPreferencesUpdate): Promi
return data;
}
// ---------------------------------------------------------------------------
// Jira system config (admin only)
// ---------------------------------------------------------------------------
export interface JiraConfigOut {
enabled: boolean;
url: string;
project_key: string;
parent_ticket: string;
}
export interface JiraConfigUpdate {
enabled?: boolean;
url?: string;
project_key?: string;
parent_ticket?: string;
}
export async function getJiraConfig(): Promise<JiraConfigOut> {
const { data } = await client.get<JiraConfigOut>("/system/jira-config");
return data;
}
export async function updateJiraConfig(payload: JiraConfigUpdate): Promise<JiraConfigOut> {
const { data } = await client.patch<JiraConfigOut>("/system/jira-config", payload);
return data;
}
export async function testJiraConnection(): Promise<{ status: string; connected_as: string; jira_url: string }> {
const { data } = await client.post("/system/jira-test");
return data;
}