Skip to content

Commit

Permalink
feat: add stakwork workflow link to ticket editor
Browse files Browse the repository at this point in the history
  • Loading branch information
saithsab877 committed Dec 13, 2024
1 parent 72f8efd commit 09dbb54
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
20 changes: 15 additions & 5 deletions src/people/widgetViews/PhasePlannerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,21 @@ const PhasePlannerView: React.FC = observer(() => {
return;
}

if (data.ticket_uuid && data.swwf_id) {
setSwwfLinks((prev: Record<string, string>) => ({
...prev,
[data.ticket_uuid]: data.swwf_id
}));
if (data.action === 'swrun' && data.message && data.ticketDetails?.ticketUUID) {
try {
const stakworkId = data.message.replace(
'https://jobs.stakwork.com/admin/projects/',
''
);
if (stakworkId) {
setSwwfLinks((prev: Record<string, string>) => ({
...prev,
[data.ticketDetails.ticketUUID]: stakworkId
}));
}
} catch (error) {
console.error('Error processing Stakwork URL:', error);
}
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/store/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ export interface TicketMessage {
broadcastType: 'pool' | 'direct';
sourceSessionID: string;
message: string;
action: 'process' | 'message' | 'run-link';
action: 'process' | 'message' | 'run-link' | 'swrun';
ticketDetails: Ticket;
}

Expand Down

0 comments on commit 09dbb54

Please sign in to comment.