Browse Source

[Admin | Trunk]: Update to Angular 11

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@61384 d315682c-612b-4755-9ff5-7f18f6832af3
master
k.triantafyllou 6 months ago
parent
commit
62ce7ee7df
  1. 11
      .browserslistrc
  2. 21
      LICENSE
  3. 25
      README.md
  4. 14
      README.txt
  5. 149
      angular.json
  6. 3
      clean-library.sh
  7. 14
      e2e/app.e2e-spec.ts
  8. 11
      e2e/app.po.ts
  9. 6
      e2e/protractor.conf.js
  10. 23
      e2e/src/app.e2e-spec.ts
  11. 11
      e2e/src/app.po.ts
  12. 5
      e2e/tsconfig.e2e.json
  13. 2
      interactivemining-install.sh
  14. BIN
      interactiveminingv3.tgz
  15. 103
      package.json
  16. 32
      src/app/app.component.ts
  17. 2
      src/app/app.module.ts
  18. 17
      src/app/app.routing.ts
  19. 13
      src/app/main.ts
  20. 12
      src/app/pages/admin-tools/admin-tools-routing.module.ts
  21. 6
      src/app/pages/admin-tools/portal-admin-tools-routing.module.ts
  22. 14
      src/app/pages/community-info/community-info-routing.module.ts
  23. 2
      src/app/pages/community-info/profile/profile.component.ts
  24. 12
      src/app/pages/community-routing.module.ts
  25. 2
      src/app/pages/content-providers/manage-content-providers.component.ts
  26. 39
      src/app/pages/customization/Border.component.ts
  27. 2
      src/app/pages/customization/Color.component.ts
  28. 4
      src/app/pages/customization/customization.module.ts
  29. 4
      src/app/pages/mining/mining.component.ts
  30. 2
      src/app/pages/mining/mining.module.ts
  31. 9
      src/app/pages/projects/manage-projects.component.ts
  32. 2
      src/app/pages/stats/stats.module.ts
  33. 23
      src/app/pages/subjects/subjects-edit-form/subjects-edit-form.component.ts
  34. 3
      src/app/pages/usernotifications/manage-user-notifications.module.ts
  35. 10
      src/app/pages/users/users-routing.module.ts
  36. 4
      src/app/pages/zenodo-communities/zenodo-communities.component.ts
  37. 49
      src/app/polyfills.ts
  38. 27
      src/app/services/help-content.service.ts
  39. 2
      src/app/services/manageContentProviders.service.ts
  40. 9
      src/karma.conf.js
  41. 3
      src/main.ts
  42. 8
      src/mining.scss
  43. 70
      src/polyfills.ts
  44. 1
      src/styles.css
  45. 14
      src/test.ts
  46. 23
      src/tsconfig.app.json
  47. 3
      src/tsconfig.spec.json
  48. 5
      src/typings.d.ts
  49. 15
      tsconfig.json
  50. 141
      tslint.json

11
.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

21
LICENSE

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2017 Stefanos Gatsios
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

25
README.md

@ -1,18 +1,24 @@
# AdminPortal
# Connect Admin
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:5000`. 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.<br>
Use the `npm run build-beta` for a beta build.<br>
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).

14
README.txt

@ -1,14 +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.*

149
angular.json

@ -1,71 +1,134 @@
{
"$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": {
"admin-portal": {
"connect-admin": {
"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/connect-admin",
"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"
],
"styles": [
"src/material.scss",
"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/mining.scss",
"src/styles.css"
],
"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"
]
},
"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"
},
{
"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": {
"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"
}
]
}
@ -74,45 +137,33 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "admin-portal:build"
"browserTarget": "connect-admin:build"
},
"configurations": {
"production": {
"browserTarget": "admin-portal:build:production"
},
"beta": {
"browserTarget": "admin-portal:build:beta"
"browserTarget": "connect-admin:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "admin-portal:build"
"browserTarget": "connect-admin: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/assets"
]
}
},
@ -130,24 +181,27 @@
}
}
},
"admin-portal-e2e": {
"root": "e2e",
"sourceRoot": "e2e",
"connect-admin-e2e": {
"root": "e2e/",
"projectType": "application",
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "admin-portal:serve"
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "connect-admin:serve"
},
"configurations": {
"production": {
"devServerTarget": "connect-admin:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
@ -156,14 +210,5 @@
}
}
},
"defaultProject": "admin-portal",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "css"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
"defaultProject": "connect-admin"
}

3
clean-library.sh

@ -0,0 +1,3 @@
cd src/app/openaireLibrary
cd ../../../
echo "Done"

14
e2e/app.e2e-spec.ts

@ -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!');
});
});

11
e2e/app.po.ts

@ -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();
}
}

6
protractor.conf.js → 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 } }));
}
};
};

23
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 connect-admin!');
});
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));
});
});

11
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<any>;
}
getTitleText() {
return element(by.css('app-root h1')).getText() as Promise<string>;
}
}

5
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"
]
}
}
}

2
interactivemining-install.sh

@ -1,7 +1,7 @@
rm -f interactiveminingv3.tgz
git clone https://github.com/tasosgig/interactive-mining.git
cd interactive-mining/
git checkout angular7
git checkout angular11
cd interactive-mining-angular-frontend/
npm install
npm run packagr

BIN
interactiveminingv3.tgz

Binary file not shown.

103
package.json

@ -1,76 +1,65 @@
{
"name": "admin-portal",
"version": "0.0.0",
"license": "MIT",
"name": "connect-admin",
"version": "1.0.0",
"scripts": {
"ng": "ng",
"clean-install": "rm -rf node_modules; npm install; npm run mining",
"mining": "./interactivemining-install.sh",
"start": "ng serve --host 0.0.0.0 --disable-host-check --port=5000",
"build": "ng build --prod; npm run after-build-clean",
"build-beta": "ng build --configuration=beta; npm run after-build-clean",
"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/monitor-dashboard/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/ dist/assets/connect-assets/.svn/ dist/assets/dashboard-theme/.svn/"
"mining": "chmod +x interactivemining-install.sh && ./interactivemining-install.sh",
"postinstall": "chmod +x clean-library.sh && ./clean-library.sh && npm run mining",
"after-build-clean": "rm -rf dist/connect-admin/assets/common-assets/.svn/ dist/connect-admin/assets/dashboard-theme/.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-datatables": "^4.4.1",
"citation-js": "^0.3.4",
"ng2-ckeditor": "1.1.9",
"@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",
"datatables.net": "^1.10.19",
"datatables.net-dt": "^1.10.19",
"interactiveminingv3": "file:interactiveminingv3.tgz",
"core-js": "^2.5.4",
"express": "^4.15.2",
"jquery": "^3.4.1",
"ng-recaptcha": "^3.0.5",
"ngx-bootstrap": "^1.6.6",
"ng-recaptcha": "^7.0.1",
"ng2-ckeditor": "1.3.1",
"ngx-color-picker": "^8.1.0",
"ngx-json-ld": "0.1.6",
"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",
"sass-loader": "7.3.1"
},
"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": "^8.0.30",
"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",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.4",
"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",
"rxjs": "6.5.1",
"rxjs-compat": "^6.5.1",
"rxjs-tslint": "^0.1.7"
"typescript": "~4.0.7"
}
}

32
src/app/app.component.ts

@ -1,6 +1,6 @@
import {ChangeDetectorRef, Component, HostListener, OnInit} from '@angular/core';
import {MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu';
import {ActivatedRoute, NavigationEnd, Params, Router} from '@angular/router';
import {ActivatedRoute, Data, NavigationEnd, Params, Router} from '@angular/router';
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
import {Session, User} from './openaireLibrary/login/utils/helper.class';
import {UserManagementService} from './openaireLibrary/services/user-management.service';
@ -12,6 +12,8 @@ import {CommunityInfo} from "./openaireLibrary/connect/community/communityInfo";
import {CommunityService} from "./openaireLibrary/connect/community/community.service";
import {arrow_left} from "./openaireLibrary/utils/icons/icons";
import {SmoothScroll} from "./openaireLibrary/utils/smooth-scroll";
import {ConnectHelper} from './openaireLibrary/connect/connectHelper';
import {ConfigurationService} from './openaireLibrary/utils/configuration/configuration.service';
@Component({
selector: 'app-root',
@ -22,6 +24,7 @@ export class AppComponent implements OnInit {
properties: EnvProperties = properties;
user: User;
params: BehaviorSubject<Params> = new BehaviorSubject<Params>(null);
data: BehaviorSubject<Data> = new BehaviorSubject<Data>(null);
hasSidebar: boolean = false;
hasHeader: boolean = false;
hasAdminMenu: boolean = false;
@ -55,17 +58,17 @@ export class AppComponent implements OnInit {
private cdr: ChangeDetectorRef,
private smoothScroll: SmoothScroll,
private layoutService: LayoutService,
private userManagementService: UserManagementService) {
private userManagementService: UserManagementService,
private configurationService: ConfigurationService) {
this.subscriptions.push(this.router.events.subscribe(event => {
if (event instanceof NavigationEnd) {
let r = this.route;
let params = r.snapshot.params;
while (r.firstChild && !params['community']) {
while (r.firstChild) {
r = r.firstChild;
params = r.snapshot.params
}
this.paramsResolved = true;
this.params.next(params);
this.params.next(r.snapshot.params);
this.data.next(r.snapshot.data);
}
}));
}
@ -104,6 +107,7 @@ export class AppComponent implements OnInit {
this.subscriptions.push(this.communityService.getCommunity(params['community']).subscribe(community => {
if (community) {
this.community = community;
this.setProperties(community.communityId);
this.buildMenu();
this.loading = false;
} else {
@ -125,6 +129,12 @@ export class AppComponent implements OnInit {
}
}
}));
this.subscriptions.push(this.data.subscribe(data => {
if(data && data.portal) {
this.setProperties(data.portal);
this.configurationService.initCommunityInformation(this.properties, this.properties.adminToolsCommunity);
}
}));
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
this.user = user;
if (this.user) {
@ -158,6 +168,16 @@ export class AppComponent implements OnInit {
this.smoothScroll.clearSubscriptions();
}
setProperties(id, type = null){
this.properties.adminToolsCommunity = id;
if(type) {
this.properties.adminToolsPortalType = type;
} else {
ConnectHelper.setPortalTypeFromPid(id);
}
this.configurationService.initCommunityInformation(this.properties, this.properties.adminToolsCommunity);
}
public get open() {
return this.layoutService.open;
}

2
src/app/app.module.ts

@ -11,7 +11,6 @@ import {IsCommunity} from './openaireLibrary/connect/communityGuard/isCommunity.
import {AdminErrorPageComponent} from './pages/error/errorPage.component';
import {ErrorModule} from './openaireLibrary/error/error.module';
import {TitleCasePipe} from '@angular/common';
import {InteractiveMiningModule} from 'interactiveminingv3';
import {CommunityService} from './openaireLibrary/connect/community/community.service';
import {SubscribeService} from './openaireLibrary/utils/subscribe/subscribe.service';
import {ConnectRIGuard} from './openaireLibrary/connect/communityGuard/connectRIGuard.guard';
@ -23,6 +22,7 @@ import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.servi
import {DEFAULT_TIMEOUT, TimeoutInterceptor} from "./openaireLibrary/timeout-interceptor.service";
import {AdminLoginGuard} from "./openaireLibrary/login/adminLoginGuard.guard";
import {LoginGuard} from "./openaireLibrary/login/loginGuard.guard";
import {InteractiveMiningModule} from 'interactiveminingv3';
@NgModule({
imports: [

17
src/app/app.routing.ts

@ -9,17 +9,17 @@ import {LoginGuard} from "./openaireLibrary/login/loginGuard.guard";
const routes: Routes = [
{
path: '',
loadChildren: './pages/manage-communities/manage-communities.module#ManageCommunitiesModule',
loadChildren: () => import('./pages/manage-communities/manage-communities.module').then(m => m.ManageCommunitiesModule),
canActivateChild: [LoginGuard]
},
{
path: 'reload',
loadChildren: './reload/libReload.module#LibReloadModule',
loadChildren: () => import('./reload/libReload.module').then(m => m.LibReloadModule),
data: {hasSidebar: false, hasHeader: false}
},
{
path: 'user-info',
loadChildren: './login/libUser.module#LibUserModule',
loadChildren: () => import('./login/libUser.module').then(m => m.LibUserModule),
data: {hasSidebar: false}
},
{ path: 'error',
@ -29,19 +29,19 @@ const routes: Routes = [
},
{
path: 'connect/admin-tools',
loadChildren: './pages/admin-tools/admin-tools-routing.module#AdminToolsRoutingModule',
loadChildren: () => import('./pages/admin-tools/admin-tools-routing.module').then(m => m.AdminToolsRoutingModule),
canActivateChild: [AdminLoginGuard],
data: {portal: 'connect'}
},
{
path: 'openaire/admin-tools',
loadChildren: './pages/admin-tools/admin-tools-routing.module#AdminToolsRoutingModule',
loadChildren: () => import('./pages/admin-tools/admin-tools-routing.module').then(m => m.AdminToolsRoutingModule),
canActivateChild: [AdminLoginGuard],
data: {portal: 'openaire'}
},
{
path: 'admin-tools',
loadChildren: './pages/admin-tools/portal-admin-tools-routing.module#PortalAdminToolsRoutingModule',
loadChildren: () => import('./pages/admin-tools/portal-admin-tools-routing.module').then(m => m.PortalAdminToolsRoutingModule),
canActivateChild: [AdminLoginGuard]
},
{
@ -49,7 +49,7 @@ const routes: Routes = [
},
{
path: ':community',
loadChildren: './pages/community-routing.module#CommunityRoutingModule',
loadChildren: () => import('./pages/community-routing.module').then(m => m.CommunityRoutingModule),
canActivateChild: [IsCommunity, ConnectAdminLoginGuard]
},
{ path: '**',
@ -62,8 +62,7 @@ const routes: Routes = [
@NgModule({
imports: [RouterModule.forRoot(routes, {
preloadingStrategy: PreloadAllModules,
onSameUrlNavigation: "reload",
relativeLinkResolution: 'corrected'
onSameUrlNavigation: "reload"
})],
exports: [ RouterModule ]
})

13
src/app/main.ts

@ -1,13 +0,0 @@
/**
* Created by stefania on 10/3/16.
*/
import './polyfills.ts';
//import './vendors.ts';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
import {enableProdMode} from "@angular/core";
const platform = platformBrowserDynamic();
if(process.env.PRODUCTION) {enableProdMode();}
platform.bootstrapModule(AppModule);

12
src/app/pages/admin-tools/admin-tools-routing.module.ts

@ -6,32 +6,32 @@ import {RouterModule} from '@angular/router';
RouterModule.forChild([
{
path: 'entities',
loadChildren: '../../openaireLibrary/dashboard/entity/entities.module#EntitiesModule',
loadChildren: () => import('../../openaireLibrary/dashboard/entity/entities.module').then(m => m.EntitiesModule),
pathMatch: 'full'
},
{
path: 'classContents',
loadChildren: '../../openaireLibrary/dashboard/divhelpcontent/class-help-contents.module#ClassHelpContentsModule',
loadChildren: () => import('../../openaireLibrary/dashboard/divhelpcontent/class-help-contents.module').then(m => m.ClassHelpContentsModule),
pathMatch: 'full'
},
{
path: 'classContents/edit',
loadChildren: '../../openaireLibrary/dashboard/divhelpcontent/class-help-content-form.module#ClassHelpContentFormModule',
loadChildren: () => import('../../openaireLibrary/dashboard/divhelpcontent/class-help-content-form.module').then(m => m.ClassHelpContentFormModule),
pathMatch: 'full'
},
{
path: 'helptexts',
loadChildren: '../../openaireLibrary/dashboard/helpTexts/page-help-contents.module#PageHelpContentsModule',
loadChildren: () => import('../../openaireLibrary/dashboard/helpTexts/page-help-contents.module').then(m => m.PageHelpContentsModule),
pathMatch: 'full'
},
{
path: 'helptexts/edit',
loadChildren: '../../openaireLibrary/dashboard/helpTexts/page-help-content-form.module#PageHelpContentFormModule',
loadChildren: () => import('../../openaireLibrary/dashboard/helpTexts/page-help-content-form.module').then(m => m.PageHelpContentFormModule),
pathMatch: 'full'
},
{
path: 'pages',
loadChildren: '../../openaireLibrary/dashboard/page/pages.module#PagesModule',
loadChildren: () => import('../../openaireLibrary/dashboard/page/pages.module').then(m => m.PagesModule),
pathMatch: 'full'
}
])

6
src/app/pages/admin-tools/portal-admin-tools-routing.module.ts

@ -3,9 +3,9 @@ import {RouterModule} from "@angular/router";
@NgModule({
imports: [RouterModule.forChild([
{path: '', loadChildren: './admin-tools-routing.module#AdminToolsRoutingModule'},
{path: 'portals', loadChildren: '../../openaireLibrary/dashboard/portal/portals.module#PortalsModule'},
{path: 'classes', loadChildren: '../../openaireLibrary/dashboard/divId/divIds.module#DivIdsModule'}
{path: '', loadChildren: () => import('./admin-tools-routing.module').then(m => m.AdminToolsRoutingModule)},
{path: 'portals', loadChildren: () => import('../../openaireLibrary/dashboard/portal/portals.module').then(m => m.PortalsModule)},
{path: 'classes', loadChildren: () => import('../../openaireLibrary/dashboard/divId/divIds.module').then(m => m.DivIdsModule)}
])]
})
export class PortalAdminToolsRoutingModule {

14
src/app/pages/community-info/community-info-routing.module.ts

@ -6,13 +6,13 @@ import {ConnectCommunityGuard} from "../../openaireLibrary/connect/communityGuar
imports: [
RouterModule.forChild([
{path: '', redirectTo: 'profile', pathMatch: 'full'},
{path: 'profile', loadChildren: './profile/profile.module#ProfileModule'},
{path: 'organizations', loadChildren: '../affiliations/affiliations.module#AffiliationsModule'},
{path: 'projects', loadChildren: '../projects/communityProjects.module#CommunityProjectsModule'},
{path: 'content-providers', loadChildren: '../content-providers/communityContentProviders.module#CommunityContentProvidersModule'},
{path: 'content-providers/:provider', loadChildren: '../content-providers/criteria/criteria.module#CriteriaModule'},
{path: 'zenodo-communities', loadChildren: '../zenodo-communities/zenodo-communities.module#ZenodoCommunitiesModule'},
{path: 'subjects', canActivateChild: [ConnectCommunityGuard], loadChildren: '../subjects/subjects-edit-form/subjects-edit-form.module#SubjectsEditFormModule'},
{path: 'profile', loadChildren: () => import('./profile/profile.module').then(m => m.ProfileModule)},
{path: 'organizations', loadChildren: () => import('../affiliations/affiliations.module').then(m => m.AffiliationsModule)},
{path: 'projects', loadChildren: () => import('../projects/communityProjects.module').then(m => m.CommunityProjectsModule)},
{path: 'content-providers', loadChildren: () => import('../content-providers/communityContentProviders.module').then(m => m.CommunityContentProvidersModule)},
{path: 'content-providers/:provider', loadChildren: () => import('../content-providers/criteria/criteria.module').then(m => m.CriteriaModule)},
{path: 'zenodo-communities', loadChildren: () => import('../zenodo-communities/zenodo-communities.module').then(m => m.ZenodoCommunitiesModule)},
{path: 'subjects', canActivateChild: [ConnectCommunityGuard], loadChildren: () => import('../subjects/subjects-edit-form/subjects-edit-form.module').then(m => m.SubjectsEditFormModule)},
])
],
providers: [ConnectCommunityGuard]

2
src/app/pages/community-info/profile/profile.component.ts

@ -56,7 +56,7 @@ export class ProfileComponent implements OnInit, OnDestroy {
public properties: EnvProperties = properties;
public loading: boolean = false;
private subscriptions: any[] = [];
@ViewChild('editCommunityComponent') editCommunityComponent: EditCommunityComponent;
@ViewChild('editCommunityComponent', { static: true }) editCommunityComponent: EditCommunityComponent;
constructor(private communityService: CommunityService,
private title: Title) {

12
src/app/pages/community-routing.module.ts

@ -6,31 +6,31 @@ import {ConnectRIGuard} from "../openaireLibrary/connect/communityGuard/connectR
imports: [RouterModule.forChild([
{
path: 'info',
loadChildren: './community-info/community-info-routing.module#CommunityInfoRoutingModule',
loadChildren: () => import('./community-info/community-info-routing.module').then(m => m.CommunityInfoRoutingModule),
},
{
path: 'users',
loadChildren: './users/users-routing.module#UsersRoutingModule'
loadChildren: () => import('./users/users-routing.module').then(m => m.UsersRoutingModule)
},
{
path: 'mining',
loadChildren: './mining/mining.module#MiningModule',
loadChildren: () => import('./mining/mining.module').then(m => m.MiningModule),
canActivateChild: [ConnectRIGuard]
},
{
path: 'admin-tools',
loadChildren: './admin-tools/admin-tools-routing.module#AdminToolsRoutingModule',
loadChildren: () => import('./admin-tools/admin-tools-routing.module').then(m => m.AdminToolsRoutingModule),
data: {
param: 'community'
}
},
{
path: 'stats',
loadChildren: './stats/stats.module#StatsModule'
loadChildren: () => import('./stats/stats.module').then(m => m.StatsModule)
},
{
path: 'customize-layout',
loadChildren: './customization/customization.module#CustomizationModule',
loadChildren: () => import('./customization/customization.module').then(m => m.CustomizationModule),
}
])]
})

2
src/app/pages/content-providers/manage-content-providers.component.ts

@ -44,7 +44,7 @@ import {Subscriber} from "rxjs";
export class ManageContentProvidersComponent implements OnInit {
@Input() communityContentProviders = [];
@ViewChild(RemoveContentProvidersComponent) removeContentProvidersComponent: RemoveContentProvidersComponent;
@ViewChild('fsModal') fullscreen: FullScreenModalComponent;
@ViewChild('fsModal', { static: true }) fullscreen: FullScreenModalComponent;
public toggle: boolean = false;

39
src/app/pages/customization/Border.component.ts

@ -4,19 +4,19 @@ import {Component, EventEmitter, Input, OnInit, Output,} from '@angular/core';
@Component({
selector: 'border',
template: `
<div class="uk-grid uk-child-width-1-2" >
<div class="uk-grid uk-child-width-1-2">
<div class="uk-margin-remove">
<div class="uk-text-bold uk-form-label uk-margin-small-bottom"> Border radius (px)</div>
<!-- <div class="uk-margin-bottom uk-form-hint ">hint</div>-->
<!-- <div class="uk-margin-bottom uk-form-hint ">hint</div>-->
<div class="input-box">
<input class="uk-input " [(ngModel)]="radius" (ngModelChange)="borderChanged()" type="number" min="0" />
<input class="uk-input" [(ngModel)]="radius" (input)="borderChanged()" type="number" min="0"/>
</div>
</div>
<div class="uk-margin-remove">
<div class="uk-text-bold uk-form-label uk-margin-small-bottom"> Border width (px)</div>
<!-- <div class="uk-margin-bottom uk-form-hint "> hint</div>-->
<div class="input-box">
<input class="uk-input " [(ngModel)]="width" (ngModelChange)="borderChanged()" type="number" min="0" />
<input class="uk-input" [(ngModel)]="width" (input)="borderChanged()" type="number" min="0"/>
</div>
</div>
<div class="uk-margin-small-top">
@ -24,42 +24,41 @@ import {Component, EventEmitter, Input, OnInit, Output,} from '@angular/core';
<!-- <div class="uk-margin-bottom uk-form-hint "> hint</div>-->
<div class="input-box ">
<mat-form-field class="uk-width-1-1">
<mat-select class="" [(ngModel)]="style" name="{{'select_type_'}}"
<mat-select class="" [(ngModel)]="style" name="{{'select_type_'}}"
(ngModelChange)="borderChanged()"
[disableOptionCentering]="true"
panelClass="">
<mat-option [value]="'solid'" >solid</mat-option>
<mat-option [value]="'dotted'" >dotted</mat-option>
<mat-option [value]="'dashed'" >dashed</mat-option>
<mat-option [value]="'solid'">solid</mat-option>
<mat-option [value]="'dotted'">dotted</mat-option>
<mat-option [value]="'dashed'">dashed</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</div>
`
})
export class BorderComponent implements OnInit {
@Input() radius:number =0;
@Input() width:number =0;
@Input() radius: number = 0;
@Input() width: number = 0;
@Input() style = 'solid';
// @Input() addMargin: boolean = false;
@Output() borderChange = new EventEmitter();
constructor() {
}
ngOnInit() {
}
borderChanged() {
this.borderChange.emit({radius:this.radius, width:this.width, style:this.style});
console.log(this.radius);
this.borderChange.emit({radius: this.radius, width: this.width, style: this.style});
}
}

2
src/app/pages/customization/Color.component.ts

@ -8,7 +8,7 @@ import {CustomizationOptions} from '../../openaireLibrary/connect/community/Cust
<div [class]="(addMargin?'uk-margin-small-top':'') + ' colorPicker uk-flex uk-flex-middle'">
<div class=" uk-flex">
<div class="">
<input id="colorPickerInput" class="uk-margin-small-left uk-width-small " color-picker [colorPicker]="color" [style.background]="color"
<input class="uk-margin-small-left uk-width-small" color-picker [colorPicker]="color" [style.background]="color"
(colorPickerChange)="color=$event; colorChanged();"/>
</div>
<div class="uk-margin-small-left"> {{label}}</div>

4
src/app/pages/customization/customization.module.ts

@ -16,7 +16,9 @@ import {PageContentModule} from '../../openaireLibrary/dashboard/sharedComponent
import {QuickLookComponent} from './quickLook.component';
import {QuickLookBackgroundsComponent} from './quickLook-backgrounds.component';
import {QuickLookButtonsComponent} from './quickLook-buttons.component';
import {MatFormFieldModule, MatSelectModule, MatSlideToggleModule} from '@angular/material';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatSelectModule } from '@angular/material/select';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import {CustomizeButtonsComponent} from './customize-buttons.component';
import {IconsModule} from '../../openaireLibrary/utils/icons/icons.module';
import {IconsService} from '../../openaireLibrary/utils/icons/icons.service';

4
src/app/pages/mining/mining.component.ts

@ -8,7 +8,9 @@ import {Subscription} from "rxjs";
template: `
<div page-content>
<div inner>
<router-outlet></router-outlet>
<div class="mining">
<router-outlet></router-outlet>
</div>
</div>
</div>
`

2
src/app/pages/mining/mining.module.ts

@ -10,7 +10,7 @@ import {PageContentModule} from "../../openaireLibrary/dashboard/sharedComponent
RouterModule.forChild([
{
path: '', component: MiningComponent, children: [
{path: '', loadChildren: './mining-routing.module#MiningRoutingModule'}
{path: '', loadChildren: () => import('./mining-routing.module').then(m => m.MiningRoutingModule)}
]
}
]),

9
src/app/pages/projects/manage-projects.component.ts

@ -43,7 +43,7 @@ import {Subscriber} from "rxjs";
export class ManageProjectsComponent implements OnInit {
@Input() communityProjects = [];
@ViewChild(RemoveProjectsComponent) removeProjectsComponent: RemoveProjectsComponent;
@ViewChild('fsModal') fullscreen: FullScreenModalComponent;
@ViewChild('fsModal', { static: true }) fullscreen: FullScreenModalComponent;
public toggle: boolean = false;
@ -69,11 +69,10 @@ export class ManageProjectsComponent implements OnInit {
this.body = "[Please write your message here]";
this.body = StringUtils.URIEncode(this.body);
}
this.fullscreen.title = "Search and Add Projects";
this.fullscreen.okButtonText = "Done";
this.fullscreen.okButton = true;
}));
this.fullscreen.title = "Search and Add Projects";
this.fullscreen.okButtonText = "Done";
this.fullscreen.okButton = true;
}
public ngOnDestroy() {

2
src/app/pages/stats/stats.module.ts

@ -3,7 +3,7 @@ import {RouterModule} from '@angular/router';
import {CommonModule} from '@angular/common';
import {StatsComponent} from './stats.component';
import {StatsRoutingModule} from './stats-routing.module';
import {MatSlideToggleModule} from '@angular/material';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
@NgModule({
imports: [

23
src/app/pages/subjects/subjects-edit-form/subjects-edit-form.component.ts

@ -6,14 +6,13 @@ import {SubjectsService} from '../subjects.service';
import {EnvProperties} from '../../../openaireLibrary/utils/properties/env-properties';
import {Session} from '../../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class';
import {concat} from 'rxjs/observable/concat';
import {Title} from '@angular/platform-browser';
import {properties} from '../../../../environments/environment';
import {AlertModal} from '../../../openaireLibrary/utils/modal/alert';
import {SearchInputComponent} from '../../../openaireLibrary/sharedComponents/search-input/search-input.component';
import {Subscription} from 'rxjs';
import {Subscription, zip} from 'rxjs';
import {CommunityInfo} from '../../../openaireLibrary/connect/community/communityInfo';
import {concat} from 'rxjs/operators';
declare var UIkit;
@ -156,17 +155,13 @@ export class SubjectsEditFormComponent implements OnInit {
const subjectsToDelete = this.getNonEmptyItems(subjectsToDeleteAr);
const subjectsToAdd = this.getNonEmptyItems(subjectsToAddAr);
if (subjectsToAdd.length > 0 && subjectsToDelete.length > 0) {
const obs = concat(this._subjectsService.addSubjects(
this.properties.communityAPI + this.communityId + '/subjects', subjectsToAdd),
this._subjectsService.removeSubjects(
this.properties.communityAPI + this.communityId + '/subjects', subjectsToDelete));
this.subscriptions.push(obs.subscribe(res => {
if (res['method'] === 'delete') {
this.afterUpdateActions(res, "updated");
}
},
error => this.handleUpdateError('System error updating subjects', error)
));
this.subscriptions.push(this._subjectsService.removeSubjects(
this.properties.communityAPI + this.communityId + '/subjects', subjectsToDelete).subscribe(res =>{
this.subscriptions.push(this._subjectsService.addSubjects(
this.properties.communityAPI + this.communityId + '/subjects', subjectsToAdd).subscribe(res => {
this.afterUpdateActions(res, "added");
}));
}));
} else if (subjectsToAdd.length > 0) {
this.subscriptions.push(this._subjectsService.addSubjects(
this.properties.communityAPI + this.communityId + '/subjects', subjectsToAdd).subscribe(res => {

3
src/app/pages/usernotifications/manage-user-notifications.module.ts

@ -9,7 +9,8 @@ import {MailPrefsModule} from '../../openaireLibrary/connect/userEmailPreference
import {ManageUserNotificationsRoutingModule} from './manage-user-notifications-routing.module';
import {UsersTabsModule} from '../users/users-tabs.module';
import {PageContentModule} from '../../openaireLibrary/dashboard/sharedComponents/page-content/page-content.module';
import {MatSelectModule, MatSlideToggleModule} from '@angular/material';
import { MatSelectModule } from '@angular/material/select';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import {LoadingModule} from '../../openaireLibrary/utils/loading/loading.module';
import {SharedModule} from '../../openaireLibrary/shared/shared.module';

10
src/app/pages/users/users-routing.module.ts

@ -5,14 +5,14 @@ import {RouterModule} from '@angular/router';
imports: [
RouterModule.forChild([
{path: '', redirectTo: 'managers', pathMatch: 'full'},
{path: 'managers', loadChildren: './users-managers/users-managers.module#UsersManagersModule'},
{path: 'subscribers', loadChildren: './users-subscribers/users-subscribers.module#UsersSubscribersModule'},
{path: 'managers', loadChildren: () => import('./users-managers/users-managers.module').then(m => m.UsersManagersModule)},
{path: 'subscribers', loadChildren: () => import('./users-subscribers/users-subscribers.module').then(m => m.UsersSubscribersModule)},
{
path: 'notifications',
loadChildren: '../usernotifications/manage-user-notifications.module#ManageUserNotificationsModule'
loadChildren: () => import('../usernotifications/manage-user-notifications.module').then(m => m.ManageUserNotificationsModule)
},
{path: 'claims', loadChildren: '../claims/claims.module#ClaimsModule'},
{path: 'personal', loadChildren: './personal-info/personal-info.module#PersonalInfoModule'}
{path: 'claims', loadChildren: () => import('../claims/claims.module').then(m => m.ClaimsModule)},
{path: 'personal', loadChildren: () => import('./personal-info/personal-info.module').then(m => m.PersonalInfoModule)}
])
]
})

4
src/app/pages/zenodo-communities/zenodo-communities.component.ts

@ -58,7 +58,7 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
zenodoSearchUtils: SearchUtilsClass = new SearchUtilsClass();
public errorCodes: ErrorCodes = new ErrorCodes();
subscriptions = [];
@ViewChild('fsModal') fullscreen: FullScreenModalComponent;
@ViewChild('fsModal', { static: true }) fullscreen: FullScreenModalComponent;
@ViewChild('manage') manage: ManageZenodoCommunitiesComponent;
constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router,
@ -122,8 +122,6 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
this.fullscreen.title = "Search and Add Zenodo Communities";
this.fullscreen.okButtonText = "Done";
this.fullscreen.okButton = true;
}
ngOnDestroy() {

49
src/app/polyfills.ts

@ -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');
//
// }

27
src/app/services/help-content.service.ts

@ -1,20 +1,19 @@
/**
* Created by stefania on 7/13/17.
*/
import { Injectable } from '@angular/core';
import {HttpClient, HttpErrorResponse, HttpHeaders} from "@angular/common/http";
import {Observable, Subscription} from 'rxjs';
import { Page } from "../domain/page";
import { PageHelpContent } from "../domain/page-help-content";
import { Portal } from "../domain/portal";
import { Entity } from "../domain/entity";
import { DivId } from "../domain/divId";
import { DivHelpContent } from "../domain/div-help-content";
import {Injectable} from '@angular/core';
import {HttpClient, HttpErrorResponse} from '@angular/common/http';
import {Observable, throwError} from 'rxjs';
import {Page} from '../domain/page';
import {PageHelpContent} from '../domain/page-help-content';
import {Portal} from '../domain/portal';
import {Entity} from '../domain/entity';
import {DivId} from '../domain/divId';
import {DivHelpContent} from '../domain/div-help-content';
import {StatisticsDisplay, StatisticsSummary} from '../openaireLibrary/connect/statistics/statisticsEntities';
import { CustomOptions } from '../openaireLibrary/services/servicesUtils/customOptions.class';
import {catchError, map} from "rxjs/operators";
import {COOKIE} from "../openaireLibrary/login/utils/helper.class";
import {properties} from "../../environments/environment";
import {CustomOptions} from '../openaireLibrary/services/servicesUtils/customOptions.class';
import {catchError, map} from 'rxjs/operators';
import {properties} from '../../environments/environment';
@Injectable()
@ -426,7 +425,7 @@ export class HelpContentService {
// in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console
console.error(error);
return Observable.throw(error.error || 'Server error');
return throwError(error.error || 'Server error');
}
// getDataProviders() {

2
src/app/services/manageContentProviders.service.ts

@ -2,7 +2,7 @@ import {Injectable} from '@angular/core';
import {HttpClient, HttpHeaders} from '@angular/common/http';
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import {ContentProvider} from '../openaireLibrary/utils/entities/contentProvider';
import {Observable} from 'rxjs/Observable';
import {Observable} from 'rxjs';
@Injectable()
export class ManageCommunityContentProvidersService {

9
karma.conf.js → 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/connect-admin'),
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
});
};

3
src/main.ts

@ -8,4 +8,5 @@ if (properties.environment !== "development") {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));

8
src/mining.scss

@ -0,0 +1,8 @@
@use "sass:meta";
@import "~interactiveminingv3/assets/css/variables.css";
.mining {
@include meta.load-css("node_modules/interactiveminingv3/assets/css/interactive-mining.css");
@include meta.load-css("node_modules/interactiveminingv3/assets/css/animations.css");
}

70
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
*/