removes unnecessary console.log and comments
This commit is contained in:
parent
fc72c014a5
commit
0542c17aae
|
@ -16,7 +16,7 @@
|
||||||
<div class="funder-form">
|
<div class="funder-form">
|
||||||
<div *ngIf="!isCreateNewFunder">
|
<div *ngIf="!isCreateNewFunder">
|
||||||
<mat-form-field appearance="outline">
|
<mat-form-field appearance="outline">
|
||||||
<app-single-auto-complete required='true' [formControl]="funderFormGroup.get('existFunder')" placeholder="{{'DMP-EDITOR.FIELDS.FUNDER' | translate}}" [configuration]="funderAutoCompleteConfiguration" (optionSelected)="funderSelectionChanged()">
|
<app-single-auto-complete required='true' [formControl]="funderFormGroup.get('existFunder')" placeholder="{{'DMP-EDITOR.FIELDS.FUNDER' | translate}}" [configuration]="funderAutoCompleteConfiguration">
|
||||||
</app-single-auto-complete>
|
</app-single-auto-complete>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,6 +12,7 @@ import { GrantCriteria } from '@app/core/query/grant/grant-criteria';
|
||||||
import { ProjectCriteria } from '@app/core/query/project/project-criteria';
|
import { ProjectCriteria } from '@app/core/query/project/project-criteria';
|
||||||
import { FunderCriteria } from '@app/core/query/funder/funder-criteria';
|
import { FunderCriteria } from '@app/core/query/funder/funder-criteria';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
import { GrantEditorModel } from '@app/ui/grant/editor/grant-editor.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'funding-info',
|
selector: 'funding-info',
|
||||||
|
@ -81,35 +82,9 @@ export class FundingInfoComponent extends BaseComponent implements OnInit {
|
||||||
.subscribe(x => {
|
.subscribe(x => {
|
||||||
this.configureAutoCompletes();
|
this.configureAutoCompletes();
|
||||||
});
|
});
|
||||||
|
|
||||||
// this.funderFormGroup.statusChanges
|
|
||||||
// .pipe(takeUntil(this._destroyed))
|
|
||||||
// .subscribe(x => {
|
|
||||||
// console.log("FUNDER CHANGE: INIT");
|
|
||||||
// this.grantformGroup.reset();
|
|
||||||
// if (x == 'INVALID') {
|
|
||||||
// this.grantformGroup.get('existGrant').reset();
|
|
||||||
// this.grantformGroup.get('label').reset();
|
|
||||||
// this.grantformGroup.get('description').reset();
|
|
||||||
// this.grantformGroup.get('existGrant').disable();
|
|
||||||
// this.grantformGroup.get('label').disable();
|
|
||||||
// this.grantformGroup.get('description').disable();
|
|
||||||
// } else if (x == 'VALID') {
|
|
||||||
// if (!this.isNew) {
|
|
||||||
// this.grantformGroup.get('label').reset();
|
|
||||||
// this.grantformGroup.get('description').reset();
|
|
||||||
// this.grantformGroup.get('label').disable();
|
|
||||||
// this.grantformGroup.get('description').disable();
|
|
||||||
// this.grantformGroup.get('existGrant').enable();
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// this.configureAutoCompletes();
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
configureAutoCompletes(): void {
|
configureAutoCompletes(): void {
|
||||||
console.log("before Search")
|
|
||||||
this.funderAutoCompleteConfiguration = {
|
this.funderAutoCompleteConfiguration = {
|
||||||
filterFn: this.searchFunder.bind(this),
|
filterFn: this.searchFunder.bind(this),
|
||||||
initialItems: () => this.searchFunder(''),
|
initialItems: () => this.searchFunder(''),
|
||||||
|
@ -136,13 +111,12 @@ export class FundingInfoComponent extends BaseComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
searchGrant(query: any) {
|
searchGrant(query: any) {
|
||||||
// console.log("Search GRANTS");
|
|
||||||
const grantRequestItem: RequestItem<GrantCriteria> = new RequestItem();
|
const grantRequestItem: RequestItem<GrantCriteria> = new RequestItem();
|
||||||
grantRequestItem.criteria = new GrantCriteria();
|
grantRequestItem.criteria = new GrantCriteria();
|
||||||
grantRequestItem.criteria.like = query;
|
grantRequestItem.criteria.like = query;
|
||||||
if (this.funderFormGroup.get('existFunder').value) {
|
if (this.funderFormGroup.get('existFunder').value) {
|
||||||
grantRequestItem.criteria.funderReference = this.funderFormGroup.controls['existFunder'].value.reference;
|
grantRequestItem.criteria.funderReference = this.funderFormGroup.controls['existFunder'].value.reference;
|
||||||
// console.log(grantRequestItem);
|
console.log(grantRequestItem);
|
||||||
}
|
}
|
||||||
return this.grantService.getWithExternal(grantRequestItem);
|
return this.grantService.getWithExternal(grantRequestItem);
|
||||||
}
|
}
|
||||||
|
@ -196,7 +170,6 @@ export class FundingInfoComponent extends BaseComponent implements OnInit {
|
||||||
this.grantformGroup.get('label').disable();
|
this.grantformGroup.get('label').disable();
|
||||||
this.grantformGroup.get('description').disable();
|
this.grantformGroup.get('description').disable();
|
||||||
} else {
|
} else {
|
||||||
// console.log("SET VALIDATORS")
|
|
||||||
this.grantformGroup.get('existGrant').enable();
|
this.grantformGroup.get('existGrant').enable();
|
||||||
this.grantformGroup.get('label').disable();
|
this.grantformGroup.get('label').disable();
|
||||||
this.grantformGroup.get('label').reset();
|
this.grantformGroup.get('label').reset();
|
||||||
|
@ -260,15 +233,12 @@ export class FundingInfoComponent extends BaseComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
funderValueChanged(funder: any) {
|
funderValueChanged(funder: any) {
|
||||||
// console.log("Funder ", funder);
|
if ((funder.label !== "" && funder.label !== null && funder.label !== undefined)
|
||||||
// console.log(this.funderFormGroup.get('existFunder').value);
|
|
||||||
|
|
||||||
if ((funder.label !== "" && funder.label != null && funder.label !== undefined)
|
|
||||||
|| (funder.existFunder !== null && funder.existFunder !== undefined && funder.existFunder.id !== undefined)) {
|
|| (funder.existFunder !== null && funder.existFunder !== undefined && funder.existFunder.id !== undefined)) {
|
||||||
// console.log('Funder Value Changed')
|
|
||||||
this.grantformGroup.reset();
|
this.grantformGroup.reset();
|
||||||
this.grantformGroup.enable();
|
this.grantformGroup.enable();
|
||||||
this.setGrantValidators();
|
this.setGrantValidators();
|
||||||
|
// this.grantformGroup.updateValueAndValidity();
|
||||||
} else {
|
} else {
|
||||||
this.grantformGroup.reset();
|
this.grantformGroup.reset();
|
||||||
this.grantformGroup.disable();
|
this.grantformGroup.disable();
|
||||||
|
@ -276,19 +246,6 @@ export class FundingInfoComponent extends BaseComponent implements OnInit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
funderSelectionChanged() {
|
|
||||||
// console.log("onFunderSelectionChanged")
|
|
||||||
// console.log(this.funderFormGroup.get('existFunder').value);
|
|
||||||
// this.grantAutoCompleteConfiguration = null;
|
|
||||||
// this.grantAutoCompleteConfiguration = {
|
|
||||||
// filterFn: this.searchGrant.bind(this),
|
|
||||||
// initialItems: () => this.searchGrant(''),
|
|
||||||
// displayFn: (item) => item['label'] + this.getGrantIdText(item),
|
|
||||||
// titleFn: (item) => item['label'] + this.getGrantIdText(item),
|
|
||||||
// subtitleFn: (item) => item['source'] ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['source'] : (item['key'] ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['key'] : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE'))
|
|
||||||
// };
|
|
||||||
}
|
|
||||||
|
|
||||||
isGrantDisabled() {
|
isGrantDisabled() {
|
||||||
return this.grantformGroup.disabled;
|
return this.grantformGroup.disabled;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue