Merge pull request 'Allow empty clause value when operator is NE or CONTAINS' (#83) from issue-82 into main
Reviewed-on: #83
This commit is contained in:
commit
9a0b9573d5
|
@ -980,15 +980,18 @@ export class EditorComponent implements OnInit, AfterViewInit {
|
|||
|
||||
// Apply licence rows limitation if exists, it is only affecting data
|
||||
// which will be send to SAS
|
||||
const strippedCsvArrayData = csvArrayData.slice(0, this.licenceState.value.submit_rows_limit)
|
||||
const strippedCsvArrayData = csvArrayData.slice(
|
||||
0,
|
||||
this.licenceState.value.submit_rows_limit
|
||||
)
|
||||
// To submit to sas service, we need clean version of CSV of file
|
||||
// attached. XLSX will do the parsing and heavy lifting
|
||||
// First we create worksheet of json (data we extracted)
|
||||
let ws = XLSX.utils.json_to_sheet(strippedCsvArrayData, {
|
||||
skipHeader: true
|
||||
});
|
||||
})
|
||||
// create CSV to be uploaded from worksheet
|
||||
let csvContentClean = XLSX.utils.sheet_to_csv(ws);
|
||||
let csvContentClean = XLSX.utils.sheet_to_csv(ws)
|
||||
// Prepend headers
|
||||
csvContentClean = csvArrayHeaders.join(',') + '\n' + csvContentClean
|
||||
|
||||
|
|
|
@ -878,17 +878,25 @@ export class QueryComponent
|
|||
*/
|
||||
public hasInvalidCluase(clauses: any): boolean {
|
||||
for (let clause of clauses) {
|
||||
clause['invalidClause'] = false
|
||||
|
||||
if (
|
||||
clause.variable === null ||
|
||||
clause.operator === null ||
|
||||
clause.value === null ||
|
||||
clause.value === ''
|
||||
clause.value === '' &&
|
||||
!(clause.operator === 'NE' || clause.operator === 'CONTAINS')
|
||||
) {
|
||||
clause['invalidClause'] = true
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
if (
|
||||
clause.variable === null ||
|
||||
clause.operator === null ||
|
||||
clause.value === null
|
||||
) {
|
||||
clause['invalidClause'] = true
|
||||
|
||||
return true
|
||||
} else {
|
||||
clause['invalidClause'] = false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user