From 21fe015534523cee38a15b61aadbd4025bfaa304 Mon Sep 17 00:00:00 2001 From: Mikael Hoegqvist Tabor Date: Wed, 6 Dec 2023 10:55:28 +0100 Subject: [PATCH 1/2] fix: showing undefined when sync status is not-deployed --- core/src/commands/sync/sync-status.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/commands/sync/sync-status.ts b/core/src/commands/sync/sync-status.ts index 303b2e2401..8b8a02c63d 100644 --- a/core/src/commands/sync/sync-status.ts +++ b/core/src/commands/sync/sync-status.ts @@ -192,6 +192,7 @@ export async function getSyncStatuses({ "active": "is", "failed": "has", "not-active": "is", + "not-deployed": "is", } const syncCount = syncStatus.syncs.length From 6c163a481fe44d279c2446b9ed3c311cbc76b180 Mon Sep 17 00:00:00 2001 From: Mikael Hoegqvist Tabor Date: Wed, 6 Dec 2023 11:25:27 +0100 Subject: [PATCH 2/2] chore: updated to handle all sync states --- core/src/commands/sync/sync-status.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/core/src/commands/sync/sync-status.ts b/core/src/commands/sync/sync-status.ts index 8b8a02c63d..ab2591b1b0 100644 --- a/core/src/commands/sync/sync-status.ts +++ b/core/src/commands/sync/sync-status.ts @@ -128,6 +128,16 @@ function stateStyle(state: SyncState, msg: string) { return styleFn(msg) } +const verbMap: { [key in SyncState]: string } = { + "active": "is", + "failed": "has", + "not-active": "is", + "not-deployed": "is", + "unknown": "is", + "not-configured": "is", + "outdated": "is", +} + function describeState(state: SyncState) { return state.replace("-", " ") } @@ -188,13 +198,6 @@ export async function getSyncStatuses({ }) syncStatus["syncs"] = sorted - const verbMap = { - "active": "is", - "failed": "has", - "not-active": "is", - "not-deployed": "is", - } - const syncCount = syncStatus.syncs.length const pluralizedSyncs = syncCount === 1 ? "sync" : "syncs" log.info(