mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-10 02:25:56 +00:00
Hide Proxmox Replication tab when no replication signals exist
The Replication tab was gated on `hasPveEstate || replicationChanges.length > 0`, which meant every PVE estate got an always-visible tab whose only content was empty-state copy. That broke the pattern set by every other Proxmox sub-tab (Storage, Backups, Ceph, Mail Gateway), each of which only appears when there is actual data to show. The `hasPveEstate ||` clause was added in111af289awithout a recorded rationale; the prior "gate by evidence" design (251e8844d) correctly gated on `replicationChanges.length > 0` only. Restore the original gate so Replication matches the rest of the platform page: it shows up when there is something to show.
This commit is contained in:
@@ -130,7 +130,7 @@ describe('proxmoxPageModel', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it('keeps Replication available for a PVE estate without recent replication events', () => {
|
||||
it('hides Replication for a PVE estate without replication signals', () => {
|
||||
const model = buildProxmoxPageModel([
|
||||
makeResource({
|
||||
id: 'pve-node-1',
|
||||
@@ -148,10 +148,7 @@ describe('proxmoxPageModel', () => {
|
||||
}),
|
||||
]);
|
||||
|
||||
expect(buildVisibleProxmoxTabSpecs(model).map((tab) => tab.id)).toEqual([
|
||||
'overview',
|
||||
'replication',
|
||||
]);
|
||||
expect(buildVisibleProxmoxTabSpecs(model).map((tab) => tab.id)).toEqual(['overview']);
|
||||
});
|
||||
|
||||
it('resolves Proxmox suite scope from canonical platform hints', () => {
|
||||
|
||||
@@ -373,12 +373,11 @@ export function buildProxmoxPageModel(resources: Resource[]): ProxmoxPageModel {
|
||||
|
||||
export function buildVisibleProxmoxTabSpecs(model: ProxmoxPageModel): ProxmoxTabSpec[] {
|
||||
const visible = new Set<ProxmoxPageTabId>(['overview']);
|
||||
const hasPveEstate = model.pveNodes.length > 0 || model.guests.length > 0;
|
||||
|
||||
if (model.storage.length > 0 || model.physicalDisks.length > 0) {
|
||||
visible.add('storage');
|
||||
}
|
||||
if (hasPveEstate || model.replicationChanges.length > 0) {
|
||||
if (model.replicationChanges.length > 0) {
|
||||
visible.add('replication');
|
||||
}
|
||||
if (model.resources.some(hasBackupSignal) || model.pbs.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user