@igstack/app-catalog-frontend-core 0.4.0-alpha-20260729112817 → 0.4.0-alpha-20260729145014
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/esm/modules/appCatalog/context/mergeFrontendBuildId.d.ts +1 -1
- package/dist/esm/modules/appCatalog/context/mergeFrontendBuildId.js.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/integration/mock-backend/magazines.ts +3 -3
- package/src/__tests__/integration/serviceDesks.integration.test.ts +8 -8
- package/src/__tests__/modules/appCatalog/utils/searchApps.test.ts +7 -7
- package/src/__tests__/ui/components/header/VersionDisplay.test.tsx +1 -1
- package/src/modules/appCatalog/context/mergeFrontendBuildId.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppVersionInfo } from '@igstack/app-catalog-backend-core';
|
|
2
2
|
/**
|
|
3
|
-
* Merge the (
|
|
3
|
+
* Merge the (company-agnostic) frontend build id into the backend-provided
|
|
4
4
|
* version info's `frontend` slot.
|
|
5
5
|
*
|
|
6
6
|
* The build id is baked into the deployed JS bundle at build time (e.g. a CI
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeFrontendBuildId.js","sources":["../../../../../src/modules/appCatalog/context/mergeFrontendBuildId.ts"],"sourcesContent":["import type { AppVersionInfo } from '@igstack/app-catalog-backend-core'\n\n/**\n * Merge the (
|
|
1
|
+
{"version":3,"file":"mergeFrontendBuildId.js","sources":["../../../../../src/modules/appCatalog/context/mergeFrontendBuildId.ts"],"sourcesContent":["import type { AppVersionInfo } from '@igstack/app-catalog-backend-core'\n\n/**\n * Merge the (company-agnostic) frontend build id into the backend-provided\n * version info's `frontend` slot.\n *\n * The build id is baked into the deployed JS bundle at build time (e.g. a CI\n * pipeline id via a Vite env var). We PREPEND it to the resolved frontend-core\n * npm version instead of replacing it, so the footer surfaces both:\n * `#<buildId> · <frontend-core version> (<sha>)`.\n *\n * - No build id → return versions unchanged.\n * - build id === 'local' → show `local` (local dev, no meaningful SHA/version).\n * - otherwise → prepend `#<buildId> · ` and preserve the version + sha + shaUrl.\n */\nexport function mergeFrontendBuildId(\n versions: AppVersionInfo,\n frontendBuildId: string | undefined,\n): AppVersionInfo {\n if (!frontendBuildId) return versions\n if (frontendBuildId === 'local') {\n return { ...versions, frontend: { displayName: 'local' } }\n }\n const be = versions.frontend\n return {\n ...versions,\n frontend: be\n ? { ...be, displayName: `#${frontendBuildId} · ${be.displayName}` }\n : { displayName: `#${frontendBuildId}` },\n }\n}\n"],"names":[],"mappings":"AAeO,SAAS,qBACd,UACA,iBACgB;AAChB,MAAI,CAAC,gBAAiB,QAAO;AAC7B,MAAI,oBAAoB,SAAS;AAC/B,WAAO,EAAE,GAAG,UAAU,UAAU,EAAE,aAAa,UAAQ;AAAA,EACzD;AACA,QAAM,KAAK,SAAS;AACpB,SAAO;AAAA,IACL,GAAG;AAAA,IACH,UAAU,KACN,EAAE,GAAG,IAAI,aAAa,IAAI,eAAe,MAAM,GAAG,WAAW,OAC7D,EAAE,aAAa,IAAI,eAAe,GAAA;AAAA,EAAG;AAE7C;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@igstack/app-catalog-frontend-core",
|
|
3
|
-
"version": "0.4.0-alpha-
|
|
3
|
+
"version": "0.4.0-alpha-20260729145014",
|
|
4
4
|
"description": "Frontend core library for App Catalog",
|
|
5
5
|
"homepage": "https://github.com/lislon/app-catalog",
|
|
6
6
|
"repository": {
|
|
@@ -134,8 +134,8 @@
|
|
|
134
134
|
"vite-plugin-static-copy": "^3.1.4",
|
|
135
135
|
"vite-plugin-svgr": "^4.2.0",
|
|
136
136
|
"vitest": "^4.1.2",
|
|
137
|
-
"@igstack/app-catalog-backend-core": "0.4.0-alpha-
|
|
138
|
-
"@igstack/app-catalog-shared-core": "0.4.0-alpha-
|
|
137
|
+
"@igstack/app-catalog-backend-core": "0.4.0-alpha-20260729145014",
|
|
138
|
+
"@igstack/app-catalog-shared-core": "0.4.0-alpha-20260729145014"
|
|
139
139
|
},
|
|
140
140
|
"peerDependencies": {
|
|
141
141
|
"react": "19.1.2",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"vite": "^6.3.5",
|
|
145
145
|
"vite-plugin-svgr": "^4.2.0"
|
|
146
146
|
},
|
|
147
|
-
"gitHead": "
|
|
147
|
+
"gitHead": "e3909ab5c9c2619fb189171600c3bb48b9622e80",
|
|
148
148
|
"scripts": {
|
|
149
149
|
"build": "vite build",
|
|
150
150
|
"build:lenient": "vite build --mode lenient",
|
|
@@ -42,10 +42,10 @@ function fullMagazine(
|
|
|
42
42
|
},
|
|
43
43
|
})
|
|
44
44
|
backendCfg.withApprovalMethod({
|
|
45
|
-
slug: '
|
|
45
|
+
slug: 'ops-helpdesk',
|
|
46
46
|
type: 'service',
|
|
47
|
-
displayName: '
|
|
48
|
-
config: { url: 'https://
|
|
47
|
+
displayName: 'Ops Helpdesk',
|
|
48
|
+
config: { url: 'https://opsdesk.example.com' },
|
|
49
49
|
})
|
|
50
50
|
const managerApproval = backendCfg.withApprovalMethod({
|
|
51
51
|
slug: 'manager-approval',
|
|
@@ -8,7 +8,7 @@ import { magazine } from './mock-backend/magazines'
|
|
|
8
8
|
|
|
9
9
|
// #9: a header toggle (Apps | Service Desks) + a /service-desks route showing a
|
|
10
10
|
// searchable table of all type:'service' approval methods with open links.
|
|
11
|
-
// magazine.full() seeds two service desks (IT Help Desk,
|
|
11
|
+
// magazine.full() seeds two service desks (IT Help Desk, Ops Helpdesk) and
|
|
12
12
|
// two custom methods (Manager Approval, Self-Service) which must NOT appear.
|
|
13
13
|
|
|
14
14
|
function serviceDeskTable(): HTMLElement {
|
|
@@ -38,7 +38,7 @@ describe('Service Desks view (#9)', () => {
|
|
|
38
38
|
|
|
39
39
|
const names = deskNames()
|
|
40
40
|
expect(names).toContain('IT Help Desk')
|
|
41
|
-
expect(names).toContain('
|
|
41
|
+
expect(names).toContain('Ops Helpdesk')
|
|
42
42
|
// custom-type methods are not service desks
|
|
43
43
|
expect(names).not.toContain('Manager Approval')
|
|
44
44
|
expect(names).not.toContain('Self-Service')
|
|
@@ -72,12 +72,12 @@ describe('Service Desks view (#9)', () => {
|
|
|
72
72
|
const nameCell = within(itRow).getAllByRole('cell')[0]
|
|
73
73
|
expect(nameCell).toHaveTextContent('IT Infrastructure support desk')
|
|
74
74
|
|
|
75
|
-
//
|
|
75
|
+
// Ops Helpdesk has no description — its name cell shows only the name.
|
|
76
76
|
const uxRow = within(serviceDeskTable())
|
|
77
77
|
.getAllByRole('row')
|
|
78
|
-
.find((r) => r.textContent.includes('
|
|
78
|
+
.find((r) => r.textContent.includes('Ops Helpdesk'))!
|
|
79
79
|
const uxNameCell = within(uxRow).getAllByRole('cell')[0]!
|
|
80
|
-
expect(uxNameCell.textContent.trim()).toBe('
|
|
80
|
+
expect(uxNameCell.textContent.trim()).toBe('Ops Helpdesk')
|
|
81
81
|
})
|
|
82
82
|
|
|
83
83
|
it('filters the desks by search', async () => {
|
|
@@ -86,13 +86,13 @@ describe('Service Desks view (#9)', () => {
|
|
|
86
86
|
initialRoute: '/service-desks',
|
|
87
87
|
})
|
|
88
88
|
|
|
89
|
-
await waitFor(() => expect(deskNames()).toContain('
|
|
89
|
+
await waitFor(() => expect(deskNames()).toContain('Ops Helpdesk'))
|
|
90
90
|
|
|
91
|
-
await user.type(screen.getByLabelText('Search service desks'), '
|
|
91
|
+
await user.type(screen.getByLabelText('Search service desks'), 'Ops')
|
|
92
92
|
|
|
93
93
|
await waitFor(() => {
|
|
94
94
|
const names = deskNames()
|
|
95
|
-
expect(names).toContain('
|
|
95
|
+
expect(names).toContain('Ops Helpdesk')
|
|
96
96
|
expect(names).not.toContain('IT Help Desk')
|
|
97
97
|
})
|
|
98
98
|
})
|
|
@@ -50,14 +50,14 @@ describe('searchResources', () => {
|
|
|
50
50
|
describe('child resource search', () => {
|
|
51
51
|
const childResources: Resource[] = [
|
|
52
52
|
makeChildResource({
|
|
53
|
-
slug: 'aws-
|
|
54
|
-
displayName: '
|
|
53
|
+
slug: 'aws-acme-pipelines-dev',
|
|
54
|
+
displayName: 'acme-pipelines-biomarkers-ici-dev',
|
|
55
55
|
parentSlug: 'aws-console',
|
|
56
|
-
aliases: ['
|
|
56
|
+
aliases: ['000000000001'],
|
|
57
57
|
}),
|
|
58
58
|
makeChildResource({
|
|
59
|
-
slug: 'aws-
|
|
60
|
-
displayName: '
|
|
59
|
+
slug: 'aws-acme-infosec-dev',
|
|
60
|
+
displayName: 'acme-infosec-dev',
|
|
61
61
|
parentSlug: 'aws-console',
|
|
62
62
|
aliases: [],
|
|
63
63
|
}),
|
|
@@ -72,13 +72,13 @@ describe('searchResources', () => {
|
|
|
72
72
|
})
|
|
73
73
|
|
|
74
74
|
it('finds app by child resource alias (account ID)', () => {
|
|
75
|
-
const results = searchResources(allResources, '
|
|
75
|
+
const results = searchResources(allResources, '000000000001')
|
|
76
76
|
expect(results).toHaveLength(1)
|
|
77
77
|
expect(results[0]!.slug).toBe('aws-console')
|
|
78
78
|
})
|
|
79
79
|
|
|
80
80
|
it('does not match child resources when none provided', () => {
|
|
81
|
-
const results = searchResources(apps, '
|
|
81
|
+
const results = searchResources(apps, '000000000001')
|
|
82
82
|
expect(results).toHaveLength(0)
|
|
83
83
|
})
|
|
84
84
|
|
|
@@ -27,7 +27,7 @@ describe('VersionDisplay footer', () => {
|
|
|
27
27
|
'href',
|
|
28
28
|
'https://github.com/lislon/app-catalog/commit/abc1234',
|
|
29
29
|
)
|
|
30
|
-
// Backend line carries the
|
|
30
|
+
// Backend line carries the deployment SHA suffix
|
|
31
31
|
expect(screen.getByText(/#12345 \(deadbee\)/)).toBeInTheDocument()
|
|
32
32
|
})
|
|
33
33
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AppVersionInfo } from '@igstack/app-catalog-backend-core'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Merge the (
|
|
4
|
+
* Merge the (company-agnostic) frontend build id into the backend-provided
|
|
5
5
|
* version info's `frontend` slot.
|
|
6
6
|
*
|
|
7
7
|
* The build id is baked into the deployed JS bundle at build time (e.g. a CI
|