[Feature] Allow actions to be shared via public link: Milestone 1 (#27777)
* Add public_uuid and made_public_by_id to actions table & endpoints to enable/disable the public sharing on individual actions (#27721) * Add migration for public_uuid (indexed) and made_public_by_id * Add UUIDString schema * Add endpoints for enabling/disabling sharing of actions * Test that the new fields are returned with `GET /api/action/:id` * Remove validCheckSum on migration * Remove trailing whitespace * Fix DELETE test * Fix tests * Please migration linter * Update the default public_uuid every test run * Please migration linter * Add FK onDelete cascade * Replace ü * Add GET endpoint and post-select for action * Revert "Add GET endpoint and post-select for action" This reverts commit 8cc8b57d6034146dd726b54bc4199830ec1fda21. * Fix merge * Reorder migrations * Update test for GET `api/action?model-id=<id>` endpoint to include public sharing keys (#27802) * Add GET: /api/public/action/:uuid endpoint (#27781) * Add test * Remove non-public columns and check for 404 * Fix docstring * Rename for clarity * Fix missing ns * Remove unneccessary keys from action * Update test * Remove unused refer * Reorder migrations * Use mt * Add require and refactor * Use mt * Add endpoint for executing a public action (#27793) * Add endpoint and test * Add more tests and TODOs * Use mt * Reorder migrations * Remove unused require * Rate limit actions at 1 per second * Fix the tests for the throttle * Refactor tests * Fix test * Fix docstring * Add test for failed execution if actions are disabled * Use crowberto in tests * Fix using crowberto in tests * Fix cyclic load dependency * Refactor ActionCreator (#27832) * Refactor make ActionCreator more sane * Render sidebar conditionally with JS rather than hiding it in CSS * Make action public (#27809) * Move action creator action buttons to the header following design * Remove double border which make it looks thicker * Draft toggle action public * Add confirmation when disabling public link similiar to questions and dashboards * Add an action public UUID input and copy button * Show action settings based on user permission * Add public action toggle tests * Remove unused import * Attempt to fix flaky CI unit tests The problem seems to be because of how long it takes for the response to be received even on unit tests, it took longer than 1 second which is the default timeout for `waitFor`. * See if not using `userEvent` could make the involving nock faster * Improve test speed to reduce flakiness * Add public action page (#27747) * Add basic public action page * Add form submit logic placeholder * Use "Submit" as default action form's button label * Add "big" variant to `EmbedFrame's` footer * Use new footer variant for action page * Break down the page, add document title * Handle long forms better * Add `PublicWritebackAction` type * Use public action GET endpoint * Add endpoint to execute public actions * Use action execution endpoint * Add tests * Handle actions without parameters * Rename variant prop * Replace `waitFor` with `findBy` * Define `FooterVariant` type * Fix router setup in `renderWithProviders` * Show which action is publicly accessible on model detail page (#28039) * Bring e2e tests back Manually bringing back tests added in: https://github.com/metabase/metabase/pull/28056 * Update typo Co-authored-by: Tim Macdonald <tim@metabase.com> * Remove TODO and use malli for defendpoint * Add malli schema for endpoints * Update permissions checks for POST and DELETE --------- Co-authored-by:
Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev> Co-authored-by:
Mahatthana Nomsawadi <mahatthana.n@gmail.com> Co-authored-by:
Anton Kulyk <kuliks.anton@gmail.com> Co-authored-by:
Tim Macdonald <tim@metabase.com>
Showing
- frontend/src/metabase-types/api/actions.ts 6 additions, 0 deletionsfrontend/src/metabase-types/api/actions.ts
- frontend/src/metabase-types/api/mocks/actions.ts 22 additions, 8 deletionsfrontend/src/metabase-types/api/mocks/actions.ts
- frontend/src/metabase/actions/components/ActionForm/ActionForm.tsx 1 addition, 1 deletion...src/metabase/actions/components/ActionForm/ActionForm.tsx
- frontend/src/metabase/actions/components/ActionForm/ActionForm.unit.spec.tsx 1 addition, 0 deletions...se/actions/components/ActionForm/ActionForm.unit.spec.tsx
- frontend/src/metabase/actions/containers/ActionCreator/ActionCreator.tsx 45 additions, 82 deletions...tabase/actions/containers/ActionCreator/ActionCreator.tsx
- frontend/src/metabase/actions/containers/ActionCreator/ActionCreator.unit.spec.tsx 148 additions, 4 deletions...ions/containers/ActionCreator/ActionCreator.unit.spec.tsx
- frontend/src/metabase/actions/containers/ActionCreator/ActionCreatorHeader.styled.tsx 8 additions, 0 deletions...s/containers/ActionCreator/ActionCreatorHeader.styled.tsx
- frontend/src/metabase/actions/containers/ActionCreator/ActionCreatorHeader.tsx 6 additions, 0 deletions.../actions/containers/ActionCreator/ActionCreatorHeader.tsx
- frontend/src/metabase/actions/containers/ActionCreator/ActionCreatorView.tsx 154 additions, 0 deletions...se/actions/containers/ActionCreator/ActionCreatorView.tsx
- frontend/src/metabase/actions/containers/ActionCreator/InlineActionSettings.styled.tsx 36 additions, 0 deletions.../containers/ActionCreator/InlineActionSettings.styled.tsx
- frontend/src/metabase/actions/containers/ActionCreator/InlineActionSettings.tsx 152 additions, 0 deletions...actions/containers/ActionCreator/InlineActionSettings.tsx
- frontend/src/metabase/actions/containers/ActionCreator/InlineDataReference.styled.tsx 1 addition, 12 deletions...s/containers/ActionCreator/InlineDataReference.styled.tsx
- frontend/src/metabase/actions/containers/ActionCreator/InlineDataReference.tsx 5 additions, 13 deletions.../actions/containers/ActionCreator/InlineDataReference.tsx
- frontend/src/metabase/actions/containers/ActionCreator/QueryActionEditor.tsx 7 additions, 18 deletions...se/actions/containers/ActionCreator/QueryActionEditor.tsx
- frontend/src/metabase/actions/containers/ActionCreator/types.ts 1 addition, 0 deletions...nd/src/metabase/actions/containers/ActionCreator/types.ts
- frontend/src/metabase/components/ConfirmContent.tsx 15 additions, 5 deletionsfrontend/src/metabase/components/ConfirmContent.tsx
- frontend/src/metabase/core/components/Button/Button.tsx 2 additions, 1 deletionfrontend/src/metabase/core/components/Button/Button.tsx
- frontend/src/metabase/core/components/FormSubmitButton/FormSubmitButton.tsx 3 additions, 1 deletion...ase/core/components/FormSubmitButton/FormSubmitButton.tsx
- frontend/src/metabase/entities/actions/actions.ts 50 additions, 0 deletionsfrontend/src/metabase/entities/actions/actions.ts
- frontend/src/metabase/lib/urls/actions.ts 3 additions, 0 deletionsfrontend/src/metabase/lib/urls/actions.ts
frontend/src/metabase/lib/urls/actions.ts
0 → 100644
Please register or sign in to comment