[develop | DONE | FIXED]: Initialize properties on field definition (files: displayClaims.component.ts & directLinking.component.ts & approved.component.ts & curators.component.ts & portals.component.ts & depositFirstPage.component.ts & searchResultsInDeposit.component.ts & statisticsTab.component.ts & citeThis.component.ts & deletedByInference.component.ts & organization.component.ts & project.component.ts & deletedByInference.component.ts & myOrcidLinks.component.ts & searchMyOrcidResults.component.ts & searchRecommendedResultsForOrcid.component.ts & searchResultsForOrcid.component.ts & searchAll.component.ts & advancedSearchForm.component.ts & searchDataProviders.component.ts & searchDataProviders.component.ts & searchOrganizations.component.ts & searchProjects.component.ts).

This commit is contained in:
Konstantina Galouni 2024-07-02 13:51:15 +03:00
parent 93897534dc
commit 1401a68256
23 changed files with 24 additions and 61 deletions

View File

@ -28,7 +28,7 @@ import {DropdownFilterComponent} from "../../../utils/dropdown-filter/dropdown-f
})
export class DisplayClaimsComponent implements OnInit, OnDestroy {
@Input() pageTitle: string = "";
properties: EnvProperties;
properties: EnvProperties = properties;
public searchTermStream = new Subject<string>();
subscriptions: any = [];
public subResults: any;
@ -101,7 +101,6 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy {
sort: this._fb.control(this.sortOptions[0].value)
});
this.properties = properties;
this.url = properties.domain + properties.baseLink + this._router.url;
if (!this.myClaims) {
this.sortOptions.push({label: "User (desc) ", value: {sort: "user", descending: true}});

View File

@ -34,7 +34,7 @@ export class DirectLinkingComponent {
sources: ClaimEntity[] = [];
inlineEntity: ClaimEntity = null;
validInput: boolean = null;//'true;
properties: EnvProperties;
properties: EnvProperties = properties;
@Input() communityId: string = null;
localStoragePrefix: string = "";
@Input() organizationClaim: boolean = false;
@ -50,7 +50,6 @@ export class DirectLinkingComponent {
});
}
ngOnInit() {
this.properties = properties;
/* if(!this.claimsProperties){
this.claimsProperties = new ClaimsProperties();
}*/

View File

@ -21,13 +21,12 @@ export class ApprovedByCommunityComponent {
public approved:boolean = false;
private communityContentProviders = [];
properties:EnvProperties;
properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities;
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchCommunityDataprovidersService) {}
public ngOnInit() {
this.properties =properties;
this.route.queryParams.subscribe(
communityId => {
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);

View File

@ -36,7 +36,7 @@ export class CuratorsComponent {
public viewingMore: boolean = false;
public curatorInModal;
public properties: EnvProperties;
public properties: EnvProperties = properties;
public pageContents = null;
public divContents = null;
@ -63,7 +63,6 @@ export class CuratorsComponent {
ngOnInit() {
this.showLoading = true;
this.properties = properties;
this.downloadUrl = this.properties.utilsService + '/download/';
//if (properties.environment !== 'development') {
if (!this.longView) {

View File

@ -34,7 +34,7 @@ export class PortalsComponent implements OnInit {
private searchText: RegExp = new RegExp('');
public keyword = '';
public properties: EnvProperties = null;
public properties: EnvProperties = properties;
public showLoading = true;
public portalUtils: PortalUtils = new PortalUtils();
@ -61,7 +61,6 @@ export class PortalsComponent implements OnInit {
}));
HelperFunctions.scroll();
this.properties = properties;
this.getPortals();
}

View File

@ -191,7 +191,7 @@ export class DepositFirstPageComponent {
public keyword: string;
public depositRoute: string;
public searchPlaceHolder = "Search by title, country, organization, subject, type...";
properties:EnvProperties;
properties:EnvProperties = properties;
public routerHelper:RouterHelper = new RouterHelper();
@Input() showBreadcrumb:boolean = false;
breadcrumbs:Breadcrumb[] = [];
@ -208,7 +208,6 @@ export class DepositFirstPageComponent {
ngOnInit() {
this.properties = properties;
this.url = this.properties.domain+this.properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url, false);

View File

@ -18,7 +18,7 @@ export class SearchResultsInDepositComponent {
@Input() results: SearchResult[];
@Input() status: number;
@Input() type: string;
@Input() properties:EnvProperties;
@Input() properties:EnvProperties = properties;
@Input() isMobile: boolean = false;
@ -60,8 +60,6 @@ export class SearchResultsInDepositComponent {
this.urlParam = "datasourceId";
}
this.properties = properties;
if (!this.zenodoInformation) {
this.zenodoInformation = new ZenodoInformationClass();
}

View File

@ -78,15 +78,12 @@ export class StatisticsTabComponent {
private dataProjectsUrl:string ;
private pubsProjectsUrl:string;
public errorCodes:ErrorCodes = new ErrorCodes();
properties:EnvProperties;
properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities;
sub;
constructor (private route: ActivatedRoute) {}
ngOnInit() {
this.properties = properties;
if (this.properties.useNewStatistisTool) {
this.docsTimelineUrl = this.properties.statisticsFrameNewAPIURL +
'chart?json='+StringUtils.URIEncode('{"library":"HighCharts","chartDescription":{"queries":[{"name":"'+this.openaireEntities.RESULTS+'","type":"column","query":{"name":"dtsrcYear","parameters":["'+this.datasourceId+'"]}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Produced '+this.openaireEntities.RESULTS+' per year"},"subtitle":{},"yAxis":{"title":{"text":"'+this.openaireEntities.RESULTS+'"}},"xAxis":{"title":{"text":"Year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}');

View File

@ -41,7 +41,7 @@ export class CiteThisComponent implements OnInit, OnDestroy {
public selectedStyle: string = null;
public selectedFormat: string = null;
public fileText: string;
properties:EnvProperties;
properties:EnvProperties = properties;
public citationText: string;
public citation: Citation = new Citation();
@Input() result: any;
@ -55,7 +55,6 @@ export class CiteThisComponent implements OnInit, OnDestroy {
constructor( @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2, private _piwikService: PiwikService){
}
ngOnInit() {
this.properties = properties;
try{
if (!this.document.getElementById('citationjs')) {
const renderer = this.rendererFactory.createRenderer(this.document, {

View File

@ -57,7 +57,7 @@ export class OrganizationsDeletedByInferenceComponent {
public errorCodes:ErrorCodes = new ErrorCodes();
subscriptions = [];
properties:EnvProperties;
properties:EnvProperties = properties;
constructor ( private element: ElementRef,
private _deletedByInferenceService: OrganizationsDeletedByInferenceService,
@ -65,9 +65,6 @@ export class OrganizationsDeletedByInferenceComponent {
}
ngOnInit() {
this.properties = properties;
this.subscriptions.push(this.route.queryParams.subscribe(data => {
this.errorCodes = new ErrorCodes();
this.status = this.errorCodes.LOADING;

View File

@ -117,7 +117,7 @@ export class OrganizationComponent {
subscriptions = [];
innerReportSubscriptions = [];
properties: EnvProperties;
properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
public indexUpdateDate: Date;
public showFeedback: boolean = false;
@ -167,7 +167,6 @@ export class OrganizationComponent {
this.isBottomIntersecting = isBottomIntersecting;
this.cdr.detectChanges();
}));
this.properties = properties;
if (typeof document !== 'undefined') {
this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
if (lastIndexUpdate) {

View File

@ -171,7 +171,7 @@ export class ProjectComponent {
subscriptions = [];
private sub: Subscription;
properties: EnvProperties;
properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
public isMobile: boolean = false;
@ -214,7 +214,6 @@ export class ProjectComponent {
this.isBottomIntersecting = isBottomIntersecting;
this.cdr.detectChanges();
}));
this.properties = properties;
if (typeof document !== 'undefined') {
this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
if (lastIndexUpdate) {

View File

@ -62,7 +62,7 @@ export class DeletedByInferenceComponent {
public errorCodes: ErrorCodes = new ErrorCodes();
subscriptions = [];
properties: EnvProperties;
properties: EnvProperties = properties;
constructor(private element: ElementRef,
private _deletedByInferenceService: DeletedByInferenceService,
@ -70,10 +70,6 @@ export class DeletedByInferenceComponent {
}
ngOnInit() {
this.properties = properties;
this.subscriptions.push(this.route.queryParams.subscribe(data => {
this.errorCodes = new ErrorCodes();
this.status = this.errorCodes.LOADING;

View File

@ -121,7 +121,7 @@ export class MyOrcidLinksComponent {
public oldTotalResults: number = 0;
pagingLimit = 0;
properties:EnvProperties;
properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities;
public lastOrcidUpdateDate: string = "";
@ -183,7 +183,6 @@ export class MyOrcidLinksComponent {
}
public ngOnInit() {
this.properties = properties;
this.baseUrl = this.properties.myOrcidLinksPage;
this.pagingLimit = this.properties.pagingLimit;
var description = "Openaire, ORCID linking, publication, research data, software, other research product";

View File

@ -21,7 +21,7 @@ export class searcMyOrcidResultsComponent {
@Input() results: SearchResult[];
@Input() status: number;
@Input() type: string;
@Input() properties:EnvProperties;
@Input() properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities;
@Input() previewResults:{"work":{},results:ResultPreview[]}[];
@ -57,9 +57,6 @@ export class searcMyOrcidResultsComponent {
this.linkToAdvancedSearchPage = this.properties.searchLinkToAdvancedOrps;
this.urlParam = "orpId";
}
this.properties = properties;
}

View File

@ -77,7 +77,7 @@ export class SearchRecommendedResultsForOrcidComponent {
public oldTotalResults: number = 0;
pagingLimit = 0;
properties:EnvProperties;
properties:EnvProperties = properties;
@Input() public communityId: string = null;
@ -100,7 +100,6 @@ export class SearchRecommendedResultsForOrcidComponent {
}
public ngOnInit() {
this.properties = properties;
this.depositLearnHowPage = this.properties.depositLearnHowPage;
this.baseUrl = this.properties.depositSearchPage;
this.pagingLimit = this.properties.pagingLimit;

View File

@ -17,7 +17,7 @@ export class SearchResultsForOrcidComponent {
@Input() results: SearchResult[];
@Input() status: number;
@Input() type: string;
@Input() properties:EnvProperties;
@Input() properties:EnvProperties = properties;
public urlParam: string;
@ -56,9 +56,6 @@ export class SearchResultsForOrcidComponent {
this.linkToAdvancedSearchPage = this.properties.searchLinkToAdvancedDataProviders;
this.urlParam = "datasourceId";
}
this.properties = properties;
}
public quote(params: string):string {

View File

@ -85,7 +85,7 @@ export class SearchAllComponent {
showServices: boolean = false;
showOrganizations: boolean = false;
advancedSearchLink: string = properties.searchLinkToAdvancedResults;
properties: EnvProperties;
properties: EnvProperties = properties;
offset: number;
public openaireEntities = OpenaireEntities;
@Input() logoURL;
@ -154,7 +154,6 @@ export class SearchAllComponent {
var description = "Search for "+OpenaireEntities.RESULTS+" ("+OpenaireEntities.PUBLICATIONS+", "+OpenaireEntities.DATASETS+", "+OpenaireEntities.SOFTWARE+", "+OpenaireEntities.OTHER+"), "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.ORGANIZATIONS+", "+OpenaireEntities.DATASOURCES+" in the OpenAIRE Graph. ";
var title = "OpenAIRE |Search for "+OpenaireEntities.RESULTS+", "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.DATASOURCES+" & "+OpenaireEntities.ORGANIZATIONS;
this.properties = properties;
var url = this.properties.domain + this.properties.baseLink + this._router.url;
this._title.setTitle(title);
this._meta.updateTag({content: description}, "name='description'");

View File

@ -80,7 +80,7 @@ export class SearchDataProvidersComponent {
public loadPaging: boolean = true;
public oldTotalResults: number = 0;
public pagingLimit: number = 0;
properties:EnvProperties;
properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities;
@Input() type: "all" | "registries" | "journals" | "compatible" | "deposit" | "services" = "all";
@Input() entityType: "dataprovider" | "service" = "dataprovider";
@ -130,7 +130,6 @@ export class SearchDataProvidersComponent {
if(this.showSwitchSearchLink == null){
this.showSwitchSearchLink = (this.type == "all" || this.type == "services");
}
this.properties= properties;
this.csvPath = this.entityType == "service" ? OpenaireEntities.SERVICES_FILE : OpenaireEntities.DATASOURCES_FILE;
if (!this.simpleSearchLink) {
this.simpleSearchLink = this.entityType == "service" ? this.properties.searchLinkToServices : this.properties.searchLinkToDataProviders;

View File

@ -47,7 +47,7 @@ import {zip} from "rxjs";
export class SearchOrganizationsComponent {
private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent;
properties:EnvProperties;
properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities;
@Input() searchForm: SearchForm = {class: 'search-form', dark: true};
public results =[];
@ -103,7 +103,6 @@ export class SearchOrganizationsComponent {
}
ngOnInit() {
this.properties= properties;
if (!this.simpleSearchLink) {
this.simpleSearchLink = this.properties.searchLinkToOrganizations;
}

View File

@ -67,7 +67,7 @@ export class SearchProjectsComponent {
public fieldIdsMap = this.searchFields.PROJECT_FIELDS;
public rangeFields: string[][] = this.searchFields.PROJECT_RANGE_FIELDS;
public selectedFields: AdvancedField[] = [];
properties: EnvProperties;
properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
public resourcesQuery = "(oaftype exact project)";
@ -107,8 +107,6 @@ export class SearchProjectsComponent {
}
ngOnInit() {
this.properties = properties;
if (!this.simpleSearchLink) {
this.simpleSearchLink = this.properties.searchLinkToProjects;
}

View File

@ -51,7 +51,7 @@ export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges
newFieldName: string;
fieldList: { [id: string]: any[] } = {};
public searchFields: SearchFields = new SearchFields();
properties: EnvProperties;
properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
public operators: string[] = this.searchFields.ADVANCED_SEARCH_OPERATORS;
public isOperators: Option[] = [{label: 'is', value: true}, {label: 'is not', value: false}];
@ -69,9 +69,7 @@ export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges
ngOnInit() {
this.selectedEntity = this.entityType;
this.properties = properties;
for (var i = 0; i < this.fieldIds.length; i++) {
this.fieldList[this.fieldIds[i]] = [];
}

View File

@ -39,7 +39,7 @@ export class SearchDownloadComponent {
@ViewChild(ModalLoading) loading: ModalLoading;
// Alert box when something is wrong with CSV requests
@ViewChild('AlertModalCsvError') alertCsvError;
public properties: EnvProperties;
public properties: EnvProperties = properties;
public errorCodes: ErrorCodes = new ErrorCodes();
subscriptions = [];
@ -47,7 +47,6 @@ export class SearchDownloadComponent {
}
ngOnInit() {
this.properties = properties;
this.csvLimit = this.properties.csvLimit;
this.downloadURLAPI = this.properties.csvAPIURL;
}