@shipfox/client-integrations 14.0.1 → 17.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +32 -0
  3. package/dist/application/complete-integration-callback.d.ts +2 -2
  4. package/dist/components/integration-gallery.stories.d.ts +1 -0
  5. package/dist/components/integration-gallery.stories.d.ts.map +1 -1
  6. package/dist/components/integration-gallery.stories.js +28 -0
  7. package/dist/components/integration-gallery.stories.js.map +1 -1
  8. package/dist/components/integration-usage-modal.d.ts +1 -1
  9. package/dist/components/integration-usage-modal.d.ts.map +1 -1
  10. package/dist/components/integration-usage-modal.js +2 -1
  11. package/dist/components/integration-usage-modal.js.map +1 -1
  12. package/dist/components/webhook/webhook-modals.stories.d.ts.map +1 -1
  13. package/dist/feature.d.ts +8 -8
  14. package/dist/feature.d.ts.map +1 -1
  15. package/dist/hooks/api/integrations.d.ts +4 -4
  16. package/dist/hooks/api/integrations.d.ts.map +1 -1
  17. package/dist/hooks/api/webhook-connections.d.ts +1 -1
  18. package/dist/hooks/api/webhook-connections.d.ts.map +1 -1
  19. package/dist/routes/gitea.d.ts.map +1 -1
  20. package/dist/routes/github-callback.d.ts.map +1 -1
  21. package/dist/routes/github.d.ts.map +1 -1
  22. package/dist/routes/integrations-settings.d.ts.map +1 -1
  23. package/dist/routes/integrations.d.ts.map +1 -1
  24. package/dist/routes/jira-callback.d.ts.map +1 -1
  25. package/dist/routes/jira.d.ts.map +1 -1
  26. package/dist/routes/linear-callback.d.ts.map +1 -1
  27. package/dist/routes/linear.d.ts.map +1 -1
  28. package/dist/routes/sentry-callback.d.ts.map +1 -1
  29. package/dist/routes/sentry.d.ts.map +1 -1
  30. package/dist/routes/slack-callback.d.ts.map +1 -1
  31. package/dist/routes/slack.d.ts.map +1 -1
  32. package/dist/tsconfig.test.tsbuildinfo +1 -1
  33. package/package.json +14 -14
  34. package/src/components/integration-gallery.stories.tsx +20 -0
  35. package/src/components/integration-gallery.test.tsx +21 -0
  36. package/src/components/integration-usage-modal.tsx +3 -1
  37. package/tsconfig.build.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shipfox/client-integrations",
3
3
  "license": "MIT",
4
- "version": "14.0.1",
4
+ "version": "17.0.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ShipfoxHQ/shipfox.git",
@@ -27,20 +27,20 @@
27
27
  "dependencies": {
28
28
  "@swc/helpers": "^0.5.17",
29
29
  "@tanstack/react-form": "^1.32.0",
30
- "@shipfox/api-integration-core-dto": "12.0.0",
31
- "@shipfox/api-integration-gitea-dto": "12.0.0",
32
- "@shipfox/api-integration-github-dto": "12.0.0",
33
- "@shipfox/api-integration-jira-dto": "12.0.0",
34
- "@shipfox/api-integration-linear-dto": "12.0.0",
35
- "@shipfox/api-integration-slack-dto": "12.0.0",
36
- "@shipfox/api-integration-sentry-dto": "12.0.0",
37
- "@shipfox/api-integration-webhook-dto": "12.0.0",
30
+ "@shipfox/api-integration-gitea-dto": "12.2.0",
31
+ "@shipfox/api-integration-core-dto": "12.2.0",
32
+ "@shipfox/api-integration-jira-dto": "12.2.0",
33
+ "@shipfox/api-integration-linear-dto": "12.2.0",
34
+ "@shipfox/api-integration-github-dto": "12.2.0",
35
+ "@shipfox/api-integration-slack-dto": "12.2.0",
36
+ "@shipfox/api-integration-sentry-dto": "12.2.0",
37
+ "@shipfox/api-integration-webhook-dto": "12.2.0",
38
38
  "@shipfox/client-api": "6.0.1",
39
- "@shipfox/client-auth": "14.0.1",
40
- "@shipfox/client-shell": "14.0.1",
41
- "@shipfox/client-ui": "14.0.1",
42
- "@shipfox/integration-icons": "0.3.1",
43
- "@shipfox/react-ui": "1.0.0"
39
+ "@shipfox/client-auth": "17.0.0",
40
+ "@shipfox/client-shell": "17.0.0",
41
+ "@shipfox/client-ui": "17.0.0",
42
+ "@shipfox/integration-icons": "0.3.3",
43
+ "@shipfox/react-ui": "1.2.0"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@tanstack/react-query": "^5.101.0",
@@ -17,6 +17,7 @@ import {
17
17
  } from '@tanstack/react-router';
18
18
  import {createStore, Provider as JotaiProvider} from 'jotai';
19
19
  import {useMemo} from 'react';
20
+ import {expect, screen, userEvent, within} from 'storybook/test';
20
21
  import {IntegrationGallery} from './integration-gallery.js';
21
22
 
22
23
  const WORKSPACE_ID = '11111111-1111-4111-8111-111111111111';
@@ -148,6 +149,25 @@ export const LongNames: Story = {
148
149
  args: {scenario: 'long-names'},
149
150
  };
150
151
 
152
+ export const UsageModalCloseRestoresInteraction: Story = {
153
+ play: async ({canvasElement}) => {
154
+ const user = userEvent.setup();
155
+ const canvas = within(canvasElement);
156
+ const actionsButton = await canvas.findByRole('button', {
157
+ name: 'Open acme-corp integration actions',
158
+ });
159
+
160
+ await user.click(actionsButton);
161
+ await user.click(await screen.findByRole('menuitem', {name: 'Use this integration'}));
162
+ await screen.findByRole('dialog', {name: 'Use acme-corp'});
163
+ await user.click(await screen.findByRole('button', {name: 'Done'}));
164
+ expect(screen.queryByRole('dialog', {name: 'Use acme-corp'})).not.toBeInTheDocument();
165
+ expect(document.body.style.pointerEvents).not.toBe('none');
166
+ await user.click(actionsButton);
167
+ await screen.findByRole('menuitem', {name: 'Use this integration'});
168
+ },
169
+ };
170
+
151
171
  function fetchForScenario(scenario: Scenario): typeof fetch {
152
172
  return (input, init) => {
153
173
  const url = requestUrl(input);
@@ -367,6 +367,27 @@ describe('IntegrationGallery — installed section', () => {
367
367
  expect(screen.getByText(webhookConnectionDto.inbound_url)).toBeVisible();
368
368
  });
369
369
 
370
+ test('restores page interactivity after closing the usage modal', async () => {
371
+ renderGallery({}, {connections: [webhookConnection]});
372
+
373
+ await openActions('Open Stripe production integration actions');
374
+ expect(document.body.style.pointerEvents).toBe('none');
375
+ fireEvent.click(screen.getByRole('menuitem', {name: 'Use this integration'}));
376
+ expect(await screen.findByRole('dialog', {name: 'Use Stripe production'})).toBeVisible();
377
+ expect(document.body.style.pointerEvents).toBe('none');
378
+
379
+ const usageDialog = screen.getByRole('dialog', {name: 'Use Stripe production'});
380
+ fireEvent.click(within(usageDialog).getByRole('button', {name: 'Done'}));
381
+
382
+ await waitFor(() => {
383
+ expect(screen.queryByRole('dialog', {name: 'Use Stripe production'})).not.toBeInTheDocument();
384
+ expect(document.body).not.toHaveStyle({pointerEvents: 'none'});
385
+ });
386
+
387
+ await openActions('Open Stripe production integration actions');
388
+ expect(screen.getByRole('menuitem', {name: 'Use this integration'})).toBeVisible();
389
+ });
390
+
370
391
  test('opens the usage modal with a GitHub event selector', async () => {
371
392
  renderGallery({}, {connections: [githubConnection]});
372
393
 
@@ -71,8 +71,10 @@ export function IntegrationUsageModal({
71
71
  );
72
72
  const title = connection ? `Use ${connection.displayName}` : 'Use integration';
73
73
 
74
+ if (!open || connection === null) return null;
75
+
74
76
  return (
75
- <Modal open={open && connection !== null} onOpenChange={onOpenChange}>
77
+ <Modal open={open} onOpenChange={onOpenChange}>
76
78
  <ModalContent aria-describedby={undefined} className="max-h-[calc(100vh-32px)] max-w-[640px]">
77
79
  <ModalTitle className="sr-only">{title}</ModalTitle>
78
80
  <ModalHeader>