Fixes bug on public roles filters when logged out. (Issue #175)
This commit is contained in:
parent
72df634132
commit
f2833576d3
|
@ -45,7 +45,7 @@
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-10 gray-container">
|
<div *ngIf="isAuthenticated()" class="col-10 gray-container">
|
||||||
<h6 class="category-title">{{ 'FACET-SEARCH.ROLE.TITLE' | translate }}</h6>
|
<h6 class="category-title">{{ 'FACET-SEARCH.ROLE.TITLE' | translate }}</h6>
|
||||||
<mat-radio-group>
|
<mat-radio-group>
|
||||||
<mat-list-item><mat-radio-button value="null" checked (change)="roleChanged($event)">{{ 'FACET-SEARCH.ROLE.ANY' | translate }}</mat-radio-button></mat-list-item>
|
<mat-list-item><mat-radio-button value="null" checked (change)="roleChanged($event)">{{ 'FACET-SEARCH.ROLE.ANY' | translate }}</mat-radio-button></mat-list-item>
|
||||||
|
|
|
@ -28,6 +28,7 @@ import { DataTableData } from '../../../core/model/data-table/data-table-data';
|
||||||
import { DmpListingModel } from '../../../core/model/dmp/dmp-listing';
|
import { DmpListingModel } from '../../../core/model/dmp/dmp-listing';
|
||||||
import { ExploreDmpCriteriaModel } from '../../../core/query/explore-dmp/explore-dmp-criteria';
|
import { ExploreDmpCriteriaModel } from '../../../core/query/explore-dmp/explore-dmp-criteria';
|
||||||
import { DatasetProfileCriteria } from "../../../core/query/dataset-profile/dataset-profile-criteria";
|
import { DatasetProfileCriteria } from "../../../core/query/dataset-profile/dataset-profile-criteria";
|
||||||
|
import { AuthService } from '../../../core/services/auth/auth.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-explore-dataset-filters-component',
|
selector: 'app-explore-dataset-filters-component',
|
||||||
|
@ -105,6 +106,7 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public activatedRoute: ActivatedRoute,
|
public activatedRoute: ActivatedRoute,
|
||||||
|
private authentication: AuthService,
|
||||||
public grantService: GrantService,
|
public grantService: GrantService,
|
||||||
public dmpService: DmpService,
|
public dmpService: DmpService,
|
||||||
public organisationService: OrganisationService,
|
public organisationService: OrganisationService,
|
||||||
|
@ -361,4 +363,8 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
|
||||||
|
|
||||||
return this.organisationService.searchPublicOrganisations(dataTableRequest).pipe(map(x => x.data));
|
return this.organisationService.searchPublicOrganisations(dataTableRequest).pipe(map(x => x.data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public isAuthenticated(): boolean {
|
||||||
|
return !(!this.authentication.current());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,26 +3,29 @@
|
||||||
<div class="row" style="justify-content: center;">
|
<div class="row" style="justify-content: center;">
|
||||||
|
|
||||||
<mat-form-field class="col-11 search">
|
<mat-form-field class="col-11 search">
|
||||||
<input matInput placeholder="{{'CRITERIA.GRANTS.LIKE'| translate}}" name="dmpCriteriaName"
|
<input matInput placeholder="{{'CRITERIA.GRANTS.LIKE'| translate}}" name="dmpCriteriaName" [(ngModel)]="facetCriteria.like" (ngModelChange)="controlModified()">
|
||||||
[(ngModel)]="facetCriteria.like" (ngModelChange)="controlModified()">
|
|
||||||
<mat-icon matSuffix class="style-icon">search</mat-icon>
|
<mat-icon matSuffix class="style-icon">search</mat-icon>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<div class="col-10 gray-container">
|
<div class="col-10 gray-container">
|
||||||
<h6 class="category-title">{{ 'FACET-SEARCH.GRANT-STATUS.TITLE' | translate }}</h6>
|
<h6 class="category-title">{{ 'FACET-SEARCH.GRANT-STATUS.TITLE' | translate }}</h6>
|
||||||
<mat-radio-group>
|
<mat-radio-group>
|
||||||
<mat-list-item><mat-radio-button value="null" checked (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ANY' | translate }}</mat-radio-button></mat-list-item>
|
<mat-list-item>
|
||||||
<mat-list-item><mat-radio-button value="0" (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ACTIVE' | translate }}</mat-radio-button></mat-list-item>
|
<mat-radio-button value="null" checked (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ANY' | translate }}</mat-radio-button>
|
||||||
<mat-list-item><mat-radio-button value="1" (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.INACTIVE' | translate }}</mat-radio-button></mat-list-item>
|
</mat-list-item>
|
||||||
|
<mat-list-item>
|
||||||
|
<mat-radio-button value="0" (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ACTIVE' | translate }}</mat-radio-button>
|
||||||
|
</mat-list-item>
|
||||||
|
<mat-list-item>
|
||||||
|
<mat-radio-button value="1" (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.INACTIVE' | translate }}</mat-radio-button>
|
||||||
|
</mat-list-item>
|
||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-10 gray-container">
|
<div class="col-10 gray-container">
|
||||||
<h6 class="category-title">{{ 'FACET-SEARCH.GRANT.TITLE' | translate }}</h6>
|
<h6 class="category-title">{{ 'FACET-SEARCH.GRANT.TITLE' | translate }}</h6>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<app-multiple-auto-complete placeholder="{{ 'CRITERIA.DATA-SETS.SELECT-GRANTS' | translate }}"
|
<app-multiple-auto-complete placeholder="{{ 'CRITERIA.DATA-SETS.SELECT-GRANTS' | translate }}" [configuration]="grantAutoCompleteConfiguration" (optionSelected)="onGrantOptionSelected($event)" (optionRemoved)="onGrantOptionRemoved($event)">
|
||||||
[configuration]="grantAutoCompleteConfiguration"
|
|
||||||
(optionSelected)="onGrantOptionSelected($event)" (optionRemoved)="onGrantOptionRemoved($event)">
|
|
||||||
</app-multiple-auto-complete>
|
</app-multiple-auto-complete>
|
||||||
<mat-icon matSuffix class="style-icon">arrow_drop_down</mat-icon>
|
<mat-icon matSuffix class="style-icon">arrow_drop_down</mat-icon>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
@ -31,30 +34,31 @@
|
||||||
<div class="col-10 gray-container">
|
<div class="col-10 gray-container">
|
||||||
<h6 class="category-title">{{ 'FACET-SEARCH.PROFILES.TITLE' | translate }}</h6>
|
<h6 class="category-title">{{ 'FACET-SEARCH.PROFILES.TITLE' | translate }}</h6>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<app-multiple-auto-complete placeholder="{{ 'CRITERIA.DATA-SETS.SELECT-SPEC' | translate }}"
|
<app-multiple-auto-complete placeholder="{{ 'CRITERIA.DATA-SETS.SELECT-SPEC' | translate }}" [configuration]="profileAutoCompleteConfiguration" (optionSelected)="onProfileOptionSelected($event)" (optionRemoved)="onProfileOptionRemoved($event)">
|
||||||
[configuration]="profileAutoCompleteConfiguration"
|
|
||||||
(optionSelected)="onProfileOptionSelected($event)" (optionRemoved)="onProfileOptionRemoved($event)">
|
|
||||||
</app-multiple-auto-complete>
|
</app-multiple-auto-complete>
|
||||||
<mat-icon matSuffix class="style-icon">arrow_drop_down</mat-icon>
|
<mat-icon matSuffix class="style-icon">arrow_drop_down</mat-icon>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-10 gray-container">
|
<div *ngIf="isAuthenticated()" class="col-10 gray-container">
|
||||||
<h6 class="category-title">{{ 'FACET-SEARCH.ROLE.TITLE' | translate }}</h6>
|
<h6 class="category-title">{{ 'FACET-SEARCH.ROLE.TITLE' | translate }}</h6>
|
||||||
<mat-radio-group>
|
<mat-radio-group>
|
||||||
<mat-list-item><mat-radio-button value="null" checked (change)="roleChanged($event)">{{ 'FACET-SEARCH.ROLE.ANY' | translate }}</mat-radio-button></mat-list-item>
|
<mat-list-item>
|
||||||
<mat-list-item><mat-radio-button value="0" (change)="roleChanged($event)">{{ 'FACET-SEARCH.ROLE.OWNER' | translate }}</mat-radio-button></mat-list-item>
|
<mat-radio-button value="null" checked (change)="roleChanged($event)">{{ 'FACET-SEARCH.ROLE.ANY' | translate }}</mat-radio-button>
|
||||||
<mat-list-item><mat-radio-button value="1" (change)="roleChanged($event)">{{ 'FACET-SEARCH.ROLE.MEMBER' | translate }}</mat-radio-button></mat-list-item>
|
</mat-list-item>
|
||||||
</mat-radio-group>
|
<mat-list-item>
|
||||||
</div>
|
<mat-radio-button value="0" (change)="roleChanged($event)">{{ 'FACET-SEARCH.ROLE.OWNER' | translate }}</mat-radio-button>
|
||||||
|
</mat-list-item>
|
||||||
|
<mat-list-item>
|
||||||
|
<mat-radio-button value="1" (change)="roleChanged($event)">{{ 'FACET-SEARCH.ROLE.MEMBER' | translate }}</mat-radio-button>
|
||||||
|
</mat-list-item>
|
||||||
|
</mat-radio-group>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-10 gray-container">
|
<div class="col-10 gray-container">
|
||||||
<h6 class="category-title">{{ 'FACET-SEARCH.DMP-ORGANISATIONS.TITLE' | translate }}</h6>
|
<h6 class="category-title">{{ 'FACET-SEARCH.DMP-ORGANISATIONS.TITLE' | translate }}</h6>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<app-multiple-auto-complete placeholder="{{ 'CRITERIA.DATA-SETS.SELECT-ORGANIZATIONS' | translate }}"
|
<app-multiple-auto-complete placeholder="{{ 'CRITERIA.DATA-SETS.SELECT-ORGANIZATIONS' | translate }}" [configuration]="organizationAutoCompleteConfiguration" (optionSelected)="onOrganizationOptionSelected($event)" (optionRemoved)="onOrganizationOptionRemoved($event)">
|
||||||
[configuration]="organizationAutoCompleteConfiguration"
|
|
||||||
(optionSelected)="onOrganizationOptionSelected($event)"
|
|
||||||
(optionRemoved)="onOrganizationOptionRemoved($event)">
|
|
||||||
</app-multiple-auto-complete>
|
</app-multiple-auto-complete>
|
||||||
<mat-icon matSuffix class="style-icon">arrow_drop_down</mat-icon>
|
<mat-icon matSuffix class="style-icon">arrow_drop_down</mat-icon>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
|
@ -23,6 +23,7 @@ import { OrganizationModel } from "../../../core/model/organisation/organization
|
||||||
import { OrganisationCriteria } from "../../../core/query/organisation/organisation-criteria";
|
import { OrganisationCriteria } from "../../../core/query/organisation/organisation-criteria";
|
||||||
import { OrganisationService } from "../../../core/services/organisation/organisation.service";
|
import { OrganisationService } from "../../../core/services/organisation/organisation.service";
|
||||||
import { DatasetProfileCriteria } from "../../../core/query/dataset-profile/dataset-profile-criteria";
|
import { DatasetProfileCriteria } from "../../../core/query/dataset-profile/dataset-profile-criteria";
|
||||||
|
import { AuthService } from '../../../core/services/auth/auth.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-explore-dmp-filters-component',
|
selector: 'app-explore-dmp-filters-component',
|
||||||
|
@ -95,6 +96,7 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
|
||||||
public activatedRoute: ActivatedRoute,
|
public activatedRoute: ActivatedRoute,
|
||||||
public languageService: TranslateService,
|
public languageService: TranslateService,
|
||||||
public grantService: GrantService,
|
public grantService: GrantService,
|
||||||
|
private authentication: AuthService,
|
||||||
public datasetProfileService: DatasetService,
|
public datasetProfileService: DatasetService,
|
||||||
public organisationService: OrganisationService,
|
public organisationService: OrganisationService,
|
||||||
public externalSourcesService: ExternalSourcesService,
|
public externalSourcesService: ExternalSourcesService,
|
||||||
|
@ -340,4 +342,8 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
|
||||||
isOptionSelected(profile: any) {
|
isOptionSelected(profile: any) {
|
||||||
return this.formGroup.value.map(x => x.id).indexOf(profile.id) !== -1;
|
return this.formGroup.value.map(x => x.id).indexOf(profile.id) !== -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public isAuthenticated(): boolean {
|
||||||
|
return !(!this.authentication.current());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -855,7 +855,7 @@
|
||||||
"EXTERNAL-SOURCE-HINT": "External source",
|
"EXTERNAL-SOURCE-HINT": "External source",
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"YES": "Yes",
|
"YES": "Yes",
|
||||||
"No": "No"
|
"NO": "No"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"DATASET-PROFILE-INTERNAL-DMP-ENTITIES-TYPE": {
|
"DATASET-PROFILE-INTERNAL-DMP-ENTITIES-TYPE": {
|
||||||
|
|
Loading…
Reference in New Issue