@streamoid/settings 0.7.7 → 0.7.8

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/dist/index.d.mts CHANGED
@@ -366,9 +366,12 @@ interface OrganizationWorkspaceItem {
366
366
  imageUrl?: string;
367
367
  orgVisibility: "private" | "shared";
368
368
  /** Whether the viewer is in it. An org member is shown every shared
369
- * workspace; the ones with `joined: false` get a Join button (with
370
- * `joinWorkspaces`). Absent is treated as joined. */
369
+ * workspace, an org admin every workspace; the ones with `joined: false`
370
+ * get a Join button (with `joinWorkspaces`). Absent is treated as joined.
371
+ * A member joins as member, an org admin as admin. */
371
372
  joined?: boolean;
373
+ /** "inactive" workspaces are listed to org admins but can't be joined. */
374
+ status?: string;
372
375
  }
373
376
  /** A shared workspace in the organization that the viewer isn't in yet. */
374
377
  interface OrganizationJoinableWorkspace {
package/dist/index.d.ts CHANGED
@@ -366,9 +366,12 @@ interface OrganizationWorkspaceItem {
366
366
  imageUrl?: string;
367
367
  orgVisibility: "private" | "shared";
368
368
  /** Whether the viewer is in it. An org member is shown every shared
369
- * workspace; the ones with `joined: false` get a Join button (with
370
- * `joinWorkspaces`). Absent is treated as joined. */
369
+ * workspace, an org admin every workspace; the ones with `joined: false`
370
+ * get a Join button (with `joinWorkspaces`). Absent is treated as joined.
371
+ * A member joins as member, an org admin as admin. */
371
372
  joined?: boolean;
373
+ /** "inactive" workspaces are listed to org admins but can't be joined. */
374
+ status?: string;
372
375
  }
373
376
  /** A shared workspace in the organization that the viewer isn't in yet. */
374
377
  interface OrganizationJoinableWorkspace {
package/dist/index.js CHANGED
@@ -6467,7 +6467,8 @@ function OrganizationContent({
6467
6467
  const current = organization.current;
6468
6468
  const [members, setMembers] = (0, import_react12.useState)([]);
6469
6469
  const [workspaces, setWorkspaces] = (0, import_react12.useState)([]);
6470
- const canJoinShared = current?.role === "member" && !!organization.joinWorkspaces;
6470
+ const joinRole = current?.role === "admin" || current?.role === "member" ? current.role : null;
6471
+ const canJoin = !!joinRole && !!organization.joinWorkspaces;
6471
6472
  const [joiningId, setJoiningId] = (0, import_react12.useState)(null);
6472
6473
  const [joinRequests, setJoinRequests] = (0, import_react12.useState)([]);
6473
6474
  const [highestRole, setHighestRole] = (0, import_react12.useState)("guest");
@@ -6744,7 +6745,7 @@ function OrganizationContent({
6744
6745
  {
6745
6746
  workspace: ws,
6746
6747
  joining: joiningId === ws._id,
6747
- onJoin: canJoinShared && ws.joined === false && ws.orgVisibility === "shared" ? () => void handleJoinWorkspace(ws) : void 0
6748
+ onJoin: canJoin && ws.joined === false && ws.status !== "inactive" && (joinRole === "admin" || ws.orgVisibility === "shared") ? () => void handleJoinWorkspace(ws) : void 0
6748
6749
  },
6749
6750
  ws._id
6750
6751
  ))
package/dist/index.mjs CHANGED
@@ -6444,7 +6444,8 @@ function OrganizationContent({
6444
6444
  const current = organization.current;
6445
6445
  const [members, setMembers] = useState10([]);
6446
6446
  const [workspaces, setWorkspaces] = useState10([]);
6447
- const canJoinShared = current?.role === "member" && !!organization.joinWorkspaces;
6447
+ const joinRole = current?.role === "admin" || current?.role === "member" ? current.role : null;
6448
+ const canJoin = !!joinRole && !!organization.joinWorkspaces;
6448
6449
  const [joiningId, setJoiningId] = useState10(null);
6449
6450
  const [joinRequests, setJoinRequests] = useState10([]);
6450
6451
  const [highestRole, setHighestRole] = useState10("guest");
@@ -6721,7 +6722,7 @@ function OrganizationContent({
6721
6722
  {
6722
6723
  workspace: ws,
6723
6724
  joining: joiningId === ws._id,
6724
- onJoin: canJoinShared && ws.joined === false && ws.orgVisibility === "shared" ? () => void handleJoinWorkspace(ws) : void 0
6725
+ onJoin: canJoin && ws.joined === false && ws.status !== "inactive" && (joinRole === "admin" || ws.orgVisibility === "shared") ? () => void handleJoinWorkspace(ws) : void 0
6725
6726
  },
6726
6727
  ws._id
6727
6728
  ))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/settings",
3
- "version": "0.7.7",
3
+ "version": "0.7.8",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",