From 250fd48098179f6e69c5a7a02a2bb4f53dd07468 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Tue, 30 Jun 2020 16:00:24 +0000 Subject: [PATCH] [Connect|Trunk] Angular.json: -in prod/beta configuration add replacements for index.html, robots.txt -add sitemap.xml file Clean up index.html add css files in styles.css PRoduction: communities browse: in production show link to beta or prod based on the list of prodReadyCommunities git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@59029 d315682c-612b-4755-9ff5-7f18f6832af3 --- angular.json | 22 +++- package.json | 3 +- .../browse-community.component.html | 6 +- .../browse-community.component.ts | 11 +- src/app/utils/piwikHelper.ts | 16 ++- src/index.beta.html | 101 ++++++++++++++++++ src/index.html | 7 -- src/index.prod.html | 100 +++++++++++++++++ src/robots.beta.txt | 2 + src/robots.prod.txt | 3 + src/robots.txt | 2 - src/sitemap.xml | 24 +++++ src/styles.css | 5 + 13 files changed, 277 insertions(+), 25 deletions(-) create mode 100644 src/index.beta.html create mode 100644 src/index.prod.html create mode 100644 src/robots.beta.txt create mode 100644 src/robots.prod.txt create mode 100644 src/sitemap.xml diff --git a/angular.json b/angular.json index 024b4ed..65be69f 100644 --- a/angular.json +++ b/angular.json @@ -18,7 +18,8 @@ "polyfills": "src/polyfills.ts", "assets": [ "src/assets", - "src/robots.txt" + "src/robots.txt", + "src/sitemap.xml" ], "styles": [ "src/styles.css", @@ -45,6 +46,14 @@ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" + }, + { + "replace": "src/index.html", + "with": "src/index.prod.html" + }, + { + "replace": "src/robots.txt", + "with": "src/robots.prod.txt" } ] }, @@ -62,6 +71,14 @@ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.beta.ts" + }, + { + "replace": "src/index.html", + "with": "src/index.beta.html" + }, + { + "replace": "src/robots.txt", + "with": "src/robots.beta.txt" } ] } @@ -105,7 +122,8 @@ ], "assets": [ "src/assets", - "src/robots.txt" + "src/robots.txt", + "src/sitemap.xml" ] } }, diff --git a/package.json b/package.json index d3ef6cb..a405107 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "generate:prerender": "cd dist && node prerender", "webpack:server": "webpack --config webpack.server.config.js --progress --colors", "serve:prerender": "cd dist/browser && http-server", - "serve:ssr": "node dist/server" + "serve:ssr": "node dist/server", + "after-build-clean": "rm -rf src node_modules .idea/ installOpenaireLib.sh deploy;" }, "private": true, "dependencies": { diff --git a/src/app/communities/browseCommunity/browse-community.component.html b/src/app/communities/browseCommunity/browse-community.component.html index 8a58124..9503533 100644 --- a/src/app/communities/browseCommunity/browse-community.component.html +++ b/src/app/communities/browseCommunity/browse-community.component.html @@ -75,10 +75,12 @@
diff --git a/src/app/communities/browseCommunity/browse-community.component.ts b/src/app/communities/browseCommunity/browse-community.component.ts index f162d83..c50e68c 100644 --- a/src/app/communities/browseCommunity/browse-community.component.ts +++ b/src/app/communities/browseCommunity/browse-community.component.ts @@ -3,7 +3,7 @@ import {ActivatedRoute, Router} from '@angular/router'; import {Location} from '@angular/common'; import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; -import {CommunityInfo} from '../../openaireLibrary/connect/community/communityInfo'; +import {CommunityInfo, prodReadyCommunities} from '../../openaireLibrary/connect/community/communityInfo'; import {LocalStorageService} from "../../openaireLibrary/services/localStorage.service"; @Component({ @@ -49,9 +49,8 @@ export class BrowseCommunityComponent { return this.properties.environment != "development"; } - getProductionPrefix(): string { - //return (this.properties.environment == "beta") ? "beta." : "" - return "beta."; + getProductionPrefix(id:string): string { + return (this.properties.environment == "production" && prodReadyCommunities.indexOf(id)!=-1) ? "" : "beta."; } public confirmModalOpen() { @@ -70,7 +69,7 @@ export class BrowseCommunityComponent { public getCommunityPageUrl(): string { let url = ''; if (this.isProduction()) { - url = 'https://' + this.getProductionPrefix() + this.community.communityId + '.openaire.eu'; + url = 'https://' + this.getProductionPrefix(this.community.communityId) + this.community.communityId + '.openaire.eu'; } else { url = this.router.createUrlTree(['/'], { queryParams: {'communityId': this.community.communityId} @@ -84,7 +83,7 @@ export class BrowseCommunityComponent { this.localStorageService.setCommunityDirectLink(data.choice); let url = ''; if (this.isProduction()) { - url = 'https://' + this.getProductionPrefix() + this.community.communityId + '.openaire.eu'; + url = 'https://' + this.getProductionPrefix(this.community.communityId) + this.community.communityId + '.openaire.eu'; } else { url = this.router.createUrlTree(['/'], { queryParams: {'communityId': this.community.communityId} diff --git a/src/app/utils/piwikHelper.ts b/src/app/utils/piwikHelper.ts index 07db466..95e00cc 100644 --- a/src/app/utils/piwikHelper.ts +++ b/src/app/utils/piwikHelper.ts @@ -18,7 +18,9 @@ export class PiwikHelper{ "beopen": 218, "risis":219, "science-innovation-policy":253, - "covid-19":267 + "covid-19":267, + "desira":null, + "enermaps":null }; public static siteIDsProduction={ "connect": 112, @@ -37,12 +39,16 @@ export class PiwikHelper{ "dariah":'', "epos": null, "beopen" :null, - "risis":null + "risis":null, + "science-innovation-policy":null, + "covid-19":null, + "desira":null, + "enermaps":null }; public static getSiteId(communityId:string, environment:string){ - if(environment == 'production'){ - return this.siteIDsProduction[communityId]; - } + // if(environment == 'production'){ + // return this.siteIDsProduction[communityId]; + // } return this.siteIDs[communityId]; } diff --git a/src/index.beta.html b/src/index.beta.html new file mode 100644 index 0000000..9e97c1d --- /dev/null +++ b/src/index.beta.html @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/src/index.html b/src/index.html index 700854b..0a6b0a1 100644 --- a/src/index.html +++ b/src/index.html @@ -7,8 +7,6 @@ - - @@ -53,12 +51,7 @@ - - - - - diff --git a/src/index.prod.html b/src/index.prod.html new file mode 100644 index 0000000..f63e500 --- /dev/null +++ b/src/index.prod.html @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/src/robots.beta.txt b/src/robots.beta.txt new file mode 100644 index 0000000..c6742d8 --- /dev/null +++ b/src/robots.beta.txt @@ -0,0 +1,2 @@ +User-Agent: * +Disallow: / diff --git a/src/robots.prod.txt b/src/robots.prod.txt new file mode 100644 index 0000000..5919c0a --- /dev/null +++ b/src/robots.prod.txt @@ -0,0 +1,3 @@ +User-Agent: * + +Sitemap: https://connect.openaire.eu/sitemap.xml diff --git a/src/robots.txt b/src/robots.txt index e44c1d4..c6742d8 100644 --- a/src/robots.txt +++ b/src/robots.txt @@ -1,4 +1,2 @@ User-Agent: * -Disallow: /cache -Disallow: /upload Disallow: / diff --git a/src/sitemap.xml b/src/sitemap.xml new file mode 100644 index 0000000..9baa05c --- /dev/null +++ b/src/sitemap.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/styles.css b/src/styles.css index 5f69d4f..74c71ce 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1,2 +1,7 @@ /* 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/custom.css"; +@import "assets/common-assets/library.css"; +@import "assets/connect-custom.css";