mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-15 01:07:32 +00:00
Keep setup completion identity local
This commit is contained in:
parent
7d3c482a0a
commit
0849c316db
4 changed files with 48 additions and 3 deletions
|
|
@ -970,6 +970,11 @@ inventory. It may not present Docker, Kubernetes, Proxmox, or TrueNAS as
|
|||
competing primary onboarding paths, nor fall back to logo-led feature
|
||||
brochure copy that obscures the unified-resource contract the wizard is
|
||||
supposed to introduce.
|
||||
That same connected-systems summary must preserve canonical local operator
|
||||
identity for newly connected infrastructure. When governed resources such as
|
||||
PBS or PMG appear in the setup-completion poll, the surface must show their
|
||||
local instance labels instead of replacing those identities with governed
|
||||
summary text, so the operator can tell which system actually connected.
|
||||
That same first-session setup-completion surface must also honor the lane's
|
||||
optional-auth install contract: when Pulse does not require API tokens, the
|
||||
wizard may switch to tokenless install commands only after an explicit operator
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import {
|
|||
trackUpgradeClicked,
|
||||
} from '@/utils/upgradeMetrics';
|
||||
import {
|
||||
getPreferredResourceDisplayName,
|
||||
getPreferredInfrastructureDisplayName,
|
||||
getPreferredResourceHostname,
|
||||
} from '@/utils/resourceIdentity';
|
||||
import {
|
||||
|
|
@ -90,7 +90,7 @@ const hasAgentFacet = (resource: Resource): boolean => resourceHasAgentFacet(res
|
|||
const toNodeSummaryShape = (resource: Resource) => {
|
||||
const platformData = pd(resource);
|
||||
const proxmox = asRecord(platformData?.proxmox);
|
||||
const name = getPreferredResourceDisplayName(resource);
|
||||
const name = getPreferredInfrastructureDisplayName(resource);
|
||||
return {
|
||||
id: resource.id,
|
||||
name,
|
||||
|
|
@ -101,7 +101,7 @@ const toNodeSummaryShape = (resource: Resource) => {
|
|||
|
||||
const toAgentSummaryShape = (resource: Resource) => {
|
||||
const hostname = getPreferredResourceHostname(resource) || resource.id;
|
||||
const name = getPreferredResourceDisplayName(resource);
|
||||
const name = getPreferredInfrastructureDisplayName(resource);
|
||||
const id = getActionableAgentIdFromResource(resource) || resource.id;
|
||||
return {
|
||||
id,
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ describe('SetupCompletionPanel guardrails', () => {
|
|||
expect(setupCompletionPanelSource).not.toContain('ProxmoxIcon');
|
||||
});
|
||||
|
||||
it('keeps connected infrastructure labels on the canonical local identity helper', () => {
|
||||
expect(setupCompletionPanelSource).toContain('getPreferredInfrastructureDisplayName');
|
||||
expect(setupCompletionPanelSource).not.toContain('getPreferredResourceDisplayName(resource)');
|
||||
});
|
||||
|
||||
it('does not reintroduce a separate setup-wizard install command surface', () => {
|
||||
expect(setupCompletionPanelSource).not.toContain('buildUnixAgentInstallCommand');
|
||||
expect(setupCompletionPanelSource).not.toContain('buildWindowsAgentInstallCommand');
|
||||
|
|
|
|||
|
|
@ -192,6 +192,41 @@ describe('SetupCompletionPanel', () => {
|
|||
expect(onComplete).toHaveBeenCalledWith('/');
|
||||
});
|
||||
|
||||
it('keeps connected governed infrastructure on local operator identity', async () => {
|
||||
apiFetchJSONMock.mockResolvedValue({
|
||||
resources: [
|
||||
{
|
||||
id: 'pbs-1',
|
||||
type: 'pbs',
|
||||
name: 'redacted-pbs',
|
||||
displayName: 'PBS Main',
|
||||
status: 'online',
|
||||
agent: { agentId: 'pbs-1' },
|
||||
platformData: {
|
||||
pbs: { hostname: 'pbs.local', instanceId: 'pbs-main' },
|
||||
},
|
||||
policy: {
|
||||
display: {
|
||||
mode: 'governed',
|
||||
summary: 'backup server resource; status online; sources pbs',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
render(() => <SetupCompletionPanel state={baseState} onComplete={vi.fn()} />);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText('Connected (1 agent)')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
expect(screen.getByText('PBS Main')).toBeInTheDocument();
|
||||
expect(
|
||||
screen.queryByText('backup server resource; status online; sources pbs'),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('routes relay setup through the canonical settings destination', async () => {
|
||||
const onComplete = vi.fn();
|
||||
apiFetchJSONMock.mockResolvedValue({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue