-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate App services plugins to TS projects (#87294)
* migrate expressions to ts project refs * bfetch to ts project * ui_actions to ts project * move fitures to data plugins * add data ts project * remove outdated ts-expect-error * add data to x-pack tsconfigs * navigation to ts project * cleanup licensing tsconfig * saved_objects to ts project * embeddable to ts project * ui_actions_enhanced to ts project * embeddable_enhanced to ts project * features to ts project * data_enhanced to ts project refs * fix i18n check * fix find_plugins_ready_to_migrate_to_ts_refs script * add a comment for bug ignoring json for composite projects Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
1d49166
commit 69e2c38
Showing
39 changed files
with
1,187 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"extends": "../../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"composite": true, | ||
"outDir": "./target/types", | ||
"emitDeclarationOnly": true, | ||
"declaration": true, | ||
"declarationMap": true | ||
}, | ||
"include": ["common/**/*", "public/**/*", "server/**/*", "index.ts"], | ||
"references": [ | ||
{ "path": "../../core/tsconfig.json" }, | ||
{ "path": "../kibana_utils/tsconfig.json" }, | ||
] | ||
} |
85 changes: 85 additions & 0 deletions
85
src/plugins/data/common/index_patterns/index_patterns/fixtures/logstash_fields.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths | ||
import { shouldReadFieldFromDocValues, castEsToKbnFieldTypeName } from '../../../../server'; | ||
|
||
function stubbedLogstashFields() { | ||
return [ | ||
// |aggregatable | ||
// | |searchable | ||
// name esType | | |metadata | subType | ||
['bytes', 'long', true, true, { count: 10 }], | ||
['ssl', 'boolean', true, true, { count: 20 }], | ||
['@timestamp', 'date', true, true, { count: 30 }], | ||
['time', 'date', true, true, { count: 30 }], | ||
['@tags', 'keyword', true, true], | ||
['utc_time', 'date', true, true], | ||
['phpmemory', 'integer', true, true], | ||
['ip', 'ip', true, true], | ||
['request_body', 'attachment', true, true], | ||
['point', 'geo_point', true, true], | ||
['area', 'geo_shape', true, true], | ||
['hashed', 'murmur3', false, true], | ||
['geo.coordinates', 'geo_point', true, true], | ||
['extension', 'text', true, true], | ||
['extension.keyword', 'keyword', true, true, {}, { multi: { parent: 'extension' } }], | ||
['machine.os', 'text', true, true], | ||
['machine.os.raw', 'keyword', true, true, {}, { multi: { parent: 'machine.os' } }], | ||
['geo.src', 'keyword', true, true], | ||
['_id', '_id', true, true], | ||
['_type', '_type', true, true], | ||
['_source', '_source', true, true], | ||
['non-filterable', 'text', true, false], | ||
['non-sortable', 'text', false, false], | ||
['custom_user_field', 'conflict', true, true], | ||
['script string', 'text', true, false, { script: "'i am a string'" }], | ||
['script number', 'long', true, false, { script: '1234' }], | ||
['script date', 'date', true, false, { script: '1234', lang: 'painless' }], | ||
['script murmur3', 'murmur3', true, false, { script: '1234' }], | ||
].map(function (row) { | ||
const [name, esType, aggregatable, searchable, metadata = {}, subType = undefined] = row; | ||
|
||
const { | ||
count = 0, | ||
script, | ||
lang = script ? 'expression' : undefined, | ||
scripted = !!script, | ||
} = metadata; | ||
|
||
// the conflict type is actually a kbnFieldType, we | ||
// don't have any other way to represent it here | ||
const type = esType === 'conflict' ? esType : castEsToKbnFieldTypeName(esType); | ||
|
||
return { | ||
name, | ||
type, | ||
esTypes: [esType], | ||
readFromDocValues: shouldReadFieldFromDocValues(aggregatable, esType), | ||
aggregatable, | ||
searchable, | ||
count, | ||
script, | ||
lang, | ||
scripted, | ||
subType, | ||
}; | ||
}); | ||
} | ||
|
||
export default stubbedLogstashFields; |
37 changes: 37 additions & 0 deletions
37
.../data/common/index_patterns/index_patterns/fixtures/stubbed_saved_object_index_pattern.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
// @ts-expect-error | ||
import stubbedLogstashFields from './logstash_fields'; | ||
|
||
const mockLogstashFields = stubbedLogstashFields(); | ||
|
||
export function stubbedSavedObjectIndexPattern(id: string | null = null) { | ||
return { | ||
id, | ||
type: 'index-pattern', | ||
attributes: { | ||
timeFieldName: 'timestamp', | ||
customFormats: {}, | ||
fields: mockLogstashFields, | ||
title: 'title', | ||
}, | ||
version: '2', | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.