From f5cd6b74b777b68b6a2e8763bfd8579eee5dc01d Mon Sep 17 00:00:00 2001 From: Zhongnan Su Date: Tue, 16 Feb 2021 13:36:37 -0800 Subject: [PATCH] add global tenant for report definition urls --- .../server/routes/utils/converters/backendToUi.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kibana-reports/server/routes/utils/converters/backendToUi.ts b/kibana-reports/server/routes/utils/converters/backendToUi.ts index c254ad57..3baf222e 100644 --- a/kibana-reports/server/routes/utils/converters/backendToUi.ts +++ b/kibana-reports/server/routes/utils/converters/backendToUi.ts @@ -222,12 +222,15 @@ const getUiQueryUrl = ( const timeFrom = moment(beginTimeMs).toISOString(); const timeTo = moment(endTimeMs).toISOString(); let queryUrl = `${baseUrl}?_g=(time:(from:'${timeFrom}',to:'${timeTo}'))`; - if (tenant) { - if (tenant === '__user__') { + if (tenant !== undefined) { + if (tenant === '') { + tenant = 'global'; + } else if (tenant === '__user__') { tenant = 'private'; } queryUrl = addTenantToURL(queryUrl, tenant); } + return queryUrl; };