Skip to content

Commit 896d611

Browse files
committed
[Data plugin] cleanup - remove unused getRoutes / routes from indexPattern object
1 parent 8373247 commit 896d611

9 files changed

Lines changed: 21 additions & 68 deletions

File tree

docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export declare class IndexPattern implements IIndexPattern
2828
| [formatHit](./kibana-plugin-plugins-data-public.indexpattern.formathit.md) | | <code>any</code> | |
2929
| [id](./kibana-plugin-plugins-data-public.indexpattern.id.md) | | <code>string</code> | |
3030
| [metaFields](./kibana-plugin-plugins-data-public.indexpattern.metafields.md) | | <code>string[]</code> | |
31-
| [routes](./kibana-plugin-plugins-data-public.indexpattern.routes.md) | | <code>{</code><br/><code> edit: string;</code><br/><code> addField: string;</code><br/><code> indexedFields: string;</code><br/><code> scriptedFields: string;</code><br/><code> sourceFilters: string;</code><br/><code> }</code> | |
3231
| [timeFieldName](./kibana-plugin-plugins-data-public.indexpattern.timefieldname.md) | | <code>string &#124; undefined</code> | |
3332
| [title](./kibana-plugin-plugins-data-public.indexpattern.title.md) | | <code>string</code> | |
3433
| [type](./kibana-plugin-plugins-data-public.indexpattern.type.md) | | <code>string</code> | |

docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.routes.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatterns.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ indexPatterns: {
1818
validate: typeof validateIndexPattern;
1919
getFromSavedObject: typeof getFromSavedObject;
2020
flattenHitWrapper: typeof flattenHitWrapper;
21-
getRoutes: typeof getRoutes;
2221
formatHitProvider: typeof formatHitProvider;
2322
}
2423
```

src/plugins/data/public/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ import {
230230
validateIndexPattern,
231231
getFromSavedObject,
232232
flattenHitWrapper,
233-
getRoutes,
234233
formatHitProvider,
235234
} from './index_patterns';
236235

@@ -247,7 +246,6 @@ export const indexPatterns = {
247246
getFromSavedObject,
248247
flattenHitWrapper,
249248
// TODO: exported only in stub_index_pattern test. Move into data plugin and remove export.
250-
getRoutes,
251249
formatHitProvider,
252250
};
253251

src/plugins/data/public/index_patterns/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export {
2626
getFromSavedObject,
2727
isDefault,
2828
} from './lib';
29-
export { getRoutes } from './utils';
3029
export { flattenHitWrapper, formatHitProvider } from './index_patterns';
3130

3231
export { getIndexPatternFieldListCreator, Field, IIndexPatternFieldList } from './fields';

src/plugins/data/public/index_patterns/index_patterns/index_pattern.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030

3131
import { ES_FIELD_TYPES, KBN_FIELD_TYPES, IIndexPattern, IFieldType } from '../../../common';
3232

33-
import { findByTitle, getRoutes } from '../utils';
33+
import { findByTitle } from '../utils';
3434
import { IndexPatternMissingIndices } from '../lib';
3535
import { Field, IIndexPatternFieldList, getIndexPatternFieldListCreator } from '../fields';
3636
import { createFieldsFetcher } from './_fields_fetcher';
@@ -190,10 +190,6 @@ export class IndexPattern implements IIndexPattern {
190190
return this.indexFields(forceFieldRefresh);
191191
}
192192

193-
public get routes() {
194-
return getRoutes();
195-
}
196-
197193
getComputedFields() {
198194
const scriptFields: any = {};
199195
if (!this.fields) {

src/plugins/data/public/index_patterns/utils.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,3 @@ export async function findByTitle(
4848
(obj: SimpleSavedObject<any>) => obj.get('title').toLowerCase() === title.toLowerCase()
4949
);
5050
}
51-
52-
export function getRoutes() {
53-
return {
54-
edit: '/management/kibana/index_patterns/{{id}}',
55-
addField: '/management/kibana/index_patterns/{{id}}/create-field',
56-
indexedFields: '/management/kibana/index_patterns/{{id}}?_a=(tab:indexedFields)',
57-
scriptedFields: '/management/kibana/index_patterns/{{id}}?_a=(tab:scriptedFields)',
58-
sourceFilters: '/management/kibana/index_patterns/{{id}}?_a=(tab:sourceFilters)',
59-
};
60-
}

src/plugins/data/public/public.api.md

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -912,14 +912,6 @@ export class IndexPattern implements IIndexPattern {
912912
// (undocumented)
913913
removeScriptedField(field: IFieldType): Promise<void | Error>;
914914
// (undocumented)
915-
get routes(): {
916-
edit: string;
917-
addField: string;
918-
indexedFields: string;
919-
scriptedFields: string;
920-
sourceFilters: string;
921-
};
922-
// (undocumented)
923915
save(saveAttempts?: number): Promise<void | Error>;
924916
// (undocumented)
925917
timeFieldName: string | undefined;
@@ -1021,7 +1013,6 @@ export const indexPatterns: {
10211013
validate: typeof validateIndexPattern;
10221014
getFromSavedObject: typeof getFromSavedObject;
10231015
flattenHitWrapper: typeof flattenHitWrapper;
1024-
getRoutes: typeof getRoutes;
10251016
formatHitProvider: typeof formatHitProvider;
10261017
};
10271018

@@ -1812,27 +1803,26 @@ export type TSearchStrategyProvider<T extends TStrategyTypes> = (context: ISearc
18121803
// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "UrlFormat" needs to be exported by the entry point index.d.ts
18131804
// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "StringFormat" needs to be exported by the entry point index.d.ts
18141805
// src/plugins/data/public/index.ts:179:26 - (ae-forgotten-export) The symbol "TruncateFormat" needs to be exported by the entry point index.d.ts
1815-
// src/plugins/data/public/index.ts:238:27 - (ae-forgotten-export) The symbol "isFilterable" needs to be exported by the entry point index.d.ts
1816-
// src/plugins/data/public/index.ts:238:27 - (ae-forgotten-export) The symbol "isNestedField" needs to be exported by the entry point index.d.ts
1817-
// src/plugins/data/public/index.ts:238:27 - (ae-forgotten-export) The symbol "validateIndexPattern" needs to be exported by the entry point index.d.ts
1818-
// src/plugins/data/public/index.ts:238:27 - (ae-forgotten-export) The symbol "getFromSavedObject" needs to be exported by the entry point index.d.ts
1819-
// src/plugins/data/public/index.ts:238:27 - (ae-forgotten-export) The symbol "flattenHitWrapper" needs to be exported by the entry point index.d.ts
1820-
// src/plugins/data/public/index.ts:238:27 - (ae-forgotten-export) The symbol "getRoutes" needs to be exported by the entry point index.d.ts
1821-
// src/plugins/data/public/index.ts:238:27 - (ae-forgotten-export) The symbol "formatHitProvider" needs to be exported by the entry point index.d.ts
1822-
// src/plugins/data/public/index.ts:377:20 - (ae-forgotten-export) The symbol "getRequestInspectorStats" needs to be exported by the entry point index.d.ts
1823-
// src/plugins/data/public/index.ts:377:20 - (ae-forgotten-export) The symbol "getResponseInspectorStats" needs to be exported by the entry point index.d.ts
1824-
// src/plugins/data/public/index.ts:377:20 - (ae-forgotten-export) The symbol "tabifyAggResponse" needs to be exported by the entry point index.d.ts
1825-
// src/plugins/data/public/index.ts:377:20 - (ae-forgotten-export) The symbol "tabifyGetColumns" needs to be exported by the entry point index.d.ts
1826-
// src/plugins/data/public/index.ts:379:1 - (ae-forgotten-export) The symbol "CidrMask" needs to be exported by the entry point index.d.ts
1827-
// src/plugins/data/public/index.ts:380:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts
1828-
// src/plugins/data/public/index.ts:389:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts
1829-
// src/plugins/data/public/index.ts:390:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts
1830-
// src/plugins/data/public/index.ts:391:1 - (ae-forgotten-export) The symbol "isDateHistogramBucketAggConfig" needs to be exported by the entry point index.d.ts
1831-
// src/plugins/data/public/index.ts:395:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts
1832-
// src/plugins/data/public/index.ts:396:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts
1833-
// src/plugins/data/public/index.ts:399:1 - (ae-forgotten-export) The symbol "parseInterval" needs to be exported by the entry point index.d.ts
1834-
// src/plugins/data/public/index.ts:400:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts
1835-
// src/plugins/data/public/index.ts:403:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts
1806+
// src/plugins/data/public/index.ts:237:27 - (ae-forgotten-export) The symbol "isFilterable" needs to be exported by the entry point index.d.ts
1807+
// src/plugins/data/public/index.ts:237:27 - (ae-forgotten-export) The symbol "isNestedField" needs to be exported by the entry point index.d.ts
1808+
// src/plugins/data/public/index.ts:237:27 - (ae-forgotten-export) The symbol "validateIndexPattern" needs to be exported by the entry point index.d.ts
1809+
// src/plugins/data/public/index.ts:237:27 - (ae-forgotten-export) The symbol "getFromSavedObject" needs to be exported by the entry point index.d.ts
1810+
// src/plugins/data/public/index.ts:237:27 - (ae-forgotten-export) The symbol "flattenHitWrapper" needs to be exported by the entry point index.d.ts
1811+
// src/plugins/data/public/index.ts:237:27 - (ae-forgotten-export) The symbol "formatHitProvider" needs to be exported by the entry point index.d.ts
1812+
// src/plugins/data/public/index.ts:375:20 - (ae-forgotten-export) The symbol "getRequestInspectorStats" needs to be exported by the entry point index.d.ts
1813+
// src/plugins/data/public/index.ts:375:20 - (ae-forgotten-export) The symbol "getResponseInspectorStats" needs to be exported by the entry point index.d.ts
1814+
// src/plugins/data/public/index.ts:375:20 - (ae-forgotten-export) The symbol "tabifyAggResponse" needs to be exported by the entry point index.d.ts
1815+
// src/plugins/data/public/index.ts:375:20 - (ae-forgotten-export) The symbol "tabifyGetColumns" needs to be exported by the entry point index.d.ts
1816+
// src/plugins/data/public/index.ts:377:1 - (ae-forgotten-export) The symbol "CidrMask" needs to be exported by the entry point index.d.ts
1817+
// src/plugins/data/public/index.ts:378:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts
1818+
// src/plugins/data/public/index.ts:387:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts
1819+
// src/plugins/data/public/index.ts:388:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts
1820+
// src/plugins/data/public/index.ts:389:1 - (ae-forgotten-export) The symbol "isDateHistogramBucketAggConfig" needs to be exported by the entry point index.d.ts
1821+
// src/plugins/data/public/index.ts:393:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts
1822+
// src/plugins/data/public/index.ts:394:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts
1823+
// src/plugins/data/public/index.ts:397:1 - (ae-forgotten-export) The symbol "parseInterval" needs to be exported by the entry point index.d.ts
1824+
// src/plugins/data/public/index.ts:398:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts
1825+
// src/plugins/data/public/index.ts:401:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts
18361826
// src/plugins/data/public/query/state_sync/connect_to_query_state.ts:33:33 - (ae-forgotten-export) The symbol "FilterStateStore" needs to be exported by the entry point index.d.ts
18371827
// src/plugins/data/public/query/state_sync/connect_to_query_state.ts:37:1 - (ae-forgotten-export) The symbol "QueryStateChange" needs to be exported by the entry point index.d.ts
18381828
// src/plugins/data/public/types.ts:52:5 - (ae-forgotten-export) The symbol "createFiltersFromValueClickAction" needs to be exported by the entry point index.d.ts

src/test_utils/public/stub_index_pattern.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export default function StubIndexPattern(pattern, getConfig, timeField, fields,
6565
this.getSourceFiltering = sinon.stub();
6666
this.metaFields = ['_id', '_type', '_source'];
6767
this.fieldFormatMap = {};
68-
this.routes = indexPatterns.getRoutes();
6968

7069
this.getComputedFields = IndexPattern.prototype.getComputedFields.bind(this);
7170
this.flattenHit = indexPatterns.flattenHitWrapper(this, this.metaFields);

0 commit comments

Comments
 (0)