@startsimpli/integrations 0.2.11 → 0.2.13
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": "@startsimpli/integrations",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"description": "Provider-agnostic types, API clients, hooks, and UI primitives for email + calendar integrations across StartSimpli apps.",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -247,6 +247,33 @@ describe('TrackerPage — what is outstanding', () => {
|
|
|
247
247
|
render(<TrackerPage api={makeApi({ rows: [] })} scope={SCOPE} now={NOW} />);
|
|
248
248
|
expect(await screen.findByText(/Nothing has been pulled out of your meetings yet/)).toBeInTheDocument();
|
|
249
249
|
});
|
|
250
|
+
|
|
251
|
+
it('does NOT say the workspace is empty when a VIEW is empty', async () => {
|
|
252
|
+
// Browser-verified failure on the deployed tenant: the Overdue tab said
|
|
253
|
+
// "Nothing has been pulled out of your meetings yet" over ninety-seven open
|
|
254
|
+
// items, because nothing carried a due date. Advice that is false is worse
|
|
255
|
+
// than no advice.
|
|
256
|
+
const rows = [commitment({ externalId: 'commit:x', title: 'An open item' })];
|
|
257
|
+
const api: CommitmentTrackerApi = {
|
|
258
|
+
async listCommitments(query: CommitmentQuery = {}) {
|
|
259
|
+
// The server filters: the overdue query matches nothing, an unfiltered
|
|
260
|
+
// count-only probe still reports the workspace has rows.
|
|
261
|
+
const filtered = Boolean(query.dueBefore);
|
|
262
|
+
return {
|
|
263
|
+
count: filtered ? 0 : rows.length,
|
|
264
|
+
next: null, previous: null,
|
|
265
|
+
results: filtered ? [] : rows,
|
|
266
|
+
appliedFilters: ['status', 'dueBefore'],
|
|
267
|
+
};
|
|
268
|
+
},
|
|
269
|
+
};
|
|
270
|
+
render(<TrackerPage api={api} scope={SCOPE} now={NOW} />);
|
|
271
|
+
await screen.findByText('An open item');
|
|
272
|
+
await userEvent.click(screen.getByRole('tab', { name: 'Overdue' }));
|
|
273
|
+
|
|
274
|
+
expect(await screen.findByText(/Nothing matches this view/)).toBeInTheDocument();
|
|
275
|
+
expect(screen.queryByText(/Nothing has been pulled out of your meetings yet/)).not.toBeInTheDocument();
|
|
276
|
+
});
|
|
250
277
|
});
|
|
251
278
|
|
|
252
279
|
describe('TrackerPage — running the extraction', () => {
|
|
@@ -113,6 +113,18 @@ export function TrackerPage({
|
|
|
113
113
|
const [error, setError] = React.useState('');
|
|
114
114
|
const [run, setRun] = React.useState<ExtractionResult | null>(null);
|
|
115
115
|
const [running, setRunning] = React.useState(false);
|
|
116
|
+
/**
|
|
117
|
+
* Does this workspace hold ANY commitments at all?
|
|
118
|
+
*
|
|
119
|
+
* Now that the server really filters, an empty page means one of two very
|
|
120
|
+
* different things and the screen owes the difference: "nothing has been
|
|
121
|
+
* pulled in yet" is advice, and saying it to somebody with ninety-seven open
|
|
122
|
+
* items and nothing overdue is simply false. Browser-verified on the deployed
|
|
123
|
+
* tenant — the Overdue tab said "Nothing has been pulled out of your meetings
|
|
124
|
+
* yet" over a corpus of ninety-seven. Resolved with ONE unfiltered
|
|
125
|
+
* count-only read, and only when a view comes back empty.
|
|
126
|
+
*/
|
|
127
|
+
const [workspaceHasAny, setWorkspaceHasAny] = React.useState<boolean | null>(null);
|
|
116
128
|
|
|
117
129
|
const query = React.useMemo<CommitmentQuery>(
|
|
118
130
|
() => ({
|
|
@@ -136,6 +148,15 @@ export function TrackerPage({
|
|
|
136
148
|
const page = await apiRef.current.listCommitments(query);
|
|
137
149
|
setRows(page.results);
|
|
138
150
|
setApplied(page.appliedFilters ?? []);
|
|
151
|
+
if (page.results.length > 0) {
|
|
152
|
+
setWorkspaceHasAny(true);
|
|
153
|
+
} else {
|
|
154
|
+
const any = await apiRef.current
|
|
155
|
+
.listCommitments({ pageSize: 1 })
|
|
156
|
+
.then((probe) => probe.count > 0)
|
|
157
|
+
.catch(() => null);
|
|
158
|
+
setWorkspaceHasAny(any);
|
|
159
|
+
}
|
|
139
160
|
} catch (err) {
|
|
140
161
|
setRows([]);
|
|
141
162
|
setError(failureMessage(err));
|
|
@@ -249,9 +270,9 @@ export function TrackerPage({
|
|
|
249
270
|
|
|
250
271
|
{!loading && visible.length === 0 ? (
|
|
251
272
|
<p className={cn.muted}>
|
|
252
|
-
{
|
|
273
|
+
{workspaceHasAny === false
|
|
253
274
|
? 'Nothing has been pulled out of your meetings yet. Connect a source, then run “Pull from meetings”.'
|
|
254
|
-
: 'Nothing matches this view.
|
|
275
|
+
: 'Nothing matches this view. Your other tabs may still have items.'}
|
|
255
276
|
</p>
|
|
256
277
|
) : null}
|
|
257
278
|
|