[Connect]: Update trunk to angular 11. Delete branch angular-11

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@61397 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2021-07-14 14:51:20 +00:00
parent 6eee9f81ef
commit 564b1f3e37
45 changed files with 597 additions and 936 deletions

11
.browserslistrc Normal file
View File

@ -0,0 +1,11 @@
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
#
# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11

View File

@ -1,54 +1,39 @@
# Angular Universal & Anguar-CLI minimal starter # Connect
> This demo is built following the [Angular-CLI Wiki guide](https://github.com/angular/angular-cli/wiki/stories-universal-rendering) This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.3.10 and has been updated to 11.2.14.
We're utilizing packages from the [Angular Universal @nguniversal](https://github.com/angular/universal) repo, such as [ng-module-map-ngfactory-loader](https://github.com/angular/universal/tree/master/modules/module-map-ngfactory-loader) to enable Lazy Loading. ## Install packages
--- Run npm install (maybe needs sudo), a script that will delete unused files from library will be run.
## Static or Dynamic ## Development server
This repo demonstrates the use of 2 different forms of Server Side Rendering.
**Static** Also known as "prerendering" Run `npm start` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
* Happens at build time
* Renders your application and replaces the dist index.html with a version rendered at the route `/`.
**Dynamic** ## Build - CSR
* Happens at runtime
* Uses `ngExpressEngine` to render you application on the fly at the requested url.
--- Use the `npm run build-dev` for a development build.<br>
Use the `npm run build-beta` for a beta build.<br>
Use the `npm run build-prod` for a production build.
## Installation ## Build - SSR
* `npm install` or `yarn`
--- Use the `npm run build:ssr-dev` for a development build.<br>
Use the `npm run build:ssr-beta` for a beta build.<br>
Use the `npm run build:ssr-prod` for a production build.
## Development (Client-side only rendering) ## Run SSR
* run `npm run start` which will start `ng serve` (project served at the standard: localhost:4200)
--- `npm run serve:ssr` will run the last server build.
## Production ## Webpack Analyzer
Depending on whether you're publishing dynamic or static prerendering, run the build command, and then serve up your dist folder assets. In order to analyze bundle size you can run `npm run webpack-bundle-analyzer`
> **NOTE**: To deploy your **Static** site to a static hosting platform you will have to deploy the *`dist/browser`* folder, rather than the usual *`dist`* ## Running unit tests
ie: `npm run build:dynamic` or `npm run build:static`. All of the files that need to be served will be found within the `/dist` folder. Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
---
## Testing Universal (dynamic or static) builds -Locally-
**Dynamic** : **`npm run start:dynamic`**
Compiles your application and spins up a Node Express to dynamically serve your Universal application on `http://localhost:4000`.
**Static** : **`npm run start:static`**
- Compiles your application and prerenders your applications files, spinning up a demo http-server so you can view it on `http://127.0.0.1:8080`
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

View File

@ -1,21 +1,46 @@
{ {
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json", "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1, "version": 1,
"newProjectRoot": "projects", "newProjectRoot": "projects",
"projects": { "projects": {
"ng-universal-demo": { "connect": {
"root": "", "root": "",
"sourceRoot": "src", "sourceRoot": "src",
"projectType": "application", "projectType": "application",
"prefix": "app",
"schematics": {
"@schematics/angular:class": {
"skipTests": true
},
"@schematics/angular:component": {
"skipTests": true
},
"@schematics/angular:directive": {
"skipTests": true
},
"@schematics/angular:guard": {
"skipTests": true
},
"@schematics/angular:module": {
"skipTests": true
},
"@schematics/angular:pipe": {
"skipTests": true
},
"@schematics/angular:service": {
"skipTests": true
}
},
"architect": { "architect": {
"build": { "build": {
"builder": "@angular-devkit/build-angular:browser", "builder": "@angular-devkit/build-angular:browser",
"options": { "options": {
"outputPath": "dist/browser", "aot": true,
"outputPath": "dist/connect/browser",
"index": "src/index.html", "index": "src/index.html",
"main": "src/main.ts", "main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts", "polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [ "assets": [
"src/assets" "src/assets"
], ],
@ -24,102 +49,123 @@
"src/material.scss" "src/material.scss"
], ],
"scripts": [ "scripts": [
"node_modules/jquery/dist/jquery.js", "node_modules/jquery/dist/jquery.js"
] ]
}, },
"configurations": { "configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
},
{
"replace": "src/index.html",
"with": "src/index.prod.html"
}
]
},
"beta": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.beta.ts"
},
{
"replace": "src/index.html",
"with": "src/index.beta.html"
}
]
},
"development": { "development": {
"optimization": true, "optimization": true,
"outputHashing": "all", "outputHashing": "all",
"sourceMap": false, "sourceMap": false,
"extractCss": true,
"namedChunks": false, "namedChunks": false,
"aot": true, "aot": true,
"extractLicenses": true, "extractLicenses": true,
"vendorChunk": false, "vendorChunk": false,
"buildOptimizer": true "buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
]
},
"beta": {
"index": {
"input": "src/beta/index.html",
"output": "index.html"
},
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.beta.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
]
},
"production": {
"index": {
"input": "src/prod/index.html",
"output": "index.html"
},
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
]
} }
} }
}, },
"serve": { "serve": {
"builder": "@angular-devkit/build-angular:dev-server", "builder": "@angular-devkit/build-angular:dev-server",
"options": { "options": {
"browserTarget": "ng-universal-demo:build" "browserTarget": "connect:build"
}, },
"configurations": { "configurations": {
"production": { "production": {
"browserTarget": "ng-universal-demo:build:production" "browserTarget": "connect:build:production"
},
"beta": {
"browserTarget": "ng-universal-demo:build:beta"
},
"development": {
"browserTarget": "ng-universal-demo:build:development"
} }
} }
}, },
"extract-i18n": { "extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n", "builder": "@angular-devkit/build-angular:extract-i18n",
"options": { "options": {
"browserTarget": "ng-universal-demo:build" "browserTarget": "connect:build"
} }
}, },
"test": { "test": {
"builder": "@angular-devkit/build-angular:karma", "builder": "@angular-devkit/build-angular:karma",
"options": { "options": {
"main": "src/test.ts", "main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts", "polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json", "tsConfig": "src/tsconfig.spec.json",
"scripts": [ "karmaConfig": "src/karma.conf.js",
"node_modules/jquery/dist/jquery.js"
],
"styles": [ "styles": [
"src/styles.css", "src/styles.css"
"src/material.scss"
], ],
"scripts": [],
"assets": [ "assets": [
"src/assets" "src/assets"
] ]
@ -140,58 +186,89 @@
"server": { "server": {
"builder": "@angular-devkit/build-angular:server", "builder": "@angular-devkit/build-angular:server",
"options": { "options": {
"outputPath": "dist/server", "outputPath": "dist/connect/server",
"main": "src/main.server.ts", "main": "server.ts",
"tsConfig": "src/tsconfig.server.json" "tsConfig": "src/tsconfig.server.json"
}, },
"configurations": { "configurations": {
"production": { "development": {
"fileReplacements": [ "outputHashing": "media",
{ "sourceMap": false,
"replace": "src/environments/environment.ts", "optimization": true
"with": "src/environments/environment.prod.ts"
},
{
"replace": "src/index.html",
"with": "src/index.prod.html"
}
]
}, },
"beta": { "beta": {
"outputHashing": "media",
"fileReplacements": [ "fileReplacements": [
{ {
"replace": "src/environments/environment.ts", "replace": "src/environments/environment.ts",
"with": "src/environments/environment.beta.ts" "with": "src/environments/environment.beta.ts"
},
{
"replace": "src/index.html",
"with": "src/index.beta.html"
} }
] ],
"sourceMap": false,
"optimization": true
}, },
"development": {} "production": {
"outputHashing": "media",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"sourceMap": false,
"optimization": true
}
}
},
"serve-ssr": {
"builder": "@nguniversal/builders:ssr-dev-server",
"options": {
"browserTarget": "connect:build",
"serverTarget": "connect:server"
},
"configurations": {
"production": {
"browserTarget": "connect:build:production",
"serverTarget": "connect:server:production"
}
}
},
"prerender": {
"builder": "@nguniversal/builders:prerender",
"options": {
"browserTarget": "connect:build:production",
"serverTarget": "connect:server:production",
"routes": [
"/"
]
},
"configurations": {
"production": {}
} }
} }
} }
}, },
"ng-universal-demo-e2e": { "connect-e2e": {
"root": "e2e", "root": "e2e/",
"sourceRoot": "e2e",
"projectType": "application", "projectType": "application",
"prefix": "",
"architect": { "architect": {
"e2e": { "e2e": {
"builder": "@angular-devkit/build-angular:protractor", "builder": "@angular-devkit/build-angular:protractor",
"options": { "options": {
"protractorConfig": "./protractor.conf.js", "protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "ng-universal-demo:serve" "devServerTarget": "connect:serve"
},
"configurations": {
"production": {
"devServerTarget": "connect:serve:production"
}
} }
}, },
"lint": { "lint": {
"builder": "@angular-devkit/build-angular:tslint", "builder": "@angular-devkit/build-angular:tslint",
"options": { "options": {
"tsConfig": [ "tsConfig": "e2e/tsconfig.e2e.json",
"e2e/tsconfig.e2e.json"
],
"exclude": [ "exclude": [
"**/node_modules/**" "**/node_modules/**"
] ]
@ -200,33 +277,5 @@
} }
} }
}, },
"defaultProject": "ng-universal-demo", "defaultProject": "connect"
"schematics": {
"@schematics/angular:class": {
"spec": false
},
"@schematics/angular:component": {
"spec": false,
"inlineStyle": true,
"inlineTemplate": true,
"prefix": "app",
"styleext": "css"
},
"@schematics/angular:directive": {
"spec": false,
"prefix": "app"
},
"@schematics/angular:guard": {
"spec": false
},
"@schematics/angular:module": {
"spec": false
},
"@schematics/angular:pipe": {
"spec": false
},
"@schematics/angular:service": {
"spec": false
}
}
} }

6
clean-library.sh Normal file
View File

@ -0,0 +1,6 @@
cd src/app/openaireLibrary
# Exclude Dashboard files
echo "Exclude Dashboard files"
svn update --set-depth exclude ./dashboard
cd ../../../
echo "Done"

View File

@ -1,126 +0,0 @@
{
"environment" : "beta",
"dashboard" : "connect",
"enablePiwikTrack" : true,
"useCache" : true,
"showContent" : true,
"showAddThis" : false,
"metricsAPIURL" : "https://beta.services.openaire.eu/usagestats/",
"framesAPIURL" : "https://beta.openaire.eu/stats3/",
"statisticsAPIURL" : "https://beta.services.openaire.eu/stats-api/",
"statisticsFrameAPIURL":"https://beta.openaire.eu/stats/",
"statisticsFrameNewAPIURL": "https://stats.madgik.di.uoa.gr/stats-api/",
"useNewStatistisTool":true,
"impactFactorsAPIURL" :"https://bip-api.imsi.athenarc.gr/paper/scores/batch/",
"claimsAPIURL" : "https://beta.services.openaire.eu/claims/rest/claimsService/",
"searchAPIURLLAst" : "https://beta.services.openaire.eu/search/v2/api/",
"searchResourcesAPIURL" : "https://beta.services.openaire.eu/search/v2/api/resources",
"openCitationsAPIURL" : "https://services.openaire.eu/opencitations/getCitations?id=",
"csvAPIURL" : "https://beta.services.openaire.eu/search/v2/api/reports",
"searchCrossrefAPIURL" : "https://api.crossref.org/works",
"searchDataciteAPIURL" : "https://api.datacite.org/works",
"searchOrcidURL" : "https://pub.orcid.org/v2.1/",
"orcidURL" : "https://orcid.org/",
"doiURL" : "https://dx.doi.org/",
"pmcURL": "http://europepmc.org/articles/",
"pmidURL": "https://www.ncbi.nlm.nih.gov/pubmed/",
"handleURL": "http://hdl.handle.net/",
"cordisURL" : "http://cordis.europa.eu/projects/",
"openDoarURL": "http://v2.sherpa.ac.uk/id/repository/",
"r3DataURL": "http://service.re3data.org/repository/",
"sherpaURL": "http://sherpa.ac.uk/romeo/issn/",
"sherpaURLSuffix": "/",
"zenodo" : "https://zenodo.org/",
"zenodoCommunities" : "https://zenodo.org/api/communities/",
"openAccess" : "https://www.openaire.eu/support/faq#article-id-234",
"openAccessRepo" : "https://www.openaire.eu/support/faq#article-id-310",
"fp7Guidlines" : "https://www.openaire.eu/open-access-in-fp7-seventh-research-framework-programme",
"h2020Guidlines" : "https://www.openaire.eu/oa-publications/h2020/open-access-in-horizon-2020",
"ercGuidlines" : "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf",
"helpdesk" : "https://www.openaire.eu/support/helpdesk",
"helpdeskEmail": "helpdesk@openaire.eu",
"utilsService" : "https://demo.openaire.eu/utils-service",
"vocabulariesAPI" :"https://beta.services.openaire.eu/provision/mvc/vocabularies/",
"piwikBaseUrl" :"https://analytics.openaire.eu/piwik.php?idsite=",
"piwikSiteId" : "80",
"loginUrl" :"https://beta.services.openaire.eu/connect-user-management/openid_connect_login",
"userInfoUrl" : "https://beta.services.openaire.eu/uoa-user-management/api/users/getUserInfo?accessToken=",
"logoutUrl" :"https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",
"cookieDomain" :".openaire.eu",
"feedbackmail" :"feedback@openaire.eu",
"cacheUrl" :"https://demo.openaire.eu/cache/get?url=",
"adminToolsAPIURL" :"https://beta.services.openaire.eu/uoa-admin-tools",
"adminToolsCommunity" :"connect",
"datasourcesAPI": "https://beta.services.openaire.eu/openaire/ds/search/",
"contextsAPI":"https://beta.services.openaire.eu/openaire/context",
"communityAPI": "https://beta.services.openaire.eu/openaire/community/",
"communitiesAPI": "https://beta.services.openaire.eu/openaire/community/communities",
"csvLimit": 2000,
"pagingLimit": 20,
"resultsPerPage": 10,
"baseLink" :"",
"domain":"https://beta.connect.openaire.eu",
"afterLoginRedirectLink": "/myCommunities",
"searchLinkToPublication" : "/search/publication?articleId=",
"searchLinkToProject" : "/search/project?projectId=",
"searchLinkToDataProvider" : "/search/dataprovider?datasourceId=",
"searchLinkToDataset" : "/search/dataset?datasetId=",
"searchLinkToSoftwareLanding" : "/search/software?softwareId=",
"searchLinkToOrganization" : "/search/organization?organizationId=",
"searchLinkToOrp" : "/search/other?orpId=",
"searchLinkToCommunities" : "/search/find/communities",
"searchLinkToPublications" : "/search/find/publications",
"searchLinkToDataProviders" : "/search/find/dataproviders",
"searchLinkToProjects" : "/search/find/projects",
"searchLinkToDatasets" : "/search/find/datasets",
"searchLinkToSoftware" : "/search/find/software",
"searchLinkToOrps" : "/search/find/other",
"searchLinkToOrganizations" : "/search/find/organizations",
"searchLinkToCompatibleDataProviders" : "/search/content-providers",
"searchLinkToEntityRegistriesDataProviders" : "/search/entity-registries",
"searchLinkToEntityRegistriesDataProvidersTable" : "/search/entity-registries-table",
"searchLinkToJournals" : "/search/journals",
"searchLinkToJournalsTable" : "/search/journals-table",
"searchLinkToResults" : "/search/find/research-outcomes",
"searchLinkToAdvancedPublications" : "/search/advanced/publications",
"searchLinkToAdvancedProjects" : "/search/advanced/projects",
"searchLinkToAdvancedDatasets" : "/search/advanced/datasets",
"searchLinkToAdvancedSoftware" : "/search/advanced/software",
"searchLinkToAdvancedOrps" : "/search/advanced/other",
"searchLinkToAdvancedDataProviders" : "/search/advanced/dataproviders",
"searchLinkToAdvancedOrganizations" : "/search/advanced/organizations",
"searchLinkToAdvancedResults" : "/search/advanced/research-outcomes",
"lastIndexInformationLink" : "https://beta.openaire.eu/aggregation-and-content-provision-workflows",
"showLastIndexInformationLink" : true,
"widgetLink" : "https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=",
"claimsInformationLink": "https://beta.openaire.eu/linking",
"depositLearnHowPage": "/participate/deposit/learn-how",
"depositSearchPage": "/participate/deposit/search",
"shareInZenodoPage": "/participate/deposit/zenodo",
"reCaptchaSiteKey": "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P",
"admins" : ["rcd-helpdesk@openaire.eu"],
"lastIndexUpdate": "2020-05-06",
"indexInfoAPI": "https://beta.services.openaire.eu/openaire/info/",
"altMetricsAPIURL": "https://api.altmetric.com/v1/doi/",
"b2noteAPIURL": "http://b2note-dev.bsc.es/api/",
"adminPortalURL": "https://beta.admin.connect.openaire.eu"
}

View File

@ -1,51 +0,0 @@
#ATTENTION
#DON'T run it in svn folder - it REMOVES files
#Copy project in another location eg "deploy-folder"
#go to "deploy-folder/deploy"
#uncomment the proper commands
#run the script
# cp theproperties file according to the deploy environment!!!
## uncommect one of the following -->
# cp beta-properties.json ../src/assets/env-properties.json;
# cp production-properties.json ../src/assets/env-properties.json;
## uncommect from here-->
# printf '\nCheck that you have the correct properties file';
# echo -n "Press key:";
# read -n1 ans
# pico ../src/assets/env-properties.json;
# printf '\nCheck the properties file version';
# echo -n "Press key:";
# read -n1 ans
# pico ../src/app/openaireLibrary/utils/properties/environment-specific.service.ts;
# echo 'For Production keep meta for bots';
# printf '\n\nCheck index.html: For test and beta keep meta for noindex, for production remove noindex and keep meta for Search engines verification';
# printf '\nUpdate css/ js files version!';
# echo -n "Press key:";
# read -n1 ans
# echo -n "Pressed";
# pico ../src/index.html;
# pico ../src/app/utils/customization/customization.component.ts;
# echo -n 'Check Robots.txt: For test and beta add "Diasallow /", for production remove it!';
# echo -n "Press key:";
# read -n1 ans
# pico ../src/robots.txt;
# echo -n "Pressed";
# rm -rf ../src/assets/common-assets/.svn/;
# rm -rf ../src/app/openaireLibrary/.svn/;
# cd ..; npm run build:ssr; cd deploy;
# rm -rf ../src ../node_modules ../.idea/ ../installOpenaireLib.sh; cd ../; rm -rf deploy;
# echo 'Now copy to the server!'
##<-- to here
#Deploy instructions!
#copy "deploy-folder" in beta.connect.openaire.eu or connect.openaire.eu
#copies of previous deployments exist in "/home/argiro.kokogiannaki/connect-portal/connectYYYY-MM-DD"
#run "npm i"
#become nodejs user to be able to copy the files: "sudo su nodejs -s /bin/bash"
#check what is running "pm2 list"
#portal files exist in "/srv/www/portal/connect"
#copy deployment files to the portal folder "cp -r /home/argiro.kokogiannaki/connect-portal/connectYYYY-MM-DD/* /srv/www/portal/connect"
#restart portal to get the changes "pm2 restart connect"

View File

@ -1,127 +0,0 @@
{
"environment" : "production",
"dashboard" : "connect",
"enablePiwikTrack" : false,
"useCache" : true,
"showContent" : true,
"showAddThis" : false,
"metricsAPIURL" : "https://services.openaire.eu/usagestats/",
"framesAPIURL" : "https://www.openaire.eu/stats3/",
"statisticsAPIURL" : "https://services.openaire.eu/stats-api/",
"statisticsFrameAPIURL":"https://www.openaire.eu/stats/",
"statisticsFrameNewAPIURL": "https://services.openaire.eu/stats/",
"useNewStatistisTool":false,
"impactFactorsAPIURL" :"https://bip-api.imsi.athenarc.gr/paper/scores/batch/",
"claimsAPIURL" : "https://services.openaire.eu/claims/rest/claimsService/",
"searchAPIURLLAst" : "https://services.openaire.eu/search/v2/api/",
"searchResourcesAPIURL" : "https://services.openaire.eu/search/v2/api/resources",
"openCitationsAPIURL" : "https://services.openaire.eu/opencitations/getCitations?id=",
"csvAPIURL" : "https://services.openaire.eu/search/v2/api/reports",
"searchCrossrefAPIURL" : "https://api.crossref.org/works",
"searchDataciteAPIURL" : "https://api.datacite.org/works",
"searchOrcidURL" : "https://pub.orcid.org/v2.1/",
"orcidURL" : "https://orcid.org/",
"doiURL" : "https://dx.doi.org/",
"pmcURL": "http://europepmc.org/articles/",
"pmidURL": "https://www.ncbi.nlm.nih.gov/pubmed/",
"handleURL": "http://hdl.handle.net/",
"cordisURL" : "http://cordis.europa.eu/projects/",
"openDoarURL": "http://v2.sherpa.ac.uk/id/repository/",
"r3DataURL": "http://service.re3data.org/repository/",
"sherpaURL": "http://sherpa.ac.uk/romeo/issn/",
"sherpaURLSuffix": "/",
"zenodo" : "https://zenodo.org/",
"zenodoCommunities" : "https://zenodo.org/api/communities/",
"openAccess" : "https://www.openaire.eu/support/faq#article-id-234",
"openAccessRepo" : "https://www.openaire.eu/support/faq#article-id-310",
"fp7Guidlines" : "https://www.openaire.eu/open-access-in-fp7-seventh-research-framework-programme",
"h2020Guidlines" : "https://www.openaire.eu/oa-publications/h2020/open-access-in-horizon-2020",
"ercGuidlines" : "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf",
"helpdesk" : "https://www.openaire.eu/support/helpdesk",
"helpdeskEmail": "helpdesk@openaire.eu",
"utilsService" : "https://explore.openaire.eu/utils-service",
"vocabulariesAPI" :"https://services.openaire.eu/provision/mvc/vocabularies/",
"piwikBaseUrl" :"https://analytics.openaire.eu/piwik.php?idsite=",
"piwikSiteId" : "112",
"loginUrl" :"https://services.openaire.eu/_UPDATE_/openid_connect_login",
"userInfoUrl" : " https://services.openaire.eu/uoa-user-management/api/users/getUserInfo?accessToken=",
"logoutUrl" :"https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",
"cookieDomain" :".openaire.eu",
"feedbackmail" :"feedback@openaire.eu",
"cacheUrl" :"https://explore.openaire.eu/cache/get?url=",
"datasourcesAPI": "https://services.openaire.eu/openaire/ds/search/",
"adminToolsAPIURL" :"https://services.openaire.eu/uoa-admin-tools/",
"adminToolsCommunity" :"connect",
"contextsAPI":"https://services.openaire.eu/openaire/context",
"communityAPI": "https://services.openaire.eu/openaire/community/",
"communitiesAPI": "https://services.openaire.eu/openaire/community/communities",
"csvLimit": 2000,
"pagingLimit": 20,
"resultsPerPage": 10,
"baseLink" :"",
"domain": "https://connect.openaire.eu",
"afterLoginRedirectLink": "/myCommunities",
"searchLinkToPublication" : "/search/publication?articleId=",
"searchLinkToProject" : "/search/project?projectId=",
"searchLinkToDataProvider" : "/search/dataprovider?datasourceId=",
"searchLinkToDataset" : "/search/dataset?datasetId=",
"searchLinkToSoftwareLanding" : "/search/software?softwareId=",
"searchLinkToOrp" : "/search/other?orpId=",
"searchLinkToOrganization" : "/search/organization?organizationId=",
"searchLinkToCommunities" : "/search/find/communities",
"searchLinkToPublications" : "/search/find/publications",
"searchLinkToDataProviders" : "/search/find/dataproviders",
"searchLinkToProjects" : "/search/find/projects",
"searchLinkToDatasets" : "/search/find/datasets",
"searchLinkToSoftware" : "/search/find/software",
"searchLinkToOrps" : "/search/find/other",
"searchLinkToOrganizations" : "/search/find/organizations",
"searchLinkToCompatibleDataProviders" : "/search/content-providers",
"searchLinkToEntityRegistriesDataProviders" : "/search/entity-registries",
"searchLinkToEntityRegistriesDataProvidersTable" : "/search/entity-registries-table",
"searchLinkToJournals" : "/search/journals",
"searchLinkToJournalsTable" : "/search/journals-table",
"searchLinkToResults" : "/search/find/research-outcomes",
"searchLinkToAdvancedPublications" : "/search/advanced/publications",
"searchLinkToAdvancedProjects" : "/search/advanced/projects",
"searchLinkToAdvancedDatasets" : "/search/advanced/datasets",
"searchLinkToAdvancedSoftware" : "/search/advanced/software",
"searchLinkToAdvancedOrps" : "/search/advanced/other",
"searchLinkToAdvancedDataProviders" : "/search/advanced/dataproviders",
"searchLinkToAdvancedOrganizations" : "/search/advanced/organizations",
"searchLinkToAdvancedResults" : "/search/advanced/research-outcomes",
"lastIndexInformationLink" : "https://www.openaire.eu/aggregation-and-content-provision-workflows",
"showLastIndexInformationLink" : true,
"widgetLink" : "https://www.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=",
"claimsInformationLink": "https://www.openaire.eu/linking",
"depositLearnHowPage": "/participate/deposit/learn-how",
"depositSearchPage": "/participate/deposit/search",
"shareInZenodoPage": "/participate/deposit/zenodo",
"reCaptchaSiteKey": "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P",
"admins" : ["rcd-helpdesk@openaire.eu"],
"lastIndexUpdate": "2019-07-24",
"indexInfoAPI": "https://services.openaire.eu/openaire/info/",
"altMetricsAPIURL": "https://api.altmetric.com/v1/doi/",
"b2noteAPIURL": "http://b2note-dev.bsc.es/api/",
"adminPortalURL": "https://admin.connect.openaire.eu"
}

View File

@ -1,78 +1,72 @@
{ {
"name": "openaire-connect", "name": "connect",
"version": "1.0.0", "version": "1.0.0",
"license": "Openaire",
"contributors": [
"Argiro Kokogiannaki <argirok@di.uoa.gr>",
"Konstantina Galouni <kgalouni@di.uoa.gr>"
],
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": " ng serve --disable-host-check --host 0.0.0.0", "start": "ng serve --disable-host-check --host 0.0.0.0 --port 4200",
"start:ssr": "npm run build:ssr && npm run serve:ssr",
"start:prerender": "npm run build:prerender && npm run serve:prerender",
"start:ssr-beta": "npm run build:ssr-beta && npm run serve:ssr",
"start:prerender-beta": "npm run build:prerender-beta && npm run serve:prerender",
"start:ssr-dev": "npm run build:ssr-dev && npm run serve:ssr",
"start:prerender-dev": "npm run build:prerender-dev && npm run serve:prerender",
"build": "ng build", "build": "ng build",
"build:client-and-server-bundles": "ng build --prod --stats-json=true && ng run ng-universal-demo:server:production", "build-dev": "ng build --configuration=development",
"build:client-and-server-bundles-beta": "ng build --configuration=beta --stats-json=true && ng run ng-universal-demo:server:beta", "build-beta": "ng build --configuration=beta",
"build:client-and-server-bundles-dev": "ng build --configuration=development --stats-json=true && ng run ng-universal-demo:server:development", "build-prod": "ng build --prod",
"build:prerender": "npm run build:client-and-server-bundles && npm run webpack:server && npm run generate:prerender", "webpack-bundle-analyzer": "ng build --stats-json && webpack-bundle-analyzer dist/connect/browser/stats.json --host 0.0.0.0",
"build:ssr": "npm run build:client-and-server-bundles && npm run webpack:server", "test": "ng test",
"build:prerender-beta": "npm run build:client-and-server-bundles-beta && npm run webpack:server && npm run generate:prerender", "e2e": "ng e2e",
"build:ssr-beta": "npm run build:client-and-server-bundles-beta && npm run webpack:server", "dev:ssr": "ng run connect:serve-ssr",
"build:prerender-dev": "npm run build:client-and-server-bundles-dev && npm run webpack:server && npm run generate:prerender", "serve:ssr": "node dist/connect/server/main.js",
"build:ssr-dev": "npm run build:client-and-server-bundles-dev && npm run webpack:server", "build:ssr-dev": "npm run build-dev && ng run connect:server:development",
"generate:prerender": "cd dist && node prerender", "build:ssr-beta": "npm run build-beta && ng run connect:server:beta",
"webpack:server": "webpack --config webpack.server.config.js --progress --colors", "build:ssr-prod": "npm run build-prod && ng run connect:server:production",
"serve:prerender": "cd dist/browser && http-server", "prerender": "ng run connect:prerender",
"serve:ssr": "node dist/server", "postinstall": "chmod +x clean-library.sh && ./clean-library.sh",
"after-build-clean": "rm -rf src node_modules .idea/ installOpenaireLib.sh deploy dist/browser/assets/common-assets/.svn/ dist/browser/stats.json ; " "after-build-clean": "rm -rf dist/connect/browser/assets/common-assets/.svn/ src/app/openaireLibrary/.svn node_modules src/assets/common-assets/.svn/"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "^7.2.14", "@angular/animations": "~11.2.14",
"@angular/cdk": "^7.3.7", "@angular/cdk": "^11.2.13",
"@angular/common": "7.2.14", "@angular/common": "~11.2.14",
"@angular/compiler": "7.2.14", "@angular/compiler": "~11.2.14",
"@angular/core": "7.2.14", "@angular/core": "~11.2.14",
"@angular/forms": "7.2.14", "@angular/forms": "~11.2.14",
"@angular/http": "7.2.14", "@angular/localize": "^11.2.14",
"@angular/material": "^7.3.7", "@angular/material": "^11.2.13",
"@angular/platform-browser": "7.2.14", "@angular/platform-browser": "~11.2.14",
"@angular/platform-browser-dynamic": "7.2.14", "@angular/platform-browser-dynamic": "~11.2.14",
"@angular/platform-server": "7.2.14", "@angular/platform-server": "~11.2.14",
"@angular/router": "7.2.14", "@angular/router": "~11.2.14",
"@nguniversal/express-engine": "^6.0.0", "@nguniversal/express-engine": "^11.2.1",
"@nguniversal/module-map-ngfactory-loader": "^6.0.0",
"@types/express": "^4.16.1",
"clipboard": "^1.5.16", "clipboard": "^1.5.16",
"core-js": "^2.4.1", "core-js": "^2.5.4",
"express": "^4.15.2",
"jquery": "^3.4.1", "jquery": "^3.4.1",
"ngx-json-ld": "0.1.6", "ng-recaptcha": "^7.0.1",
"prom-client": "^11.3.0", "ng2-ckeditor": "1.3.1",
"rxjs": "^6.5.1",
"ts-md5": "^1.2.0", "ts-md5": "^1.2.0",
"tslib": "^1.9.0", "tslib": "^2.0.0",
"zone.js": "^0.8.26", "zone.js": "~0.10.2"
"ng-recaptcha": "^3.0.5",
"ng2-ckeditor": "1.1.9"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~0.13.0", "@angular-devkit/build-angular": "~0.1102.14",
"@angular/cli": "^7.3.9", "@angular/cli": "~11.2.14",
"@angular/compiler-cli": "7.2.14", "@angular/compiler-cli": "~11.2.14",
"@angular/language-service": "7.2.14", "@angular/language-service": "~11.2.14",
"@types/jquery": "^3.3.29", "@nguniversal/builders": "^11.2.1",
"@types/node": "^8.0.30", "@types/node": "^12.11.1",
"cpy-cli": "^1.0.1", "@types/jasmine": "~3.6.0",
"http-server": "^0.10.0", "@types/jasminewd2": "~2.0.3",
"reflect-metadata": "^0.1.10", "@types/express": "^4.17.0",
"rxjs": "6.5.1", "@types/compression": "^1.7.0",
"rxjs-compat": "^6.5.1", "codelyzer": "^6.0.0",
"ts-loader": "^4.2.0", "jasmine-core": "~3.8.0",
"typescript": "3.2.4", "jasmine-spec-reporter": "~5.0.0",
"webpack-cli": "^3.3.2" "karma": "~6.3.3",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.6.0",
"protractor": "~7.0.0",
"ts-node": "~7.0.0",
"typescript": "~4.0.7"
} }
} }

View File

@ -1,45 +0,0 @@
// Load zone.js for the server.
import 'zone.js/dist/zone-node';
import 'reflect-metadata';
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
import { join } from 'path';
import { enableProdMode } from '@angular/core';
// Faster server renders w/ Prod mode (dev mode never needed)
enableProdMode();
// Express Engine
import { ngExpressEngine } from '@nguniversal/express-engine';
// Import module map for lazy loading
import { provideModuleMap } from '@nguniversal/module-map-ngfactory-loader';
import { renderModuleFactory } from '@angular/platform-server';
import { ROUTES } from './static.paths';
// * NOTE :: leave this as require() since this file is built Dynamically from webpack
const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require('./dist/server/main');
const BROWSER_FOLDER = join(process.cwd(), 'browser');
// Load the index.html file containing referances to your application bundle.
const index = readFileSync(join('browser', 'index.html'), 'utf8');
let previousRender = Promise.resolve();
// Iterate each route path
ROUTES.forEach(route => {
const fullPath = join(BROWSER_FOLDER, route);
// Make sure the directory structure is there
if(!existsSync(fullPath)){
mkdirSync(fullPath);
}
// Writes rendered HTML to index.html, replacing the file if it already exists.
previousRender = previousRender.then(_ => renderModuleFactory(AppServerModuleNgFactory, {
document: index,
url: route,
extraProviders: [
provideModuleMap(LAZY_MODULE_MAP)
]
})).then(html => writeFileSync(join(fullPath, 'index.html'), html));
});

217
server.ts
View File

@ -1,86 +1,48 @@
import 'zone.js/dist/zone-node'; import 'zone.js/dist/zone-node';
import 'reflect-metadata';
import { renderModuleFactory } from '@angular/platform-server';
import { enableProdMode } from '@angular/core';
import {ngExpressEngine} from '@nguniversal/express-engine';
import * as express from 'express'; import * as express from 'express';
import { join } from 'path'; import * as compression from 'compression';
import { readFileSync } from 'fs'; import {join} from 'path';
// Faster server renders w/ Prod mode (dev mode never needed) import {AppServerModule} from './src/main.server';
enableProdMode(); import {APP_BASE_HREF} from '@angular/common';
import {existsSync} from 'fs';
// Express server import {REQUEST, RESPONSE} from "./src/app/openaireLibrary/utils/tokens";
const app = express();
const PORT = process.env.PORT || 4000;
const DIST_FOLDER = join(process.cwd(), 'dist');
// Our index.html we'll use as our template
const template = readFileSync(join(DIST_FOLDER, 'browser', 'index.html')).toString();
// * NOTE :: leave this as require() since this file is built Dynamically from webpack
const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require('./dist/server/main');
// Express Engine
import {ngExpressEngine, RenderOptions} from '@nguniversal/express-engine';
// Import module map for lazy loading
import { provideModuleMap } from '@nguniversal/module-map-ngfactory-loader';
import {REQUEST, RESPONSE} from "@nguniversal/express-engine/tokens";
import {isArray} from "util"; import {isArray} from "util";
// Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine) // The Express app is exported so that it can be used by serverless Functions.
// app.engine('html', ngExpressEngine({ export function app() {
// bootstrap: AppServerModuleNgFactory, const server = express();
// providers: [ server.use(compression());
// { provide: 'request', useFactory: () => options.req, deps: [] }, const distFolder = join(process.cwd(), 'dist/connect/browser');
// provideModuleMap(LAZY_MODULE_MAP) const indexHtml = existsSync(join(distFolder, 'index.original.html')) ? 'index.original.html' : 'index';
// ]
// }));
// be able to get request and get domain from there // Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine)
server.engine('html', ngExpressEngine({
bootstrap: AppServerModule,
}));
app.engine('html', (_, options: any, callback) => { server.set('view engine', 'html');
const opts = { server.set('views', distFolder);
document: template,
url: options.req.url,
extraProviders: [
provideModuleMap(LAZY_MODULE_MAP),
{
provide: REQUEST,
useValue: options.req
},
{
provide: RESPONSE,
useValue: options.req.res,
},
]
};
renderModuleFactory(AppServerModuleNgFactory, opts) server.use(function (req, res, next) {
.then(html => callback(null, html) var XFRAME_WHITELIST = [ 'http://spitoo.di.uoa.gr:5000/','http://scoobydoo.di.uoa.gr:5000/', 'https://beta.admin.connect.openaire.eu/','https://admin.connect.openaire.eu/' ];
); let referer: string;
}); if(req.headers.referer){
referer = isArray(req.headers.referer)?req.headers.referer[0]:(<string>req.headers.referer);
referer = referer.split("?")[0];
}
if ( referer && (XFRAME_WHITELIST.indexOf(referer) != -1 || referer.indexOf("/customize-layout") !=-1 || referer.indexOf(".d4science.org") != -1)) {
// res.header('X-FRAME-OPTIONS', 'allow from ' +req.headers.referer);
}else {
res.header('X-FRAME-OPTIONS', 'SAMEORIGIN');
}
next();
});
app.set('view engine', 'html'); // - Serve sitemap based on the host -
app.set('views', join(DIST_FOLDER, 'browser')); server.get('/sitemap.xml', (req, res) => {
// Allow frames from specific domains
app.use(function (req, res, next) {
var XFRAME_WHITELIST = [ 'http://spitoo.di.uoa.gr:5000/','http://scoobydoo.di.uoa.gr:5000/', 'https://beta.admin.connect.openaire.eu/','https://admin.connect.openaire.eu/' ];
let referer: string;
if(req.headers.referer){
referer = isArray(req.headers.referer)?req.headers.referer[0]:(<string>req.headers.referer);
referer = referer.split("?")[0];
}
if ( referer && (XFRAME_WHITELIST.indexOf(referer) != -1 || referer.indexOf("/customize-layout") !=-1 || referer.indexOf(".d4science.org") != -1)) {
// res.header('X-FRAME-OPTIONS', 'allow from ' +req.headers.referer);
}else {
res.header('X-FRAME-OPTIONS', 'SAMEORIGIN');
}
next();
});
// - Serve sitemap based on the host -
app.get('/sitemap.xml', (req, res) => {
let host = req.get("host").split(":")[0]; let host = req.get("host").split(":")[0];
let connectLinks= ["/","/about/learn-how","/about/learn-in-depth", "/about/faq","/search/find/communities"]; let connectLinks= ["/","/about/learn-how","/about/learn-in-depth", "/about/faq","/search/find/communities"];
let communityLinks= ["/","/search/find/research-outcomes?size=20","/search/advanced/research-outcomes?size=20","/participate/deposit/learn-how","/organizations", "/content"]; let communityLinks= ["/","/search/find/research-outcomes?size=20","/search/advanced/research-outcomes?size=20","/participate/deposit/learn-how","/organizations", "/content"];
@ -92,52 +54,85 @@ app.use(function (req, res, next) {
" </url>"; " </url>";
for(let link of (host.indexOf("connect.openaire.eu") == -1 ?communityLinks:connectLinks)){ for(let link of (host.indexOf("connect.openaire.eu") == -1 ?communityLinks:connectLinks)){
sitemap += urlPre + "https://" + host + link + urlSuf; sitemap += urlPre + "https://" + host + link + urlSuf;
} }
sitemap += "\n</urlset>"; sitemap += "\n</urlset>";
res.setHeader('content-type', 'application/xml'); res.setHeader('content-type', 'application/xml');
res.send( sitemap); res.send( sitemap);
}); });
app.get('/robots.txt', (req, res) => {
let host = req.get("host").split(":")[0];
let robots = "";
if(host.indexOf(".openaire.eu") != -1 && host.indexOf("beta.") == -1 ){
//link to disallow
let connectLinks= ["/about/*","/search/find/communities"];
let communityLinks= ["/search/advanced/*","/participate/*",
"/search/project",'/search/result', '/search/publication', '/search/dataset','/search/software','/search/other','/search/dataprovider','/search/organization','/project-report',
'/search/find/publications','/search/find/datasets','/search/find/software','/search/find/other','/search/find/projects','/search/find/dataproviders','/search/find/research-outcomes'
]; // - Serve robots based on the host -
server.get('/robots.txt', (req, res) => {
let host = req.get("host").split(":")[0];
let robots = "";
if (host.indexOf(".openaire.eu") != -1 && host.indexOf("beta.") == -1) {
//link to disallow
let connectLinks = ["/about/*", "/search/find/communities"];
let communityLinks = ["/search/advanced/*", "/participate/*",
"/search/project", '/search/result', '/search/publication', '/search/dataset', '/search/software', '/search/other', '/search/dataprovider', '/search/organization', '/project-report',
'/search/find/publications', '/search/find/datasets', '/search/find/software', '/search/find/other', '/search/find/projects', '/search/find/dataproviders', '/search/find/research-outcomes'
robots = "User-Agent: *\n"+ ];
"Crawl-delay: 30\n" + robots = "User-Agent: *\n" +
"Sitemap: /sitemap.xml\n"; "Crawl-delay: 30\n" +
for(let link of (host.indexOf("connect.openaire.eu") == -1 ?connectLinks:communityLinks)){ "Sitemap: /sitemap.xml\n";
robots += "Disallow: " + link + "\n"; for (let link of (host.indexOf("connect.openaire.eu") == -1 ? connectLinks : communityLinks)) {
robots += "Disallow: " + link + "\n";
}
} else {
robots = "User-Agent: *\n" +
"Disallow: /\n"
} }
}else{ res.setHeader('content-type', 'text/plain');
robots = "User-Agent: *\n" + res.send(robots);
"Disallow: /\n" });
}
res.setHeader('content-type', 'text/plain');
res.send( robots);
});
/* - Example Express Rest API endpoints - // Example Express Rest API endpoints
app.get('/api/**', (req, res) => { }); // server.get('/api/**', (req, res) => { });
*/ // Serve static files from /browser
server.get('*.*', express.static(distFolder, {
maxAge: '1y'
}));
// Server static files from /browser // All regular routes use the Universal engine
app.get('*.*', express.static(join(DIST_FOLDER, 'browser'), { server.get('*', (req, res) => {
maxAge: '1y' res.render(indexHtml, {
})); req, providers: [
{
provide: APP_BASE_HREF,
useValue: req.baseUrl
},
{
provide: REQUEST, useValue: (req)
},
{
provide: RESPONSE, useValue: (res)
}
]
}
);
});
// ALl regular routes use the Universal engine return server;
app.get('*', (req, res) => { }
res.render('index', { req });
});
// Start up the Node server function run() {
app.listen(PORT, () => { const port = process.env.PORT || 4000;
console.log(`Node Express server listening on http://localhost:${PORT}`);
}); // Start up the Node server
const server = app();
server.listen(port, () => {
console.log(`Node Express server listening on http://localhost:${port}`);
});
}
// Webpack will replace 'require' with '__webpack_require__'
// '__non_webpack_require__' is a proxy to Node 'require'
// The below code is to ensure that the server is run only when not requiring the bundle.
declare const __non_webpack_require__: NodeRequire;
const mainModule = __non_webpack_require__.main;
const moduleFilename = mainModule && mainModule.filename || '';
if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
run();
}
export * from './src/main.server';

View File

@ -6,94 +6,94 @@ import {IsCommunity} from "./openaireLibrary/connect/communityGuard/isCommunity.
const routes: Routes = [ const routes: Routes = [
// ORCID Pages // ORCID Pages
{path: 'orcid', loadChildren: './orcid/orcid.module#LibOrcidModule'}, {path: 'orcid', loadChildren: () => import('./orcid/orcid.module').then(m => m.LibOrcidModule)},
{path: 'my-orcid-links', loadChildren: './orcid/my-orcid-links/myOrcidLinks.module#LibMyOrcidLinksModule'}, {path: 'my-orcid-links', loadChildren: () => import('./orcid/my-orcid-links/myOrcidLinks.module').then(m => m.LibMyOrcidLinksModule)},
/** Other Pages */ /** Other Pages */
{path: '', loadChildren: './communitywrapper/communityWrapper.module#CommunityWrapperModule'}, {path: '', loadChildren: () => import('./communitywrapper/communityWrapper.module').then(m => m.CommunityWrapperModule)},
{path: 'about', redirectTo: 'about/learn-how', pathMatch: 'full'}, {path: 'about', redirectTo: 'about/learn-how', pathMatch: 'full'},
{path: 'about/learn-how', loadChildren: './learn-how/learn-how.module#LearnHowModule'}, {path: 'about/learn-how', loadChildren: () => import('./learn-how/learn-how.module').then(m => m.LearnHowModule)},
{path: 'about/learn-in-depth', loadChildren: './learn-how/learnInDepth/learn-in-depth.module#LearnInDepthModule'}, {path: 'about/learn-in-depth', loadChildren: () => import('./learn-how/learnInDepth/learn-in-depth.module').then(m => m.LearnInDepthModule)},
{path: 'about/faq', loadChildren: './learn-how/faqs/faqs.module#FaqsModule'}, {path: 'about/faq', loadChildren: () => import('./learn-how/faqs/faqs.module').then(m => m.FaqsModule)},
{path: 'contact-us', loadChildren: './contact/contact.module#ContactModule'}, {path: 'contact-us', loadChildren: () => import('./contact/contact.module').then(m => m.ContactModule)},
{path: 'invite', loadChildren: './utils/subscribe/invite/invite.module#InviteModule'}, {path: 'invite', loadChildren: () => import('./utils/subscribe/invite/invite.module').then(m => m.InviteModule)},
{path: 'content', loadChildren: './content/contentPage.module#ContentPageModule', canActivate: [IsCommunity]}, {path: 'content', loadChildren: () => import('./content/contentPage.module').then(m => m.ContentPageModule), canActivate: [IsCommunity]},
{ {
path: 'organizations', path: 'organizations',
loadChildren: './htmlPages/organizations/organizationsPage.module#OrganizationsPageModule', loadChildren: () => import('./htmlPages/organizations/organizationsPage.module').then(m => m.OrganizationsPageModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'publications', path: 'publications',
loadChildren: './htmlPages/publications/publications-page.module#PublicationsPageModule', loadChildren: () => import('./htmlPages/publications/publications-page.module').then(m => m.PublicationsPageModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'projects', path: 'projects',
loadChildren: './htmlPages/projects/projectsPage.module#ProjectsPageModule', loadChildren: () => import('./htmlPages/projects/projectsPage.module').then(m => m.ProjectsPageModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'national-bulletins', path: 'national-bulletins',
loadChildren: './htmlPages/nationalBulletins/nationalBulletinsPage.module#NaionalBulletinPageModule', loadChildren: () => import('./htmlPages/nationalBulletins/nationalBulletinsPage.module').then(m => m.NaionalBulletinPageModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{path: 'curators', loadChildren: './curators/curators.module#CuratorsModule', canActivate: [IsCommunity]}, {path: 'curators', loadChildren: () => import('./curators/curators.module').then(m => m.CuratorsModule), canActivate: [IsCommunity]},
{path: 'subjects', loadChildren: './subjects/subjects.module#SubjectsModule', canActivate: [IsCommunity]}, {path: 'subjects', loadChildren: () => import('./subjects/subjects.module').then(m => m.SubjectsModule), canActivate: [IsCommunity]},
{path: 'myCommunities', loadChildren: './my-communities/my-communities.module#MyCommunitiesModule'}, {path: 'myCommunities', loadChildren: () => import('./my-communities/my-communities.module').then(m => m.MyCommunitiesModule)},
/** Testing Page for help contents */ /** Testing Page for help contents */
{path: 'helper-test', loadChildren: './helper-test/helper-test.module#HelperTestModule'}, {path: 'helper-test', loadChildren: () => import('./helper-test/helper-test.module').then(m => m.HelperTestModule)},
/** Landing Pages */ /** Landing Pages */
{ {
path: 'search/result', path: 'search/result',
loadChildren: './landingPages/result/libResult.module#LibResultModule', loadChildren: () => import('./landingPages/result/libResult.module').then(m => m.LibResultModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'search/publication', path: 'search/publication',
loadChildren: './landingPages/publication/libPublication.module#LibPublicationModule', loadChildren: () => import('./landingPages/publication/libPublication.module').then(m => m.LibPublicationModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'search/dataset', path: 'search/dataset',
loadChildren: './landingPages/dataset/libDataset.module#LibDatasetModule', loadChildren: () => import('./landingPages/dataset/libDataset.module').then(m => m.LibDatasetModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'search/software', path: 'search/software',
loadChildren: './landingPages/software/libSoftware.module#LibSoftwareModule', loadChildren: () => import('./landingPages/software/libSoftware.module').then(m => m.LibSoftwareModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{path: 'search/other', loadChildren: './landingPages/orp/libOrp.module#LibOrpModule', canActivate: [IsCommunity]}, {path: 'search/other', loadChildren: () => import('./landingPages/orp/libOrp.module').then(m => m.LibOrpModule), canActivate: [IsCommunity]},
{ {
path: 'search/project', path: 'search/project',
loadChildren: './landingPages/project/libProject.module#LibProjectModule', loadChildren: () => import('./landingPages/project/libProject.module').then(m => m.LibProjectModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'search/dataprovider', path: 'search/dataprovider',
loadChildren: '././landingPages/dataProvider/libDataProvider.module#LibDataProviderModule', loadChildren: () => import('././landingPages/dataProvider/libDataProvider.module').then(m => m.LibDataProviderModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'search/organization', path: 'search/organization',
loadChildren: './landingPages/organization/libOrganization.module#LibOrganizationModule', loadChildren: () => import('./landingPages/organization/libOrganization.module').then(m => m.LibOrganizationModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'project-report', path: 'project-report',
loadChildren: './landingPages/htmlProjectReport/libHtmlProjectReport.module#LibHtmlProjectReportModule' loadChildren: () => import('./landingPages/htmlProjectReport/libHtmlProjectReport.module').then(m => m.LibHtmlProjectReportModule)
}, },
/** Search Pages */ /** Search Pages */
{path: 'search/find', redirectTo: 'search/find/research-outcomes', pathMatch: 'full'}, {path: 'search/find', redirectTo: 'search/find/research-outcomes', pathMatch: 'full'},
{ {
path: 'search/find/communities', path: 'search/find/communities',
loadChildren: './searchPages/communities/searchCommunities.module#SearchCommunitiesModule' loadChildren: () => import('./searchPages/communities/searchCommunities.module').then(m => m.SearchCommunitiesModule)
}, },
{ {
path: 'search/find/research-outcomes', path: 'search/find/research-outcomes',
loadChildren: './searchPages/simple/searchResearchResults.module#OpenaireSearchResearchResultsModule', loadChildren: () => import('./searchPages/simple/searchResearchResults.module').then(m => m.OpenaireSearchResearchResultsModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{path: 'search/find/publications', component: PageURLResolverComponent, canActivate: [IsCommunity]}, {path: 'search/find/publications', component: PageURLResolverComponent, canActivate: [IsCommunity]},
@ -102,18 +102,18 @@ const routes: Routes = [
{path: 'search/find/other', component: PageURLResolverComponent, canActivate: [IsCommunity]}, {path: 'search/find/other', component: PageURLResolverComponent, canActivate: [IsCommunity]},
{ {
path: 'search/find/projects', path: 'search/find/projects',
loadChildren: './searchPages/simple/searchProjects.module#LibSearchProjectsModule', loadChildren: () => import('./searchPages/simple/searchProjects.module').then(m => m.LibSearchProjectsModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'search/find/dataproviders', path: 'search/find/dataproviders',
loadChildren: './searchPages/simple/searchDataProviders.module#LibSearchDataProvidersModule', loadChildren: () => import('./searchPages/simple/searchDataProviders.module').then(m => m.LibSearchDataProvidersModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
/** Advanced Search Pages */ /** Advanced Search Pages */
{ {
path: 'search/advanced/research-outcomes', path: 'search/advanced/research-outcomes',
loadChildren: './searchPages/advanced/searchResearchResults.module#OpenaireAdvancedSearchResearchResultsModule', loadChildren: () => import('./searchPages/advanced/searchResearchResults.module').then(m => m.OpenaireAdvancedSearchResearchResultsModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{path: 'search/advanced/publications', component: PageURLResolverComponent, canActivate: [IsCommunity]}, {path: 'search/advanced/publications', component: PageURLResolverComponent, canActivate: [IsCommunity]},
@ -122,100 +122,81 @@ const routes: Routes = [
{path: 'search/advanced/other', component: PageURLResolverComponent, canActivate: [IsCommunity]}, {path: 'search/advanced/other', component: PageURLResolverComponent, canActivate: [IsCommunity]},
{ {
path: 'search/advanced/organizations', path: 'search/advanced/organizations',
loadChildren: './searchPages/advanced/advancedSearchOrganizations.module#LibAdvancedSearchOrganizationsModule', loadChildren: () => import('./searchPages/advanced/advancedSearchOrganizations.module').then(m => m.LibAdvancedSearchOrganizationsModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'search/advanced/dataproviders', path: 'search/advanced/dataproviders',
loadChildren: './searchPages/advanced/advancedSearchDataProviders.module#LibAdvancedSearchDataProvidersModule', loadChildren: () => import('./searchPages/advanced/advancedSearchDataProviders.module').then(m => m.LibAdvancedSearchDataProvidersModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'search/advanced/projects', path: 'search/advanced/projects',
loadChildren: './searchPages/advanced/advancedSearchProjects.module#LibAdvancedSearchProjectsModule', loadChildren: () => import('./searchPages/advanced/advancedSearchProjects.module').then(m => m.LibAdvancedSearchProjectsModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
/** Deposit Pages */ /** Deposit Pages */
{ { path: 'participate/deposit-datasets',
path: 'participate/deposit-datasets',
redirectTo: 'participate/deposit/learn-how', redirectTo: 'participate/deposit/learn-how',
pathMatch: 'full', pathMatch: 'full' },
canActivate: [IsCommunity] { path: 'participate/deposit-datasets-result',
},
{
path: 'participate/deposit-datasets-result',
redirectTo: 'participate/deposit/learn-how', redirectTo: 'participate/deposit/learn-how',
pathMatch: 'full', pathMatch: 'full' },
canActivate: [IsCommunity] { path: 'participate/deposit-subject-result',
},
{
path: 'participate/deposit-subject-result',
redirectTo: 'participate/deposit/learn-how', redirectTo: 'participate/deposit/learn-how',
pathMatch: 'full', pathMatch: 'full' },
canActivate: [IsCommunity] { path: 'participate/deposit-publications',
},
{
path: 'participate/deposit-publications',
redirectTo: 'participate/deposit/learn-how', redirectTo: 'participate/deposit/learn-how',
pathMatch: 'full', pathMatch: 'full' },
canActivate: [IsCommunity] { path: 'participate/deposit-publications-result',
},
{
path: 'participate/deposit-publications-result',
redirectTo: 'participate/deposit/learn-how', redirectTo: 'participate/deposit/learn-how',
pathMatch: 'full', pathMatch: 'full' },
canActivate: [IsCommunity] { path: 'participate/share-zenodo',
},
{
path: 'participate/share-zenodo',
redirectTo: '/participate/deposit/zenodo', redirectTo: '/participate/deposit/zenodo',
pathMatch: 'full', pathMatch: 'full' },
canActivate: [IsCommunity]
},
{ {
path: 'participate/deposit/learn-how', path: 'participate/deposit/learn-how',
loadChildren: './deposit/deposit.module#LibDepositModule', loadChildren: () => import('./deposit/deposit.module').then(m => m.LibDepositModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'participate/deposit/search', path: 'participate/deposit/search',
loadChildren: './deposit/searchDataprovidersToDeposit.module#LibSearchDataprovidersToDepositModule', loadChildren: () => import('./deposit/searchDataprovidersToDeposit.module').then(m => m.LibSearchDataprovidersToDepositModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'participate/deposit/zenodo', path: 'participate/deposit/zenodo',
loadChildren: './deposit/zenodo/shareInZenodo.module#ShareInZenodoModule', loadChildren: () => import('./deposit/zenodo/shareInZenodo.module').then(m => m.ShareInZenodoModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
/** Linking Pages */ /** Linking Pages */
{path: 'myclaims', loadChildren: './claims/myClaims/myClaims.module#LibMyClaimsModule', canActivate: [IsCommunity]}, {path: 'myclaims', loadChildren: () => import('./claims/myClaims/myClaims.module').then(m => m.LibMyClaimsModule), canActivate: [IsCommunity]},
{ {
path: 'participate/claim', path: 'participate/claim',
loadChildren: './claims/linking/linkingGeneric.module#LibLinkingGenericModule', loadChildren: () => import('./claims/linking/linkingGeneric.module').then(m => m.LibLinkingGenericModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'participate/direct-claim', path: 'participate/direct-claim',
loadChildren: './claims/directLinking/directLinking.module#LibDirectLinkingModule', loadChildren: () => import('./claims/directLinking/directLinking.module').then(m => m.LibDirectLinkingModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
{ {
path: 'preview', path: 'preview',
loadChildren: './demo/demo.module#DemoModule', loadChildren: () => import('./demo/demo.module').then(m => m.DemoModule),
canActivate: [IsCommunity] canActivate: [IsCommunity]
}, },
/** help pages - do not exist in Admin portal/api/db */ /** help pages - do not exist in Admin portal/api/db */
{path: 'reload', loadChildren: './reload/libReload.module#LibReloadModule'}, {path: 'reload', loadChildren: () => import('./reload/libReload.module').then(m => m.LibReloadModule)},
{path: 'user-info', loadChildren: './login/libUser.module#LibUserModule'}, {path: 'user-info', loadChildren: () => import('./login/libUser.module').then(m => m.LibUserModule)},
{path: 'error', component: OpenaireErrorPageComponent}, {path: 'error', component: OpenaireErrorPageComponent},
{path: 'theme', loadChildren: './openaireLibrary/utils/theme/theme.module#ThemeModule'}, {path: 'theme', loadChildren: () => import('./openaireLibrary/utils/theme/theme.module').then(m => m.ThemeModule)},
{path: '**', pathMatch: 'full', component: OpenaireErrorPageComponent} {path: '**', pathMatch: 'full', component: OpenaireErrorPageComponent}
]; ];
@NgModule({ @NgModule({
imports: [RouterModule.forRoot(routes, { imports: [RouterModule.forRoot(routes, {
onSameUrlNavigation: "reload", onSameUrlNavigation: "reload"
relativeLinkResolution: 'corrected'
})], })],
exports: [RouterModule] exports: [RouterModule]
}) })

View File

@ -183,8 +183,6 @@ export class AppComponent {
this.layout = new CustomizationOptions(CustomizationOptions.getIdentity(communityId).mainColor, CustomizationOptions.getIdentity(communityId).secondaryColor); this.layout = new CustomizationOptions(CustomizationOptions.getIdentity(communityId).mainColor, CustomizationOptions.getIdentity(communityId).secondaryColor);
} }
); );
}else{
this.layout = new CustomizationOptions(CustomizationOptions.getIdentity(communityId).mainColor, CustomizationOptions.getIdentity(communityId).secondaryColor);
} }
} }
public buildMenu(communityId: string) { public buildMenu(communityId: string) {
@ -328,7 +326,7 @@ export class AppComponent {
}); });
this.menuItems.push({ this.menuItems.push({
rootItem: new MenuItem("communities", "Communities", restrictedData ? url + "/about/faq" : "", restrictedData ? "" : "/search/find/communities", false, [], ['/search/find/communities'], {}), rootItem: new MenuItem("communities", "Communities", restrictedData ? url + "/search/find/communities" : "", restrictedData ? "" : "/search/find/communities", false, [], ['/search/find/communities'], {}),
items: [] items: []
}); });
this.menuItems.push({ this.menuItems.push({

View File

@ -41,7 +41,7 @@ import {RoleVerificationModule} from "./openaireLibrary/role-verification/role-v
CookieLawModule, CookieLawModule,
CustomizationModule, CustomizationModule,
SubscribeModule.forRoot(), InviteBasicModule, SubscribeModule.forRoot(), InviteBasicModule,
BrowserModule.withServerTransition({appId: 'my-app'}), BrowserModule.withServerTransition({ appId: 'serverApp' }),
AppRoutingModule, AppRoutingModule,
BrowserTransferStateModule, BrowserTransferStateModule,
BrowserAnimationsModule, BrowserAnimationsModule,

View File

@ -1,21 +1,15 @@
import {NgModule} from '@angular/core'; import { NgModule } from '@angular/core';
import {ServerModule, ServerTransferStateModule} from '@angular/platform-server'; import {ServerModule, ServerTransferStateModule} from '@angular/platform-server';
import {ModuleMapLoaderModule} from '@nguniversal/module-map-ngfactory-loader';
import {AppModule} from './app.module'; import { AppModule } from './app.module';
import {AppComponent} from './app.component'; import { AppComponent } from './app.component';
@NgModule({ @NgModule({
imports: [ imports: [
// The AppServerModule should import your AppModule followed
// by the ServerModule from @angular/platform-server.
AppModule, AppModule,
ServerModule, ServerModule,
ModuleMapLoaderModule,
ServerTransferStateModule ServerTransferStateModule
], ],
// Since the bootstrapped component is not inherited from your
// imported AppModule, it needs to be repeated here.
bootstrap: [AppComponent], bootstrap: [AppComponent],
}) })
export class AppServerModule {} export class AppServerModule {}

View File

@ -18,7 +18,7 @@ export class BrowseCommunityComponent {
@Input() public community: CommunityInfo = null; @Input() public community: CommunityInfo = null;
@Input() public showDescription: boolean = true; @Input() public showDescription: boolean = true;
@Input() public smallTitle: boolean = false; @Input() public smallTitle: boolean = false;
@ViewChild('AlertModal') modal; @ViewChild('AlertModal', { static: true }) modal;
public hiddenMessage: string = "Community is hidden to registered users. It is visible only to users that have privileges to manage community; delay: 100"; public hiddenMessage: string = "Community is hidden to registered users. It is visible only to users that have privileges to manage community; delay: 100";
// cut title too // cut title too

View File

@ -93,9 +93,6 @@ export class CommunityComponent {
shareInZenodoPage: string = null; shareInZenodoPage: string = null;
public routerHelper: RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
private user: User; private user: User;
@ViewChild(SubscribeComponent) subscribeComponent: SubscribeComponent = null;
//Search Form
selectedEntity; selectedEntity;
selectedEntitySimpleUrl; selectedEntitySimpleUrl;
selectedEntityAdvancedUrl; selectedEntityAdvancedUrl;

View File

@ -22,7 +22,7 @@ import {SearchResultsModule} from "../openaireLibrary/searchPages/searchUtils/se
import {CuratorsModule} from "../curators/curators.module"; import {CuratorsModule} from "../curators/curators.module";
import {AffiliationsModule} from "../affiliations/affiliations.module"; import {AffiliationsModule} from "../affiliations/affiliations.module";
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module"; import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
import {MatSelectModule} from "@angular/material"; import { MatSelectModule } from "@angular/material/select";
import {EntitiesSelectionModule} from "../openaireLibrary/searchPages/searchUtils/entitiesSelection.module"; import {EntitiesSelectionModule} from "../openaireLibrary/searchPages/searchUtils/entitiesSelection.module";
import {TabsModule} from "../openaireLibrary/utils/tabs/tabs.module"; import {TabsModule} from "../openaireLibrary/utils/tabs/tabs.module";
import {SearchTabModule} from "../openaireLibrary/utils/tabs/contents/search-tab.module"; import {SearchTabModule} from "../openaireLibrary/utils/tabs/contents/search-tab.module";

View File

@ -32,7 +32,6 @@ export class ContactComponent implements OnInit {
public contactForm: FormGroup; public contactForm: FormGroup;
@ViewChild('AlertModal') modal; @ViewChild('AlertModal') modal;
@ViewChild('recaptcha') recaptcha;
private subscriptions = []; private subscriptions = [];
ngOnDestroy() { ngOnDestroy() {
this.subscriptions.forEach(subscription => { this.subscriptions.forEach(subscription => {

View File

@ -5,7 +5,6 @@ import {RouterModule} from '@angular/router';
import {ContactComponent} from './contact.component'; import {ContactComponent} from './contact.component';
import {ContactRoutingModule} from "./contact-routing.module"; import {ContactRoutingModule} from "./contact-routing.module";
import {EmailService} from "../openaireLibrary/utils/email/email.service"; import {EmailService} from "../openaireLibrary/utils/email/email.service";
import {RecaptchaModule} from "ng-recaptcha";
import {AlertModalModule} from "../openaireLibrary/utils/modal/alertModal.module"; import {AlertModalModule} from "../openaireLibrary/utils/modal/alertModal.module";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service"; import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {HelperModule} from "../openaireLibrary/utils/helper/helper.module"; import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
@ -19,7 +18,7 @@ import {BreadcrumbsModule} from "../openaireLibrary/utils/breadcrumbs/breadcrumb
@NgModule({ @NgModule({
imports: [ imports: [
ContactRoutingModule, CommonModule, RouterModule, ContactRoutingModule, CommonModule, RouterModule,
AlertModalModule, RecaptchaModule.forRoot(), HelperModule, AlertModalModule, HelperModule,
Schema2jsonldModule, SEOServiceModule, ContactUsModule, BreadcrumbsModule Schema2jsonldModule, SEOServiceModule, ContactUsModule, BreadcrumbsModule
], ],
declarations: [ declarations: [

View File

@ -4,7 +4,11 @@ import {SearchZenodoCommunitiesService} from '../../openaireLibrary/connect/zeno
import {ZenodoInformationClass} from '../../openaireLibrary/deposit/utils/zenodoInformation.class'; import {ZenodoInformationClass} from '../../openaireLibrary/deposit/utils/zenodoInformation.class';
import {Subscriber} from "rxjs"; import {Subscriber} from "rxjs";
import {Injectable} from "@angular/core";
@Injectable({
providedIn: 'root'
})
export class FetchZenodoInformation { export class FetchZenodoInformation {
private subscriptions = []; private subscriptions = [];
constructor ( private _zenodoCommunitieService: ZenodoCommunitiesService, constructor ( private _zenodoCommunitieService: ZenodoCommunitiesService,

View File

@ -1,6 +1,5 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import 'rxjs/Rx';
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import {Meta, Title} from "@angular/platform-browser"; import {Meta, Title} from "@angular/platform-browser";
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service"; import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";

View File

@ -43,8 +43,8 @@ import {Subscriber} from "rxjs";
}) })
export class OpenaireUserComponent { export class OpenaireUserComponent {
@ViewChild(UserComponent) usercomponent: UserComponent; @ViewChild(UserComponent, { static: true }) usercomponent: UserComponent;
@ViewChild(SubscribeComponent) subscribe: SubscribeComponent; @ViewChild(SubscribeComponent, { static: true }) subscribe: SubscribeComponent;
properties: EnvProperties; properties: EnvProperties;
communityId = null; communityId = null;
subscribeLoading: boolean = false; subscribeLoading: boolean = false;

View File

@ -65,7 +65,7 @@ export class SearchCommunitiesComponent {
public showType = false; public showType = false;
public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'communities'}]; public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'communities'}];
properties: EnvProperties; properties: EnvProperties;
@ViewChild(NewSearchPageComponent) searchPage: NewSearchPageComponent; @ViewChild(NewSearchPageComponent, { static: true }) searchPage: NewSearchPageComponent;
private user: User; private user: User;
private userFilterLoaded: boolean = false; private userFilterLoaded: boolean = false;

View File

@ -68,7 +68,7 @@ export class OpenaireSearchDataprovidersComponent {
customFilter: SearchCustomFilter = null; customFilter: SearchCustomFilter = null;
initialLoad = true; initialLoad = true;
public allResults =[]; public allResults =[];
@ViewChild(NewSearchPageComponent) searchPage: NewSearchPageComponent; @ViewChild(NewSearchPageComponent, { static: true }) searchPage: NewSearchPageComponent;
public fieldIds: string[] = this.searchFields.DATASOURCE_ADVANCED_FIELDS; public fieldIds: string[] = this.searchFields.DATASOURCE_ADVANCED_FIELDS;
public fieldIdsMap= this.searchFields.DATASOURCE_FIELDS; public fieldIdsMap= this.searchFields.DATASOURCE_FIELDS;
public selectedFields:AdvancedField[] = []; public selectedFields:AdvancedField[] = [];

View File

@ -68,7 +68,7 @@ export class OpenaireSearchProjectsComponent {
customFilter: SearchCustomFilter = null; customFilter: SearchCustomFilter = null;
initialLoad = true; initialLoad = true;
public allResults =[]; public allResults =[];
@ViewChild(NewSearchPageComponent) searchPage: NewSearchPageComponent; @ViewChild(NewSearchPageComponent, { static: true }) searchPage: NewSearchPageComponent;
public fieldIds: string[] = this.searchFields.PROJECT_ADVANCED_FIELDS; public fieldIds: string[] = this.searchFields.PROJECT_ADVANCED_FIELDS;
public fieldIdsMap= this.searchFields.PROJECT_FIELDS; public fieldIdsMap= this.searchFields.PROJECT_FIELDS;
public selectedFields:AdvancedField[] = []; public selectedFields:AdvancedField[] = [];

View File

@ -37,7 +37,7 @@ const COMPONENTS = [
] ]
}) })
export class SharedModule { export class SharedModule {
static forRoot(): ModuleWithProviders { static forRoot(): ModuleWithProviders<SharedModule> {
return { return {
ngModule: SharedModule, ngModule: SharedModule,
}; };

View File

@ -1,22 +1,20 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import {Location, TitleCasePipe} from '@angular/common'; import {Location, TitleCasePipe} from '@angular/common';
import {Title, Meta} from '@angular/platform-browser'; import {DomSanitizer, Meta, Title} from '@angular/platform-browser';
import {DomSanitizer} from '@angular/platform-browser';
import "rxjs/add/observable/zip";
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes'; import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes';
import {StatisticsService} from '../utils/services/statistics.service'; import {StatisticsService} from '../utils/services/statistics.service';
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service'; import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
import {ConnectHelper} from '../openaireLibrary/connect/connectHelper';
import { import {
availableCharts, availableEntitiesMap, StatisticsDisplay, availableCharts,
availableEntitiesMap,
StatisticsDisplay,
StatisticsSummary StatisticsSummary
} from "../openaireLibrary/connect/statistics/statisticsEntities"; } from "../openaireLibrary/connect/statistics/statisticsEntities";
import {PiwikHelper} from '../utils/piwikHelper'; import {PiwikHelper} from '../utils/piwikHelper';
import {CommunityCharts} from "../openaireLibrary/connect/statistics/communityCharts"; import {CommunityCharts} from "../openaireLibrary/connect/statistics/communityCharts";
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
import {CommunityService} from "../openaireLibrary/connect/community/community.service"; import {CommunityService} from "../openaireLibrary/connect/community/community.service";
import {Subscriber, Subscription} from "rxjs"; import {Subscriber, Subscription} from "rxjs";
import {properties} from "../../environments/environment"; import {properties} from "../../environments/environment";

View File

@ -17,7 +17,7 @@ import {LayoutService} from "../../openaireLibrary/services/layout.service";
] ]
}) })
export class CustomizationModule { export class CustomizationModule {
static forRoot(): ModuleWithProviders { static forRoot(): ModuleWithProviders<CustomizationModule> {
return { return {
ngModule: CustomizationModule, ngModule: CustomizationModule,
providers: [ providers: [

View File

@ -1,9 +1,8 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import {HttpClient, HttpErrorResponse} from "@angular/common/http"; import {HttpClient, HttpErrorResponse} from "@angular/common/http";
import { Observable } from 'rxjs/Rx';
import {StatisticsDisplay, StatisticsSummary} from "../../openaireLibrary/connect/statistics/statisticsEntities"; import {StatisticsDisplay, StatisticsSummary} from "../../openaireLibrary/connect/statistics/statisticsEntities";
import {catchError, map} from "rxjs/operators"; import {catchError, map} from "rxjs/operators";
import {throwError} from "rxjs"; import {Observable, throwError} from "rxjs";
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";

View File

@ -75,7 +75,7 @@ export class SubscribeComponent {
members: number = 0; members: number = 0;
@Output() countSubscribersEvent = new EventEmitter(); @Output() countSubscribersEvent = new EventEmitter();
showLoginAlert: Boolean = false; showLoginAlert: Boolean = false;
@ViewChild(AlertModal) alert; @ViewChild(AlertModal, { static: true }) alert;
private user: User; private user: User;
subs: Subscription[] = []; subs: Subscription[] = [];

View File

@ -19,7 +19,7 @@ import {LoadingModule} from "../../openaireLibrary/utils/loading/loading.module"
] ]
}) })
export class SubscribeModule { export class SubscribeModule {
static forRoot(): ModuleWithProviders { static forRoot(): ModuleWithProviders<SubscribeModule> {
return { return {
ngModule: SubscribeModule, ngModule: SubscribeModule,
providers: [ providers: [

32
src/karma.conf.js Normal file
View File

@ -0,0 +1,32 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage/connect'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};

View File

@ -1,8 +1,15 @@
import {properties} from "./environments/environment"; /***************************************************************************************************
import {enableProdMode} from "@angular/core"; * Load `$localize` onto the global scope - used if i18n tags appear in Angular templates.
*/
import '@angular/localize/init';
import { enableProdMode } from '@angular/core';
import {properties} from './environments/environment';
if (properties.environment !== "development") { if (properties.environment !== "development") {
enableProdMode(); enableProdMode();
} }
export { AppServerModule } from './app/app.server.module'; export { AppServerModule } from './app/app.server.module';
export { renderModule, renderModuleFactory } from '@angular/platform-server';

View File

@ -9,5 +9,6 @@ if (properties.environment !== "development") {
} }
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
platformBrowserDynamic().bootstrapModule(AppModule); platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
}); });

View File

@ -1,3 +1,7 @@
/***************************************************************************************************
* Load `$localize` onto the global scope - used if i18n tags appear in Angular templates.
*/
import '@angular/localize/init';
/** /**
* This file includes polyfills needed by Angular and is loaded before the app. * This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file. * You can add your own extra polyfills to this file.
@ -11,61 +15,53 @@
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
* *
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html * Learn more in https://angular.io/guide/browser-support
*/ */
/*************************************************************************************************** /***************************************************************************************************
* BROWSER POLYFILLS * BROWSER POLYFILLS
*/ */
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */ /** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`. // import 'classlist.js'; // Run `npm install --save classlist.js`.
/** Evergreen browsers require these. **/
import 'core-js/es6/reflect';
/** /**
* Required to support Web Animations `@angular/animation`. * Web Animations `@angular/platform-browser/animations`
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
**/ * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`. // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
* because those flags need to be set before `zone.js` being loaded, and webpack
* will put import in the top of bundle, so user need to create a separate file
* in this directory (for example: zone-flags.ts), and put the following flags
* into that file, and then add the following code before importing zone.js.
* import './zone-flags.ts';
*
* The flags allowed in zone-flags.ts are listed here.
*
* The following flags will work for all browsers.
*
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*
* (window as any).__Zone_enable_cross_context_check = true;
*
*/
/*************************************************************************************************** /***************************************************************************************************
* Zone JS is required by Angular itself. * Zone JS is required by default for Angular itself.
*/ */
import 'zone.js/dist/zone'; // Included with Angular CLI. import 'zone.js/dist/zone'; // Included with Angular CLI.
/*************************************************************************************************** /***************************************************************************************************
* APPLICATION IMPORTS * APPLICATION IMPORTS
*/ */
/**
* Date, currency, decimal and percent pipes.
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
*/
// import 'intl'; // Run `npm install --save intl`.
/**
* Need to import at least one locale-data with intl.
*/
// import 'intl/locale-data/jsonp/en';

View File

@ -1,6 +1,4 @@
/* You can add global styles to this file, and also import other style files */ /* You can add global styles to this file, and also import other style files */
@import "~@angular/material/prebuilt-themes/indigo-pink.css";
@import "assets/common-assets/common/theme.css"; @import "assets/common-assets/common/theme.css";
@import "assets/common-assets/common/custom.css"; @import "assets/common-assets/common/custom.css";
@import "assets/common-assets/library.css"; @import "assets/common-assets/library.css";

20
src/test.ts Normal file
View File

@ -0,0 +1,20 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View File

@ -2,14 +2,13 @@
"extends": "../tsconfig.json", "extends": "../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../out-tsc/app", "outDir": "../out-tsc/app",
"baseUrl": "./", "types": []
"module": "es2015",
"types": [
"node"
]
}, },
"exclude": [ "files": [
"test.ts", "main.ts",
"**/*.spec.ts" "polyfills.ts"
],
"include": [
"src/**/*.d.ts"
] ]
} }

View File

@ -1,21 +1,17 @@
{ {
"extends": "../tsconfig.json", "extends": "./tsconfig.app.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../out-tsc/app", "outDir": "../out-tsc/app-server",
"baseUrl": "./", "target": "es2016",
// Set the module format to "commonjs":
"module": "commonjs",
"types": [ "types": [
"node" "node"
] ]
}, },
"exclude": [ "files": [
"test.ts", "main.server.ts",
"**/*.spec.ts" "../server.ts"
], ],
// Add "angularCompilerOptions" with the AppServerModule you wrote
// set as the "entryModule".
"angularCompilerOptions": { "angularCompilerOptions": {
"entryModule": "app/app.server.module#AppServerModule" "entryModule": "./app/app.server.module#AppServerModule"
} }
} }

18
src/tsconfig.spec.json Normal file
View File

@ -0,0 +1,18 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"test.ts",
"polyfills.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}

View File

@ -1,15 +0,0 @@
export const ROUTES = [
'/',
'/lazy',
'/home',
'/search/publication','/search/other','/search/project','/search/dataset','/search/dataprovider','/search/organization',
'/search/find',
'/search/person','/search/publication','/search/project','/search/dataset','/search/dataprovider','/search/organization',
'/search/find/people','/search/find/publications','/search/find/other','/search/find/projects','/search/find/datasets','/search/find/dataproviders','/search/find/organizations',
'/search/advanced/people','/search/advanced/publications','/search/advanced/other','/search/advanced/projects','/search/advanced/datasets','/search/advanced/dataproviders','/search/advanced/organizations',
'/participate/deposit-publications','/participate/deposit-datasets','/participate/deposit-publications-result','/participate/deposit-datasets-result','/participate/deposit-subject-result',
'/search/content-providers','/search/content-providers-table','/search/entity-registries','/search/entity-registries-table','/search/journals','/search/journals-table',
'/project-report','/claims','/myclaims','/participate/claim','/participate/direct-claim','/claims-project-manager',
'/test','/user-info',
'/error', '/*path'
];

View File

@ -1,22 +1,23 @@
{ {
"compileOnSave": false, "compileOnSave": false,
"compilerOptions": { "compilerOptions": {
"importHelpers": true, "baseUrl": "./",
"downlevelIteration": true,
"outDir": "./dist/out-tsc", "outDir": "./dist/out-tsc",
"sourceMap": true, "sourceMap": true,
"declaration": false, "declaration": false,
"module": "es2020",
"moduleResolution": "node", "moduleResolution": "node",
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"target": "es5", "importHelpers": true,
"target": "es2015",
"typeRoots": [ "typeRoots": [
"node_modules/@types" "node_modules/@types"
], ],
"lib": [ "lib": [
"es2017", "es2018",
"dom" "dom"
], ]
"module": "es2015",
"baseUrl": "./"
} }
} }

View File

@ -1,51 +0,0 @@
// Work around for https://github.com/angular/angular-cli/issues/7200
const path = require('path');
const webpack = require('webpack');
module.exports = {
//mode: 'none',
entry: {
// This is our Express server for Dynamic universal
server: './server.ts',
// This is an example of Static prerendering (generative)
prerender: './prerender.ts'
},
target: 'node',
resolve: { extensions: ['.ts', '.js'] },
// Make sure we include all node_modules etc
externals: [/(node_modules|main\..*\.js)/,],
optimization: {
minimize: false
},
output: {
// Puts the output at the root of the dist folder
path: path.join(__dirname, 'dist'),
filename: '[name].js'
},
module: {
rules: [
{ test: /\.ts$/, loader: 'ts-loader' }
,{
// Mark files inside `@angular/core` as using SystemJS style dynamic imports.
// Removing this will cause deprecation warnings to appear.
test: /(\\|\/)@angular(\\|\/)core(\\|\/).+\.js$/,
parser: { system: true },
},
]
},
plugins: [
new webpack.ContextReplacementPlugin(
// fixes WARNING Critical dependency: the request of a dependency is an expression
/(.+)?angular(\\|\/)core(.+)?/,
path.join(__dirname, 'src'), // location of your src
{} // a map of your routes
),
new webpack.ContextReplacementPlugin(
// fixes WARNING Critical dependency: the request of a dependency is an expression
/(.+)?express(\\|\/)(.+)?/,
path.join(__dirname, 'src'),
{}
)
]
}