diff --git a/.browserslistrc b/.browserslistrc
new file mode 100644
index 0000000..37371cb
--- /dev/null
+++ b/.browserslistrc
@@ -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
\ No newline at end of file
diff --git a/README.md b/README.md
index 64f92bf..18f9c20 100644
--- a/README.md
+++ b/README.md
@@ -1,18 +1,24 @@
-# Usage Statistics
+# Usage Counts
-This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.3.0.
+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.
+
+## Install packages
+
+Run npm install (maybe needs sudo), a script that will delete unused files from library will be run.
## Development server
-Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
+Run `npm start` for a dev server. Navigate to `http://localhost:4800/`. The app will automatically reload if you change any of the source files.
-## Code scaffolding
+## Build - CSR
-Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
+Use the `npm run build-dev` for a development build.
+Use the `npm run build-beta` for a beta build.
+Use the `npm run build-prod` for a production build.
-## Build
+## Webpack Analyzer
-Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
+In order to analyze bundle size you can run `npm run webpack-bundle-analyzer`
## Running unit tests
@@ -21,8 +27,3 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
-Before running the tests make sure you are serving the app via `ng serve`.
-
-## Further help
-
-To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
diff --git a/README.txt b/README.txt
deleted file mode 100644
index 7334e82..0000000
--- a/README.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-*******Useful project infrmation***********
-Project has 2 external folders. Check them using
- svn propget svn:externals ./
-
-Above command should show the following:
- ./src/app/openaireLibrary https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app
- ./src/assets/common-assets https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/assets
-
-After initial checkout, you may have to exlude ./src/app/openaireLibrary/app.* files in order the project to run properly.
-Exclude the files from your local copy, but keep them in the repository.
-
-Use the following command, to exclude the files:
- cd ./src/app/openaireLibrary
- svn update --set-depth exclude ./app.*
- svn update --set-depth exclude ./dashboard
diff --git a/angular.json b/angular.json
index 5265dab..defaa8e 100644
--- a/angular.json
+++ b/angular.json
@@ -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,
"newProjectRoot": "projects",
"projects": {
- "usage-statistics": {
+ "usage-counts": {
"root": "",
"sourceRoot": "src",
"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": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
- "outputPath": "dist",
+ "aot": true,
+ "outputPath": "dist/usage-counts",
"index": "src/index.html",
"main": "src/main.ts",
- "tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
+ "tsConfig": "src/tsconfig.app.json",
"assets": [
"src/assets",
"src/robots.txt",
@@ -33,45 +58,91 @@
]
},
"configurations": {
- "production": {
+ "development": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
- "extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
- "fileReplacements": [
+ "budgets": [
{
- "replace": "src/environments/environment.ts",
- "with": "src/environments/environment.prod.ts"
+ "type": "initial",
+ "maximumWarning": "2mb",
+ "maximumError": "5mb"
},
{
- "replace": "src/index.html",
- "with": "src/index.prod.html"
- },
- {
- "replace": "src/robots.txt",
- "with": "src/robots.prod.txt"
+ "type": "anyComponentStyle",
+ "maximumWarning": "6kb"
}
]
},
"beta": {
+ "fileReplacements": [
+ {
+ "replace": "src/environments/environment.ts",
+ "with": "src/environments/environment.beta.ts"
+ }
+ ],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
- "extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
+ "budgets": [
+ {
+ "type": "initial",
+ "maximumWarning": "2mb",
+ "maximumError": "5mb"
+ },
+ {
+ "type": "anyComponentStyle",
+ "maximumWarning": "6kb"
+ }
+ ]
+ },
+ "production": {
+ "assets": [
+ "src/assets",
+ "src/sitemap.xml",
+ {
+ "input": "src/prod/",
+ "output": "/",
+ "glob": "*.txt"
+ }
+ ],
+ "index": {
+ "input": "src/prod/index.html",
+ "output": "index.html"
+ },
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
- "with": "src/environments/environment.beta.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"
}
]
}
@@ -80,46 +151,33 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
- "browserTarget": "usage-statistics:build"
+ "browserTarget": "usage-counts:build"
},
"configurations": {
"production": {
- "browserTarget": "usage-statistics:build:production"
- },
- "beta": {
- "browserTarget": "usage-statistics:build:beta"
+ "browserTarget": "usage-counts:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
- "browserTarget": "usage-statistics:build"
+ "browserTarget": "usage-counts:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
- "karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
- "scripts": [
- "node_modules/jquery/dist/jquery.js",
- "node_modules/datatables.net/js/jquery.dataTables.js",
- "node_modules/interactiveminingv3/assets/js/ResizeSensor.js",
- "node_modules/interactiveminingv3/assets/js/jquery.sticky-sidebar.js"
- ],
+ "karmaConfig": "src/karma.conf.js",
"styles": [
- "src/styles.css",
- "node_modules/datatables.net-dt/css/jquery.dataTables.css",
- "node_modules/interactiveminingv3/assets/css/interactive-mining.css",
- "node_modules/interactiveminingv3/assets/css/animations.css"
+ "src/styles.css"
],
+ "scripts": [],
"assets": [
- "src/assets",
- "src/robots.txt",
- "src/sitemap.xml"
+ "src/assets"
]
}
},
@@ -137,24 +195,27 @@
}
}
},
- "usage-statistics-e2e": {
- "root": "e2e",
- "sourceRoot": "e2e",
+ "usage-counts-e2e": {
+ "root": "e2e/",
"projectType": "application",
+ "prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
- "protractorConfig": "./protractor.conf.js",
- "devServerTarget": "usage-statistics:serve"
+ "protractorConfig": "e2e/protractor.conf.js",
+ "devServerTarget": "usage-counts:serve"
+ },
+ "configurations": {
+ "production": {
+ "devServerTarget": "usage-counts:serve:production"
+ }
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
- "tsConfig": [
- "e2e/tsconfig.e2e.json"
- ],
+ "tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
@@ -163,14 +224,5 @@
}
}
},
- "defaultProject": "usage-statistics",
- "schematics": {
- "@schematics/angular:component": {
- "prefix": "app",
- "styleext": "css"
- },
- "@schematics/angular:directive": {
- "prefix": "app"
- }
- }
+ "defaultProject": "usage-counts"
}
diff --git a/clean-library.sh b/clean-library.sh
new file mode 100644
index 0000000..8fae529
--- /dev/null
+++ b/clean-library.sh
@@ -0,0 +1,9 @@
+cd src/app/openaireLibrary
+# Exclude Dashboard files
+echo "Exclude Dashboard files"
+svn update --set-depth exclude ./dashboard
+# Exclude ck-editor usages
+echo "Exclude ck-editor usages"
+svn update --set-depth exclude ./sharedComponents/subscriber-invite
+cd ../../../
+echo "Done"
diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts
deleted file mode 100644
index c2949ad..0000000
--- a/e2e/app.e2e-spec.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { AppPage } from './app.po';
-
-describe('admin-portal App', () => {
- let page: AppPage;
-
- beforeEach(() => {
- page = new AppPage();
- });
-
- it('should display welcome message', () => {
- page.navigateTo();
- expect(page.getParagraphText()).toEqual('Welcome to app!');
- });
-});
diff --git a/e2e/app.po.ts b/e2e/app.po.ts
deleted file mode 100644
index 82ea75b..0000000
--- a/e2e/app.po.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { browser, by, element } from 'protractor';
-
-export class AppPage {
- navigateTo() {
- return browser.get('/');
- }
-
- getParagraphText() {
- return element(by.css('app-root h1')).getText();
- }
-}
diff --git a/protractor.conf.js b/e2e/protractor.conf.js
similarity index 86%
rename from protractor.conf.js
rename to e2e/protractor.conf.js
index 7ee3b5e..86776a3 100644
--- a/protractor.conf.js
+++ b/e2e/protractor.conf.js
@@ -6,7 +6,7 @@ const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
- './e2e/**/*.e2e-spec.ts'
+ './src/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
@@ -21,8 +21,8 @@ exports.config = {
},
onPrepare() {
require('ts-node').register({
- project: 'e2e/tsconfig.e2e.json'
+ project: require('path').join(__dirname, './tsconfig.e2e.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
-};
+};
\ No newline at end of file
diff --git a/e2e/src/app.e2e-spec.ts b/e2e/src/app.e2e-spec.ts
new file mode 100644
index 0000000..86440b7
--- /dev/null
+++ b/e2e/src/app.e2e-spec.ts
@@ -0,0 +1,23 @@
+import { AppPage } from './app.po';
+import { browser, logging } from 'protractor';
+
+describe('workspace-project App', () => {
+ let page: AppPage;
+
+ beforeEach(() => {
+ page = new AppPage();
+ });
+
+ it('should display welcome message', () => {
+ page.navigateTo();
+ expect(page.getTitleText()).toEqual('Welcome to usage-counts!');
+ });
+
+ afterEach(async () => {
+ // Assert that there are no errors emitted from the browser
+ const logs = await browser.manage().logs().get(logging.Type.BROWSER);
+ expect(logs).not.toContain(jasmine.objectContaining({
+ level: logging.Level.SEVERE,
+ } as logging.Entry));
+ });
+});
diff --git a/e2e/src/app.po.ts b/e2e/src/app.po.ts
new file mode 100644
index 0000000..5776aa9
--- /dev/null
+++ b/e2e/src/app.po.ts
@@ -0,0 +1,11 @@
+import { browser, by, element } from 'protractor';
+
+export class AppPage {
+ navigateTo() {
+ return browser.get(browser.baseUrl) as Promise;
+ }
+
+ getTitleText() {
+ return element(by.css('app-root h1')).getText() as Promise;
+ }
+}
diff --git a/e2e/tsconfig.e2e.json b/e2e/tsconfig.e2e.json
index 1d9e5ed..a6dd622 100644
--- a/e2e/tsconfig.e2e.json
+++ b/e2e/tsconfig.e2e.json
@@ -1,8 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
- "outDir": "../out-tsc/e2e",
- "baseUrl": "./",
+ "outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": [
@@ -11,4 +10,4 @@
"node"
]
}
-}
+}
\ No newline at end of file
diff --git a/package.json b/package.json
index f25566d..9079f80 100644
--- a/package.json
+++ b/package.json
@@ -1,66 +1,62 @@
{
- "name": "usage-statistics",
- "version": "0.0.1",
- "license": "MIT",
+ "name": "usage-counts",
+ "version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --host 0.0.0.0 --disable-host-check --port=4800",
- "build": "ng build --prod",
+ "build": "ng build",
+ "build-dev": "ng build --configuration=development",
"build-beta": "ng build --configuration=beta",
+ "build-prod": "ng build --prod",
+ "webpack-bundle-analyzer": "ng build --stats-json && webpack-bundle-analyzer dist/graph/browser/stats.json --host 0.0.0.0",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
- "after-build-clean": "rm -rf dist/assets/common-assets/.svn/"
+ "postinstall": "chmod +x clean-library.sh && ./clean-library.sh",
+ "after-build-clean": "rm -rf dist/usage-counts/assets/common-assets/.svn/"
},
"private": true,
"dependencies": {
- "@angular/animations": "7.2.14",
- "@angular/cdk": "^7.3.7",
- "@angular/common": "7.2.14",
- "@angular/compiler": "7.2.14",
- "@angular/core": "7.2.14",
- "@angular/forms": "7.2.14",
- "@angular/http": "7.2.14",
- "@angular/material": "^7.3.7",
- "@angular/platform-browser": "7.2.14",
- "@angular/platform-browser-dynamic": "7.2.14",
- "@angular/router": "7.2.14",
- "@nguniversal/express-engine": "^6.0.0",
- "@types/express": "^4.16.1",
+ "@angular/animations": "~11.2.14",
+ "@angular/cdk": "^11.2.13",
+ "@angular/common": "~11.2.14",
+ "@angular/compiler": "~11.2.14",
+ "@angular/core": "~11.2.14",
+ "@angular/forms": "~11.2.14",
+ "@angular/localize": "^11.2.14",
+ "@angular/material": "^11.2.13",
+ "@angular/platform-browser": "~11.2.14",
+ "@angular/platform-browser-dynamic": "~11.2.14",
+ "@angular/router": "~11.2.14",
"clipboard": "^1.5.16",
- "core-js": "2.6.8",
+ "core-js": "^2.5.4",
+ "express": "^4.15.2",
"jquery": "^3.4.1",
- "ngx-bootstrap": "^1.6.6",
- "ng-recaptcha": "^3.0.5",
+ "ng-recaptcha": "^7.0.1",
+ "rxjs": "^6.5.1",
"ts-md5": "^1.2.0",
- "tslib": "^1.9.0",
- "zone.js": "0.8.29"
+ "tslib": "^2.0.0",
+ "zone.js": "~0.10.2"
},
"devDependencies": {
- "@angular-devkit/build-angular": "~0.13.0",
- "@angular/cli": "7.3.9",
- "@angular/compiler-cli": "7.2.14",
- "@angular/language-service": "7.2.14",
- "@types/datatables.net": "^1.10.17",
- "@types/jasmine": "~2.8.8",
+ "@angular-devkit/build-angular": "~0.1102.14",
+ "@angular/cli": "~11.2.14",
+ "@angular/compiler-cli": "~11.2.14",
+ "@angular/language-service": "~11.2.14",
+ "@types/express": "^4.17.0",
+ "@types/node": "^12.11.1",
+ "@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
- "@types/jquery": "^3.3.29",
- "@types/node": "^14.0.13",
- "codelyzer": "~4.5.0",
- "jasmine-core": "~2.99.1",
- "jasmine-spec-reporter": "~4.2.1",
- "karma": "~3.0.0",
- "karma-chrome-launcher": "~2.1.1",
- "karma-cli": "~1.0.1",
- "karma-coverage-istanbul-reporter": "~2.0.1",
- "karma-jasmine": "~1.1.2",
- "karma-jasmine-html-reporter": "^0.2.2",
- "protractor": "~5.4.0",
- "rxjs": "6.5.1",
- "rxjs-compat": "^6.5.1",
- "rxjs-tslint": "^0.1.7",
+ "codelyzer": "^6.0.0",
+ "jasmine-core": "~3.8.0",
+ "jasmine-spec-reporter": "~5.0.0",
+ "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",
- "tslint": "^5.7.0",
- "typescript": "3.2.4"
+ "typescript": "~4.0.7"
}
}
diff --git a/src/app/about/about.component.css b/src/app/about/about.component.css
index 0615f3c..254c443 100644
--- a/src/app/about/about.component.css
+++ b/src/app/about/about.component.css
@@ -15,7 +15,7 @@
@media only screen and (min-width: 1200px) {
.about-background {
- background-image: url("/assets/usage-statistics-assets/about/1.svg");
+ background-image: url("~src/assets/usage-statistics-assets/about/1.svg");
background-repeat: no-repeat;
background-position: 0 -30px;
background-size: contain;
@@ -47,7 +47,7 @@
}
.architecture {
- background-image: url("/assets/usage-statistics-assets/about/2.1.png");
+ background-image: url("~src/assets/usage-statistics-assets/about/2.1.png");
background-repeat: no-repeat;
background-position: 0 0;
background-size: contain;
@@ -63,7 +63,7 @@
}
.architecture > div {
- background-image: url("/assets/usage-statistics-assets/about/2.2.svg");
+ background-image: url("~src/assets/usage-statistics-assets/about/2.2.svg");
background-repeat: no-repeat;
background-position: 0 0;
background-size: auto;
@@ -78,7 +78,7 @@
@media only screen and (min-width: 1200px) {
.workflows {
- background-image: url("/assets/usage-statistics-assets/about/3.2.svg");
+ background-image: url("~src/assets/usage-statistics-assets/about/3.2.svg");
background-repeat: no-repeat;
background-position: top left;
background-size: auto;
@@ -88,7 +88,7 @@
@media only screen and (min-width: 960px) {
.push-pull {
- background-image: url("/assets/usage-statistics-assets/about/4.svg");
+ background-image: url("~src/assets/usage-statistics-assets/about/4.svg");
background-repeat: no-repeat;
background-position: top right;
background-size: auto;
@@ -96,7 +96,7 @@
}
.faqs {
- background-image: url("/assets/usage-statistics-assets/about/5.svg");
+ background-image: url("~src/assets/usage-statistics-assets/about/5.svg");
background-repeat: no-repeat;
background-position: top right;
background-size: auto;
diff --git a/src/app/analytics/analytics.component.css b/src/app/analytics/analytics.component.css
index 00d3722..2fc4cf4 100644
--- a/src/app/analytics/analytics.component.css
+++ b/src/app/analytics/analytics.component.css
@@ -10,7 +10,7 @@
@media only screen and (min-width: 960px) {
.countries {
- background-image: url("/assets/usage-statistics-assets/analytics/1.svg");
+ background-image: url("~src/assets/usage-statistics-assets/analytics/1.svg");
background-size: contain;
background-repeat: no-repeat;
background-position: top center;
@@ -59,14 +59,14 @@
}
.second {
- background-image: url("/assets/usage-statistics-assets/analytics/2.2.svg"), url("/assets/usage-statistics-assets/analytics/2.1.svg");
+ background-image: url("~src/assets/usage-statistics-assets/analytics/2.2.svg"), url("/assets/usage-statistics-assets/analytics/2.1.svg");
background-size: auto;
background-repeat: no-repeat;
background-position: bottom left, top right;
}
.third {
- background-image: url("/assets/usage-statistics-assets/analytics/3.2.svg"), url("/assets/usage-statistics-assets/analytics/3.1.svg");
+ background-image: url("~src/assets/usage-statistics-assets/analytics/3.2.svg"), url("/assets/usage-statistics-assets/analytics/3.1.svg");
background-size: auto;
background-repeat: no-repeat;
background-position: bottom left, bottom right;
diff --git a/src/app/app.routing.ts b/src/app/app.routing.ts
index 9fee8fd..60213ee 100644
--- a/src/app/app.routing.ts
+++ b/src/app/app.routing.ts
@@ -1,12 +1,12 @@
import {NgModule} from '@angular/core';
-import {Routes, RouterModule, PreloadAllModules} from '@angular/router';
+import {RouterModule, Routes} from '@angular/router';
import {PreviousRouteRecorder} from './openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {ErrorPageComponent} from './openaireLibrary/error/errorPage.component';
const appRoutes: Routes = [
{
path: '',
- loadChildren: './home/home.module#HomeModule',
+ loadChildren: () => import('./home/home.module').then(m => m.HomeModule),
data: {
isHome: true
},
@@ -14,27 +14,27 @@ const appRoutes: Routes = [
},
{
path: 'resources',
- loadChildren: './resources/resources.module#ResourcesModule',
+ loadChildren: () => import('./resources/resources.module').then(m => m.ResourcesModule),
canDeactivate: [PreviousRouteRecorder]
},
{
path: 'analytics',
- loadChildren: './analytics/analytics.module#AnalyticsModule',
+ loadChildren: () => import('./analytics/analytics.module').then(m => m.AnalyticsModule),
canDeactivate: [PreviousRouteRecorder]
},
{
path: 'contact',
- loadChildren: './contact/contact.module#ContactModule',
+ loadChildren: () => import('./contact/contact.module').then(m => m.ContactModule),
canDeactivate: [PreviousRouteRecorder]
},
{
path: 'about',
- loadChildren: './about/about.module#AboutModule',
+ loadChildren: () => import('./about/about.module').then(m => m.AboutModule),
canDeactivate: [PreviousRouteRecorder]
},
{
path: 'sushilite/:id',
- loadChildren: './sushilite/sushilite.module#SushiliteModule',
+ loadChildren: () => import('./sushilite/sushilite.module').then(m => m.SushiliteModule),
canDeactivate: [PreviousRouteRecorder]
},
{ path: '**',pathMatch: 'full',component: ErrorPageComponent}
@@ -42,9 +42,7 @@ const appRoutes: Routes = [
@NgModule({
imports: [RouterModule.forRoot(appRoutes, {
- preloadingStrategy: PreloadAllModules,
- onSameUrlNavigation: "reload",
- relativeLinkResolution: 'corrected'
+ onSameUrlNavigation: "reload"
})],
exports: [RouterModule]
})
diff --git a/src/app/contact/contact.component.css b/src/app/contact/contact.component.css
index f6cdd13..d070323 100644
--- a/src/app/contact/contact.component.css
+++ b/src/app/contact/contact.component.css
@@ -1,5 +1,5 @@
.contact {
- background-image: url("/assets/usage-statistics-assets/contact/1.svg");
+ background-image: url("~src/assets/usage-statistics-assets/contact/1.svg");
background-size: auto;
background-repeat: no-repeat;
background-position: 0 0;
diff --git a/src/app/contact/contact.component.ts b/src/app/contact/contact.component.ts
index 055b0b1..2855200 100644
--- a/src/app/contact/contact.component.ts
+++ b/src/app/contact/contact.component.ts
@@ -26,7 +26,6 @@ export class ContactComponent implements OnInit, OnDestroy {
public contactForm: FormGroup;
@ViewChild('AlertModal') modal;
- @ViewChild('recaptcha') recaptcha;
description = 'Any questions? Contact us ';
title = 'OpenAIRE - UsageCounts | Contact Us';
subs: Subscription[] = [];
diff --git a/src/app/contact/contact.module.ts b/src/app/contact/contact.module.ts
index ca6aa21..706a59c 100644
--- a/src/app/contact/contact.module.ts
+++ b/src/app/contact/contact.module.ts
@@ -4,7 +4,6 @@ import {RouterModule} from '@angular/router';
import {ContactComponent} from './contact.component';
import {EmailService} from '../openaireLibrary/utils/email/email.service';
-import {RecaptchaModule} from 'ng-recaptcha';
import {AlertModalModule} from '../openaireLibrary/utils/modal/alertModal.module';
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
import {HelperModule} from '../openaireLibrary/utils/helper/helper.module';
@@ -20,7 +19,7 @@ import {BreadcrumbsModule} from '../openaireLibrary/utils/breadcrumbs/breadcrumb
RouterModule.forChild([{
path: '', component: ContactComponent
}]), CommonModule, RouterModule,
- AlertModalModule, RecaptchaModule.forRoot(), HelperModule,
+ AlertModalModule, HelperModule,
Schema2jsonldModule, SEOServiceModule, ContactUsModule, BreadcrumbsModule
],
declarations: [
diff --git a/src/app/home/home.component.css b/src/app/home/home.component.css
index ab039b5..96da725 100644
--- a/src/app/home/home.component.css
+++ b/src/app/home/home.component.css
@@ -1,7 +1,7 @@
@media only screen and (min-width: 1200px) {
.first {
position: relative;
- background-image: url("/assets/usage-statistics-assets/home/1.svg");
+ background-image: url("~src/assets/usage-statistics-assets/home/1.svg");
background-size: cover;
background-repeat: no-repeat;
background-position: 0 -130px;
@@ -10,7 +10,7 @@
.third .first-column {
position: relative;
- background-image: url("/assets/usage-statistics-assets/home/3.1.svg"), url("/assets/usage-statistics-assets/home/3.2.svg");
+ background-image: url("~src/assets/usage-statistics-assets/home/3.1.svg"), url("~src/assets/usage-statistics-assets/home/3.2.svg");
background-repeat: no-repeat;
background-size: contain, auto;
background-position: top left, bottom center;
@@ -23,7 +23,7 @@
}
.third .second-column {
- background-image: url("/assets/usage-statistics-assets/home/3.4.svg"), url("/assets/usage-statistics-assets/home/3.5.svg");
+ background-image: url("~src/assets/usage-statistics-assets/home/3.4.svg"), url("~src/assets/usage-statistics-assets/home/3.5.svg");
background-repeat: no-repeat;
background-size: auto, contain;
background-position: top center, bottom right;
@@ -37,7 +37,7 @@
}
.third .second-column {
- background-image: url("/assets/usage-statistics-assets/home/3.5.svg");
+ background-image: url("~src/assets/usage-statistics-assets/home/3.5.svg");
background-repeat: no-repeat;
background-size: contain;
background-position: bottom right;
@@ -46,7 +46,7 @@
@media only screen and (min-width: 960px) {
.second {
- background-image: url("/assets/usage-statistics-assets/home/2.svg");
+ background-image: url("~src/assets/usage-statistics-assets/home/2.svg");
background-size: auto;
background-repeat: no-repeat;
background-position: -2% 0;
@@ -54,7 +54,7 @@
}
.third {
- background-image: url("/assets/usage-statistics-assets/home/3.3.svg");
+ background-image: url("~src/assets/usage-statistics-assets/home/3.3.svg");
background-repeat: no-repeat;
background-size: auto;
background-position: 30% 0;
@@ -65,7 +65,7 @@
}
.third .third-column {
- background-image: url("/assets/usage-statistics-assets/home/3.6.svg");
+ background-image: url("~src/assets/usage-statistics-assets/home/3.6.svg");
background-size: auto;
background-repeat: no-repeat;
background-position: top left;
@@ -91,7 +91,7 @@
.features {
- background-image: url("/assets/usage-statistics-assets/home/4.svg");
+ background-image: url("~src/assets/usage-statistics-assets/home/4.svg");
background-size: contain;
background-repeat: no-repeat;
background-position: 0 0;
diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts
index 36cf8ef..bb23901 100644
--- a/src/app/home/home.component.ts
+++ b/src/app/home/home.component.ts
@@ -17,8 +17,7 @@ export class HomeComponent implements OnInit, OnDestroy {
public initSlide: number = 1;
public fragments: string[] = ['', 'why', 'who', 'features'];
- @ViewChild('slider')
- public slider: FullPageSliderComponent;
+ @ViewChild('slider', { static: true }) slider: FullPageSliderComponent;
properties: EnvProperties = properties;
subs: Subscription[] = [];
diff --git a/src/app/main.ts b/src/app/main.ts
deleted file mode 100644
index fd47b5e..0000000
--- a/src/app/main.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import './polyfills.ts';
-//import './vendors.ts';
-
-import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
-import {AppModule} from './app.module';
-import {enableProdMode} from "@angular/core";
-import {properties} from "../environments/environment";
-
-const platform = platformBrowserDynamic();
-if (properties.environment !== "development") {
- enableProdMode();
-}
-platform.bootstrapModule(AppModule);
diff --git a/src/app/polyfills.ts b/src/app/polyfills.ts
deleted file mode 100644
index 9dcf73e..0000000
--- a/src/app/polyfills.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Created by stefanos on 25/4/2017.
- */
-// Polyfills
-
-// import 'ie-shim'; // Internet Explorer 9 support
-import 'reflect-metadata';
-// import 'core-js/es6';
-// Added parts of es6 which are necessary for your project or your browser support requirements.
-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/set';
-import 'core-js/es6/weak-map';
-import 'core-js/es6/weak-set';
-import 'core-js/es6/typed';
-import 'core-js/es6/reflect';
-// see issue https://github.com/AngularClass/angular2-webpack-starter/issues/709
-// import 'core-js/es6/promise';
-
-import 'intl';
-import 'intl/locale-data/jsonp/en';
-
-import 'core-js/es7/reflect';
-import 'zone.js/dist/zone';
-
-// import 'ng2-ckeditor/lib';
-
-// if ('production' === ENV) {
-// // Production
-//
-// } else {
-//
-// // Development
-// Error.stackTraceLimit = Infinity;
-//
-// /* tslint:disable no-var-requires */
-// require('zone.js/dist/long-stack-trace-zone');
-//
-// }
diff --git a/src/environments/environments/environment.beta.ts b/src/environments/environments/environment.beta.ts
new file mode 100644
index 0000000..1e5bcaa
--- /dev/null
+++ b/src/environments/environments/environment.beta.ts
@@ -0,0 +1,23 @@
+import {EnvProperties} from '../app/openaireLibrary/utils/properties/env-properties';
+
+export let properties: EnvProperties = {
+ environment: 'beta',
+ useCache: true,
+ useLongCache: true,
+ domain : "https://usagecounts.openaire.eu",
+ baseLink: "",
+ enablePiwikTrack: true,
+ piwikBaseUrl: "https://analytics.openaire.eu/piwik.php?idsite=",
+ piwikSiteId: "",
+ metricsAPIURL: 'https://beta.services.openaire.eu/usagestats/',
+ loginUrl: "https://beta.services.openaire.eu/admin-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",
+ cacheUrl: "https://demo.openaire.eu/cache/get?url=",
+ adminToolsAPIURL: "https://beta.services.openaire.eu/uoa-admin-tools/",
+ reCaptchaSiteKey: "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P",
+ admins: ["feedback@openaire.eu"],
+ sushiliteURL: 'https://services.openaire.eu/usagestats/sushilite/',
+ footerGrantText: "OpenAIRE has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements No. 777541 and 101017452"
+};
diff --git a/src/environments/environments/environment.prod.ts b/src/environments/environments/environment.prod.ts
new file mode 100644
index 0000000..96f0459
--- /dev/null
+++ b/src/environments/environments/environment.prod.ts
@@ -0,0 +1,23 @@
+import {EnvProperties} from '../app/openaireLibrary/utils/properties/env-properties';
+
+export let properties: EnvProperties = {
+ environment:"production",
+ useCache: true,
+ useLongCache: true,
+ domain : "https://usagecounts.openaire.eu",
+ baseLink: "",
+ enablePiwikTrack: true,
+ piwikBaseUrl: "https://analytics.openaire.eu/piwik.php?idsite=",
+ piwikSiteId: "374",
+ metricsAPIURL: "https://services.openaire.eu/usagestats/",
+ loginUrl:"https://services.openaire.eu/admin-user-management/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",
+ cacheUrl:"https://explore.openaire.eu/cache/get?url=",
+ adminToolsAPIURL:"https://services.openaire.eu/uoa-admin-tools/",
+ reCaptchaSiteKey: "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P",
+ admins: ["feedback@openaire.eu"],
+ sushiliteURL: 'https://services.openaire.eu/usagestats/sushilite/',
+ footerGrantText: "OpenAIRE has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements No. 777541 and 101017452"
+};
diff --git a/src/environments/environments/environment.ts b/src/environments/environments/environment.ts
new file mode 100644
index 0000000..721519c
--- /dev/null
+++ b/src/environments/environments/environment.ts
@@ -0,0 +1,28 @@
+// The file contents for the current environment will overwrite these during build.
+// The build system defaults to the dev environment which uses `environment.ts`, but if you do
+// `ng build --env=prod` then `environment.prod.ts` will be used instead.
+// The list of which env maps to which file can be found in `.angular-cli.json`.
+
+import {EnvProperties} from '../app/openaireLibrary/utils/properties/env-properties';
+
+export let properties: EnvProperties = {
+ environment: 'development',
+ useCache: false,
+ useLongCache: true,
+ domain : "https://usagecounts.openaire.eu",
+ baseLink: "",
+ enablePiwikTrack: false,
+ piwikBaseUrl: "https://analytics.openaire.eu/piwik.php?idsite=",
+ piwikSiteId: "",
+ metricsAPIURL: 'https://services.openaire.eu/usagestats/',
+ loginUrl: 'http://dl170.madgik.di.uoa.gr:8180/dnet-login/openid_connect_login',
+ userInfoUrl: 'http://dl170.madgik.di.uoa.gr:8180/dnet-openaire-users-1.0.0-SNAPSHOT/api/users/getUserInfo?accessToken=',
+ logoutUrl: 'https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=',
+ cookieDomain: '.di.uoa.gr',
+ cacheUrl: "https://demo.openaire.eu/cache/get?url=",
+ adminToolsAPIURL: 'http://duffy.di.uoa.gr:8080/uoa-admin-tools/',
+ reCaptchaSiteKey: '6LcVtFIUAAAAAB2ac6xYivHxYXKoUvYRPi-6_rLu',
+ admins: ['kostis30fylloy@gmail.com'],
+ sushiliteURL: 'http://scoobydoo.di.uoa.gr/static/sushilite/',
+ footerGrantText: "OpenAIRE has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements No. 777541 and 101017452"
+};
diff --git a/karma.conf.js b/src/karma.conf.js
similarity index 81%
rename from karma.conf.js
rename to src/karma.conf.js
index 0840f6c..c3bd1cf 100644
--- a/karma.conf.js
+++ b/src/karma.conf.js
@@ -12,20 +12,21 @@ module.exports = function (config) {
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
- client:{
+ client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
- dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
+ dir: require('path').join(__dirname, '../coverage/usage-counts'),
+ reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
-
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
- singleRun: false
+ singleRun: false,
+ restartOnFileChange: true
});
};
diff --git a/src/main.ts b/src/main.ts
index 9be6714..b7e6c1a 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -8,4 +8,6 @@ if (properties.environment !== "development") {
enableProdMode();
}
-platformBrowserDynamic().bootstrapModule(AppModule);
+
+platformBrowserDynamic().bootstrapModule(AppModule)
+ .catch(err => console.error(err));
diff --git a/src/material.scss b/src/material.scss
index 95bb8c4..ac68ee1 100644
--- a/src/material.scss
+++ b/src/material.scss
@@ -1,4 +1,4 @@
-@import '~@angular/material/theming';
+@import '../node_modules/@angular/material/theming';
@include mat-core();
$my-app-primary: mat-palette($mat-blue-grey);
$my-app-accent: mat-palette($mat-green);
diff --git a/src/polyfills.ts b/src/polyfills.ts
index 4e77c07..7c9e495 100644
--- a/src/polyfills.ts
+++ b/src/polyfills.ts
@@ -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.
* 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),
* 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
*/
-/** 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 */
// 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`.
- * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
- **/
+ * Web Animations `@angular/platform-browser/animations`
+ * 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`.
-
+/**
+ * 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.
-
/***************************************************************************************************
* 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';
diff --git a/src/index.prod.html b/src/prod/index.html
similarity index 98%
rename from src/index.prod.html
rename to src/prod/index.html
index f6ab599..f08ecbc 100644
--- a/src/index.prod.html
+++ b/src/prod/index.html
@@ -25,7 +25,7 @@
-
+