Skip to content

Commit

Permalink
Restore text_object model and mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Dec 13, 2019
1 parent 02e53f0 commit 20316f0
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/legacy/core_plugins/console/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import { resolve, join } from 'path';
import url from 'url';
import { has, isEmpty, head, pick } from 'lodash';

// @ts-ignore
import mappings from './mappings.json';

// @ts-ignore
import { addProcessorDefinition } from './server/api_server/es_6_0/ingest';
// @ts-ignore
Expand Down Expand Up @@ -182,6 +185,7 @@ export default function(kibana: any) {
styleSheetPaths: resolve(npSrc, 'application/styles/index.scss'),
injectDefaultVars: () => defaultVars,
noParse: [join(npSrc, 'application/models/legacy_core_editor/mode/worker/worker.js')],
mappings,
},
} as any);
}
18 changes: 18 additions & 0 deletions src/legacy/core_plugins/console/mappings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"text-object": {
"properties": {
"createdAt": {
"type": "long"
},
"updateAt": {
"type": "long"
},
"text": {
"type": "keyword"
},
"userId": {
"type": "keyword"
}
}
}
}
2 changes: 0 additions & 2 deletions src/legacy/core_plugins/console/public/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export interface XPluginSet {
dev_tools: DevToolsSetup;
home: HomePublicPluginSetup;
__LEGACY: {
savedObjects: SavedObjectsClientContract;
I18nContext: any;
elasticsearchUrl: string;
category: FeatureCatalogueCategory;
Expand All @@ -45,7 +44,6 @@ const pluginInstance = plugin({} as any);
await pluginInstance.setup(npSetup.core, {
...npSetup.plugins,
__LEGACY: {
savedObjects: npStart.core.savedObjects.client,
elasticsearchUrl: chrome.getInjected('elasticsearchUrl'),
category: FeatureCatalogueCategory.ADMIN,
I18nContext,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* 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.
*/
import { SavedObjectAttributes } from 'src/core/public';
export const type = 'text-object';

export interface TextObject extends SavedObjectAttributes {
createdAt: number;
updateAt: number;
text: string;
userId: string;
id: string;
}
8 changes: 4 additions & 4 deletions src/legacy/core_plugins/console/public/np_ready/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class ConsoleUIPlugin implements Plugin<any, any> {

async setup({ notifications }: CoreSetup, pluginSet: XPluginSet) {
const {
__LEGACY: { I18nContext, savedObjects, elasticsearchUrl, category },
__LEGACY: { I18nContext, elasticsearchUrl, category },
dev_tools,
home,
} = pluginSet;
Expand All @@ -55,15 +55,15 @@ export class ConsoleUIPlugin implements Plugin<any, any> {
defaultMessage: 'Console',
}),
enableRouting: false,
async mount(ctx, { element }) {
async mount({ core: { docLinks, savedObjects } }, { element }) {
const { boot } = await import('./application');
render(
boot({
docLinkVersion: ctx.core.docLinks.DOC_LINK_VERSION,
docLinkVersion: docLinks.DOC_LINK_VERSION,
I18nContext,
notifications,
elasticsearchUrl,
savedObjects,
savedObjects: savedObjects.client,
}),
element
);
Expand Down

0 comments on commit 20316f0

Please sign in to comment.