Fix uk-close in criteria and subjects. Criteria: Add a criterion should be added at start

This commit is contained in:
Konstantinos Triantafyllou 2022-07-13 10:49:59 +03:00
parent b1515cd395
commit b0a0268a4e
5 changed files with 11 additions and 11 deletions

@ -1 +1 @@
Subproject commit ea952197289da5113cfb67c4c911cb5fd1583909 Subproject commit 770c3fb3eff99ddab059f0de657f576443b01a7d

View File

@ -46,10 +46,10 @@
class="uk-margin-bottom uk-hidden@l"> class="uk-margin-bottom uk-hidden@l">
<div class="uk-flex-middle uk-grid-small uk-margin-medium-bottom" uk-grid> <div class="uk-flex-middle uk-grid-small uk-margin-medium-bottom" uk-grid>
<div class="uk-flex uk-flex-right uk-width-1-1"> <div class="uk-flex uk-flex-right uk-width-1-1">
<a class="uk-close" (click)="removeConstraint(getIndex(i), j)"> <button class="uk-close uk-icon" (click)="removeConstraint(getIndex(i), j)">
<icon name="close" ratio="1.5" [flex]="true" <icon name="close" ratio="1.5" [flex]="true"
[attr.uk-tooltip]="(getConstraint(getIndex(i)).length === 1?'By removing this constraint, the filter will be removed too':null)"></icon> [attr.uk-tooltip]="(getConstraint(getIndex(i)).length === 1?'By removing this constraint, the filter will be removed too':null)"></icon>
</a> </button>
</div> </div>
<div class="uk-width-1-1" input type="select" inputClass="border-bottom" [placeholder]="{static: true, label: 'Choose a field'}" <div class="uk-width-1-1" input type="select" inputClass="border-bottom" [placeholder]="{static: true, label: 'Choose a field'}"
[options]="fields" [formInput]="constraint.get('field')"> [options]="fields" [formInput]="constraint.get('field')">
@ -92,10 +92,10 @@
(change)="caseSensitive($event, constraint)"></mat-slide-toggle> (change)="caseSensitive($event, constraint)"></mat-slide-toggle>
</div> </div>
<div class="uk-flex uk-flex-center"> <div class="uk-flex uk-flex-center">
<a class="uk-close" (click)="removeConstraint(getIndex(i), j)"> <button class="uk-close uk-icon" (click)="removeConstraint(getIndex(i), j)">
<icon name="close" ratio="1.5" [flex]="true" <icon name="close" ratio="1.5" [flex]="true"
[attr.uk-tooltip]="(getConstraint(getIndex(i)).length === 1?'By removing this constraint, the filter will be removed too':null)"></icon> [attr.uk-tooltip]="(getConstraint(getIndex(i)).length === 1?'By removing this constraint, the filter will be removed too':null)"></icon>
</a> </button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -101,7 +101,7 @@ export class CriteriaComponent implements OnInit {
verb_suffix: this.fb.control('_caseinsensitive') verb_suffix: this.fb.control('_caseinsensitive')
}) })
]); ]);
this.criteria.push(this.fb.group({ this.criteria.insert(0, this.fb.group({
constraint: constraintArray constraint: constraintArray
})); }));
this.page = Math.ceil(this.criteria.length/this.pageSize); this.page = Math.ceil(this.criteria.length/this.pageSize);

View File

@ -95,8 +95,8 @@
<form *ngIf="myForm"> <form *ngIf="myForm">
<div class="uk-margin-top uk-flex-center uk-flex uk-margin-medium-bottom"> <div class="uk-margin-top uk-flex-center uk-flex uk-margin-medium-bottom">
<a *ngIf="!isEditModal" (click)="addSubjectInForm()"> <a *ngIf="!isEditModal" (click)="addSubjectInForm()">
<button class="uk-button uk-button-primary"> <button class="uk-button uk-button-primary uk-flex uk-flex-middle">
<icon name="add"></icon> <icon name="add" [flex]="true"></icon>
<span class="uk-margin-xsmall-left">Add Subject</span> <span class="uk-margin-xsmall-left">Add Subject</span>
</button> </button>
</a> </a>
@ -106,10 +106,10 @@
<div input [formInput]="myForm.controls[i]" type="text" <div input [formInput]="myForm.controls[i]" type="text"
placeholder="Type subjects as free text keywords" class="uk-width-expand"></div> placeholder="Type subjects as free text keywords" class="uk-width-expand"></div>
<div *ngIf="!isEditModal" class="uk-width-auto uk-flex uk-flex-center uk-margin-left"> <div *ngIf="!isEditModal" class="uk-width-auto uk-flex uk-flex-center uk-margin-left">
<a class="uk-close" [class.uk-invisible]="myForm.length === 1" <button class="uk-close uk-icon" [class.uk-invisible]="myForm.length === 1"
(click)="removeSubjectInForm(i)"> (click)="removeSubjectInForm(i)">
<icon name="close" [flex]="true" [ratio]="1.5"></icon> <icon name="close" [flex]="true" [ratio]="1.5"></icon>
</a> </button>
</div> </div>
</div> </div>
</div> </div>

@ -1 +1 @@
Subproject commit c80b7371801d42611c611707ca933c1c83c3c672 Subproject commit e4c7254752de49fc801a30bde3cf0120e42cf9da