[Validator | main]: oaipmh-analysis.component.html: When no rule name, replaced - with [No title available] & added link in rule name | oaipmh-analysis.component.html: Commented option "all" for recordsNum & increased limit to 100 | oaipmh-validator.component.ts: [Bug fix] Added @ViewChild('customRecordsNum') customRecordsNum and in method updateRecordsNum(), if there is this input, mark it as checked & initialize form with this.recordsNum.

This commit is contained in:
Konstantina Galouni 2023-11-13 21:13:43 +02:00
parent 34a525f690
commit df695da83f
6 changed files with 24 additions and 16 deletions

@ -1 +1 @@
Subproject commit 6d7f6eca720d18fe694f13e380c1ede1f46303a8 Subproject commit 51bd7efcbe10543c56145c71c7af970fb730e63e

View File

@ -16,7 +16,11 @@
<tr *ngFor="let ruleResult of rules"> <tr *ngFor="let ruleResult of rules">
<td> <td>
<div> <div>
<span>{{ruleResult.rule_name ? ruleResult.rule_name : '-'}}</span> <span *ngIf="!ruleResult.rule_name">[No title available]</span>
<span *ngIf="ruleResult.rule_name">
<a *ngIf="ruleResult.link" class="custom-external uk-link-text" [href]="ruleResult.link" target="_blank">{{ruleResult.rule_name}}</a>
<span *ngIf="!ruleResult.link">{{ruleResult.rule_name}}</span>
</span>
<span *ngIf="ruleResult.requirement_level"> <span *ngIf="ruleResult.requirement_level">
<span> (</span> <span> (</span>
<ng-container *ngIf="requirementLevelMapping.has(ruleResult.requirement_level)">{{requirementLevelMapping.get(ruleResult.requirement_level)}}</ng-container> <ng-container *ngIf="requirementLevelMapping.has(ruleResult.requirement_level)">{{requirementLevelMapping.get(ruleResult.requirement_level)}}</ng-container>

View File

@ -23,22 +23,22 @@
</div> </div>
<div class="uk-margin-large-bottom"> <div class="uk-margin-large-bottom">
<h6><span class="uk-text-secondary uk-margin-right">3.</span> Define the number of record to validate</h6> <h6><span class="uk-text-secondary uk-margin-right">3.</span> Define the number of records to validate</h6>
<div class="uk-disabled uk-text-muted uk-margin-xsmall-left uk-margin-medium-top uk-margin-small-bottom"> <!-- <div class="uk-disabled uk-text-muted uk-margin-xsmall-left uk-margin-medium-top uk-margin-small-bottom">-->
<input id="all" type="radio" name="recordsNum" value="-1" formControlName="recordsNum"> <!-- <input id="all" type="radio" name="recordsNum" value="-1" formControlName="recordsNum">-->
<label for="all" class="uk-margin-xsmall-left">All</label> <!-- <label for="all" class="uk-margin-xsmall-left">All</label>-->
</div> <!-- </div>-->
<div class="uk-flex uk-flex-middle uk-margin-xsmall-left"> <div class="uk-flex uk-flex-middle uk-margin-xsmall-left">
<input id="custom" type="radio" name="recordsNum" [value]="recordsNum" formControlName="recordsNum"> <!-- <input #customRecordsNum id="custom" type="radio" name="recordsNum" [value]="recordsNum" formControlName="recordsNum">-->
<label for="custom" class="uk-margin-xsmall-left"> <!-- <label for="custom" class="uk-margin-xsmall-left uk-margin-right">-->
Custom <!-- Custom-->
</label> <!-- </label>-->
<span class="uk-margin-left uk-flex-inline uk-flex-middle"> <span class="uk-flex-inline uk-flex-middle">
<icon class="clickable" name="remove_circle_outline" flex="true" ratio="0.9" type="outlined" <icon class="clickable" name="remove_circle_outline" flex="true" ratio="0.9" type="outlined"
[ngClass]="recordsNum <= 10 ? 'uk-disabled uk-text-muted' : ''" (click)="updateRecordsNum(false)"></icon> [ngClass]="recordsNum <= 10 ? 'uk-disabled uk-text-muted' : ''" (click)="updateRecordsNum(false)"></icon>
<span class="uk-margin-small-left uk-margin-small-right">{{recordsNum}}</span> <span class="uk-margin-small-left uk-margin-small-right">{{recordsNum}}</span>
<icon class="clickable" name="add_circle_outline" flex="true" ratio="0.9" type="outlined" <icon class="clickable" name="add_circle_outline" flex="true" ratio="0.9" type="outlined"
[ngClass]="recordsNum >= 20 ? 'uk-disabled uk-text-muted' : ''" (click)="updateRecordsNum(true)"></icon> [ngClass]="recordsNum >= 100 ? 'uk-disabled uk-text-muted' : ''" (click)="updateRecordsNum(true)"></icon>
</span> </span>
</div> </div>

View File

@ -25,6 +25,7 @@ export class OaipmhValidatorComponent implements OnInit {
{label: 'OpenAIRE Guidelines for Literature Repositories Profile v4 & OpenAIRE FAIR Guidelines for Literature Profile', value: 'OpenAIRE Guidelines for Literature Repositories Profile v4'}, {label: 'OpenAIRE Guidelines for Literature Repositories Profile v4 & OpenAIRE FAIR Guidelines for Literature Profile', value: 'OpenAIRE Guidelines for Literature Repositories Profile v4'},
{label: 'OpenAIRE FAIR Guidelines for Data Repositories Profile', value: 'OpenAIRE FAIR Guidelines for Data Repositories Profile'} {label: 'OpenAIRE FAIR Guidelines for Data Repositories Profile', value: 'OpenAIRE FAIR Guidelines for Data Repositories Profile'}
]; ];
@ViewChild('customRecordsNum') customRecordsNum;
public form: UntypedFormGroup; public form: UntypedFormGroup;
public sets: Option[] = [{label: 'All sets', value: 'all'}]; public sets: Option[] = [{label: 'All sets', value: 'all'}];
public recordsNum: number = 10; public recordsNum: number = 10;
@ -44,7 +45,7 @@ export class OaipmhValidatorComponent implements OnInit {
this.form = this.fb.group({ this.form = this.fb.group({
url: this.fb.control("", [Validators.required, StringUtils.urlValidator()]),//[Validators.required/*, Validators.email*/]), url: this.fb.control("", [Validators.required, StringUtils.urlValidator()]),//[Validators.required/*, Validators.email*/]),
guidelines: this.fb.control("", Validators.required), guidelines: this.fb.control("", Validators.required),
recordsNum: this.fb.control(null, Validators.required), recordsNum: this.fb.control(this.recordsNum, Validators.required),
set: this.fb.control('all', Validators.required) set: this.fb.control('all', Validators.required)
}); });
} }
@ -84,6 +85,9 @@ export class OaipmhValidatorComponent implements OnInit {
updateRecordsNum(increase: boolean = true) { updateRecordsNum(increase: boolean = true) {
this.recordsNum = this.recordsNum + (increase ? 10 : -10); this.recordsNum = this.recordsNum + (increase ? 10 : -10);
this.form.get('recordsNum').setValue(this.recordsNum); this.form.get('recordsNum').setValue(this.recordsNum);
if(this.customRecordsNum) {
this.customRecordsNum.nativeElement.checked = true;
}
} }
getSets() { getSets() {

@ -1 +1 @@
Subproject commit 9e58421a1adf3fbeb361e21616feaea8c7f867af Subproject commit 6bb1e61b059bef1bff3bfb0611b0df46f7840426

@ -1 +1 @@
Subproject commit 3a4aa92c441467994a45a2c6a4f0c21202945404 Subproject commit 5e8c1addb1ebfa508aac8cb9540a755940c95b79