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

Send dev harness event from react hook when it is a stubbed action #638

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

alanko0511
Copy link
Contributor

This PR sends a dev harness event when the action is a stubbed action (i.e. no API trigger)

Gadget side to consume this new event type: https://github.com/gadget-inc/gadget/pull/12894

PR Checklist

  • Important or complicated code is tested
  • Any user facing changes are documented in the Gadget-side changelog
  • Any immediate changes are slated for release in Gadget via a generated package dependency bump
  • Versions within this monorepo are matching and there's a valid upgrade path

Comment on lines +818 to +826
useAction({
// @ts-expect-error intentionally passing the wrong type
type: "stubbedAction",
reason: "MissingApiTrigger",
dataPath: "fakePath",
functionName: "fakeFunction",
modelApiIdentifier: "fakeModel",
variables: {},
}),
Copy link
Contributor Author

@alanko0511 alanko0511 Sep 11, 2024

Choose a reason for hiding this comment

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

Some parameters are unavailable today, so I need to make a fake object to trigger an event. I'll update the tests once we have shipped the change to the Gadget side.

@alanko0511 alanko0511 marked this pull request as ready for review September 12, 2024 14:21
Copy link
Contributor

@MillanWangGadget MillanWangGadget left a comment

Choose a reason for hiding this comment

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

I think the useBulkAction needs the same treatment since bulk actions also becom stubbs.
See api.autoTableTest.bulkNoTriggerAction
CleanShot 2024-09-12 at 13 44 09@2x

Copy link
Contributor

@MillanWangGadget MillanWangGadget left a comment

Choose a reason for hiding this comment

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

  • 🍏 Properly pops the dev harness for no-trigger modelActions, bulkModelActions, and global actions

@alanko0511 alanko0511 merged commit 07a3936 into main Sep 13, 2024
9 checks passed
@alanko0511 alanko0511 deleted the alan/add-stubbed-action-event branch September 13, 2024 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants