From 901354fa335dded9798d78ce62088d742c45e587 Mon Sep 17 00:00:00 2001 From: Deepak Grover Date: Fri, 9 Feb 2018 02:44:59 +0530 Subject: [PATCH] Fix #47 match_phrase and match_phrase_prefix query state resolving issues --- app/app.component.ts | 2 +- .../singlequery/queries/match_phase_prefix.query.ts | 3 ++- app/queryBlocks/singlequery/queries/match_phrase.query.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/app.component.ts b/app/app.component.ts index 2085c5d8b..6986ddbfc 100644 --- a/app/app.component.ts +++ b/app/app.component.ts @@ -131,7 +131,7 @@ export class AppComponent implements OnInit, OnChanges { } else { this.urlShare.decryptUrl().then((data) => { - var decryptedData = data. data; + var decryptedData = data.data; if(decryptedData && decryptedData.config) { cb(decryptedData.config); } else { diff --git a/app/queryBlocks/singlequery/queries/match_phase_prefix.query.ts b/app/queryBlocks/singlequery/queries/match_phase_prefix.query.ts index 4c852a112..0b2479c58 100644 --- a/app/queryBlocks/singlequery/queries/match_phase_prefix.query.ts +++ b/app/queryBlocks/singlequery/queries/match_phase_prefix.query.ts @@ -92,7 +92,8 @@ export class Match_phase_prefixQuery implements OnInit, OnChanges { this.options = JSON.parse(JSON.stringify(this.default_options)); try { if(this.appliedQuery['match_phrase_prefix'][this.fieldName]) { - if (this.appliedQuery[this.current_query][this.fieldName]) { + if (this.appliedQuery[this.current_query][this.fieldName] + && typeof this.appliedQuery[this.current_query][this.fieldName] === 'object') { this.inputs.input.value = this.appliedQuery[this.current_query][this.fieldName].query; for (let option in this.appliedQuery[this.current_query][this.fieldName]) { if (option != 'query') { diff --git a/app/queryBlocks/singlequery/queries/match_phrase.query.ts b/app/queryBlocks/singlequery/queries/match_phrase.query.ts index 2e5ae3ff7..7d02b83f7 100644 --- a/app/queryBlocks/singlequery/queries/match_phrase.query.ts +++ b/app/queryBlocks/singlequery/queries/match_phrase.query.ts @@ -88,7 +88,8 @@ export class Match_phraseQuery implements OnInit, OnChanges { this.options = JSON.parse(JSON.stringify(this.default_options)); try { if (this.appliedQuery[this.current_query][this.selectedField]) { - if (this.appliedQuery[this.current_query][this.fieldName]) { + if (this.appliedQuery[this.current_query][this.fieldName] + && typeof this.appliedQuery[this.current_query][this.fieldName] === 'object') { this.inputs.input.value = this.appliedQuery[this.current_query][this.fieldName].query; for (let option in this.appliedQuery[this.current_query][this.fieldName]) { if (option != 'query') {