@seliseblocks/genesis-os 4.2.9 → 4.3.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @seliseblocks/genesis-os
2
2
 
3
+ ## 4.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Hide the open-project icon on a shared project card when the owner has granted the viewer no
8
+ menu. The project-overview route admits nobody without a grant and redirects back to the
9
+ console, so the icon looked like a page that refused to load. `IProjectGroup` now carries the
10
+ `accessPolicies` the API already returned, and `ProjectCard` takes a `canOpen` prop (default
11
+ `true`). A response without `accessPolicies` at all is read as unknown, not as denied, so an
12
+ older API keeps the previous behaviour.
13
+
3
14
  ## 4.2.0
4
15
 
5
16
  ### Minor Changes
@@ -9197,7 +9197,8 @@ var INLINE_LIMIT = 3;
9197
9197
  var ProjectCard = ({
9198
9198
  project,
9199
9199
  projects,
9200
- isShared
9200
+ isShared,
9201
+ canOpen = true
9201
9202
  }) => {
9202
9203
  const navigate = reactRouter.useNavigate();
9203
9204
  const { setTenantGroup, setSelectedProject } = chunkVAKGHXK6_cjs.useProjectStore();
@@ -9245,17 +9246,35 @@ var ProjectCard = ({
9245
9246
  RenderAlternatively,
9246
9247
  {
9247
9248
  condition: isShared,
9248
- whenTrue: /* @__PURE__ */ jsxRuntime.jsxs(
9249
- Badge,
9250
- {
9251
- variant: "outline",
9252
- className: "flex items-center gap-1 shrink-0",
9253
- children: [
9254
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UsersRound, { size: 16 }),
9255
- "Shared"
9256
- ]
9257
- }
9258
- ),
9249
+ whenTrue: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
9250
+ /* @__PURE__ */ jsxRuntime.jsxs(
9251
+ Badge,
9252
+ {
9253
+ variant: "outline",
9254
+ className: "flex items-center gap-1 shrink-0",
9255
+ children: [
9256
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UsersRound, { size: 16 }),
9257
+ "Shared"
9258
+ ]
9259
+ }
9260
+ ),
9261
+ canOpen && /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
9262
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
9263
+ Button,
9264
+ {
9265
+ size: "icon",
9266
+ "data-testid": "project-card-open-shared",
9267
+ variant: "ghost",
9268
+ className: "text-primary hover:bg-primary/10 h-8 w-8 shrink-0 transition-colors",
9269
+ disabled: isDisabled || isFetching,
9270
+ onClick: onConfigureClick,
9271
+ "aria-label": "Open shared project",
9272
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings2, { size: 16 })
9273
+ }
9274
+ ) }),
9275
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: "Open Project" })
9276
+ ] })
9277
+ ] }),
9259
9278
  whenFalse: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
9260
9279
  /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
9261
9280
  Button,
@@ -9334,6 +9353,7 @@ var cardVariants = {
9334
9353
  }
9335
9354
  })
9336
9355
  };
9356
+ var canOpenProject = (group) => !group.isShared || !group.accessPolicies || group.accessPolicies.length > 0;
9337
9357
  var SelfProjectLoading = () => {
9338
9358
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: ["sk-1", "sk-2", "sk-3", "sk-4", "sk-5", "sk-6", "sk-7", "sk-8"].map(
9339
9359
  (itemKey) => /* @__PURE__ */ jsxRuntime.jsx(ProjectCardLoadingSkeleton, {}, itemKey)
@@ -9376,7 +9396,8 @@ var SelfProject = ({ canCreateProject = false }) => {
9376
9396
  {
9377
9397
  project: project.projects[0],
9378
9398
  projects: project.projects,
9379
- isShared: project.isShared
9399
+ isShared: project.isShared,
9400
+ canOpen: canOpenProject(project)
9380
9401
  }
9381
9402
  )
9382
9403
  },
@@ -12719,5 +12740,5 @@ exports.usePaginationQueryParams = usePaginationQueryParams;
12719
12740
  exports.useRightSidePanel = useRightSidePanel;
12720
12741
  exports.useSortQueryParams = useSortQueryParams;
12721
12742
  exports.useWizardStepper = useWizardStepper;
12722
- //# sourceMappingURL=chunk-J7P4N4JM.cjs.map
12723
- //# sourceMappingURL=chunk-J7P4N4JM.cjs.map
12743
+ //# sourceMappingURL=chunk-V4GJPS3E.cjs.map
12744
+ //# sourceMappingURL=chunk-V4GJPS3E.cjs.map