Skip to content

Commit

Permalink
[Content Management] Remove dep from content_management -> saved_obje…
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant authored Apr 17, 2023
1 parent eb6bfd8 commit 4edb583
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ test/plugin_functional/plugins/saved_objects_hidden_from_http_apis_type @elastic
test/plugin_functional/plugins/saved_objects_hidden_type @elastic/kibana-core
src/plugins/saved_objects_management @elastic/kibana-core
src/plugins/saved_objects @elastic/kibana-core
packages/kbn-saved-objects-settings @elastic/appex-sharedux
src/plugins/saved_objects_tagging_oss @elastic/appex-sharedux
x-pack/plugins/saved_objects_tagging @elastic/appex-sharedux
src/plugins/saved_search @elastic/kibana-data-discovery
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@
"@kbn/saved-objects-hidden-type-plugin": "link:test/plugin_functional/plugins/saved_objects_hidden_type",
"@kbn/saved-objects-management-plugin": "link:src/plugins/saved_objects_management",
"@kbn/saved-objects-plugin": "link:src/plugins/saved_objects",
"@kbn/saved-objects-settings": "link:packages/kbn-saved-objects-settings",
"@kbn/saved-objects-tagging-oss-plugin": "link:src/plugins/saved_objects_tagging_oss",
"@kbn/saved-objects-tagging-plugin": "link:x-pack/plugins/saved_objects_tagging",
"@kbn/saved-search-plugin": "link:src/plugins/saved_search",
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-saved-objects-settings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @kbn/saved-objects-settings

Contains constants for some of saved objects related ui settings that had to be re-used between plugins without causing circular dependencies.
10 changes: 10 additions & 0 deletions packages/kbn-saved-objects-settings/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export const PER_PAGE_SETTING = 'savedObjects:perPage';
export const LISTING_LIMIT_SETTING = 'savedObjects:listingLimit';
13 changes: 13 additions & 0 deletions packages/kbn-saved-objects-settings/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

module.exports = {
preset: '@kbn/test/jest_node',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-saved-objects-settings'],
};
5 changes: 5 additions & 0 deletions packages/kbn-saved-objects-settings/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/saved-objects-settings",
"owner": "@elastic/appex-sharedux"
}
6 changes: 6 additions & 0 deletions packages/kbn-saved-objects-settings/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@kbn/saved-objects-settings",
"private": true,
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0"
}
17 changes: 17 additions & 0 deletions packages/kbn-saved-objects-settings/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
"jest",
"node"
]
},
"include": [
"**/*.ts",
],
"exclude": [
"target/**/*"
],
"kbn_references": []
}
2 changes: 1 addition & 1 deletion src/plugins/content_management/server/rpc/routes/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { schema } from '@kbn/config-schema';
import type { IRouter } from '@kbn/core/server';

import { LISTING_LIMIT_SETTING, PER_PAGE_SETTING } from '@kbn/saved-objects-finder-plugin/common';
import { LISTING_LIMIT_SETTING, PER_PAGE_SETTING } from '@kbn/saved-objects-settings';
import { ProcedureName } from '../../../common';
import type { ContentRegistry } from '../../core';
import { MSearchService } from '../../core/msearch';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/content_management/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@kbn/object-versioning",
"@kbn/core-saved-objects-api-server-mocks",
"@kbn/core-saved-objects-api-server",
"@kbn/saved-objects-finder-plugin",
"@kbn/saved-objects-settings",
],
"exclude": [
"target/**/*",
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/saved_objects_finder/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
* Side Public License, v 1.
*/

export const PER_PAGE_SETTING = 'savedObjects:perPage';
export const LISTING_LIMIT_SETTING = 'savedObjects:listingLimit';
export { PER_PAGE_SETTING, LISTING_LIMIT_SETTING } from '@kbn/saved-objects-settings';
export type { SavedObjectCommon, FindQueryHTTP, FindResponseHTTP, FinderAttributes } from './types';
1 change: 1 addition & 0 deletions src/plugins/saved_objects_finder/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@kbn/config-schema",
"@kbn/core-ui-settings-browser",
"@kbn/core-http-browser",
"@kbn/saved-objects-settings",
],
"exclude": [
"target/**/*",
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,8 @@
"@kbn/saved-objects-management-plugin/*": ["src/plugins/saved_objects_management/*"],
"@kbn/saved-objects-plugin": ["src/plugins/saved_objects"],
"@kbn/saved-objects-plugin/*": ["src/plugins/saved_objects/*"],
"@kbn/saved-objects-settings": ["packages/kbn-saved-objects-settings"],
"@kbn/saved-objects-settings/*": ["packages/kbn-saved-objects-settings/*"],
"@kbn/saved-objects-tagging-oss-plugin": ["src/plugins/saved_objects_tagging_oss"],
"@kbn/saved-objects-tagging-oss-plugin/*": ["src/plugins/saved_objects_tagging_oss/*"],
"@kbn/saved-objects-tagging-plugin": ["x-pack/plugins/saved_objects_tagging"],
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4841,6 +4841,10 @@
version "0.0.0"
uid ""

"@kbn/saved-objects-settings@link:packages/kbn-saved-objects-settings":
version "0.0.0"
uid ""

"@kbn/saved-objects-tagging-oss-plugin@link:src/plugins/saved_objects_tagging_oss":
version "0.0.0"
uid ""
Expand Down

0 comments on commit 4edb583

Please sign in to comment.