Skip to content

Commit fa509f1

Browse files
authored
Migrate sample-data-telemetry registration to Kibana platform (#63965) (#64206)
1 parent 8b35813 commit fa509f1

File tree

5 files changed

+57
-13
lines changed

5 files changed

+57
-13
lines changed

src/legacy/core_plugins/kibana/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,6 @@ export default function(kibana) {
147147
},
148148

149149
savedObjectSchemas: {
150-
'sample-data-telemetry': {
151-
isNamespaceAgnostic: true,
152-
},
153150
'kql-telemetry': {
154151
isNamespaceAgnostic: true,
155152
},

src/legacy/core_plugins/kibana/mappings.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,5 @@
9191
"type": "long"
9292
}
9393
}
94-
},
95-
"sample-data-telemetry": {
96-
"properties": {
97-
"installCount": {
98-
"type": "long"
99-
},
100-
"unInstallCount": {
101-
"type": "long"
102-
}
103-
}
10494
}
10595
}

src/plugins/home/server/plugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
SampleDataRegistryStart,
2727
} from './services';
2828
import { UsageCollectionSetup } from '../../usage_collection/server';
29+
import { sampleDataTelemetry } from './saved_objects';
2930

3031
interface HomeServerPluginSetupDependencies {
3132
usage_collection?: UsageCollectionSetup;
@@ -37,6 +38,7 @@ export class HomeServerPlugin implements Plugin<HomeServerPluginSetup, HomeServe
3738
private readonly sampleDataRegistry = new SampleDataRegistry(this.initContext);
3839

3940
public setup(core: CoreSetup, plugins: HomeServerPluginSetupDependencies): HomeServerPluginSetup {
41+
core.savedObjects.registerType(sampleDataTelemetry);
4042
return {
4143
tutorials: { ...this.tutorialsRegistry.setup(core) },
4244
sampleData: { ...this.sampleDataRegistry.setup(core, plugins.usage_collection) },
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
export { sampleDataTelemetry } from './sample_data_telemetry';
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
import { SavedObjectsType } from 'kibana/server';
20+
21+
export const sampleDataTelemetry: SavedObjectsType = {
22+
name: 'sample-data-telemetry',
23+
namespaceType: 'agnostic',
24+
hidden: false,
25+
mappings: {
26+
properties: {
27+
installCount: {
28+
type: 'long',
29+
},
30+
unInstallCount: {
31+
type: 'long',
32+
},
33+
},
34+
},
35+
};

0 commit comments

Comments
 (0)