diff --git a/.changeset/39335-connector-credentials-setup-group.md b/.changeset/39335-connector-credentials-setup-group.md new file mode 100644 index 00000000000..af9c63db2af --- /dev/null +++ b/.changeset/39335-connector-credentials-setup-group.md @@ -0,0 +1,8 @@ +--- +"@objectstack/service-automation": patch +--- + +Clause-②: no +Metadata-protocol: none + +The Connector Credentials and Connector Connections Setup entries now name the Integrations & Developer group by its live id, `group_integrations_dev`, instead of the retired `group_integrations`. The entries render in the same place as before; a boot no longer logs a `nav_contribution_group_renamed` warning against the platform's own navigation. diff --git a/packages/services/service-automation/src/connector-credentials-ui.test.ts b/packages/services/service-automation/src/connector-credentials-ui.test.ts index 38061d681ba..b7016979036 100644 --- a/packages/services/service-automation/src/connector-credentials-ui.test.ts +++ b/packages/services/service-automation/src/connector-credentials-ui.test.ts @@ -22,6 +22,8 @@ import { describe, expect, it } from 'vitest'; import { LiteKernel } from '@objectstack/core'; import { ManifestSchema } from '@objectstack/spec/kernel'; import { PLATFORM_CAPABILITIES } from '@objectstack/spec/security'; +import { SchemaRegistry, checkNavContributionGroupRenames } from '@objectstack/objectql'; +import { SETUP_APP } from '@objectstack/platform-objects'; import { AutomationServicePlugin } from './plugin.js'; import { @@ -44,7 +46,7 @@ describe('[#27238] the connector credentials UI bundle', () => { expect(CONNECTOR_CREDENTIALS_UI_BUNDLE.navigationContributions).toEqual([ { app: 'setup', - group: 'group_integrations', + group: 'group_integrations_dev', priority: 120, items: [ { @@ -76,6 +78,44 @@ describe('[#27238] the connector credentials UI bundle', () => { }); }); +/** + * The bundle's Setup contribution names a live Setup group id, read off + * `SETUP_APP` rather than spelled here: a retired id still lands through the + * successor's `renamedFrom`, but warns `nav_contribution_group_renamed` on every + * boot, so "it renders in the right group" alone would not catch it. + */ +describe('the connector credentials UI bundle names a live Setup group', () => { + const contributions = CONNECTOR_CREDENTIALS_UI_BUNDLE.navigationContributions; + const groups = (SETUP_APP.navigation ?? []).filter((n: any) => n?.type === 'group') as any[]; + + it('targets a group SETUP_APP declares, not one a group lists under renamedFrom', () => { + const live = new Set(groups.map((g) => g.id)); + const retired = new Set(groups.flatMap((g) => g.renamedFrom ?? [])); + for (const c of contributions) { + expect(live.has(c.group)).toBe(true); + expect(retired.has(c.group)).toBe(false); + } + }); + + it('draws no retired-group-id diagnostic, and the retired spelling would', () => { + expect(checkNavContributionGroupRenames([SETUP_APP as any], contributions as any)).toEqual([]); + // Non-vacuity: the spelling this entry used to carry is reported. + expect( + checkNavContributionGroupRenames([SETUP_APP as any], [{ ...contributions[0], group: 'group_integrations' }] as any) + .map((d) => d.renamedTo), + ).toEqual([contributions[0].group]); + }); + + it('lands both items in that group of the merged Setup tree', () => { + const registry = new SchemaRegistry({ multiTenant: false, collisionPolicy: 'error' }); + (registry as any).logLevel = 'silent'; + registry.registerApp(structuredClone(SETUP_APP) as any, '@objectstack/platform-objects'); + registry.registerAppNavContribution(structuredClone(contributions[0]) as any, CONNECTOR_CREDENTIALS_UI_BUNDLE.id); + const group = ((registry.getApp('setup') as any)?.navigation ?? []).find((n: any) => n?.id === contributions[0].group); + expect((group?.children ?? []).map((c: any) => c?.id)).toEqual(['nav_connector_credentials', 'nav_connector_connections']); + }); +}); + /** Boot a kernel whose `manifest` service (when given) records every registration. */ async function boot(opts: { withManifest: boolean; armRuntime?: boolean }) { const registered: Array<{ id?: string }> = []; diff --git a/packages/services/service-automation/src/connector-credentials-ui.ts b/packages/services/service-automation/src/connector-credentials-ui.ts index 0108a1cfd2b..de6213281a5 100644 --- a/packages/services/service-automation/src/connector-credentials-ui.ts +++ b/packages/services/service-automation/src/connector-credentials-ui.ts @@ -42,11 +42,16 @@ export const CONNECTOR_CONNECTIONS_NAV_CAPABILITY = 'manage_connector_connection /** * `priority` orders contributions within a group, lowest first. The group's - * other contributors, read where they are declared: Webhooks / HTTP Deliveries - * (`@objectstack/plugin-webhooks`) and Datasources - * (`@objectstack/service-datasource`) at 100, Cloud Connection - * (`@objectstack/cloud-connection`) at 200 — so 120 sorts this entry after the + * other contributors, read where they are declared: Datasources + * (`@objectstack/service-datasource`) at 105, Cloud Connection + * (`@objectstack/cloud-connection`) at 110, Webhooks / HTTP Deliveries + * (`@objectstack/plugin-webhooks`) at 115 — so 120 sorts this entry after the * connection surfaces it serves. + * + * `group` names Setup's Integrations & Developer group by its live id. The + * retired `group_integrations` still lands there through that group's + * `renamedFrom`, but draws a `nav_contribution_group_renamed` warning on every + * boot — the diagnostic meant for an app's stale group id, not the platform's. */ export const CONNECTOR_CREDENTIALS_UI_BUNDLE = { id: 'com.objectstack.service-automation.connector-credentials-ui', @@ -59,7 +64,7 @@ export const CONNECTOR_CREDENTIALS_UI_BUNDLE = { navigationContributions: [ { app: 'setup', - group: 'group_integrations', + group: 'group_integrations_dev', priority: 120, items: [ {