Commit 6668e08e authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Merge branch 'tests-integration' into 'develop'

Fix sonar CI error

See merge request !64
parents 2fb3ade1 3f8c4d1f
Pipeline #1599 failed with stages
in 14 minutes
......@@ -54,10 +54,10 @@ sonar_scanner:
- sonar-scanner \
-Dsonar.projectKey=anis-client \
-Dsonar.sources=src \
-Dsonar.projectVersion=$VERSION
-Dsonar.host.url=$SONARQUBE_URL
-Dsonar.login=$SONAR_TOKEN
-Dsonar.exclusions=**.spec.ts
-Dsonar.projectVersion=$VERSION \
-Dsonar.host.url=$SONARQUBE_URL \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.exclusions=**.spec.ts \
-Dsonar.typescript.lcov.reportPaths=./coverage/lcov.info
cache:
paths:
......
......@@ -2,15 +2,15 @@
<label class="col-3 col-form-label">{{label}}</label>
<div class="col">
<div *ngFor="let cb of checkboxes.controls; let i=index" class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="cb_{{_options[i].value}}" [formControl]="cb">
<label class="form-check-label" for="cb_{{_options[i].value}}">{{_options[i].label}}</label>
<input class="form-check-input" type="checkbox" id="cb_{{optionList[i].value}}" [formControl]="cb">
<label class="form-check-label" for="cb_{{optionList[i].value}}">{{optionList[i].label}}</label>
</div>
</div>
<div class="col-2 text-center">
<button class="btn btn-outline-success" *ngIf="!checkboxes.disabled" [hidden]="!isChecked()" (click)="addCriterion()">
<button class="btn btn-outline-success" *ngIf="!checkboxes.disabled" [hidden]="!isChecked()" (click)="emitAdd()">
<span class="fas fa-plus fa-fw"></span>
</button>
<button class="btn btn-outline-danger" *ngIf="checkboxes.disabled" (click)="deleteCriterion()">
<button class="btn btn-outline-danger" *ngIf="checkboxes.disabled" (click)="emiteDelete()">
<span class="fa fa-times fa-fw"></span>
</button>
</div>
......
......@@ -30,7 +30,7 @@ describe('[Search][Criteria][SearchType] Component: CheckboxComponent', () => {
{label: 'Three', value: 'three', display: 3}
];
component.setCheckboxes(options);
// console.log(component.checkboxes.get('0').value);
// console.log(component.checkboxes.controls[0].value);
expect(component.checkboxes.length).toEqual(3);
});
......
......@@ -14,7 +14,7 @@ export class CheckboxComponent {
@Input() label: string;
@Input()
set options(options: Option[]) {
this._options = options;
this.optionList = options;
this.setCheckboxes(options);
}
@Input()
......@@ -25,14 +25,14 @@ export class CheckboxComponent {
@Output() deleteCriterion: EventEmitter<number> = new EventEmitter();
checkboxes: FormArray;
checkboxesFormControls: {value: string, control: FormControl}[];
_options: Option[];
checkboxesFormControls: { value: string, control: FormControl }[];
optionList: Option[];
emitAdd() {
const values: Option[] = [];
this.checkboxes.controls.forEach((formControl, i) => {
if (formControl.value) {
values.push(this._options[i]);
values.push(this.optionList[i]);
}
});
const cb = new SelectMultipleCriterion(this.id, values);
......@@ -47,9 +47,10 @@ export class CheckboxComponent {
this.checkboxesFormControls = [];
this.checkboxes = new FormArray(options.map((option: Option) => {
const control = new FormControl(false);
this.checkboxesFormControls.push({value: option.value, control});
this.checkboxesFormControls.push({ value: option.value, control });
return control;
}));
// console.log(this.optionList);
}
getDefault(criterion: Criterion): void {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment