@startsimpli/ui 0.4.147 → 0.4.148

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/ui",
3
- "version": "0.4.147",
3
+ "version": "0.4.148",
4
4
  "description": "Shared UI components package for StartSimpli applications",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -55,9 +55,9 @@
55
55
  "@codemirror/language": "^6.0.0",
56
56
  "@codemirror/state": "^6.0.0",
57
57
  "@codemirror/view": "^6.0.0",
58
- "@startsimpli/i18n": "^0.1.3",
58
+ "@startsimpli/auth": "^0.4.39",
59
59
  "@startsimpli/api": "^0.5.66",
60
- "@startsimpli/auth": "^0.4.39"
60
+ "@startsimpli/i18n": "^0.1.3"
61
61
  },
62
62
  "peerDependenciesMeta": {
63
63
  "@startsimpli/api": {
@@ -152,8 +152,8 @@
152
152
  "tailwindcss": "^3.4.19",
153
153
  "tsup": "^8.5.1",
154
154
  "typescript": "^6.0.3",
155
- "@startsimpli/i18n": "0.1.3",
156
- "@startsimpli/realtime": "0.0.2"
155
+ "@startsimpli/realtime": "0.0.2",
156
+ "@startsimpli/i18n": "0.1.3"
157
157
  },
158
158
  "keywords": [
159
159
  "ui",
@@ -517,7 +517,17 @@ describe('createHttpTrackChangesClient', () => {
517
517
  await c.listComments!({ field: 'blog', status: 'all' })
518
518
  await c.roster!({})
519
519
  expect(f.mock.calls[0][0]).toBe('/api/v1/entities/d1/comments/?field=blog&status=all')
520
- expect(f.mock.calls[1][0]).toBe('/api/v1/org/roster/')
520
+ expect(f.mock.calls[1][0]).toBe('/api/v1/org/roster/?record=d1')
521
+ })
522
+
523
+ it("asks for the RECORD's team, so only people who can read it are offered (bd startsim-whwxd, mention roster = team)", async () => {
524
+ const f = fake(200, { results: [], next_cursor: null })
525
+ const c = createHttpTrackChangesClient('rec-42', { headers: () => ({}), url: (p) => p, fetch: f })
526
+ await c.roster!({ cursor: 'abc' })
527
+ const url = new URL(f.mock.calls[0][0], 'https://t.test')
528
+ expect(url.pathname).toBe('/api/v1/org/roster')
529
+ expect(url.searchParams.get('record')).toBe('rec-42')
530
+ expect(url.searchParams.get('cursor')).toBe('abc')
521
531
  })
522
532
 
523
533
  it('throws the status and body on a refusal', async () => {
@@ -104,6 +104,9 @@ export function createHttpTrackChangesClient(
104
104
  reply: (threadId, req) => call<CommentWire>(`${base}/comments/${threadId}/replies`, { method: 'POST', body: req }),
105
105
  resolveThread: (threadId) => call(`${base}/comments/${threadId}/resolve`, { method: 'POST', body: {} }),
106
106
  reopenThread: (threadId) => call(`${base}/comments/${threadId}/reopen`, { method: 'POST', body: {} }),
107
- roster: ({ cursor }) => call<RosterPageWire>(`/api/v1/org/roster`, { query: { cursor } }),
107
+ // The RECORD's team: the tenant keeps only colleagues who can read this
108
+ // record, so nobody is offered who could not open it (bd startsim-whwxd, mention roster = team).
109
+ roster: ({ cursor }) =>
110
+ call<RosterPageWire>(`/api/v1/org/roster`, { query: { record: String(recordId), cursor } }),
108
111
  };
109
112
  }