From 9df534cdf0fd622de74a2750dc7cb7141e94b06b Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Tue, 30 Jul 2024 11:50:47 +0800 Subject: [PATCH 1/2] fix missing fields Signed-off-by: Hailong Cui --- .../saved_objects/service/lib/included_fields.test.ts | 6 +++++- .../server/saved_objects/service/lib/included_fields.ts | 2 ++ .../server/saved_objects/service/lib/repository.test.js | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/server/saved_objects/service/lib/included_fields.test.ts b/src/core/server/saved_objects/service/lib/included_fields.test.ts index 7993e83a443b..042c4b926942 100644 --- a/src/core/server/saved_objects/service/lib/included_fields.test.ts +++ b/src/core/server/saved_objects/service/lib/included_fields.test.ts @@ -30,7 +30,7 @@ import { includedFields } from './included_fields'; -const BASE_FIELD_COUNT = 9; +const BASE_FIELD_COUNT = 11; describe('includedFields', () => { it('returns undefined if fields are not provided', () => { @@ -56,6 +56,8 @@ Array [ "migrationVersion", "updated_at", "originId", + "workspaces", + "permissions", "foo", ] `); @@ -90,6 +92,8 @@ Array [ "migrationVersion", "updated_at", "originId", + "workspaces", + "permissions", "foo", "bar", ] diff --git a/src/core/server/saved_objects/service/lib/included_fields.ts b/src/core/server/saved_objects/service/lib/included_fields.ts index 561ba81c4eb7..265a23a33e8a 100644 --- a/src/core/server/saved_objects/service/lib/included_fields.ts +++ b/src/core/server/saved_objects/service/lib/included_fields.ts @@ -54,5 +54,7 @@ export function includedFields(type: string | string[] = '*', fields?: string[] .concat('migrationVersion') .concat('updated_at') .concat('originId') + .concat('workspaces') + .concat('permissions') .concat(fields); // v5 compatibility } diff --git a/src/core/server/saved_objects/service/lib/repository.test.js b/src/core/server/saved_objects/service/lib/repository.test.js index 0a85cd9be3ec..45852595e88b 100644 --- a/src/core/server/saved_objects/service/lib/repository.test.js +++ b/src/core/server/saved_objects/service/lib/repository.test.js @@ -2819,6 +2819,8 @@ describe('SavedObjectsRepository', () => { 'migrationVersion', 'updated_at', 'originId', + 'workspaces', + 'permissions', 'title', ], }), From 60df022396d75dd6efb2c01e8058f00a93b32828 Mon Sep 17 00:00:00 2001 From: "opensearch-changeset-bot[bot]" <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 05:46:57 +0000 Subject: [PATCH 2/2] Changeset file for PR #7565 created/updated --- changelogs/fragments/7565.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/7565.yml diff --git a/changelogs/fragments/7565.yml b/changelogs/fragments/7565.yml new file mode 100644 index 000000000000..4f3fbfdbe094 --- /dev/null +++ b/changelogs/fragments/7565.yml @@ -0,0 +1,2 @@ +fix: +- [Workspace]Add workspaces and permissions fields into saved objects _bulk_get response ([#7565](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7565)) \ No newline at end of file