Files
radicle-desktop/src/components/IssueTimelineLifecycleAction.svelte
T
Sebastian Martinez 432db1ce5b Make Operation generic, and handle patch operations
So far we only supported issue operations on the `activity_by_id`
command.

With this commit we separate the commands into a `activity_by_issue` and
`activity_by_patch` command that calls a generic `activity_by_id` trait
implementation.

`Operation` now takes as a generic either `cob/issue/Action.ts` or
`cob/patch/Action.ts`.

Also `Operation` now stores the array of all `Action` that happened on
said operation. I'm not entirely sure if this will help us in the
future, but it represents more closely the state of the relation between
an `Operation` and the cob `Actions`.
2025-01-10 10:33:32 -06:00

29 lines
847 B
Svelte

<script lang="ts">
import type { Operation } from "@bindings/cob/Operation";
import type { Action } from "@bindings/cob/issue/Action";
import { authorForNodeId, formatTimestamp } from "@app/lib/utils";
import Border from "@app/components/Border.svelte";
import IssueStateBadge from "@app/components/IssueStateBadge.svelte";
import NodeId from "@app/components/NodeId.svelte";
interface Props {
action: Extract<Action, { type: "lifecycle" }>;
op: Operation<Action>;
}
const { op, action }: Props = $props();
</script>
<Border variant="float" stylePadding="1rem">
<div class="txt-small">
<div class="global-flex txt-small">
<NodeId {...authorForNodeId(op.author)} />
changed status to
<IssueStateBadge state={action.state} />
{formatTimestamp(op.timestamp)}
</div>
</div>
</Border>