Skip to content
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

1458 [Transactions] Edit & Delete implementation for Transactions #1459

Merged

Conversation

xoscar
Copy link
Collaborator

@xoscar xoscar commented Nov 3, 2022

This PR Adds the edit and delete implementation for transactions, it includes the initial designs and wire-up for the transactions run page, similar to what we have for tests, having the edit form and execution results in the same context.

Changes

  • Transaction run page layout
  • Transaction run variables and steps
  • Edit and delete for transactions

Fixes

Checklist

  • tested locally
  • added new dependencies
  • updated the docs
  • added a test

https://www.loom.com/share/be52d5887e734e04af480217ee8b45a7

@xoscar xoscar linked an issue Nov 3, 2022 that may be closed by this pull request
@xoscar xoscar changed the title 1458 adding transactions edit and delete features for the transaction… 1458 [Transactions] Edit & Delete implementation for Transactions Nov 4, 2022
@xoscar xoscar self-assigned this Nov 4, 2022
@xoscar xoscar added the frontend label Nov 4, 2022
@xoscar xoscar marked this pull request as ready for review November 4, 2022 15:52
transaction: TTransaction;
}

const EditTransaction = ({transaction}: IProps) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically the same implementation we have for tests

</S.Title>
<S.Text>{transaction?.description}</S.Text>
</div>
</S.Section>
<S.Section>
<TestCardActions testId={transaction?.id || ''} onDelete={noop} />
<TestCardActions testId={transaction?.id || ''} onDelete={() => onDelete(transaction.id, transaction.name)} />
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding delete capability

{items.map((test, index) => (
// eslint-disable-next-line react/no-array-index-key
<TestItem key={`${test.id}-${index}`} test={test} onDelete={onDelete} />
{items.map(({id, test}) => (
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a bug when selecting the same test twice (that is a valid scenario) and the drag & drop, I fixed it by adding an extra unique id


return (
<>
<TransactionHeader onBack={() => navigate(`/transaction/${transactionId}`)} />
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same layout mechanism as tests

query: () => `/tests`,
providesTags: result => [{type: TracetestApiTags.TRANSACTION, id: result?.id}],
transformResponse: () => TransactionMock.model(),
transformResponse: () => ({
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mock mock mock

Copy link
Contributor

@jorgeepc jorgeepc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@xoscar xoscar merged commit 7c3ac8c into main Nov 7, 2022
@xoscar xoscar deleted the 1458-transactions-edit-delete-implementation-for-transactions branch November 7, 2022 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Transactions] Edit & Delete implementation for Transactions
2 participants