Merge pull request 'Allow empty clause value when operator is NE or CONTAINS' (#83) from issue-82 into main
All checks were successful
Release / Build-production-and-ng-test (push) Successful in 4m18s
Release / Build-and-test-development (push) Successful in 7m46s
Release / release (push) Successful in 6m18s

Reviewed-on: #83
This commit is contained in:
allan 2024-02-26 14:03:36 +00:00
commit 9a0b9573d5
3 changed files with 21 additions and 10 deletions

View File

@ -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

View File

@ -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
}
}