Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UnifiedFieldList] Move routes to internal #157893

Merged
merged 1 commit into from
May 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/plugins/unified_field_list/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ const hasData = hasFieldData(currentDataViewId, fieldName) // returns a boolean

## Server APIs

* `/api/unified_field_list/field_stats` - returns the loaded field stats (except for Ad-hoc data views)
* `/internal/unified_field_list/field_stats` - returns the loaded field stats (except for Ad-hoc data views)

* `/api/unified_field_list/existing_fields/{dataViewId}` - returns the loaded existing fields (except for Ad-hoc data views)
* `/internal/unified_field_list/existing_fields/{dataViewId}` - returns the loaded existing fields (except for Ad-hoc data views)

## Development

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/unified_field_list/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
* Side Public License, v 1.
*/

export const BASE_API_PATH = '/api/unified_field_list';
export const BASE_API_PATH = '/internal/unified_field_list';
export const FIELD_STATS_API_PATH = `${BASE_API_PATH}/field_stats`;
export const FIELD_EXISTING_API_PATH = `${BASE_API_PATH}/existing_fields/{dataViewId}`;
3 changes: 3 additions & 0 deletions src/plugins/unified_field_list/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import { PluginStart } from '../types';
import { existingFieldsRoute } from './existing_fields';
import { initFieldStatsRoute } from './field_stats';

// These routes are defined only for running integration tests under
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QQ: Do we even need this routes, if the only clients are integration tests but they are not used in the UI?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kertal Once we find a replacement for those tests, we can remove routes.

// test/api_integration/apis/unified_field_list
// UnifiedFieldList does not call these API - it uses only the client code.
export function defineRoutes(setup: CoreSetup<PluginStart>, logger: Logger) {
initFieldStatsRoute(setup);
existingFieldsRoute(setup, logger);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer');
const dataViewId = 'existence_index';
const API_PATH = `/api/unified_field_list/existing_fields/${dataViewId}`;
const API_PATH = `/internal/unified_field_list/existing_fields/${dataViewId}`;

describe('existing_fields apis', () => {
before(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default ({ getService }: FtrProviderContext) => {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const supertest = getService('supertest');
const API_PATH = '/api/unified_field_list/field_stats';
const API_PATH = '/internal/unified_field_list/field_stats';

describe('field stats apis', () => {
before(async () => {
Expand Down