Fixes Project status selector on explore

This commit is contained in:
gkolokythas 2019-04-02 13:45:47 +03:00
parent 3da8557389
commit ba36dd06ec
2 changed files with 12 additions and 6 deletions

View File

@ -24,8 +24,8 @@
<mat-form-field class="col-md-12">
<textarea matInput class="description-area"
placeholder="{{'DMP-EDITOR.FIELDS.DESCRIPTION' | translate}}" formControlName="description"
required></textarea>
placeholder="{{'DMP-EDITOR.FIELDS.DESCRIPTION' | translate}}" formControlName="description">
</textarea>
<mat-error *ngIf="formGroup.get('description').hasError('backendError')">
{{formGroup.get('description').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('description').hasError('required')">
@ -83,4 +83,4 @@
</mat-card-content>
</mat-card>
</form>
</div>
</div>

View File

@ -16,6 +16,7 @@ import { ExternalSourcesService } from '../../../core/services/external-sources/
import { ProjectService } from '../../../core/services/project/project.service';
import { RequestItem } from '../../../core/query/request-item';
import { DataTableRequest } from '../../../core/model/data-table/data-table-request';
import { AuthService } from '../../../core/services/auth/auth.service';
@Component({
selector: 'app-explore-dataset-filters-component',
@ -60,7 +61,8 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
public projectService: ProjectService,
public languageService: TranslateService,
public datasetProfileService: DatasetService,
public externalSourcesService: ExternalSourcesService
public externalSourcesService: ExternalSourcesService,
private authentication: AuthService,
) { super(); }
ngOnInit() {
@ -96,10 +98,14 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
dataTableRequest.criteria = new ProjectCriteria();
dataTableRequest.criteria.projectStateType = this.facetCriteria.projectStatus;
dataTableRequest.criteria['length'] = 10;
this.projects = this.projectService.getPaged(dataTableRequest, "autocomplete").map(x => x.data);
this.facetCriteria.projects = [];
if (this.authentication.current()) {
this.projects = this.projectService.getPaged(dataTableRequest, "autocomplete").map(x => x.data);
this.facetCriteria.projects = [];
}
}
this.facetCriteriaChange.emit(this.facetCriteria);
}
public projectChanged(event: any) {