-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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`.
- Loading branch information
1 parent
63d1c87
commit 432db1c
Showing
16 changed files
with
218 additions
and
134 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
import type { Author } from "./Author"; | ||
|
||
/** | ||
* Everything that can be done in the system is represented by an `Op`. | ||
* Operations are applied to an accumulator to yield a final state. | ||
*/ | ||
export type Operation<A> = { | ||
id: string; | ||
actions: Array<A>; | ||
author: Author; | ||
timestamp: number; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script lang="ts"> | ||
import type { Operation } from "@bindings/cob/Operation"; | ||
import type { Action } from "@bindings/cob/patch/Action"; | ||
import { authorForNodeId, formatTimestamp } from "@app/lib/utils"; | ||
import Border from "@app/components/Border.svelte"; | ||
import NodeId from "@app/components/NodeId.svelte"; | ||
import PatchStateBadge from "./PatchStateBadge.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 | ||
<PatchStateBadge state={action.state} /> | ||
{formatTimestamp(op.timestamp)} | ||
</div> | ||
</div> | ||
</Border> |
Oops, something went wrong.