Compare commits

...

9 Commits

Author SHA1 Message Date
semantic-release-bot 1c8e4604de chore(release): 6.5.0 [skip ci]
# [6.5.0](https://git.datacontroller.io/dc/dc/compare/v6.4.0...v6.5.0) (2024-01-26)

### Features

* filtering by reference to Variables as well as Values ([6eb1aa8](6eb1aa85d2))
2024-01-26 10:55:18 +00:00
allan e9624635ed Merge pull request 'feat: Filtering with variable as well as values' (#70) from issue-68 into main
Release / Build-production-and-ng-test (push) Successful in 4m42s Details
Release / Build-and-test-development (push) Successful in 8m27s Details
Release / release (push) Successful in 6m47s Details
Reviewed-on: #70
2024-01-26 10:40:29 +00:00
Sabir Hassan f9beda1ddb chore: lint fix
Build / Build-and-ng-test (pull_request) Successful in 1m4s Details
2024-01-26 09:22:50 +05:00
Sabir Hassan 53400de110 chore: quick fix
Build / Build-and-ng-test (pull_request) Failing after 17s Details
2024-01-25 18:24:01 +05:00
sabir cf37ddab22 Merge branch 'main' into issue-68
Build / Build-and-ng-test (pull_request) Failing after 17s Details
2024-01-25 11:34:20 +00:00
allan 802d8a3b08 Merge branch 'main' into issue-68
Build / Build-and-ng-test (pull_request) Failing after 17s Details
2024-01-24 13:47:24 +00:00
Sabir Hassan 1a96bb1233 chore: show variables in dropdown instead of values when variable is selected
Build / Build-and-ng-test (pull_request) Failing after 16s Details
2024-01-24 10:40:33 +05:00
Mihajlo Medjedovic 8f796aec36 chore(git): Merge branch 'main' into issue-68
Build / Build-and-ng-test (pull_request) Failing after 14s Details
2023-12-26 21:09:16 +01:00
Mihajlo Medjedovic 6eb1aa85d2 feat: filtering by reference to Variables as well as Values 2023-12-26 21:08:58 +01:00
12 changed files with 116 additions and 18 deletions

View File

@ -1,3 +1,10 @@
# [6.5.0](https://git.datacontroller.io/dc/dc/compare/v6.4.0...v6.5.0) (2024-01-26)
### Features
* filtering by reference to Variables as well as Values ([6eb1aa8](https://git.datacontroller.io/dc/dc/commit/6eb1aa85d29294d63e6af377e622fbed7fd1fab8))
# [6.4.0](https://git.datacontroller.io/dc/dc/compare/v6.3.1...v6.4.0) (2024-01-24)

View File

@ -656,11 +656,10 @@ export class LineageComponent {
this.flatdata = res.flatdata
if (this.libraryList) {
let libraryToSelect = this.libraryList.find(
(library: any) =>
res.info[0]?.LIBURI?.toUpperCase()?.includes(
library?.LIBRARYID?.toUpperCase()
)
let libraryToSelect = this.libraryList.find((library: any) =>
res.info[0]?.LIBURI?.toUpperCase()?.includes(
library?.LIBRARYID?.toUpperCase()
)
)
let tableToSelect: any

View File

@ -6,6 +6,7 @@ export interface FilterClause {
operators: string[]
type: string
value: any
valueVariable: boolean
values: { formatted: string; unformatted: any }[]
variable: string
}

View File

@ -413,7 +413,10 @@
>
<app-soft-select
label="Value"
[secondLabel]="'Variable'"
[emitOnlySelected]="query.valueVariable"
[inputId]="'vals_' + queryIndex + '_' + clauseIndex"
(selectedLabelChange)="selectedLabelChange($event, query)"
[(value)]="query.value"
[enableLoadMore]="query.nobs > query.values.length"
(onInputEvent)="
@ -423,9 +426,19 @@
onAutocompleteLoadingMore($event, query.variable, queryIndex, clauseIndex)
"
>
<option [value]="column.unformatted" *ngFor="let column of query.values">
{{ column.formatted.trim() }}
</option>
<div *ngIf="!query.valueVariable">
<option [value]="column.unformatted" *ngFor="let column of query.values">
{{ column.formatted.trim() }}
</option>
</div>
<div *ngIf="query.valueVariable">
<ng-container *ngFor="let column of cols">
<option [value]="column.NAME" *ngIf="column.TYPE === query.type">
{{ column.NAME }}
</option>
</ng-container>
</div>
</app-soft-select>
</ng-template>

View File

@ -95,6 +95,7 @@ export class QueryComponent
variable: null,
operator: null,
value: null,
valueVariable: false,
startrow: 0,
rows: 0,
nobs: 0,
@ -193,6 +194,20 @@ export class QueryComponent
*/
usePickersChange() {
this.queryDateTime = []
if (this.usePickers) {
this.clauses.queryObj.forEach((queryObj: any) => {
queryObj.elements.forEach((element: any) => {
const isDateOrTime = ['DATETIME', 'TIME', 'DATE'].includes(
element.ddtype
)
if (isDateOrTime && element.valueVariable) {
element.value = ''
element.valueVariable = false
}
})
})
}
}
/**
@ -253,8 +268,6 @@ export class QueryComponent
get(globals, objPath).filter.libds = this.libds
}
get(globals, objPath).filter.clauses = this.clauses
console.log('globals', globals)
}
/**
@ -750,6 +763,12 @@ export class QueryComponent
)
}
public selectedLabelChange(label: string, query: any) {
query.valueVariable = label === 'Variable'
query.value = ''
this.whereClauseFn()
}
public variableInputChange(
queryVariable: any,
index: number,

View File

@ -416,14 +416,18 @@ export class SasStoreService {
for (let index = 0; index < clauses.queryObj.length; index++) {
let string = ''
let clause = clauses.queryObj[index]
for (let ind = 0; ind < clause.elements.length; ind++) {
let query = clause.elements[ind]
if (ind < clause.elements.length - 1) {
opr = clause.clauseLogic
} else {
opr = ''
}
let val: any
for (let k = 0; k < query.values.length; k++) {
if (
typeof query.value === 'string' &&
@ -494,6 +498,8 @@ export class SasStoreService {
}
let type = query.type
//if the value is variable, omit quotes in the 'where' string
const isValueVariable = query.valueVariable
let variable = query.variable === null ? '' : query.variable
let oper = query.operator === null ? '' : query.operator
// let value = val === null ? "''" : val;
@ -507,10 +513,14 @@ export class SasStoreService {
if (type === 'char' && oper !== 'IN' && oper !== 'NOT IN') {
if (typeof value === 'undefined') {
value = ''
value = " '" + value + "' "
} else {
value = " '" + value + "' "
}
if (isValueVariable) {
value = ' ' + value + ' ' //without quotes, with spaces
} else {
value = " '" + value + "' " //with quotes and spaces
}
string = string + ' ' + variable + ' ' + oper + value + opr
} else {
if (type === 'num' && typeof value === 'undefined') {
@ -604,7 +614,7 @@ export class SasStoreService {
rawValue = '.'
}
} else {
if (filterClause.type === 'char') {
if (filterClause.type === 'char' && !filterClause.valueVariable) {
rawValue = `'${filterClause.value.replace(/'/g, "''")}'`
}
}

View File

@ -1,4 +1,22 @@
<label *ngIf="label" class="clr-control-label">{{ label }}</label>
<label
*ngIf="label"
[class.secondLabelActive]="secondLabel && secondLabel.length > 0"
class="clr-control-label"
>
<span
(click)="onChangeLabel('first')"
[class.value-type-selected]="labelSelected === 'first'"
>{{ label }}</span
>
<ng-container *ngIf="secondLabel">
/
<span
(click)="onChangeLabel('second')"
[class.value-type-selected]="labelSelected === 'second'"
>{{ secondLabel }}</span
>
</ng-container>
</label>
<ng-container [ngSwitch]="type">
<ng-container *ngSwitchCase="'date'">
<clr-date-container>

View File

@ -28,4 +28,12 @@ clr-date-container {
margin-top: -5px;
}
}
}
label.secondLabelActive span {
&:not(.value-type-selected) {
text-decoration: line-through;
cursor: pointer;
opacity: 0.6;
}
}

View File

@ -18,6 +18,7 @@ import { OnLoadingMoreEvent } from '../autocomplete/autocomplete.component'
export class SoftSelectComponent implements OnInit, OnChanges {
@Input() inputId: string = ''
@Input() label: string | undefined
@Input() secondLabel: string | undefined
@Input() value: Date | string | null = ''
@Input() disabled: boolean = false
@Input() type: string = 'text'
@ -30,20 +31,24 @@ export class SoftSelectComponent implements OnInit, OnChanges {
@Output() focusinInput: EventEmitter<any> = new EventEmitter()
@Output() onAutocompleteLoadingMore: EventEmitter<OnLoadingMoreEvent> =
new EventEmitter()
@Output() selectedLabelChange: EventEmitter<string> = new EventEmitter()
@ViewChild('input') inputElement: any
temp: Date | string | null = ''
inputFocused: boolean = false
labelSelected: LabelTypes = 'first'
constructor() {}
ngOnChanges(changes: SimpleChanges): void {
if (
changes.value &&
changes.value.currentValue !== changes.value.previousValue
)
) {
this.valueChange.emit(changes.value.currentValue)
}
}
ngOnInit(): void {}
@ -85,4 +90,14 @@ export class SoftSelectComponent implements OnInit, OnChanges {
onFocusinInput(event: any) {
this.focusinInput.emit(event)
}
onChangeLabel(label: LabelTypes) {
this.labelSelected = label
const selectedLabelText = label === 'first' ? this.label : this.secondLabel
this.selectedLabelChange.emit(selectedLabelText)
}
}
export type LabelTypes = 'first' | 'second'

View File

@ -145,6 +145,13 @@ export class XLMapComponent implements AfterContentInit, AfterViewInit, OnInit {
public xlmapOnClick(xlmap: XLMapListItem) {
if (xlmap.id !== this.selectedXLMap?.id) {
this.selectedXLMap = xlmap
this.xlData = []
this.filename = ''
this.uploader.queue = []
if (this.fileUploadInputCompList.first) {
this.fileUploadInputCompList.first.nativeElement.value = ''
}
this.selectedTab = Tabs.Rules
this.viewXLMapRules()
this.router.navigateByUrl('/home/files/' + xlmap.id)
}
@ -270,6 +277,7 @@ export class XLMapComponent implements AfterContentInit, AfterViewInit, OnInit {
this.isLoadingDesc = ''
this.status = Status.ReadyToUpload
this.xlData = []
this.selectedTab = Tabs.Rules
this.filename = ''
this.uploader.queue = []
if (this.fileUploadInputCompList.first) {

View File

@ -18,4 +18,4 @@ In any case, you must not make any such use of this software as to develop softw
UNLESS EXPRESSLY AGREED OTHERWISE, 4GL APPS PROVIDES THIS SOFTWARE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, AND IN NO EVENT AND UNDER NO LEGAL THEORY, SHALL 4GL APPS BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM USE OR INABILITY TO USE THIS SOFTWARE.
`
`

View File

@ -1,6 +1,6 @@
{
"name": "dcfrontend",
"version": "6.4.0",
"version": "6.5.0",
"description": "Data Controller",
"devDependencies": {
"@saithodev/semantic-release-gitea": "^2.1.0",