@ossy/package-catalog 3.8.0 → 3.12.0
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 +2 -2
- package/src/PackageServiceToggle.jsx +14 -9
- package/src/packageCopy.js +0 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/package-catalog",
|
|
3
3
|
"description": "Capability catalog UI — browse manifest packages, actions, and integration examples",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.12.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"module": "./src/index.js",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"@ossy/workspaces": ">=1.0.0",
|
|
30
30
|
"react": ">=19.0.0 <20.0.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "c2650803219ad1831559b512848358d9550ffad2"
|
|
33
33
|
}
|
|
@@ -2,28 +2,33 @@ import React, { useState } from 'react'
|
|
|
2
2
|
import { Button } from '@ossy/design-system'
|
|
3
3
|
import { useApp } from '@ossy/app/shell'
|
|
4
4
|
import { GetWorkspace, EnableService, DisableService } from '@ossy/workspaces'
|
|
5
|
-
import { useSdk, cacheKey } from '@ossy/sdk-react'
|
|
5
|
+
import { useSdk, cacheKey, AsyncStatus } from '@ossy/sdk-react'
|
|
6
6
|
import { isServiceEntitled, isToggleablePackage } from '@ossy/workspaces/entitlements'
|
|
7
|
-
import { resolveWorkspaceServices } from '@ossy/app/shell'
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Enable or disable a workspace service from the package detail page.
|
|
10
|
+
*
|
|
11
|
+
* Toggle state must reflect the **live workspace** entitlement — not
|
|
12
|
+
* `devEntitlements` / `resolveWorkspaceServices` overlays used by the sidebar.
|
|
13
|
+
* Otherwise Disable appears to no-op in app-test when a package is pre-enabled
|
|
14
|
+
* for local sidebar verification.
|
|
15
|
+
*
|
|
16
|
+
* Do not mount the toggle until GetWorkspace has settled. Rendering Enable
|
|
17
|
+
* while services are still undefined, then remounting when Success lands,
|
|
18
|
+
* detaches the control under Playwright's scroll/stability wait (catalog
|
|
19
|
+
* enable e2e flake).
|
|
11
20
|
*/
|
|
12
21
|
export function PackageServiceToggle ({ packageName, entitlementRequired = true }) {
|
|
13
22
|
const app = useApp()
|
|
14
23
|
const sdk = useSdk()
|
|
15
|
-
const { data: workspace, refetch: refetchWorkspace } = sdk.read(GetWorkspace)
|
|
24
|
+
const { data: workspace, status, refetch: refetchWorkspace } = sdk.read(GetWorkspace)
|
|
16
25
|
const [busy, setBusy] = useState(false)
|
|
17
26
|
|
|
18
27
|
if (!app?.isAuthenticated || !app?.workspaceId) return null
|
|
19
28
|
if (!packageName || !isToggleablePackage(packageName, { entitlementRequired })) return null
|
|
29
|
+
if (status !== AsyncStatus.Success && status !== AsyncStatus.Error) return null
|
|
20
30
|
|
|
21
|
-
const
|
|
22
|
-
devMode: app.devMode,
|
|
23
|
-
devEntitlements: app.devEntitlements,
|
|
24
|
-
workspaceServices: workspace?.services,
|
|
25
|
-
})
|
|
26
|
-
const enabled = isServiceEntitled(services, packageName)
|
|
31
|
+
const enabled = isServiceEntitled(workspace?.services, packageName)
|
|
27
32
|
|
|
28
33
|
const toggleService = async (enable) => {
|
|
29
34
|
setBusy(true)
|
package/src/packageCopy.js
CHANGED
|
@@ -14,7 +14,6 @@ const ICON_BY_SLUG = {
|
|
|
14
14
|
email: 'email',
|
|
15
15
|
employees: 'users',
|
|
16
16
|
forecasts: 'chart',
|
|
17
|
-
gmail: 'email',
|
|
18
17
|
home: 'home',
|
|
19
18
|
'integration-stripe': 'credit-card',
|
|
20
19
|
'media-tasks': 'image',
|
|
@@ -52,7 +51,6 @@ const PITCH_BY_SLUG = {
|
|
|
52
51
|
email: 'Transactional email and templates',
|
|
53
52
|
employees: 'Team members and org structure',
|
|
54
53
|
forecasts: 'Revenue and capacity forecasting',
|
|
55
|
-
gmail: 'Gmail integration and inbox sync',
|
|
56
54
|
home: 'Workspace home and navigation',
|
|
57
55
|
'integration-stripe': 'Stripe payments and billing',
|
|
58
56
|
'media-tasks': 'Media processing background jobs',
|