Skip to content

Commit

Permalink
Index Pattern class - remove toJSON and toString (elastic#76246)
Browse files Browse the repository at this point in the history
* remove toJSON

* remove toJSON, toString

* fix ml url

* Update actions_panel.tsx

* fix url

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
mattkime and elasticmachine committed Sep 2, 2020
1 parent 8e88729 commit be59e9f
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,5 @@ export declare class IndexPattern implements IIndexPattern
| [refreshFields()](./kibana-plugin-plugins-data-public.indexpattern.refreshfields.md) | | |
| [removeScriptedField(fieldName)](./kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.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) | | |
| [toString()](./kibana-plugin-plugins-data-public.indexpattern.tostring.md) | | |

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ describe('IndexPattern', () => {
expect(indexPattern).toHaveProperty('getNonScriptedFields');
expect(indexPattern).toHaveProperty('addScriptedField');
expect(indexPattern).toHaveProperty('removeScriptedField');
expect(indexPattern).toHaveProperty('toString');
expect(indexPattern).toHaveProperty('toJSON');
expect(indexPattern).toHaveProperty('save');

// properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -664,12 +664,4 @@ export class IndexPattern implements IIndexPattern {
});
});
}

toJSON() {
return this.id;
}

toString() {
return '' + this.toJSON();
}
}
4 changes: 0 additions & 4 deletions src/plugins/data/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1059,12 +1059,8 @@ export class IndexPattern implements IIndexPattern {
// (undocumented)
title: string;
// (undocumented)
toJSON(): string | undefined;
// (undocumented)
toSpec(): IndexPatternSpec;
// (undocumented)
toString(): string;
// (undocumented)
type: string | undefined;
// (undocumented)
typeMeta?: IndexPatternTypeMeta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ import { EuiSpacer, EuiText, EuiTitle, EuiFlexGroup } from '@elastic/eui';
import { IndexPattern } from '../../../../../../../../../src/plugins/data/public';
import { CreateJobLinkCard } from '../../../../components/create_job_link_card';
import { DataRecognizer } from '../../../../components/data_recognizer';
import { getBasePath } from '../../../../util/dependency_cache';

interface Props {
indexPattern: IndexPattern;
}

export const ActionsPanel: FC<Props> = ({ indexPattern }) => {
const [recognizerResultsCount, setRecognizerResultsCount] = useState(0);
const basePath = getBasePath();

const recognizerResults = {
count: 0,
Expand All @@ -31,7 +33,7 @@ export const ActionsPanel: FC<Props> = ({ indexPattern }) => {
function openAdvancedJobWizard() {
// TODO - pass the search string to the advanced job page as well as the index pattern
// (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
Expand Down Expand Up @@ -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',
})}
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"
/>
</div>
Expand Down

0 comments on commit be59e9f

Please sign in to comment.