-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Components] kaleido #8866 #12558
base: master
Are you sure you want to change the base?
[Components] kaleido #8866 #12558
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Ignored Deployments
|
WalkthroughThe recent changes introduce new actions for Kaleido, including creating and deleting contracts and creating memberships. It also involves added methods for interacting with the Kaleido API and updating properties for better functionality. The Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CreateContractAction
participant KaleidoAPI
User->>CreateContractAction: Trigger create contract
CreateContractAction->>KaleidoAPI: Send request to create contract
KaleidoAPI-->>CreateContractAction: Return contract creation response
CreateContractAction-->>User: Return result
sequenceDiagram
participant User
participant CreateMembershipAction
participant KaleidoAPI
User->>CreateMembershipAction: Trigger create membership
CreateMembershipAction->>KaleidoAPI: Send request to create membership
KaleidoAPI-->>CreateMembershipAction: Return membership creation response
CreateMembershipAction-->>User: Return result
sequenceDiagram
participant User
participant DeleteContractAction
participant KaleidoAPI
User->>DeleteContractAction: Trigger delete contract
DeleteContractAction->>KaleidoAPI: Send request to delete contract
KaleidoAPI-->>DeleteContractAction: Return contract deletion response
DeleteContractAction-->>User: Return result
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
Files selected for processing (6)
- components/kaleido/actions/create-contract/create-contract.mjs (1 hunks)
- components/kaleido/actions/create-membership/create-membership.mjs (1 hunks)
- components/kaleido/actions/delete-contract/delete-contract.mjs (1 hunks)
- components/kaleido/common/constants.mjs (1 hunks)
- components/kaleido/kaleido.app.mjs (1 hunks)
- components/kaleido/package.json (2 hunks)
Files skipped from review due to trivial changes (1)
- components/kaleido/package.json
Additional context used
Biome
components/kaleido/kaleido.app.mjs
[error] 147-147: Useless rename. (lint/complexity/noUselessRename)
Safe fix: Remove the renaming.
[error] 155-155: Useless rename. (lint/complexity/noUselessRename)
Safe fix: Remove the renaming.
Additional comments not posted (5)
components/kaleido/common/constants.mjs (1)
1-9
: Constants defined correctly.The
TYPES
array is well-defined and follows best practices for constant management in modular JavaScript.components/kaleido/actions/delete-contract/delete-contract.mjs (1)
1-37
: Delete contract functionality implemented correctly.The rest of the code in this file is implemented correctly, adhering to best practices for asynchronous operations and API interactions.
components/kaleido/actions/create-contract/create-contract.mjs (1)
1-61
: Create contract functionality implemented correctly.The code is well-structured and adheres to best practices for asynchronous operations and API interactions.
components/kaleido/actions/create-membership/create-membership.mjs (1)
1-60
: Create membership functionality implemented correctly.The code is well-structured and adheres to best practices for asynchronous operations and API interactions.
components/kaleido/kaleido.app.mjs (1)
1-160
: Functionality for Kaleido app implemented correctly.The prop definitions and methods are correctly implemented, facilitating effective interaction with the Kaleido API.
Tools
Biome
[error] 147-147: Useless rename. (lint/complexity/noUselessRename)
Safe fix: Remove the renaming.
[error] 155-155: Useless rename. (lint/complexity/noUselessRename)
Safe fix: Remove the renaming.
import app from "../../kaleido.app.mjs"; | ||
|
||
export default { | ||
key: "kaleido-delete-contract", | ||
name: "Delete Contract", | ||
description: "Delete a contract in Kaleido. [See the documentation](https://api.kaleido.io/platform.html#tag/Contracts/paths/~1consortia~1%7Bconsortia_id%7D~1contracts~1%7Bcontract_id%7D/delete)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
app, | ||
consortiaId: { | ||
propDefinition: [ | ||
app, | ||
"consortiaId", | ||
], | ||
}, | ||
contractId: { | ||
propDefinition: [ | ||
app, | ||
"contractId", | ||
(c) => ({ | ||
consortiaId: c.consortiaId, | ||
}), | ||
], | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.app.deleteContract({ | ||
$, | ||
consortiaId: this.consortiaId, | ||
contractId: this.contractId, | ||
}); | ||
|
||
$.export("$summary", `Successfully deleted contract with ID '${this.this.contract_id}'`); | ||
|
||
return response; | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in summary export.
There is a typo in the summary export statement which could lead to a runtime error.
- $.export("$summary", `Successfully deleted contract with ID '${this.this.contract_id}'`);
+ $.export("$summary", `Successfully deleted contract with ID '${this.contractId}'`);
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
import app from "../../kaleido.app.mjs"; | |
export default { | |
key: "kaleido-delete-contract", | |
name: "Delete Contract", | |
description: "Delete a contract in Kaleido. [See the documentation](https://api.kaleido.io/platform.html#tag/Contracts/paths/~1consortia~1%7Bconsortia_id%7D~1contracts~1%7Bcontract_id%7D/delete)", | |
version: "0.0.1", | |
type: "action", | |
props: { | |
app, | |
consortiaId: { | |
propDefinition: [ | |
app, | |
"consortiaId", | |
], | |
}, | |
contractId: { | |
propDefinition: [ | |
app, | |
"contractId", | |
(c) => ({ | |
consortiaId: c.consortiaId, | |
}), | |
], | |
}, | |
}, | |
async run({ $ }) { | |
const response = await this.app.deleteContract({ | |
$, | |
consortiaId: this.consortiaId, | |
contractId: this.contractId, | |
}); | |
$.export("$summary", `Successfully deleted contract with ID '${this.this.contract_id}'`); | |
return response; | |
}, | |
import app from "../../kaleido.app.mjs"; | |
export default { | |
key: "kaleido-delete-contract", | |
name: "Delete Contract", | |
description: "Delete a contract in Kaleido. [See the documentation](https://api.kaleido.io/platform.html#tag/Contracts/paths/~1consortia~1%7Bconsortia_id%7D~1contracts~1%7Bcontract_id%7D/delete)", | |
version: "0.0.1", | |
type: "action", | |
props: { | |
app, | |
consortiaId: { | |
propDefinition: [ | |
app, | |
"consortiaId", | |
], | |
}, | |
contractId: { | |
propDefinition: [ | |
app, | |
"contractId", | |
(c) => ({ | |
consortiaId: c.consortiaId, | |
}), | |
], | |
}, | |
}, | |
async run({ $ }) { | |
const response = await this.app.deleteContract({ | |
$, | |
consortiaId: this.consortiaId, | |
contractId: this.contractId, | |
}); | |
$.export("$summary", `Successfully deleted contract with ID '${this.contractId}'`); | |
return response; | |
}, |
}); | ||
}, | ||
async getContracts({ | ||
consortiaId: consortiaId, ...args |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove useless renaming in method parameters.
The renaming of consortiaId
in the method parameters is unnecessary and can be simplified.
- async getContracts({
- consortiaId: consortiaId, ...args
- }) {
+ async getContracts({
+ consortiaId, ...args
+ }) {
- async getMemberships({
- consortiaId: consortiaId, ...args
- }) {
+ async getMemberships({
+ consortiaId, ...args
+ }) {
Also applies to: 155-155
Tools
Biome
[error] 147-147: Useless rename. (lint/complexity/noUselessRename)
Safe fix: Remove the renaming.
WHY
Summary by CodeRabbit
New Features
Updates
0.1.0
and added a new dependency.