@ossy/analytics 3.9.0 → 3.11.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ossy/analytics",
3
3
  "description": "Analytics module — workspace insight KPIs",
4
- "version": "3.9.0",
4
+ "version": "3.11.1",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
7
7
  "module": "./src/index.js",
@@ -25,8 +25,8 @@
25
25
  "README.md"
26
26
  ],
27
27
  "dependencies": {
28
- "@ossy/event-store": "^3.8.0",
29
- "@ossy/workspaces": "^3.9.0"
28
+ "@ossy/event-store": "^3.11.1",
29
+ "@ossy/workspaces": "^3.11.1"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@ossy/app": "*",
@@ -42,5 +42,5 @@
42
42
  "@jest/globals": "^30.2.0",
43
43
  "jest": "^30.2.0"
44
44
  },
45
- "gitHead": "f404be69becb27a1fd853a6ff1903554e76e7d17"
45
+ "gitHead": "f279de3535b6bc76631cbc6b943dae8f92a1565f"
46
46
  }
@@ -62,9 +62,16 @@ export default function AnalyticsProductHome ({ workspace }) {
62
62
  const kpisSettled = workspaceKpis.status === 'success' || workspaceKpis.status === 'error'
63
63
  const viewsSettled = status === 'success' || status === 'error'
64
64
  const pageLoading = !kpisSettled || !viewsSettled
65
+ const overviewStatus = pageLoading
66
+ ? 'loading'
67
+ : (workspaceKpis.status === 'error' || status === 'error')
68
+ ? 'error'
69
+ : 'ready'
65
70
 
66
71
  return (
67
72
  <Page
73
+ data-analytics-status="on"
74
+ data-analytics-overview-status={overviewStatus}
68
75
  title="analytics.home.title"
69
76
  description="analytics.home.description"
70
77
  >
@@ -0,0 +1,58 @@
1
+ import enableAnalyticsFlow from './enable-analytics.flow.js'
2
+ import { DisableService, EnableService } from '@ossy/workspaces'
3
+
4
+ const ANALYTICS = '@ossy/analytics'
5
+
6
+ export const metadata = {
7
+ id: '@ossy/analytics/flows/disable-analytics',
8
+ feature: 'analytics',
9
+ requires: ['server', 'database'],
10
+ timeout: 120_000,
11
+ }
12
+
13
+ /**
14
+ * After enabling analytics, disable the package from the catalog detail
15
+ * toggle and confirm the analytics home returns to the sales (off) state.
16
+ */
17
+ export default {
18
+ title: 'Disable analytics',
19
+ description:
20
+ 'Signed-in user enables analytics, disables it from the package catalog, and sees the sales home again',
21
+ steps: [
22
+ ...enableAnalyticsFlow.steps,
23
+ { page: '@packages/detail', params: { packageSlug: 'analytics' } },
24
+ {
25
+ result: {
26
+ action: { ...DisableService, service: ANALYTICS },
27
+ timeout: 15000,
28
+ },
29
+ },
30
+ {
31
+ result: {
32
+ selector: `[data-package-service="${ANALYTICS}"][data-service-enabled="true"]`,
33
+ timeout: 10000,
34
+ },
35
+ },
36
+ { action: { ...DisableService, service: ANALYTICS } },
37
+ {
38
+ result: {
39
+ action: { ...EnableService, service: ANALYTICS },
40
+ timeout: 20000,
41
+ },
42
+ },
43
+ {
44
+ result: {
45
+ selector: `[data-package-service="${ANALYTICS}"][data-service-enabled="false"]`,
46
+ timeout: 10000,
47
+ },
48
+ },
49
+ { page: '@analytics/home' },
50
+ { result: { selector: '[data-analytics-status="off"]', timeout: 20000 } },
51
+ {
52
+ result: {
53
+ action: { ...EnableService, service: ANALYTICS },
54
+ timeout: 10000,
55
+ },
56
+ },
57
+ ],
58
+ }
@@ -0,0 +1,26 @@
1
+ import signUpFlow from '@ossy/authentication/sign-up.flow.js'
2
+ import { EnableService } from '@ossy/workspaces'
3
+
4
+ const ANALYTICS = '@ossy/analytics'
5
+
6
+ export const metadata = {
7
+ id: '@ossy/analytics/flows/enable-analytics',
8
+ feature: 'analytics',
9
+ requires: ['server', 'database'],
10
+ }
11
+
12
+ /**
13
+ * New workspace owner signs up and enables analytics from the sales home.
14
+ */
15
+ export default {
16
+ title: 'Enable analytics',
17
+ description:
18
+ 'New user registers, verifies email, and activates analytics from the analytics home sales page',
19
+ steps: [
20
+ ...signUpFlow.steps,
21
+ { page: '@analytics/home' },
22
+ { result: { action: { ...EnableService, service: ANALYTICS }, timeout: 15000 } },
23
+ { action: { ...EnableService, service: ANALYTICS } },
24
+ { result: { selector: '[data-analytics-status="on"]', timeout: 20000 } },
25
+ ],
26
+ }
@@ -0,0 +1,27 @@
1
+ import enableAnalyticsFlow from './enable-analytics.flow.js'
2
+
3
+ export const metadata = {
4
+ id: '@ossy/analytics/flows/view-analytics',
5
+ feature: 'analytics',
6
+ requires: ['server', 'database'],
7
+ timeout: 120_000,
8
+ }
9
+
10
+ /**
11
+ * After enabling analytics, wait until workspace KPIs and page-view stats
12
+ * settle so the product home overview is ready (not just mounted).
13
+ */
14
+ export default {
15
+ title: 'View analytics overview',
16
+ description:
17
+ 'Signed-in user enables analytics and sees the product overview settle to ready',
18
+ steps: [
19
+ ...enableAnalyticsFlow.steps,
20
+ {
21
+ result: {
22
+ selector: '[data-analytics-overview-status="ready"]',
23
+ timeout: 20000,
24
+ },
25
+ },
26
+ ],
27
+ }