@jigx/core-sdk 1.0.0 → 1.2.0-rc
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/README.md +2 -0
- package/dist/action/ja.generate-pdf.d.ts +17 -1
- package/dist/action/ja.generate-pdf.d.ts.map +1 -1
- package/dist/action/ja.generate-pdf.js +4 -1
- package/dist/action/ja.in-background.d.ts +3 -2
- package/dist/action/ja.in-background.d.ts.map +1 -1
- package/dist/action/ja.in-background.js +1 -1
- package/dist/assets/example-extraction-cache.json +3 -3
- package/dist/assets/extracted-core-sdk-examples.yaml +18 -0
- package/dist/assets/extracted-core-sdk-types.yaml +58 -0
- package/dist/assets/type-extraction-cache.json +3 -3
- package/docs/array-fields.md +371 -0
- package/docs/conditional-logic.md +178 -0
- package/docs/convention-naming.md +102 -0
- package/docs/date-field.md +92 -0
- package/docs/dropdown-fields.md +879 -0
- package/docs/field-state.md +131 -0
- package/docs/field-types-overview.md +132 -0
- package/docs/formatting.md +421 -0
- package/docs/icons.md +142 -0
- package/docs/index.md +23 -0
- package/docs/jsonata-expressions.md +200 -0
- package/docs/media-fields.md +107 -0
- package/docs/overview.md +467 -0
- package/docs/pattern-build-deploy.md +91 -0
- package/docs/pattern-datasources.md +459 -0
- package/docs/pattern-forms.md +528 -0
- package/docs/pattern-global-actions.md +92 -0
- package/docs/pattern-javascript-functions.md +452 -0
- package/docs/pattern-navigation.md +304 -0
- package/docs/pattern-pdf-generation.md +391 -0
- package/docs/pattern-rest-acumatica.md +660 -0
- package/docs/pattern-sync-progress.md +96 -0
- package/docs/pattern-sync.md +653 -0
- package/docs/pattern-tabs-form.md +293 -0
- package/docs/recipe-index.md +64 -0
- package/docs/runtime-variables.md +127 -0
- package/docs/sections.md +81 -0
- package/docs/validation-patterns.md +150 -0
- package/package.json +5 -4
- package/CHANGELOG.md +0 -95
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Pattern: Sync Progress Bar
|
|
2
|
+
|
|
3
|
+
Ideas for displaying sync progress to the user. Implement and mature as needed.
|
|
4
|
+
|
|
5
|
+
## Basic approach
|
|
6
|
+
|
|
7
|
+
Use a progress bar or value widget on the home screen, bound to the `SyncStatus` table. Show it only while syncing using a `when` rule.
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
// Progress widget — visible only during sync
|
|
11
|
+
screen.addWidget.value({ name: 'sync-progress' })
|
|
12
|
+
.title('=@ctx.datasources.data-select-sync-status.data.currentStep')
|
|
13
|
+
.value('=@ctx.datasources.data-select-sync-status.data.currentProgress')
|
|
14
|
+
.when('=@ctx.datasources.data-select-sync-status.data.status = "syncing"')
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Weight-based progress
|
|
18
|
+
|
|
19
|
+
Assign a weight to each sync action based on expected duration or record count. As each action completes, add its weight to the running total and update `currentProgress` as a percentage.
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
# Example weights
|
|
23
|
+
Customers: 40 # large table, takes longest
|
|
24
|
+
Contacts: 30
|
|
25
|
+
Terms: 10
|
|
26
|
+
ShipVia: 10
|
|
27
|
+
Classes: 10
|
|
28
|
+
# Total: 100
|
|
29
|
+
|
|
30
|
+
# After Customers sync completes:
|
|
31
|
+
currentProgress: 40
|
|
32
|
+
totalSteps: 100
|
|
33
|
+
currentStep: 'Syncing Contacts...'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The progress bar value is `currentProgress / totalSteps` as a fraction.
|
|
37
|
+
|
|
38
|
+
## Step text
|
|
39
|
+
|
|
40
|
+
Update `currentStep` in the `SyncStatus` record before each sync action:
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
// Before syncing customers
|
|
44
|
+
workflow.actions.executeEntity({ instanceId: 'progress-customers' })
|
|
45
|
+
.local('SyncStatus', 'save')
|
|
46
|
+
.data({ id: 'initialSync', status: 'syncing', currentStep: 'Syncing Customers...', currentProgress: '0', totalSteps: '100' })
|
|
47
|
+
|
|
48
|
+
workflow.actions.executeAction({ action: 'act-customers-sync' })
|
|
49
|
+
|
|
50
|
+
// Before syncing contacts
|
|
51
|
+
workflow.actions.executeEntity({ instanceId: 'progress-contacts' })
|
|
52
|
+
.local('SyncStatus', 'save')
|
|
53
|
+
.data({ id: 'initialSync', status: 'syncing', currentStep: 'Syncing Contacts...', currentProgress: '40', totalSteps: '100' })
|
|
54
|
+
|
|
55
|
+
workflow.actions.executeAction({ action: 'act-contacts-sync' })
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Show/hide with when rules
|
|
59
|
+
|
|
60
|
+
- **Progress bar visible**: `when: '=@ctx.datasources.data-select-sync-status.data.status = "syncing"'`
|
|
61
|
+
- **Main content visible**: `when: '=@ctx.datasources.data-select-sync-status.data.status = "complete"'` or no `when` (always visible, progress bar overlays)
|
|
62
|
+
- **Error state**: Show a retry button when `status = "failed"`
|
|
63
|
+
|
|
64
|
+
## Card-based progress display
|
|
65
|
+
|
|
66
|
+
Instead of a simple value widget, use a card with a progress bar component and descriptive text:
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
const syncCard = screen.addControl.card({ instanceId: 'sync-card' })
|
|
70
|
+
.when('=@ctx.datasources.data-select-sync-status.data.status = "syncing"')
|
|
71
|
+
|
|
72
|
+
// Title shows current step
|
|
73
|
+
syncCard.title('=@ctx.datasources.data-select-sync-status.data.currentStep')
|
|
74
|
+
|
|
75
|
+
// Subtitle shows n of total
|
|
76
|
+
syncCard.subtitle('="Step " & @ctx.datasources.data-select-sync-status.data.currentProgress & " of " & @ctx.datasources.data-select-sync-status.data.totalSteps')
|
|
77
|
+
|
|
78
|
+
// Progress bar as fraction
|
|
79
|
+
syncCard.progress('=@ctx.datasources.data-select-sync-status.data.currentProgress / @ctx.datasources.data-select-sync-status.data.totalSteps')
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Combining with sync scopes
|
|
83
|
+
|
|
84
|
+
Use the `_syncScope` system table alongside `SyncStatus` for richer progress:
|
|
85
|
+
|
|
86
|
+
- `_syncScope.synced` / total entities = overall entity-level progress
|
|
87
|
+
- `_syncScope.details` JSON gives per-entity state for granular display
|
|
88
|
+
- Show which entity is currently syncing by checking `state = "syncing"` in details
|
|
89
|
+
|
|
90
|
+
## Ideas to consider
|
|
91
|
+
|
|
92
|
+
- **Blocking UI during initial sync**: Overlay the progress card on the home screen and hide the main content until `status = "complete"`. Prevents users from interacting with empty data.
|
|
93
|
+
- **Background sync indicator**: For subsequent diff syncs, show a subtle indicator (e.g., a small badge or icon) rather than a full progress bar — the user shouldn't be blocked.
|
|
94
|
+
- **Offline indicator**: Combine with `@ctx.system.isOnline` to show "Waiting for connection..." when offline with pending sync.
|
|
95
|
+
- **Retry on failure**: Add a retry button on the progress card that re-triggers `act-initial-sync` when `status = "failed"`.
|
|
96
|
+
- **Per-entity progress**: For very large syncs, track continuation progress (records synced so far) in the `SyncStatus` table and display it: "Syncing Customers... (3,000 of ~10,000)".
|