openaire-library/test/test.component.ts

61 lines
1.4 KiB
TypeScript

import {Component, ElementRef} from '@angular/core';
import { Subject , Observable} from 'rxjs';
import {SearchFields, FieldDetails} from '../utils/properties/searchFields';
@Component({
selector: 'test',
template: `
`
})
export class TestComponent {
constructor() {
}
ngOnInit() {
}
test(){
var sf:SearchFields = new SearchFields();
console.info("~~~RESULT");
this.checktables(sf.RESULT_REFINE_FIELDS,sf.RESULT_FIELDS,sf.RESULT_FIELDS);
this.checktables(sf.RESULT_ADVANCED_FIELDS,sf.RESULT_FIELDS,sf.RESULT_FIELDS);
console.info("~~~PR");
this.checktables(sf.PROJECT_REFINE_FIELDS,sf.PROJECT_FIELDS,sf.PROJECT_FIELDS);
this.checktables(sf.PROJECT_ADVANCED_FIELDS,sf.PROJECT_FIELDS,sf.PROJECT_FIELDS);
console.info("~~~DATAPR");
this.checktables(sf.DATASOURCE_REFINE_FIELDS,sf.DATASOURCE_FIELDS,sf.DATASOURCE_FIELDS);
this.checktables(sf.DATASOURCE_ADVANCED_FIELDS,sf.DATASOURCE_FIELDS,sf.DATASOURCE_FIELDS);
console.info("~~~ORG");
this.checktables(sf.ORGANIZATION_REFINE_FIELDS,sf.ORGANIZATION_FIELDS,sf.ORGANIZATION_FIELDS);
this.checktables(sf.ORGANIZATION_ADVANCED_FIELDS,sf.ORGANIZATION_FIELDS,sf.ORGANIZATION_FIELDS);
console.info("~~~PERSON");
}
checktables(fields,fieldsDetails,fieldsParam){
for(var i =0; i < fields.length; i++){
if(!fieldsDetails[fields[i]]){
console.info("!!!!"+fields[i]+ "field has to details");
}
}
}
}