From 35c77c541aa00717ef99928a83349663b9980fd9 Mon Sep 17 00:00:00 2001 From: Austin McGee <947888+amcgee@users.noreply.github.com> Date: Fri, 9 Oct 2020 17:29:19 +0200 Subject: [PATCH 1/3] feat: add explicit support for systemInfo and serverVersion config props --- services/config/src/__tests__/integration.test.tsx | 10 ++++++++++ services/config/src/types.ts | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/services/config/src/__tests__/integration.test.tsx b/services/config/src/__tests__/integration.test.tsx index 04517f387..959efd070 100644 --- a/services/config/src/__tests__/integration.test.tsx +++ b/services/config/src/__tests__/integration.test.tsx @@ -8,6 +8,16 @@ import { ConfigContext } from '../ConfigContext' const mockConfig: Config = { baseUrl: 'http://test.com', apiVersion: 42, + serverVersion: { + major: 2, + minor: 35, + patch: undefined, + tag: 'SNAPSHOT', + }, + systemInfo: { + contextPath: 'http://localhost:3000', + version: '2.35-SNAPSHOT', + }, } describe('Testing custom config provider', () => { diff --git a/services/config/src/types.ts b/services/config/src/types.ts index f631ea061..4e00bc5a6 100644 --- a/services/config/src/types.ts +++ b/services/config/src/types.ts @@ -1,4 +1,18 @@ +type ServerVersion = { + major: number + minor: number + patch?: number + tag: string +} + +interface SystemInfo { + version: string + contextPath: string +} + export interface Config { baseUrl: string apiVersion: number + serverVersion: ServerVersion + systemInfo: SystemInfo } From 0a15259dde50c3b85dc2f4abde2c6fc4b3024fd1 Mon Sep 17 00:00:00 2001 From: Austin McGee <947888+amcgee@users.noreply.github.com> Date: Fri, 9 Oct 2020 17:31:37 +0200 Subject: [PATCH 2/3] fix: make serverVersion and systemInfo properties optional --- services/config/src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/config/src/types.ts b/services/config/src/types.ts index 4e00bc5a6..25f3d8852 100644 --- a/services/config/src/types.ts +++ b/services/config/src/types.ts @@ -13,6 +13,6 @@ interface SystemInfo { export interface Config { baseUrl: string apiVersion: number - serverVersion: ServerVersion - systemInfo: SystemInfo + serverVersion?: ServerVersion + systemInfo?: SystemInfo } From ad7c035385e60b839e0158af761045eec8ce20f7 Mon Sep 17 00:00:00 2001 From: Austin McGee <947888+amcgee@users.noreply.github.com> Date: Mon, 12 Oct 2020 10:27:24 +0200 Subject: [PATCH 3/3] chore: set tag to optional --- services/config/src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/config/src/types.ts b/services/config/src/types.ts index 25f3d8852..92d5458c2 100644 --- a/services/config/src/types.ts +++ b/services/config/src/types.ts @@ -2,7 +2,7 @@ type ServerVersion = { major: number minor: number patch?: number - tag: string + tag?: string } interface SystemInfo {