Index Pattern class - remove toJSON and toString (#76246)
* remove toJSON * remove toJSON, toString * fix ml url * Update actions_panel.tsx * fix url Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
46aef4b1e0
commit
ee2ceef9bb
|
@ -61,7 +61,5 @@ export declare class IndexPattern implements IIndexPattern
|
||||||
| [refreshFields()](./kibana-plugin-plugins-data-public.indexpattern.refreshfields.md) | | |
|
| [refreshFields()](./kibana-plugin-plugins-data-public.indexpattern.refreshfields.md) | | |
|
||||||
| [removeScriptedField(fieldName)](./kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md) | | |
|
| [removeScriptedField(fieldName)](./kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md) | | |
|
||||||
| [save(saveAttempts)](./kibana-plugin-plugins-data-public.indexpattern.save.md) | | |
|
| [save(saveAttempts)](./kibana-plugin-plugins-data-public.indexpattern.save.md) | | |
|
||||||
| [toJSON()](./kibana-plugin-plugins-data-public.indexpattern.tojson.md) | | |
|
|
||||||
| [toSpec()](./kibana-plugin-plugins-data-public.indexpattern.tospec.md) | | |
|
| [toSpec()](./kibana-plugin-plugins-data-public.indexpattern.tospec.md) | | |
|
||||||
| [toString()](./kibana-plugin-plugins-data-public.indexpattern.tostring.md) | | |
|
|
||||||
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
||||||
|
|
||||||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [toJSON](./kibana-plugin-plugins-data-public.indexpattern.tojson.md)
|
|
||||||
|
|
||||||
## IndexPattern.toJSON() method
|
|
||||||
|
|
||||||
<b>Signature:</b>
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
toJSON(): string | undefined;
|
|
||||||
```
|
|
||||||
<b>Returns:</b>
|
|
||||||
|
|
||||||
`string | undefined`
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
||||||
|
|
||||||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) > [toString](./kibana-plugin-plugins-data-public.indexpattern.tostring.md)
|
|
||||||
|
|
||||||
## IndexPattern.toString() method
|
|
||||||
|
|
||||||
<b>Signature:</b>
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
toString(): string;
|
|
||||||
```
|
|
||||||
<b>Returns:</b>
|
|
||||||
|
|
||||||
`string`
|
|
||||||
|
|
|
@ -151,8 +151,6 @@ describe('IndexPattern', () => {
|
||||||
expect(indexPattern).toHaveProperty('getNonScriptedFields');
|
expect(indexPattern).toHaveProperty('getNonScriptedFields');
|
||||||
expect(indexPattern).toHaveProperty('addScriptedField');
|
expect(indexPattern).toHaveProperty('addScriptedField');
|
||||||
expect(indexPattern).toHaveProperty('removeScriptedField');
|
expect(indexPattern).toHaveProperty('removeScriptedField');
|
||||||
expect(indexPattern).toHaveProperty('toString');
|
|
||||||
expect(indexPattern).toHaveProperty('toJSON');
|
|
||||||
expect(indexPattern).toHaveProperty('save');
|
expect(indexPattern).toHaveProperty('save');
|
||||||
|
|
||||||
// properties
|
// properties
|
||||||
|
|
|
@ -650,12 +650,4 @@ export class IndexPattern implements IIndexPattern {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
toJSON() {
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
toString() {
|
|
||||||
return '' + this.toJSON();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1022,12 +1022,8 @@ export class IndexPattern implements IIndexPattern {
|
||||||
// (undocumented)
|
// (undocumented)
|
||||||
title: string;
|
title: string;
|
||||||
// (undocumented)
|
// (undocumented)
|
||||||
toJSON(): string | undefined;
|
|
||||||
// (undocumented)
|
|
||||||
toSpec(): IndexPatternSpec;
|
toSpec(): IndexPatternSpec;
|
||||||
// (undocumented)
|
// (undocumented)
|
||||||
toString(): string;
|
|
||||||
// (undocumented)
|
|
||||||
type: string | undefined;
|
type: string | undefined;
|
||||||
// (undocumented)
|
// (undocumented)
|
||||||
typeMeta?: IndexPatternTypeMeta;
|
typeMeta?: IndexPatternTypeMeta;
|
||||||
|
|
|
@ -13,6 +13,7 @@ import { EuiSpacer, EuiText, EuiTitle, EuiFlexGroup } from '@elastic/eui';
|
||||||
import { IndexPattern } from '../../../../../../../../../src/plugins/data/public';
|
import { IndexPattern } from '../../../../../../../../../src/plugins/data/public';
|
||||||
import { CreateJobLinkCard } from '../../../../components/create_job_link_card';
|
import { CreateJobLinkCard } from '../../../../components/create_job_link_card';
|
||||||
import { DataRecognizer } from '../../../../components/data_recognizer';
|
import { DataRecognizer } from '../../../../components/data_recognizer';
|
||||||
|
import { getBasePath } from '../../../../util/dependency_cache';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
indexPattern: IndexPattern;
|
indexPattern: IndexPattern;
|
||||||
|
@ -20,6 +21,7 @@ interface Props {
|
||||||
|
|
||||||
export const ActionsPanel: FC<Props> = ({ indexPattern }) => {
|
export const ActionsPanel: FC<Props> = ({ indexPattern }) => {
|
||||||
const [recognizerResultsCount, setRecognizerResultsCount] = useState(0);
|
const [recognizerResultsCount, setRecognizerResultsCount] = useState(0);
|
||||||
|
const basePath = getBasePath();
|
||||||
|
|
||||||
const recognizerResults = {
|
const recognizerResults = {
|
||||||
count: 0,
|
count: 0,
|
||||||
|
@ -31,7 +33,7 @@ export const ActionsPanel: FC<Props> = ({ indexPattern }) => {
|
||||||
function openAdvancedJobWizard() {
|
function openAdvancedJobWizard() {
|
||||||
// TODO - pass the search string to the advanced job page as well as the index pattern
|
// TODO - pass the search string to the advanced job page as well as the index pattern
|
||||||
// (add in with new advanced job wizard?)
|
// (add in with new advanced job wizard?)
|
||||||
window.open(`#/jobs/new_job/advanced?index=${indexPattern}`, '_self');
|
window.open(`${basePath.get()}/app/ml/jobs/new_job/advanced?index=${indexPattern.id}`, '_self');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note we use display:none for the DataRecognizer section as it needs to be
|
// Note we use display:none for the DataRecognizer section as it needs to be
|
||||||
|
@ -86,7 +88,7 @@ export const ActionsPanel: FC<Props> = ({ indexPattern }) => {
|
||||||
'Use the full range of options to create a job for more advanced use cases',
|
'Use the full range of options to create a job for more advanced use cases',
|
||||||
})}
|
})}
|
||||||
onClick={openAdvancedJobWizard}
|
onClick={openAdvancedJobWizard}
|
||||||
href={`#/jobs/new_job/advanced?index=${indexPattern}`}
|
href={`${basePath.get()}/app/ml/jobs/new_job/advanced?index=${indexPattern.id}`}
|
||||||
data-test-subj="mlDataVisualizerCreateAdvancedJobCard"
|
data-test-subj="mlDataVisualizerCreateAdvancedJobCard"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue