Skip to content

Commit

Permalink
changes based on review
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic committed Oct 11, 2021
1 parent 9349869 commit 9cc98e4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,9 @@ export const useNavigateToWizardWithClonedJob = () => {
let sourceIndexId;

try {
const ip = (await dataViews.find(sourceIndex)).find(({ title }) => title === sourceIndex);
if (ip !== undefined) {
sourceIndexId = ip.id;
const dv = (await dataViews.find(sourceIndex)).find(({ title }) => title === sourceIndex);
if (dv !== undefined) {
sourceIndexId = dv.id;
} else {
toasts.addDanger(
i18n.translate('xpack.ml.dataframe.analyticsList.noSourceIndexPatternForClone', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export const useDeleteAction = (canDeleteDataFrameAnalytics: boolean) => {

const checkIndexPatternExists = async () => {
try {
const ip = (await dataViews.find(indexName)).find(({ title }) => title === indexName);
if (ip !== undefined) {
const dv = (await dataViews.find(indexName)).find(({ title }) => title === indexName);
if (dv !== undefined) {
setIndexPatternExists(true);
} else {
setIndexPatternExists(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ export function loadIndexPatterns(maxNumber) {
dataViewsContract
.find('*', maxNumber)
.then((dataViews) => {
const indexPatterns = dataViews.sort((a, b) => a.title.localeCompare(b.title));
resolve(indexPatterns);
const sortedDataViews = dataViews.sort((a, b) => a.title.localeCompare(b.title));
resolve(sortedDataViews);
})
.catch((resp) => {
reject(resp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ describe('ML - field type utils', () => {
};
expect(kbnTypeToMLJobType(field)).toBe(ML_JOB_FIELD_TYPES.NUMBER);

// @ts-ignore reassigning ready-only type
// @ts-ignore reassigning read-only type
field.type = KBN_FIELD_TYPES.DATE;
expect(kbnTypeToMLJobType(field)).toBe(ML_JOB_FIELD_TYPES.DATE);

// @ts-ignore reassigning ready-only type
// @ts-ignore reassigning read-only type
field.type = KBN_FIELD_TYPES.IP;
expect(kbnTypeToMLJobType(field)).toBe(ML_JOB_FIELD_TYPES.IP);

// @ts-ignore reassigning ready-only type
// @ts-ignore reassigning read-only type
field.type = KBN_FIELD_TYPES.BOOLEAN;
expect(kbnTypeToMLJobType(field)).toBe(ML_JOB_FIELD_TYPES.BOOLEAN);

// @ts-ignore reassigning ready-only type
// @ts-ignore reassigning read-only type
field.type = KBN_FIELD_TYPES.GEO_POINT;
expect(kbnTypeToMLJobType(field)).toBe(ML_JOB_FIELD_TYPES.GEO_POINT);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export class IndexPatternHandler {
constructor(private dataViewService: DataViewsService) {}
// returns a id based on an index pattern name
async getIndexPatternId(indexName: string) {
const ip = (await this.dataViewService.find(indexName)).find(
const dv = (await this.dataViewService.find(indexName)).find(
({ title }) => title === indexName
);
return ip?.id;
return dv?.id;
}

async deleteIndexPatternById(indexId: string) {
Expand Down

0 comments on commit 9cc98e4

Please sign in to comment.