@integry/sdk 4.7.16 → 4.7.18

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integry/sdk",
3
- "version": "4.7.16",
3
+ "version": "4.7.18",
4
4
  "description": "Integry SDK",
5
5
  "main": "dist/umd/index.umd.js",
6
6
  "module": "dist/esm/index.csm.js",
@@ -40,6 +40,8 @@ export type DynamicFieldsProps = {
40
40
  dependsOn?: string[];
41
41
  isArray?: boolean;
42
42
  allowWorkspaceConnectedAccounts?: boolean;
43
+ tagsTree?: any;
44
+ showMenuOnLeft?: boolean;
43
45
  } & StoreType;
44
46
 
45
47
  interface DynamicDataItem {
@@ -72,6 +74,8 @@ const DynamicTypedFields = (props: DynamicFieldsProps) => {
72
74
  dependsOn = [],
73
75
  isArray = false,
74
76
  allowWorkspaceConnectedAccounts = false,
77
+ tagsTree = null,
78
+ showMenuOnLeft = false,
75
79
  } = props;
76
80
 
77
81
  const [dynamicItems, setDynamicItems] = useState<DynamicDataItem[]>([]);
@@ -374,6 +378,8 @@ const DynamicTypedFields = (props: DynamicFieldsProps) => {
374
378
  ).length > 0}
375
379
  allowTagsInText=${true}
376
380
  isDisabled=${isDisabled}
381
+ tagsTree=${tagsTree}
382
+ showMenuOnLeft=${showMenuOnLeft}
377
383
  ><//>
378
384
  </div>
379
385
  `,
@@ -421,6 +427,8 @@ const DynamicTypedFields = (props: DynamicFieldsProps) => {
421
427
  .length > 0}
422
428
  allowTagsInText=${true}
423
429
  isDisabled=${isDisabled}
430
+ tagsTree=${tagsTree}
431
+ showMenuOnLeft=${showMenuOnLeft}
424
432
  ><//>
425
433
  </div>
426
434
  `,
@@ -369,6 +369,14 @@
369
369
  margin-top: 16px;
370
370
  align-items: center;
371
371
  gap: 24px;
372
+ .integrationProgress {
373
+ display: flex;
374
+ gap: 8px;
375
+ align-items: center;
376
+ color: #999;
377
+ font-size: 12px;
378
+ font-weight: 400;
379
+ }
372
380
  .flowStatus {
373
381
  display: flex;
374
382
  gap: 9px;
@@ -0,0 +1,58 @@
1
+ import { render, screen } from '@testing-library/preact';
2
+ import { html } from 'htm/preact';
3
+ import { Provider } from 'unistore/preact';
4
+ import createStore from 'unistore';
5
+ import { describe, it, expect, vi } from 'vitest';
6
+ import FlowCard from './flowCard';
7
+
8
+ const baseFlow = {
9
+ id: 1,
10
+ name: 'Test Flow',
11
+ description: null,
12
+ execution_type: 'ON_DEMAND',
13
+ allow_multiple_instances: false,
14
+ instances: [],
15
+ execution_behaviour: 'SAVE_ONLY',
16
+ button_text: '',
17
+ };
18
+
19
+ const renderWithStore = (flow: any) => {
20
+ const store = createStore({ userConfig: {} });
21
+ return render(
22
+ html`<${Provider} store=${store}>
23
+ <${FlowCard}
24
+ flow=${flow}
25
+ accountVerified=${true}
26
+ onFlowSelect=${vi.fn()}
27
+ updateInstanceName=${vi.fn()}
28
+ />
29
+ <//>`,
30
+ );
31
+ };
32
+
33
+ describe('FlowCard', () => {
34
+ it('shows setup button when integration creation not in progress', () => {
35
+ const flow = { ...baseFlow, integration_creation_in_progress: false };
36
+ renderWithStore(flow);
37
+ expect(screen.getByRole('button')).toBeInTheDocument();
38
+ });
39
+
40
+ it('shows setup button when creation is in progress but multiple instances allowed', () => {
41
+ const flow = {
42
+ ...baseFlow,
43
+ allow_multiple_instances: true,
44
+ integration_creation_in_progress: true,
45
+ };
46
+ renderWithStore(flow);
47
+ expect(screen.getByRole('button')).toBeInTheDocument();
48
+ });
49
+
50
+ it('shows progress message when integration creation is in progress and single instance', () => {
51
+ const flow = { ...baseFlow, integration_creation_in_progress: true };
52
+ renderWithStore(flow);
53
+ expect(screen.queryByRole('button')).toBeNull();
54
+ expect(
55
+ screen.getByText('Integration creation in progress')
56
+ ).toBeInTheDocument();
57
+ });
58
+ });
@@ -2,6 +2,7 @@ import { html } from 'htm/preact';
2
2
  import { connect } from 'unistore/preact';
3
3
  import { Button, ButtonTypes } from '@/components/Button';
4
4
  import { Hint } from '@/components/Tooltip';
5
+ import { ThreeDotLoader } from '@/components/ThreeDotLoader';
5
6
  import { convertDateToStandard } from '@/utils/datetime';
6
7
  import { Flow, Instance } from '@/interfaces';
7
8
  import { actionFunctions } from '@/store';
@@ -163,13 +164,19 @@ const FlowCard = ({
163
164
  class=${styles.readonlyHint}
164
165
  data-hint=${disabledButtonTooltip()}
165
166
  ></span>`}
166
- <${Button}
167
- label=${getButtonLabel()}
168
- type=${ButtonTypes.PRIMARY}
169
- onClick=${() => handleFlowSelect()}
170
- disabled=${!accountVerified}
171
- id=${`setup-integration-btn-${flow?.id}`}
172
- />
167
+ ${flow?.integration_creation_in_progress &&
168
+ !flow?.allow_multiple_instances
169
+ ? html`<div class=${styles.integrationProgress}>
170
+ Integration creation in progress
171
+ <${ThreeDotLoader} color="#999" />
172
+ </div>`
173
+ : html`<${Button}
174
+ label=${getButtonLabel()}
175
+ type=${ButtonTypes.PRIMARY}
176
+ onClick=${() => handleFlowSelect()}
177
+ disabled=${!accountVerified}
178
+ id=${`setup-integration-btn-${flow?.id}`}
179
+ />`}
173
180
  <//>
174
181
  `}
175
182
  ${showFlowLastRunTime() &&
@@ -0,0 +1,49 @@
1
+ import { render, screen } from '@testing-library/preact';
2
+ import { html } from 'htm/preact';
3
+ import { Provider } from 'unistore/preact';
4
+ import createStore from 'unistore';
5
+ import { describe, it, expect, vi } from 'vitest';
6
+ import FlowCardCompact from './flowCardCompact';
7
+
8
+ const baseFlow = {
9
+ id: 1,
10
+ name: 'Test Flow',
11
+ description: null,
12
+ execution_type: 'ON_DEMAND',
13
+ allow_multiple_instances: false,
14
+ instances: [],
15
+ execution_behaviour: 'SAVE_ONLY',
16
+ button_text: '',
17
+ };
18
+
19
+ const renderWithStore = (flow: any) => {
20
+ const store = createStore({ userConfig: {} });
21
+ return render(
22
+ html`<${Provider} store=${store}>
23
+ <${FlowCardCompact}
24
+ flow=${flow}
25
+ accountVerified=${true}
26
+ onFlowSelect=${vi.fn()}
27
+ updateInstanceName=${vi.fn()}
28
+ />
29
+ <//>`,
30
+ );
31
+ };
32
+
33
+ describe('FlowCardCompact', () => {
34
+ it('shows setup button when integration creation not in progress', () => {
35
+ const flow = { ...baseFlow, integration_creation_in_progress: false };
36
+ renderWithStore(flow);
37
+ expect(screen.getByRole('button')).toBeInTheDocument();
38
+ expect(
39
+ screen.queryByText('Integration creation in progress'),
40
+ ).toBeNull();
41
+ });
42
+
43
+ it('shows progress message when integration creation is in progress', () => {
44
+ const flow = { ...baseFlow, integration_creation_in_progress: true };
45
+ renderWithStore(flow);
46
+ expect(screen.queryByRole('button')).toBeNull();
47
+ expect(screen.getByText('Integration creation in progress')).toBeInTheDocument();
48
+ });
49
+ });
@@ -3,6 +3,7 @@ import { html } from 'htm/preact';
3
3
  import { connect } from 'unistore/preact';
4
4
  import { Button, ButtonTypes } from '@/components/Button';
5
5
  import { Hint } from '@/components/Tooltip';
6
+ import { ThreeDotLoader } from '@/components/ThreeDotLoader';
6
7
  import { convertDateToStandard } from '@/utils/datetime';
7
8
  import { Flow, Instance } from '@/interfaces';
8
9
  import { actionFunctions } from '@/store';
@@ -376,13 +377,19 @@ const FlowCardCompact = ({
376
377
  class=${styles.readonlyHint}
377
378
  data-hint=${disabledButtonTooltip()}
378
379
  ></span>`}
379
- <${Button}
380
- label=${getButtonLabel()}
381
- type=${ButtonTypes.PRIMARY}
382
- onClick=${() => handleFlowSelect()}
383
- disabled=${!accountVerified}
384
- id=${`setup-integration-btn-${flow?.id}`}
385
- />
380
+ ${flow?.integration_creation_in_progress &&
381
+ !flow?.allow_multiple_instances
382
+ ? html`<div class=${styles.integrationProgress}>
383
+ Integration creation in progress
384
+ <${ThreeDotLoader} color="#999" />
385
+ </div>`
386
+ : html`<${Button}
387
+ label=${getButtonLabel()}
388
+ type=${ButtonTypes.PRIMARY}
389
+ onClick=${() => handleFlowSelect()}
390
+ disabled=${!accountVerified}
391
+ id=${`setup-integration-btn-${flow?.id}`}
392
+ />`}
386
393
  <//>
387
394
  `}
388
395
  ${showFlowLastRunTime() &&
@@ -210,6 +210,14 @@
210
210
  padding-top: 0px;
211
211
  align-items: center;
212
212
  gap: 24px;
213
+ .integrationProgress {
214
+ display: flex;
215
+ gap: 8px;
216
+ align-items: center;
217
+ color: #999;
218
+ font-size: 12px;
219
+ font-weight: 400;
220
+ }
213
221
  .flowStatus {
214
222
  display: flex;
215
223
  gap: 9px;
@@ -858,6 +858,7 @@ export interface Flow {
858
858
  button_text: string;
859
859
  branding_app?: BrandingApp;
860
860
  version_number?: number | null;
861
+ integration_creation_in_progress?: boolean;
861
862
  }
862
863
 
863
864
  export interface AppFlowsResponse {