[Trunk | Graph]: Initial commit for OpenAIRE Research Graph portal.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-graph-portal/trunk@59507 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
Konstantina Galouni 2020-10-05 16:36:30 +00:00
parent a3016b2dd3
commit 0ba45f038e
51 changed files with 13300 additions and 0 deletions

28
README.md Normal file
View File

@ -0,0 +1,28 @@
# Graph Portal
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.3.0.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4900/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
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`.
## Build
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.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## 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).

15
README.txt Normal file
View File

@ -0,0 +1,15 @@
*******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

165
angular.json Normal file
View File

@ -0,0 +1,165 @@
{
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"graph-portal": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets"
],
"styles": [
"src/styles.css",
"src/material.scss"
],
"scripts": [
"src/assets/common-assets/common/jquery.js",
"src/assets/common-assets/common/uikit.min.js",
"src/assets/common-assets/common/uikit-icons.min.js",
"node_modules/jquery/dist/jquery.js"
]
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
},
"beta": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.beta.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "graph-portal:build"
},
"configurations": {
"production": {
"browserTarget": "graph-portal:build:production"
},
"beta": {
"browserTarget": "graph-portal:build:beta"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "graph-portal: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"
],
"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"
],
"assets": [
"src/assets",
"src/robots.txt"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"graph-portal-e2e": {
"root": "e2e",
"sourceRoot": "e2e",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "graph-portal:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "graph-portal",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "css"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
}

14
e2e/app.e2e-spec.ts Normal file
View File

@ -0,0 +1,14 @@
import { AppPage } from './app.po';
describe('graph-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 Normal file
View File

@ -0,0 +1,11 @@
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}

14
e2e/tsconfig.e2e.json Normal file
View File

@ -0,0 +1,14 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"baseUrl": "./",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}

31
karma.conf.js Normal file
View File

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

11330
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

72
package.json Normal file
View File

@ -0,0 +1,72 @@
{
"name": "graph-portal",
"version": "0.0.1",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve --host 0.0.0.0 --disable-host-check --port=4900",
"build": "ng build --prod",
"build-beta": "ng build --configuration=beta",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"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",
"clipboard": "^1.5.16",
"core-js": "2.6.8",
"datatables.net": "^1.10.19",
"datatables.net-dt": "^1.10.19",
"jquery": "^3.4.1",
"ng2-ckeditor": "1.1.9",
"ngx-bootstrap": "^1.6.6",
"ngx-color-picker": "^8.1.0",
"ngx-json-ld": "0.1.6",
"ng-recaptcha": "^3.0.5",
"ts-md5": "^1.2.0",
"tslib": "^1.9.0",
"zone.js": "0.8.29"
},
"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",
"@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",
"ts-node": "~7.0.0",
"tslint": "^5.7.0",
"typescript": "3.2.4"
}
}

28
protractor.conf.js Normal file
View File

@ -0,0 +1,28 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4900/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};

View File

View File

View File

@ -0,0 +1,35 @@
import {AfterViewChecked, Component, OnInit} from '@angular/core';
import {faqs} from './faqs';
import {ActivatedRoute} from '@angular/router';
import {Title} from '@angular/platform-browser';
@Component({
selector: 'about',
templateUrl: 'about.component.html',
styleUrls: ['about.component.css'],
})
export class AboutComponent implements OnInit {
faqs: any[] = faqs;
constructor(private title: Title,
private route: ActivatedRoute) {
}
ngOnInit() {
this.title.setTitle('OpenAIRE - Research Graph | About');
// this.route.fragment.subscribe(fragment => {
// setTimeout(() => {
// this.goTo(fragment);
// }, 100);
// });
}
// goTo(id: string) {
// const yOffset = -100;
// const element = document.getElementById(id);
// if(element) {
// const y = element.getBoundingClientRect().top + window.pageYOffset + yOffset;
// window.scrollTo({top: y, behavior: 'smooth'});
// }
// }
}

View File

@ -0,0 +1,19 @@
import {NgModule} from "@angular/core";
import {CommonModule} from "@angular/common";
import {RouterModule} from "@angular/router";
import {AboutComponent} from "./about.component";
@NgModule({
imports: [
CommonModule,
RouterModule.forChild([{
path: '', component: AboutComponent
}])
],
declarations: [AboutComponent],
exports: [AboutComponent]
})
export class AboutModule {
}

6
src/app/about/faqs.ts Normal file
View File

@ -0,0 +1,6 @@
export const faqs = [
/* {
question: 'Test',
answer: 'Test'
}*/
];

View File

@ -0,0 +1,21 @@
<navbar *ngIf= "showMenu" portal="usage-counts" [onlyTop]="false" [userMenu]="false" [showLogo]="!isHome"
[user]="user" [userMenuItems]=userMenuItems [menuItems]=menuItems [properties]=properties></navbar>
<div class="custom-main-content">
<main [class.full-height]="isHome">
<router-outlet></router-outlet>
</main>
</div>
<bottom class="footer uk-visible@m"
[showSocialButtons]="true" [showMenuItems]="true" [showOpenaire]="true"
[darkBackground]="false" [centered]="true"></bottom>
<bottom class="footer uk-hidden@m"
[showSocialButtons]="true" [showMenuItems]="true" [showOpenaire]="true"
[darkBackground]="false" [centered]="true"></bottom>
<cookie-law position="bottom">
OpenAIRE uses cookies in order to function properly.<br>
Cookies are small pieces of data that websites store in your browser to allow us to give you the best browsing experience possible.
By using the OpenAIRE portal you accept our use of cookies. <a href="//ec.europa.eu/ipg/basics/legal/cookies/index_en.htm" target="_blank"> Read more <span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="chevron-right" ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.03" points="7 4 13 10 7 16"></polyline></svg>
</span></a>
</cookie-law>

View File

@ -0,0 +1,32 @@
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!');
}));
});

66
src/app/app.component.ts Normal file
View File

@ -0,0 +1,66 @@
import {Component, OnInit} from '@angular/core';
import {MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu';
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
import {User} from './openaireLibrary/login/utils/helper.class';
import {properties} from '../environments/environment';
import {LayoutService} from './services/layout.service';
@Component({
selector: 'app',
templateUrl: './app.component.html',
})
export class AppComponent implements OnInit {
title = 'OpenAIRE Research Graph';
userMenuItems: MenuItem[] = [];
menuItems: RootMenuItem [] = [];
logInUrl = null;
logOutUrl = null;
properties: EnvProperties = properties;
showMenu: boolean = false;
user: User;
isHome: boolean;
constructor(private layoutService: LayoutService) {}
ngOnInit() {
this.logInUrl = this.properties.loginUrl;
this.logOutUrl = this.properties.logoutUrl;
this.showMenu = true;
this.layoutService.isHome.subscribe(isHome => {
this.isHome = isHome;
this.buildMenu(isHome);
});
}
buildMenu(isHome) {
this.menuItems = [
{
rootItem: new MenuItem("about", "About", "", "/about", false, [], null, {}),
items: [
// new MenuItem("architecture", "Architecture", "", "/about", false, [], null, {}, null, 'architecture'),
/*
new MenuItem("faqs", "FAQs", "", "/about", false, [], null, {}, null, 'faqs')
*/
]
},
{
rootItem: new MenuItem("resources", "Resources", "", "/resources", false, [], null, {}),
items: [
// new MenuItem("provide", "OpenAIRE Provide", "", "/resources", false, [], null, {}),
// new MenuItem("apis", "APIs and Reports", "", "/resources", false, [], null, {}, null, 'apis')
]
},
{
rootItem: new MenuItem("contact", "Support", "", "/support", false, [], null, {}),
items: []
}
];
if(!isHome) {
this.menuItems = [{
rootItem: new MenuItem("home", "Home", "", "/", false, [], null, {}),
items: []
}].concat(this.menuItems);
}
}
}

31
src/app/app.module.ts Normal file
View File

@ -0,0 +1,31 @@
import {AppRoutingModule} from "./app.routing";
import {BrowserModule} from "@angular/platform-browser";
import {HttpClientModule} from "@angular/common/http";
import {CookieLawModule} from "./openaireLibrary/sharedComponents/cookie-law/cookie-law.module";
import {NavigationBarModule} from "./openaireLibrary/sharedComponents/navigationBar.module";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {SafeHtmlPipeModule} from "./openaireLibrary/utils/pipes/safeHTMLPipe.module";
import {AppComponent} from "./app.component";
import {NgModule} from "@angular/core";
import {EnvironmentSpecificService} from "./openaireLibrary/utils/properties/environment-specific.service";
import {BottomModule} from './openaireLibrary/sharedComponents/bottom.module';
@NgModule({
imports: [
AppRoutingModule,
BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
NavigationBarModule,
CookieLawModule,
SafeHtmlPipeModule,
BrowserAnimationsModule,
BottomModule
],
declarations: [
AppComponent,
],
providers: [EnvironmentSpecificService],
bootstrap: [ AppComponent ]
})
export class AppModule { }

34
src/app/app.routing.ts Normal file
View File

@ -0,0 +1,34 @@
import {NgModule} from '@angular/core';
import {Routes, RouterModule, PreloadAllModules} from '@angular/router';
const appRoutes: Routes = [
{
path: '',
loadChildren: './home/home.module#HomeModule',
data: {
isHome: true
}
},
{
path: 'resources',
loadChildren: './resources/resources.module#ResourcesModule'
},
{
path: 'support',
loadChildren: './contact/contact.module#ContactModule'
},
{
path: 'about',
loadChildren: './about/about.module#AboutModule'
}
];
@NgModule({
imports: [RouterModule.forRoot(appRoutes, {
preloadingStrategy: PreloadAllModules,
scrollPositionRestoration: 'top'
})],
exports: [RouterModule]
})
export class AppRoutingModule {
}

View File

@ -0,0 +1,14 @@
.contact {
background-image: url("/assets/usage-statistics-assets/contact/1.svg");
background-size: auto;
background-repeat: no-repeat;
background-position: 0 0;
}
.contact-card {
background: rgba(255, 255, 255, 0.5) 0 0 no-repeat padding-box;
box-shadow: 1px 3px 6px #00000029;
border: 1px solid #E0E0E0;
border-radius: 5px;
padding: 20px 80px;
}

View File

@ -0,0 +1,42 @@
<div class="uk-section uk-section-small uk-container uk-container-large contact">
<div class="uk-container uk-align-center">
<h2 class="uk-text-bold uk-text-center">Support</h2>
<div class="uk-grid uk-flex uk-flex-bottom" uk-grid>
<div class="uk-width-expand">
<div class="uk-margin-large-left uk-visible@s">
<div *ngIf="showLoading" class="uk-margin-large">
<div class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
</div>
<div *ngIf="!showLoading">
<contact-us [properties]="properties" [errorMessage]="errorMessage"
[right]="false" buttonClass="uk-button-primary"
[formTitle]="'Do you have a question? Contact us.'"
[contactForm]="contactForm" (sendEmitter)="send($event)"></contact-us>
</div>
</div>
<div class="uk-hidden@s">
<div *ngIf="showLoading" class="uk-margin-large">
<div class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
</div>
<div *ngIf="!showLoading">
<contact-us [properties]="properties" [errorMessage]="errorMessage"
[right]="false" buttonClass="uk-button-primary"
[formTitle]="'Do you have a question? Contact us.'"
[contactForm]="contactForm" (sendEmitter)="send($event)"></contact-us>
</div>
</div>
</div>
</div>
</div>
<div class="uk-align-center">
</div>
</div>
<modal-alert #AlertModal (alertOutput)="goToHome()">
<div class="uk-text-center">
Our team will respond to your submission soon.<br>
Press OK to redirect to OpenAIRE UsageCounts home page.
</div>
</modal-alert>

View File

@ -0,0 +1,104 @@
import {Component, OnInit, ViewChild} from '@angular/core';
import {Router} from '@angular/router';
import {EmailService} from '../openaireLibrary/utils/email/email.service';
import {Email} from '../openaireLibrary/utils/email/email';
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import {Composer} from '../openaireLibrary/utils/email/composer';
import {Title} from '@angular/platform-browser';
import {HelperFunctions} from '../openaireLibrary/utils/HelperFunctions.class';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {properties} from '../../environments/environment';
@Component({
selector: 'contact',
templateUrl: './contact.component.html',
styleUrls: ['contact.component.css']
})
export class ContactComponent implements OnInit {
public showLoading = true;
public errorMessage = '';
public email: Email;
public properties: EnvProperties = properties;
public contactForm: FormGroup;
@ViewChild('AlertModal') modal;
@ViewChild('recaptcha') recaptcha;
constructor(private router: Router,
private emailService: EmailService,
private title: Title,
private fb: FormBuilder) {
}
ngOnInit() {
this.title.setTitle('OpenAIRE - UsageCounts | Contact Us');
this.email = {body: '', subject: '', recipients: []};
this.reset();
this.showLoading = false;
}
public send(event) {
HelperFunctions.scroll();
if (event.valid === true) {
this.sendMail(this.properties.admins);
} else {
this.errorMessage = 'Please fill in all the required fields!';
}
}
public reset() {
this.contactForm = this.fb.group({
name: this.fb.control('', Validators.required),
email: this.fb.control('', [Validators.required, Validators.email]),
affiliation: this.fb.control('', Validators.required),
organization: this.fb.control('', Validators.required),
description: this.fb.control('', Validators.required),
recaptcha: this.fb.control('', Validators.required),
});
this.errorMessage = '';
}
private sendMail(admins: any) {
this.showLoading = true;
this.emailService.contact(this.properties,
Composer.composeEmailForUsageCounts(this.contactForm.value, admins),
this.contactForm.value.recaptcha).subscribe(
res => {
this.showLoading = false;
if (res) {
this.reset();
this.modalOpen();
} else {
this.errorMessage = 'Email sent failed! Please try again.';
this.contactForm.get('recaptcha').setValue('');
}
},
error => {
this.handleError('Email sent failed! Please try again.', error);
this.showLoading = false;
this.contactForm.get('recaptcha').setValue('');
}
);
}
public modalOpen() {
this.modal.okButton = true;
this.modal.alertTitle = 'Your request has been successfully submitted';
this.modal.alertMessage = false;
this.modal.cancelButton = false;
this.modal.okButtonLeft = false;
this.modal.okButtonText = 'OK';
this.modal.open();
}
handleError(message: string, error) {
this.errorMessage = message;
console.log('Server responded: ' + error);
this.showLoading = false;
}
public goToHome() {
this.router.navigate(['/']);
}
}

View File

@ -0,0 +1,37 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
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';
import {IsRouteEnabled} from '../openaireLibrary/error/isRouteEnabled.guard';
import {Schema2jsonldModule} from '../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module';
import {SEOServiceModule} from '../openaireLibrary/sharedComponents/SEO/SEOService.module';
import {ContactUsModule} from '../openaireLibrary/contact-us/contact-us.module';
import {BreadcrumbsModule} from '../openaireLibrary/utils/breadcrumbs/breadcrumbs.module';
@NgModule({
imports: [
RouterModule.forChild([{
path: '', component: ContactComponent
}]), CommonModule, RouterModule,
AlertModalModule, RecaptchaModule.forRoot(), HelperModule,
Schema2jsonldModule, SEOServiceModule, ContactUsModule, BreadcrumbsModule
],
declarations: [
ContactComponent
],
providers: [
EmailService, PiwikService, IsRouteEnabled
],
exports: [
ContactComponent
]
})
export class ContactModule { }

View File

@ -0,0 +1,15 @@
.portal-color.emphasis {
color: #37C7E9;
font-size: 40px;
font-weight: bold;
}
/*.numbers-background {*/
/* background: transparent url('explore-assets/numbers_background_pattern.svg') 0% 0% repeat-x padding-box;*/
/* background-position: center bottom;*/
/*}*/
.numbers-background .emphasis {
font-size: 40px;
font-weight: bold;
}

View File

@ -0,0 +1,87 @@
<div class="uk-section-default uk-section uk-padding-remove-bottom">
<div class="uk-container uk-text-center uk-margin-medium-bottom">
<div class="uk-margin-medium uk-flex-center">
<div class="uk-first-column">
<div class="uk-panel">
<h2 class="uk-margin uk-h2 uk-text-center">
We believe in <span class="uk-text-bold">Numbers</span>
</h2>
<div class="uk-margin-medium-top">
<div class="uk-grid uk-child-width-1-3@m">
<p *ngIf="fundersSize">
<span class="portal-color emphasis">
<span class="uk-text-bold"> {{fundersSize.number|number}}</span>{{fundersSize.size}}
</span>
<br>
<span class="uk-text-uppercase uk-text-large">Funders</span>
</p>
<p *ngIf="datasourcesSize" class="">
<span class="portal-color emphasis">
<span class="uk-text-bold"> {{datasourcesSize.number|number}}</span>
<span class="portal-color uk-h2">{{datasourcesSize.size}}</span>
</span>
<br>
<span class="uk-text-uppercase uk-text-large">Content providers</span>
</p>
<p *ngIf="projectsSize">
<span class="portal-color emphasis">
<span class="uk-text-bold"> {{projectsSize.number|number}}</span>
<span class="portal-color uk-h2">{{projectsSize.size}}</span>
</span>
<br>
<span class="uk-text-uppercase uk-text-large">Projects</span>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="uk-section-default uk-section numbers-background uk-padding-remove-top">
<div class="uk-container uk-margin-medium-top">
<div class="uk-grid uk-flex uk-flex-center">
<div class="uk-margin-large-right">
<div *ngIf="publicationsSize" class="uk-margin-medium-bottom">
<p>
<span class="emphasis">{{publicationsSize.count|number}} </span><br>
<span class="uk-icon uk-text-uppercase uk-float-left">
<svg height="20" ratio="1" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><rect style="stroke: var(--portal-main-color);" fill="none" height="16" stroke="#000" width="12" x="3.5" y="2.5"></rect><polyline style="stroke: var(--portal-main-color);" fill="none" points="5 0.5 17.5 0.5 17.5 17" stroke="#000"></polyline></svg>
publications
</span>
</p>
</div>
<div *ngIf="softwareSize" class="uk-margin-medium-bottom">
<p>
<span class="emphasis">{{softwareSize.count|number}} </span><br>
<span class="uk-icon uk-text-uppercase uk-float-left">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" data-svg="cog"><circle style="stroke: var(--portal-main-color);" fill="none" stroke="#000" cx="9.997" cy="10" r="3.31"></circle><path style="stroke: var(--portal-main-color);" fill="none" stroke="#000" d="M18.488,12.285 L16.205,16.237 C15.322,15.496 14.185,15.281 13.303,15.791 C12.428,16.289 12.047,17.373 12.246,18.5 L7.735,18.5 C7.938,17.374 7.553,16.299 6.684,15.791 C5.801,15.27 4.655,15.492 3.773,16.237 L1.5,12.285 C2.573,11.871 3.317,10.999 3.317,9.991 C3.305,8.98 2.573,8.121 1.5,7.716 L3.765,3.784 C4.645,4.516 5.794,4.738 6.687,4.232 C7.555,3.722 7.939,2.637 7.735,1.5 L12.263,1.5 C12.072,2.637 12.441,3.71 13.314,4.22 C14.206,4.73 15.343,4.516 16.225,3.794 L18.487,7.714 C17.404,8.117 16.661,8.988 16.67,10.009 C16.672,11.018 17.415,11.88 18.488,12.285 L18.488,12.285 Z"></path></svg>
software
</span>
</p>
</div>
</div>
<div class="">
<div *ngIf="datasetsSize" class="uk-margin-medium-bottom">
<p>
<span class="emphasis">{{datasetsSize.count|number}} </span><br>
<span class="uk-icon uk-text-uppercase uk-float-left">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" data-svg="database"><ellipse style="stroke: var(--portal-main-color);" fill="none" stroke="#000" cx="10" cy="4.64" rx="7.5" ry="3.14"></ellipse><path style="stroke: var(--portal-main-color);" fill="none" stroke="#000" d="M17.5,8.11 C17.5,9.85 14.14,11.25 10,11.25 C5.86,11.25 2.5,9.84 2.5,8.11"></path><path style="stroke: var(--portal-main-color);"fill="none" stroke="#000" d="M17.5,11.25 C17.5,12.99 14.14,14.39 10,14.39 C5.86,14.39 2.5,12.98 2.5,11.25"></path><path style="stroke: var(--portal-main-color);" fill="none" stroke="#000" d="M17.49,4.64 L17.5,14.36 C17.5,16.1 14.14,17.5 10,17.5 C5.86,17.5 2.5,16.09 2.5,14.36 L2.5,4.64"></path></svg>
research data
</span>
</p>
</div>
<div *ngIf="otherSize" class="uk-margin-medium-bottom">
<p>
<span class="emphasis">{{otherSize.count|number}} </span><br>
<span class="uk-icon uk-text-uppercase uk-float-left">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" data-svg="world"><path style="stroke: var(--portal-main-color);" fill="none" stroke="#000" d="M1,10.5 L19,10.5"></path><path style="stroke: var(--portal-main-color);" fill="none" stroke="#000" d="M2.35,15.5 L17.65,15.5"></path><path style="stroke: var(--portal-main-color);" fill="none" stroke="#000" d="M2.35,5.5 L17.523,5.5"></path><path style="stroke: var(--portal-main-color);" fill="none" stroke="#000" d="M10,19.46 L9.98,19.46 C7.31,17.33 5.61,14.141 5.61,10.58 C5.61,7.02 7.33,3.83 10,1.7 C10.01,1.7 9.99,1.7 10,1.7 L10,1.7 C12.67,3.83 14.4,7.02 14.4,10.58 C14.4,14.141 12.67,17.33 10,19.46 L10,19.46 L10,19.46 L10,19.46 Z"></path><circle style="stroke: var(--portal-main-color);" fill="none" stroke="#000" cx="10" cy="10.5" r="9"></circle></svg>
other research products
</span>
</p>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,184 @@
import {Component} from '@angular/core';
import {Subscription} from 'rxjs';
import {ActivatedRoute, Router} from '@angular/router';
import {Location} from '@angular/common';
import "rxjs/add/observable/zip";
import {Title, Meta} from '@angular/platform-browser';
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
import { SearchDataprovidersService} from '../openaireLibrary/services/searchDataproviders.service';
import { SearchProjectsService} from '../openaireLibrary/services/searchProjects.service';
import { SearchOrganizationsService} from '../openaireLibrary/services/searchOrganizations.service';
import { RefineFieldResultsService} from '../openaireLibrary/services/refineFieldResults.service';
import { NumberUtils} from '../openaireLibrary/utils/number-utils.class';
import { RouterHelper} from '../openaireLibrary/utils/routerHelper.class';
import { EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import { ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes';
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
import { SEOService } from '../openaireLibrary/sharedComponents/SEO/SEO.service';
import {SearchResearchResultsService} from "../openaireLibrary/services/searchResearchResults.service";
import {properties} from "../../environments/environment";
@Component({
selector: 'home',
templateUrl: 'home.component.html',
styleUrls: ['home.component.css']
})
export class HomeComponent {
public pageTitle = "OpenAIRE Research Graph";
public errorCodes:ErrorCodes = new ErrorCodes();
public routerHelper:RouterHelper = new RouterHelper();
public publicationsSize:any = null;
public datasetsSize:any = null;
public datasetsLinkedSize:any = null;
public softwareLinkedSize:any = null;
public softwareSize: any = null;
public otherSize: any = null;
public fundersSize:any = null;
public projectsSize:any = null;
public datasourcesSize:any = null;
properties: EnvProperties = properties;
subs: Subscription[] = [];
constructor (
private route: ActivatedRoute,
private _router: Router,
private _searchResearchResultsService: SearchResearchResultsService,
private _searchDataprovidersService: SearchDataprovidersService,
private _searchProjectsService: SearchProjectsService,
private _searchOrganizationsService: SearchOrganizationsService,
private _refineFieldResultsService:RefineFieldResultsService,
private location: Location, private _piwikService:PiwikService,
private config: ConfigurationService, private _meta: Meta, private _title: Title, private seoService: SEOService
) {
let description = "OpenAIRE Research Graph: Over 100M of research deduplicated, 170K research software, 11M research data. One of the largest open scholarly records collection worldwide.";
let title = "OpenAIRE | Find and Share research";
this._title.setTitle(title);
this._meta.updateTag({content:description},"name='description'");
this._meta.updateTag({content:description},"property='og:description'");
this._meta.updateTag({content:title},"property='og:title'");
}
public ngOnInit() {
this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink+this._router.url, false);
if(this.properties){
var url = this.properties.domain + this.properties.baseLink+this._router.url;
this._meta.updateTag({content:url},"property='og:url'");
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.subs.push(this._piwikService.trackView(this.properties, "OpenAIRE").subscribe());
}
this.getNumbers();
}
}
public ngOnDestroy() {
for (let sub of this.subs) {
sub.unsubscribe();
}
}
private getNumbers() {
this.subs.push(this._searchResearchResultsService.numOfSearchResults("publication", "", this.properties).subscribe(
data => {
if(data && data > 0 ){
this.publicationsSize = NumberUtils.roundNumber(data);
}
},
err => {
this.handleError("Error getting number of publications", err);
}
));
this.subs.push(this._searchResearchResultsService.numOfSearchResults("dataset", "", this.properties).subscribe(
data => {
if(data && data > 0 ){
this.datasetsSize = NumberUtils.roundNumber(data);
}
},
err => {
//console.log(err);
this.handleError("Error getting number of research data", err);
}
));
this.subs.push(this._searchResearchResultsService.numOfSearchResultsLinkedToPub("dataset", this.properties).subscribe(
data => {
if(data && data > 0 ){
this.datasetsLinkedSize = NumberUtils.roundNumber(data);
}
},
err => {
this.handleError("Error getting number of linkedresearch data", err);
}
));
this.subs.push(this._searchResearchResultsService.numOfSearchResults("software", "", this.properties).subscribe(
data => {
if (data && data > 0) {
this.softwareSize = NumberUtils.roundNumber(data);
}
},
err => {
this.handleError("Error getting number of software data", err);
}
));
this.subs.push(this._searchResearchResultsService.numOfSearchResultsLinkedToPub("software", this.properties).subscribe(
data => {
if(data && data > 0 ){
this.softwareLinkedSize = NumberUtils.roundNumber(data);
}
},
err => {
this.handleError("Error getting number of linked software", err);
}
));
this.subs.push(this._searchResearchResultsService.numOfSearchResults("other", "", this.properties).subscribe(
data => {
if (data && data > 0) {
this.otherSize = NumberUtils.roundNumber(data);
}
},
err => {
this.handleError("Error getting number of software data", err);
}
));
this.subs.push(this._refineFieldResultsService.getRefineFieldsResultsByEntityName(["funder"],"project", this.properties).subscribe(
data => {
if(data[0] && data[0] > 0 ){
this.projectsSize = NumberUtils.roundNumber(data[0]);
}
if(data[1].length > 0 && data[1][0].filterId == "funder" && data[1][0].values ){
this.fundersSize = NumberUtils.roundNumber(data[1][0].values.length);
}
},
err => {
this.handleError("Error getting 'funder' field results of projects", err);
})
);
this.subs.push(this._searchDataprovidersService.numOfSearchDataproviders("", this.properties).subscribe(
data => {
if(data && data > 0 ){
this.datasourcesSize = NumberUtils.roundNumber(data);
}
},
err => {
this.handleError("Error getting number of content providers", err);
}
));
}
private handleError(message: string, error) {
console.error("Home Page: "+message, error);
}
}

View File

@ -0,0 +1,77 @@
// import {NgModule} from '@angular/core';
// import {HomeComponent} from './home.component';
// import {CommonModule} from '@angular/common';
// import {RouterModule} from '@angular/router';
// import {FullPageSliderModule} from '../openaireLibrary/utils/full-page-slider/full-page-slider.module';
// import {BottomModule} from '../openaireLibrary/sharedComponents/bottom.module';
//
// @NgModule({
// imports: [
// CommonModule,
// RouterModule.forChild([{
// path: '', component: HomeComponent,
// }]),
// FullPageSliderModule,
// BottomModule,
// ],
// declarations: [HomeComponent],
// exports: [HomeComponent]
// })
// export class HomeModule{
// }
import { NgModule} from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
//import {HomeRoutingModule} from './home-routing.module';
import {HomeComponent} from './home.component';
import { DataProvidersServiceModule} from '../openaireLibrary/services/dataProvidersService.module';
import { SearchResearchResultsServiceModule} from '../openaireLibrary/services/searchResearchResultsService.module';
import { ProjectsServiceModule} from '../openaireLibrary/services/projectsService.module';
import { OrganizationsServiceModule} from '../openaireLibrary/services/organizationsService.module';
import { SearchFormModule} from '../openaireLibrary/searchPages/searchUtils/searchForm.module';
import { PiwikServiceModule} from '../openaireLibrary/utils/piwik/piwikService.module';
import {HelperModule} from '../openaireLibrary/utils/helper/helper.module';
import {RefineFieldResultsServiceModule} from '../openaireLibrary/services/refineFieldResultsService.module';
import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard';
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import { SEOServiceModule } from '../openaireLibrary/sharedComponents/SEO/SEOService.module';
import {ErrorMessagesModule} from '../openaireLibrary/utils/errorMessages.module';
import {OtherPortalsModule} from "../openaireLibrary/sharedComponents/other-portals/other-portals.module";
import {EntitiesSelectionModule} from "../openaireLibrary/searchPages/searchUtils/entitiesSelection.module";
import {QuickSelectionsModule} from "../openaireLibrary/searchPages/searchUtils/quick-selections.module";
@NgModule({
imports: [
CommonModule, FormsModule, RouterModule,
RouterModule.forChild([{
path: '', component: HomeComponent,
}]),
RefineFieldResultsServiceModule,
DataProvidersServiceModule, SearchResearchResultsServiceModule,
ProjectsServiceModule, OrganizationsServiceModule,
SearchFormModule,
PiwikServiceModule,
// HomeRoutingModule,
HelperModule,
ErrorMessagesModule,
SEOServiceModule, OtherPortalsModule, EntitiesSelectionModule, QuickSelectionsModule
],
declarations: [
HomeComponent
],
providers:[
FreeGuard, PreviousRouteRecorder
],
exports: [
HomeComponent
]
})
export class HomeModule { }

13
src/app/main.ts Normal file
View File

@ -0,0 +1,13 @@
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);

49
src/app/polyfills.ts Normal file
View File

@ -0,0 +1,49 @@
/**
* 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');
//
// }

View File

@ -0,0 +1,33 @@
import {AfterViewChecked, Component, OnInit} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {ActivatedRoute} from '@angular/router';
@Component({
selector: 'resources',
templateUrl: 'resources.component.html',
styleUrls: ['resources.component.css'],
})
export class ResourcesComponent implements OnInit {
constructor(private title: Title,
private route: ActivatedRoute) {
}
ngOnInit() {
this.title.setTitle('OpenAIRE - Research Graph | Resources');
// this.route.fragment.subscribe(fragment => {
// setTimeout(() => {
// this.goTo(fragment);
// }, 100);
// });
}
// goTo(id: string) {
// const yOffset = -100;
// const element = document.getElementById(id);
// if(element) {
// const y = element.getBoundingClientRect().top + window.pageYOffset + yOffset;
// window.scrollTo({top: y, behavior: 'smooth'});
// }
// }
}

View File

@ -0,0 +1,19 @@
import {NgModule} from "@angular/core";
import {CommonModule} from "@angular/common";
import {RouterModule} from "@angular/router";
import {ResourcesComponent} from "./resources.component";
@NgModule({
imports: [
CommonModule,
RouterModule.forChild([{
path: '', component: ResourcesComponent
}])
],
declarations: [ResourcesComponent],
exports: [ResourcesComponent]
})
export class ResourcesModule {
}

View File

@ -0,0 +1,33 @@
import {Injectable} from '@angular/core';
import {ActivationStart, Router} from '@angular/router';
import {BehaviorSubject, Observable} from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class LayoutService {
private isHomeSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
constructor(private router: Router) {
this.router.events.subscribe(event => {
if (event instanceof ActivationStart) {
let data = event.snapshot.data;
if (data['isHome'] == undefined ||
data['isHome'] === false) {
this.setIsHome(false);
} else {
this.setIsHome(true);
}
}
});
}
public setIsHome(isHome: boolean) {
this.isHomeSubject.next(isHome);
}
public get isHome(): Observable<boolean> {
return this.isHomeSubject.asObservable();
}
}

View File

@ -0,0 +1 @@
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg enable-background="new 0 0 64 64" width="20px" height="20px" version="1.1" viewBox="0 0 64 64" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Ebene_2"/><g id="Ebene_1"><g><path d="M48,27c-0.553,0-1,0.448-1,1v27H9V17h27c0.553,0,1-0.448,1-1s-0.447-1-1-1H8c-0.552,0-1,0.448-1,1v40c0,0.553,0.448,1,1,1 h40c0.553,0,1-0.447,1-1V28C49,27.448,48.553,27,48,27z"/><path d="M56,7H44c-0.553,0-1,0.448-1,1s0.447,1,1,1h10h1v1v10c0,0.552,0.447,1,1,1s1-0.448,1-1V8C57,7.448,56.553,7,56,7z"/><path d="M54,9c-0.256,0-0.512,0.098-0.707,0.293l-22,22c-0.391,0.391-0.391,1.023,0,1.414C31.488,32.902,31.744,33,32,33 s0.512-0.098,0.707-0.293l22-22C54.902,10.512,55,10.256,55,10s-0.098-0.512-0.293-0.707S54.256,9,54,9z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 904 B

BIN
src/assets/loading.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,10 @@
import {EnvProperties} from '../app/openaireLibrary/utils/properties/env-properties';
export let properties: EnvProperties = {
environment: "beta",
searchAPIURLLAst: "http://beta.services.openaire.eu/search/v2/api/",
helpdesk: "https://www.openaire.eu/support/helpdesk",
helpdeskEmail: "helpdesk@openaire.eu",
cookieDomain: ".openaire.eu",
reCaptchaSiteKey: "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P",
};

View File

@ -0,0 +1,10 @@
import {EnvProperties} from '../app/openaireLibrary/utils/properties/env-properties';
export let properties: EnvProperties = {
environment: "production",
searchAPIURLLAst: "http://services.openaire.eu/search/v2/api/",
helpdesk: "https://www.openaire.eu/support/helpdesk",
helpdeskEmail: "helpdesk@openaire.eu",
cookieDomain: ".openaire.eu",
reCaptchaSiteKey: "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P",
};

View File

@ -0,0 +1,15 @@
// 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",
searchAPIURLLAst: "http://beta.services.openaire.eu/search/v2/api/",
helpdesk: "https://www.openaire.eu/support/helpdesk",
helpdeskEmail: "helpdesk@openaire.eu",
cookieDomain: ".di.uoa.gr",
reCaptchaSiteKey: "6LcVtFIUAAAAAB2ac6xYivHxYXKoUvYRPi-6_rLu",
};

30
src/index.html Normal file
View File

@ -0,0 +1,30 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href="/">
<title>OpenAIRE - Graph</title>
<meta charset="UTF-8">
<link rel="apple-touch-icon" sizes="57x57" href="assets/common-assets/logo/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="assets/common-assets/logo/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="assets/common-assets/logo/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="assets/common-assets/logo/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="assets/common-assets/logo/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="assets/common-assets/logo/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="assets/common-assets/logo/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="assets/common-assets/logo/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="assets/common-assets/logo/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="assets/common-assets/logo/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/common-assets/logo/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="assets/common-assets/logo/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/common-assets/logo/favicon-16x16.png">
<link href="assets/common-assets/logo/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"/>
<meta name="robots" content="noindex">
<script src="https://cdn.ckeditor.com/4.5.11/full-all/ckeditor.js"></script>
</head>
<body>
<app></app>
</body>
</html>

11
src/main.ts Normal file
View File

@ -0,0 +1,11 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { properties } from './environments/environment';
if (properties.environment !== "development") {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);

13
src/material.scss Normal file
View File

@ -0,0 +1,13 @@
@import '~@angular/material/theming';
@include mat-core();
$my-app-primary: mat-palette($mat-blue-grey);
$my-app-accent: mat-palette($mat-green);
$my-app-warn: mat-palette($mat-deep-orange);
$my-app-theme: mat-light-theme($my-app-primary, $my-app-accent, $my-app-warn);
@include angular-material-theme($my-app-theme);
.mat-option:hover:not(.mat-option-disabled), .mat-option:focus:not(.mat-option-disabled), .mat-option.mat-active:not(.mat-option-disabled) {
background-color: #F8CBBB;
}

71
src/polyfills.ts Normal file
View File

@ -0,0 +1,71 @@
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* 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
*/
/***************************************************************************************************
* 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
**/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/***************************************************************************************************
* Zone JS is required by 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';

236
src/styles.css Normal file
View File

@ -0,0 +1,236 @@
/* You can add global styles to this file, and also import other style files */
@import "assets/common-assets/common/theme.css";
@import "assets/common-assets/common/custom.css";
@import "assets/common-assets/library.css";
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
@import "assets/common-assets/common/theme-changes.css";
:root {
--portal-main-color: #EE2540;
--portal-main-contrast: white;
--portal-dark-color: #E63946;
}
.top-bar-background {
background-color: #F9FBFC;
}
main {
background-color: #F9FBFC;
color: #333333;
min-height: calc(100vh - 100px);
font-size: 16px;
font-family: Roboto, sans-serif;
line-height: 21px;
letter-spacing: 0.48px;
}
navbar > * {
background-color: #F9FBFC;
}
main.full-height {
min-height: 100vh;
}
/* Order list */
ol.light-blue {
counter-reset: counter;
list-style: none;
}
ol.light-blue li {
margin: 0 0 20px 0;
counter-increment: counter;
position: relative;
}
ol.light-blue li::before {
content: counter(counter);
color: #4687E6;
font-size: 27px;
position: absolute;
--size: 22px;
left: calc(-1 * var(--size) - 10px);
line-height: var(--size);
width: var(--size);
height: var(--size);
top: 0;
text-align: center;
}
ol.openaire-list {
list-style: none;
counter-reset: counter;
padding-left: 0;
}
ol.openaire-list li {
counter-increment: counter;
}
ol.openaire-list li::before {
content: counter(counter) ". ";
color: #222080;
font-weight: bold;
}
/* Unordered list*/
ul.light-blue-circle {
list-style: none;
}
ul.light-blue-circle li {
margin: 0 0 20px 0;
position: relative;
}
ul.light-blue-circle.large li {
margin: 0 0 40px 0;
}
ul.light-blue-circle li:last-child {
margin: 0;
}
ul.light-blue-circle li:before {
content: "";
border: 10px #4687E6 solid !important;
border-radius: 50px;
line-height: 21px;
margin-left: -40px;
position: absolute;
}
ul.light-blue-triangle {
list-style: none;
}
ul.light-blue-triangle li {
margin: 0 0 20px 0;
position: relative;
}
ul.light-blue-triangle.large li {
margin: 0 0 50px 0;
}
ul.light-blue-triangle li:last-child {
margin: 0;
}
ul.light-blue-triangle li:before {
content: "";
border-top: 12px solid transparent;
border-bottom: 12px solid transparent;
border-left: 15px solid #4687E6;
line-height: 21px;
margin-left: -40px;
position: absolute;
}
ul.portal-circle {
list-style: none;
padding-left: 40px;
}
ul.portal-circle li {
margin: 0 0 20px 0;
position: relative;
}
ul.portal-circle li:before {
content: "";
border: 5px var(--portal-main-color) solid !important;
border-radius: 50px;
line-height: 21px;
margin-left: -20px;
position: absolute;
top: 4px;
}
contact .uk-text-danger {
color: #B50000 !important;
font-size: 12px;
}
.footer,
.footer .uk-section-primary {
background-color: #ffffff;
color: #000000 !important;
font-family: "Open Sans", sans-serif !important;
font-size: 14px !important;
font-weight: 400!important;
}
.footer svg .stroke_line {
stroke: #000000 !important;
}
.footer svg .fill_text {
fill: #000000 !important;
}
.footer .uk-h6:not(.ignoreFooter),
.footer .uk-h5:not(.ignoreFooter),
.footer .uk-h4:not(.ignoreFooter),
.footer .uk-h3:not(.ignoreFooter),
.footer .uk-h2:not(.ignoreFooter),
.footer .uk-h1:not(.ignoreFooter) {
color: #000000 !important;
}
.footer .uk-link:not(.ignoreFooter),
.footer a:not(.uk-button):not(.uk-button-text):not(.ignoreFooter) {
color: #000000 !important;
font-family: "Open Sans", sans-serif !important;
font-size: 14px !important;
}
.footer .uk-icon-button {
border-color: rgba(0, 0, 0, 0.5);
}
.footer .uk-totop {
background-color: #ffffff;
}
.footer .uk-totop svg {
color: rgba(0, 0, 0, 0.5);
}
.footer .uk-totop:hover svg {
color: black;
}
.footer .uk-link:not(.ignoreFooter):hover,
.footer a:not(.uk-button):not(.uk-button-text):not(.ignoreFooter):hover {
color: #000000 !important;
}
.footer .uk-label:not(.ignoreFooter) a {
border-color: #000000;
border-bottom: 1px solid;
}
.footer .uk-label:not(.ignoreFooter) a:hover {
border-color: rgba(0, 0, 0, 0.5);
}
.footer .uk-button:not(.ignoreFooter) {
background-color: #ffffff !important;
color: black !important;
border-color: #ffffff !important;
border-style: solid !important;
border-width: 1px !important;
}
.footer .uk-button:not(.ignoreFooter):hover {
background-color: #eeeeee !important;
/*color: var(--portal-main-color) !important;*/
color: black !important;
border-color: #eeeeee !important;
}

32
src/test.ts Normal file
View File

@ -0,0 +1,32 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/long-stack-trace-zone';
import 'zone.js/dist/proxy.js';
import 'zone.js/dist/sync-test';
import 'zone.js/dist/jasmine-patch';
import 'zone.js/dist/async-test';
import 'zone.js/dist/fake-async-test';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
declare const __karma__: any;
declare const require: any;
// Prevent Karma from running prematurely.
__karma__.loaded = function () {};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
// Finally, start Karma to run the tests.
__karma__.start();

23
src/tsconfig.app.json Normal file
View File

@ -0,0 +1,23 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"paths": {
"*": [
"types/*"
]
},
"paths": {
"*": [
"types/*"
]
},
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": ["node"]
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}

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

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

5
src/typings.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
/* SystemJS module definition */
declare var module: NodeModule;
interface NodeModule {
id: string;
}

22
tsconfig.json Normal file
View File

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

141
tslint.json Normal file
View File

@ -0,0 +1,141 @@
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"eofline": true,
"forin": true,
"import-blacklist": [
true
],
"import-spacing": true,
"indent": [
true,
"spaces"
],
"interface-over-type-literal": true,
"label-position": true,
"max-line-length": [
true,
140
],
"member-access": false,
"member-ordering": [
true,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-misused-new": true,
"no-non-null-assertion": true,
"no-shadowed-variable": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"prefer-const": true,
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": [
true,
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"typeof-compare": true,
"unified-signatures": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"directive-selector": [
true,
"attribute",
"app",
"camelCase"
],
"component-selector": [
true,
"element",
"app",
"kebab-case"
],
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true,
"no-access-missing-member": true,
"templates-use-public": true,
"invoke-injectable": true
}
}