diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..37371cb --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,11 @@ +# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries +# +# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed + +> 0.5% +last 2 versions +Firefox ESR +not dead +not IE 9-11 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9e21678 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.angular +node_modules/ +dist/ +.idea/ +package-lock.json diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..b14b9aa --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "src/app/openaireLibrary"] + path = src/app/openaireLibrary + url = gitea@code-repo.d4science.org:MaDgIK/openaire-library.git +[submodule "src/assets/common-assets"] + path = src/assets/common-assets + url = gitea@code-repo.d4science.org:MaDgIK/openaire-assets.git +[submodule "src/assets/openaire-theme"] + path = src/assets/openaire-theme + url = gitea@code-repo.d4science.org:MaDgIK/openaire-theme.git diff --git a/angular.json b/angular.json new file mode 100644 index 0000000..d8ed6b9 --- /dev/null +++ b/angular.json @@ -0,0 +1,197 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "eosc-metadata-harvester": { + "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": { + }, + "@schematics/angular:pipe": { + "skipTests": true + }, + "@schematics/angular:service": { + "skipTests": true + } + }, + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/eosc-metadata-harvester", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/tsconfig.app.json", + "assets": [ + "src/assets", + "src/robots.txt", + "src/.htaccess" + ], + "styles": [ + "src/styles.less", + "src/assets/common-assets/library-css/material.scss" + ], + "scripts": [ + "node_modules/uikit/dist/js/uikit.min.js", + "node_modules/uikit/dist/js/uikit-icons.min.js", + "node_modules/jquery/dist/jquery.js" + ], + "vendorChunk": true, + "extractLicenses": false, + "buildOptimizer": false, + "sourceMap": true, + "optimization": false, + "namedChunks": true + }, + "configurations": { + "development": { + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "budgets": [ + { + "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, + "namedChunks": false, + "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.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "2mb", + "maximumError": "5mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "6kb" + } + ] + } + }, + "defaultConfiguration": "" + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "eosc-metadata-harvester:build" + }, + "configurations": { + "production": { + "browserTarget": "eosc-metadata-harvester:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "eosc-metadata-harvester:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/tsconfig.spec.json", + "karmaConfig": "src/karma.conf.js", + "styles": [ + "src/styles.css" + ], + "scripts": [], + "assets": [ + "src/assets" + ] + } + } + } + }, + "eosc-metadata-harvester-e2e": { + "root": "e2e/", + "projectType": "application", + "prefix": "", + "architect": { + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "e2e/protractor.conf.js", + "devServerTarget": "eosc-metadata-harvester:serve" + }, + "configurations": { + "production": { + "devServerTarget": "eosc-metadata-harvester:serve:production" + } + } + } + } + } + }, + "cli": { + "analytics": false + } +} diff --git a/e2e/protractor.conf.js b/e2e/protractor.conf.js new file mode 100644 index 0000000..86776a3 --- /dev/null +++ b/e2e/protractor.conf.js @@ -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: [ + './src/**/*.e2e-spec.ts' + ], + capabilities: { + 'browserName': 'chrome' + }, + directConnect: true, + baseUrl: 'http://localhost:4200/', + framework: 'jasmine', + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000, + print: function() {} + }, + onPrepare() { + require('ts-node').register({ + project: require('path').join(__dirname, './tsconfig.e2e.json') + }); + jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); + } +}; \ No newline at end of file diff --git a/e2e/src/app.e2e-spec.ts b/e2e/src/app.e2e-spec.ts new file mode 100644 index 0000000..736556e --- /dev/null +++ b/e2e/src/app.e2e-spec.ts @@ -0,0 +1,23 @@ +import { AppPage } from './app.po'; +import { browser, logging } from 'protractor'; + +describe('workspace-project App', () => { + let page: AppPage; + + beforeEach(() => { + page = new AppPage(); + }); + + it('should display welcome message', () => { + page.navigateTo(); + expect(page.getTitleText()).toEqual('Welcome to 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)); + }); +}); diff --git a/e2e/src/app.po.ts b/e2e/src/app.po.ts new file mode 100644 index 0000000..5776aa9 --- /dev/null +++ b/e2e/src/app.po.ts @@ -0,0 +1,11 @@ +import { browser, by, element } from 'protractor'; + +export class AppPage { + navigateTo() { + return browser.get(browser.baseUrl) as Promise; + } + + getTitleText() { + return element(by.css('app-root h1')).getText() as Promise; + } +} diff --git a/e2e/tsconfig.e2e.json b/e2e/tsconfig.e2e.json new file mode 100644 index 0000000..a6dd622 --- /dev/null +++ b/e2e/tsconfig.e2e.json @@ -0,0 +1,13 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/app", + "module": "commonjs", + "target": "es5", + "types": [ + "jasmine", + "jasminewd2", + "node" + ] + } +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..b207f3a --- /dev/null +++ b/package.json @@ -0,0 +1,64 @@ +{ + "name": "eosc-metadata-harvester", + "version": "0.0.1", + "scripts": { + "ng": "ng", + "start": "ng serve --host 0.0.0.0 --disable-host-check --port=5300", + "build": "ng build", + "build-dev": "ng build --configuration=development", + "build-beta": "ng build --configuration=beta", + "build-prod": "ng build --configuration production", + "webpack-bundle-analyzer": "ng build --stats-json && webpack-bundle-analyzer dist/monitor-dashboard/browser/stats.json --host 0.0.0.0", + "test": "ng test", + "e2e": "ng e2e", + "after-build-clean": "rm -rf dist/eosc-metadata-harvester/assets/common-assets/.git dist/eosc-metadata-harvester/assets/openaire-theme/.git .angular" + }, + "private": true, + "dependencies": { + "@angular/animations": "^16.1.8", + "@angular/cdk": "^16.1.7", + "@angular/common": "^16.1.8", + "@angular/compiler": "^16.1.8", + "@angular/core": "^16.1.8", + "@angular/forms": "^16.1.8", + "@angular/localize": "^16.1.8", + "@angular/material": "^16.1.7", + "@angular/platform-browser": "^16.1.8", + "@angular/platform-browser-dynamic": "^16.1.8", + "@angular/router": "^16.1.8", + "clipboard": "^1.5.16", + "core-js": "^2.5.4", + "express": "^4.15.2", + "jquery": "^3.4.1", + "ng-recaptcha": "^12.0.2", + "ng2-ckeditor": "1.3.7", + "ngx-color-picker": "^14.0.0", + "rxjs": "^6.5.1", + "sass-loader": "7.3.1", + "ts-md5": "^1.2.0", + "tslib": "^2.0.0", + "uikit": "3.16.24", + "zone.js": "~0.13.1" + }, + "devDependencies": { + "@angular-devkit/build-angular": "^16.1.7", + "@angular/cli": "^16.1.7", + "@angular/compiler-cli": "^16.1.8", + "@angular/language-service": "^16.1.8", + "@types/ckeditor": "^4.9.10", + "@types/express": "^4.17.0", + "@types/jasmine": "~3.6.0", + "@types/jasminewd2": "~2.0.3", + "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", + "typescript": "~4.9.5" + } +} diff --git a/src/app/app.component.html b/src/app/app.component.html new file mode 100644 index 0000000..0620bf0 --- /dev/null +++ b/src/app/app.component.html @@ -0,0 +1,17 @@ + + + +
+ + + + + +
+ +
+ +
+
+
+ diff --git a/src/app/app.component.ts b/src/app/app.component.ts new file mode 100644 index 0000000..e7ff6ec --- /dev/null +++ b/src/app/app.component.ts @@ -0,0 +1,171 @@ +import {ChangeDetectorRef, Component, HostListener, OnInit} from '@angular/core'; +import {MenuItem} from './openaireLibrary/sharedComponents/menu'; +import {ActivatedRoute, Data, NavigationEnd, Params, Router} from '@angular/router'; +import {EnvProperties} from './openaireLibrary/utils/properties/env-properties'; +import {Header} from './openaireLibrary/sharedComponents/navigationBar.component'; +import {LayoutService} from "./openaireLibrary/dashboard/sharedComponents/sidebar/layout.service"; +import {properties} from "../environments/environment"; +import {BehaviorSubject, Subscriber} from "rxjs"; +import {SmoothScroll} from "./openaireLibrary/utils/smooth-scroll"; +import {ConnectHelper} from './openaireLibrary/connect/connectHelper'; +import {ConfigurationService} from './openaireLibrary/utils/configuration/configuration.service'; +import {StringUtils} from "./openaireLibrary/utils/string-utils.class"; +import {OpenaireEntities} from "./openaireLibrary/utils/properties/searchFields"; + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', +}) +export class AppComponent implements OnInit { + title = 'Research Community Dashboard | Administrator'; + properties: EnvProperties = properties; + params: BehaviorSubject = new BehaviorSubject(null); + data: BehaviorSubject = new BehaviorSubject(null); + hasSidebar: boolean = false; + hasHeader: boolean = true; + hasAdminMenu: boolean = false; + isFrontPage: boolean = false; + sideBarItems: MenuItem[] = []; + backItem: MenuItem = null; + menuItems: MenuItem[] = []; + menuHeader: Header = { + route: "/", + url: null, + title: "Default menu header", + logoUrl: null, + logoSmallUrl: null, + position: 'center', + badge: false + }; + userMenuItems: MenuItem[] = []; + loading: boolean = true; + paramsResolved: boolean = false; + innerWidth; + private subscriptions: any[] = []; + headerLogoUrl: string; + headerUrl: string; + + constructor(private route: ActivatedRoute, + private router: Router, + private cdr: ChangeDetectorRef, + private smoothScroll: SmoothScroll, + private layoutService: LayoutService, + private configurationService: ConfigurationService) { + this.subscriptions.push(this.router.events.subscribe(event => { + if (event instanceof NavigationEnd) { + let r = this.route; + while (r.firstChild) { + r = r.firstChild; + } + this.paramsResolved = true; + this.params.next(r.snapshot.params); + this.data.next(r.snapshot.data); + } + })); + } + + ngOnInit() { + // if (typeof document !== 'undefined' && window) { + // this.innerWidth = window.innerWidth; + // } + // this.subscriptions.push(this.layoutService.hasSidebar.subscribe(hasSidebar => { + // this.hasSidebar = hasSidebar; + // this.cdr.detectChanges(); + // })); + // this.subscriptions.push(this.layoutService.hasHeader.subscribe(hasHeader => { + // this.hasHeader = hasHeader; + // this.cdr.detectChanges(); + // })); + // this.subscriptions.push(this.layoutService.hasAdminMenu.subscribe(hasAdminMenu => { + // this.hasAdminMenu = hasAdminMenu; + // this.cdr.detectChanges(); + // })); + // this.subscriptions.push(this.layoutService.isFrontPage.subscribe(isFrontPage => { + // this.isFrontPage = isFrontPage; + // this.cdr.detectChanges(); + // })); + // this.layoutService.setSmallScreen((this.innerWidth && this.innerWidth <= 640)); + // this.layoutService.setOpen(!(this.innerWidth && this.innerWidth <= 640)); + // this.subscriptions.push(this.params.subscribe(params => { + // if (this.paramsResolved) { + // this.loading = true; + // } + // })); + // this.subscriptions.push(this.data.subscribe(data => { + // if(data && data.portal) { + // this.setProperties(data.portal); + // this.configurationService.initPortal(this.properties, this.properties.adminToolsCommunity); + // } + // })); + } + + // @HostListener('window:resize', ['$event']) + // onResize(event) { + // if (this.layoutService.isSmallScreen && event.target.innerWidth > 1219) { + // this.layoutService.setSmallScreen(false); + // } else if (!this.layoutService.isSmallScreen && event.target.innerWidth < 1219) { + // this.layoutService.setSmallScreen(true); + // this.layoutService.setOpen(false); + // } + // } + + public ngOnDestroy() { + this.subscriptions.forEach(value => { + if (value instanceof Subscriber) { + value.unsubscribe(); + } + }); + this.layoutService.clearSubscriptions(); + this.smoothScroll.clearSubscriptions(); + } + + // setProperties(id, type = null){ + // this.properties.adminToolsCommunity = id; + // if(type) { + // this.properties.adminToolsPortalType = type; + // } else { + // ConnectHelper.setPortalTypeFromPid(id); + // } + // this.configurationService.initPortal(this.properties, this.properties.adminToolsCommunity); + // } + // + // public get open() { + // return this.layoutService.open; + // } + // + // public get hover() { + // return this.layoutService.hover; + // } + // + // private buildMenu() { + // this.userMenuItems = []; + // this.sideBarItems = []; + // this.headerLogoUrl = null; + // this.headerUrl = 'https://' + ((properties.environment !== 'production')?'beta.':'') + 'connect.openaire.eu'; + // this.menuHeader = { + // route: null, + // url: this.headerUrl, + // title: "Monitor", + // logoUrl: 'assets/common-assets/logo-services/connect/small.svg', + // logoSmallUrl: "assets/common-assets/logo-services/connect/small.svg", + // position: 'left', + // badge: true, + // menuPosition: "center" + // }; + // this.menuItems = []; + // this.menuItems.push( + // new MenuItem("about", "About", this.headerUrl + "/about/learn-how", "", false, [], [], {}, null, null, null, null, "_self", + // "internal", false, + // [ + // new MenuItem("", "Learn the process", this.headerUrl + "/about/learn-how", "", false, [], [], {}, null, null, null, null, "_self"), + // ] + // ) + // ); + // this.menuItems.push( + // new MenuItem("communities", "Communities", this.headerUrl + "/search/find/communities", "", false, [], [], {}, null, null, null, null, "_self") + // ); + // + // this.backItem = null; + // this.hasSidebar = this.hasSidebar && this.sideBarItems.length > 1; + // } +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts new file mode 100644 index 0000000..8cec154 --- /dev/null +++ b/src/app/app.module.ts @@ -0,0 +1,48 @@ +import {NgModule} from '@angular/core'; +import {BrowserModule} from '@angular/platform-browser'; +import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http'; +import {AppComponent} from './app.component'; +import {AppRoutingModule} from './app.routing'; +import {ReactiveFormsModule} from '@angular/forms'; +import {NavigationBarModule} from './openaireLibrary/sharedComponents/navigationBar.module'; +import {BottomModule} from './openaireLibrary/sharedComponents/bottom.module'; +import {ErrorModule} from './openaireLibrary/error/error.module'; +import {TitleCasePipe} from '@angular/common'; +import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; +import {LoadingModule} from "./openaireLibrary/utils/loading/loading.module"; +import {SideBarModule} from "./openaireLibrary/dashboard/sharedComponents/sidebar/sideBar.module"; +import {SharedModule} from "./openaireLibrary/shared/shared.module"; +import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.service"; +import {DEFAULT_TIMEOUT, TimeoutInterceptor} from "./openaireLibrary/timeout-interceptor.service"; +import { HomeModule } from './home/home.module'; + +@NgModule({ + imports: [ + AppRoutingModule, + BrowserModule, + HttpClientModule, + ReactiveFormsModule, + BottomModule, NavigationBarModule, + ErrorModule, + SharedModule, + BrowserAnimationsModule, LoadingModule, SideBarModule, + HomeModule + ], + declarations: [ + AppComponent, + ], + providers: [ + TitleCasePipe, + { + provide: HTTP_INTERCEPTORS, + useClass: ErrorInterceptorService, + multi: true + }, + [{provide: HTTP_INTERCEPTORS, useClass: TimeoutInterceptor, multi: true}], + [{provide: DEFAULT_TIMEOUT, useValue: 30000}] + ], + bootstrap: [AppComponent] +}) + +export class AppModule { +} diff --git a/src/app/app.routing.ts b/src/app/app.routing.ts new file mode 100644 index 0000000..bb3a9c4 --- /dev/null +++ b/src/app/app.routing.ts @@ -0,0 +1,31 @@ +import {NgModule} from '@angular/core'; +import {RouterModule, Routes} from '@angular/router'; +import {LoginGuard} from "./openaireLibrary/login/loginGuard.guard"; + +const routes: Routes = [ + { + path: '', + loadChildren: () => import('./home/home.module').then(m => m.HomeModule) + }, + { + path: 'reload', + loadChildren: () => import('./reload/libReload.module').then(m => m.LibReloadModule), + data: {hasSidebar: false, hasHeader: false} + }, + // { path: 'error', + // pathMatch: 'full', + // component: AdminErrorPageComponent, + // data: {hasSidebar: false} + // }, + // { path: '**', + // pathMatch: 'full', + // component: AdminErrorPageComponent + // } + +]; + +@NgModule({ + imports: [RouterModule.forRoot(routes)], + exports: [ RouterModule ] +}) +export class AppRoutingModule {} diff --git a/src/app/home/home-routing.module.ts b/src/app/home/home-routing.module.ts new file mode 100644 index 0000000..cd23cec --- /dev/null +++ b/src/app/home/home-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import{HomeComponent} from './home.component'; +import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: HomeComponent, canDeactivate: [PreviousRouteRecorder] } + + ]) + ] +}) +export class HomeRoutingModule { } diff --git a/src/app/home/home.component.css b/src/app/home/home.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html new file mode 100644 index 0000000..5f2c53f --- /dev/null +++ b/src/app/home/home.component.html @@ -0,0 +1 @@ +

home works!

diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts new file mode 100644 index 0000000..0cb0d0f --- /dev/null +++ b/src/app/home/home.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.css'] +}) +export class HomeComponent { + +} diff --git a/src/app/home/home.module.ts b/src/app/home/home.module.ts new file mode 100644 index 0000000..ad8eb94 --- /dev/null +++ b/src/app/home/home.module.ts @@ -0,0 +1,35 @@ +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 {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module"; +import {OtherPortalsModule} from "../openaireLibrary/sharedComponents/other-portals/other-portals.module"; +import {IconsModule} from "../openaireLibrary/utils/icons/icons.module"; +import {NumbersModule} from "../openaireLibrary/sharedComponents/numbers/numbers.module"; +import { + AdvancedSearchInputModule +} from "../openaireLibrary/sharedComponents/advanced-search-input/advanced-search-input.module"; +import {InputModule} from "../openaireLibrary/sharedComponents/input/input.module"; +import {SearchInputModule} from "../openaireLibrary/sharedComponents/search-input/search-input.module"; +import {HomeComponent} from "./home.component"; +import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard"; + +@NgModule({ + imports: [ + CommonModule, FormsModule, RouterModule, + HomeRoutingModule, + // SEOServiceModule, OtherPortalsModule, IconsModule, NumbersModule, + // AdvancedSearchInputModule, InputModule, SearchInputModule + ], + declarations: [ + HomeComponent + ], + providers:[ + PreviousRouteRecorder + ], + exports: [ + HomeComponent + ] +}) +export class HomeModule {} diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary new file mode 160000 index 0000000..1a030e2 --- /dev/null +++ b/src/app/openaireLibrary @@ -0,0 +1 @@ +Subproject commit 1a030e2a0d54602b1d975c9879e9ee290d08d135 diff --git a/src/app/reload/libReload.module.ts b/src/app/reload/libReload.module.ts new file mode 100644 index 0000000..0bc5699 --- /dev/null +++ b/src/app/reload/libReload.module.ts @@ -0,0 +1,14 @@ +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { RouterModule } from '@angular/router'; + +import { ReloadModule } from '../openaireLibrary/reload/reload.module'; + + +@NgModule({ + imports: [ + CommonModule, FormsModule, RouterModule, ReloadModule + ] +}) +export class LibReloadModule { } diff --git a/src/assets/common-assets b/src/assets/common-assets new file mode 160000 index 0000000..031329d --- /dev/null +++ b/src/assets/common-assets @@ -0,0 +1 @@ +Subproject commit 031329d5ca890663a0911e3dac5649eb5c00c601 diff --git a/src/assets/openaire-theme b/src/assets/openaire-theme new file mode 160000 index 0000000..ac458b5 --- /dev/null +++ b/src/assets/openaire-theme @@ -0,0 +1 @@ +Subproject commit ac458b5a6d156167d7b6c9005ef1f9cfac75d3ae diff --git a/src/environments/environment.beta.ts b/src/environments/environment.beta.ts new file mode 100644 index 0000000..13dcb76 --- /dev/null +++ b/src/environments/environment.beta.ts @@ -0,0 +1,5 @@ +import {EnvProperties} from '../app/openaireLibrary/utils/properties/env-properties'; + +export let properties: EnvProperties = { + environment: "beta" +}; diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts new file mode 100644 index 0000000..d1a2431 --- /dev/null +++ b/src/environments/environment.prod.ts @@ -0,0 +1,5 @@ +import {EnvProperties} from '../app/openaireLibrary/utils/properties/env-properties'; + +export let properties: EnvProperties = { + environment:"production" +}; diff --git a/src/environments/environment.ts b/src/environments/environment.ts new file mode 100644 index 0000000..398988c --- /dev/null +++ b/src/environments/environment.ts @@ -0,0 +1,10 @@ +// 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' +}; diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..9eb5c02 --- /dev/null +++ b/src/index.html @@ -0,0 +1,32 @@ + + + + + + EOSC Metadata Harvester + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/karma.conf.js b/src/karma.conf.js new file mode 100644 index 0000000..86c7c56 --- /dev/null +++ b/src/karma.conf.js @@ -0,0 +1,32 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage-istanbul-reporter'), + require('@angular-devkit/build-angular/plugins/karma') + ], + client: { + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + coverageIstanbulReporter: { + dir: require('path').join(__dirname, '../coverage/connect-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, + restartOnFileChange: true + }); +}; diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..c203640 --- /dev/null +++ b/src/main.ts @@ -0,0 +1,12 @@ +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) + .catch(err => console.error(err)); diff --git a/src/polyfills.ts b/src/polyfills.ts new file mode 100644 index 0000000..7e1f7ff --- /dev/null +++ b/src/polyfills.ts @@ -0,0 +1,57 @@ +/*************************************************************************************************** + * 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. + * + * 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/guide/browser-support + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** + * By default, zone.js will patch all possible macroTask and DomEvents + * user can disable parts of macroTask/DomEvents patch by setting following flags + * because those flags need to be set before `zone.js` being loaded, and webpack + * will put import in the top of bundle, so user need to create a separate file + * in this directory (for example: zone-flags.ts), and put the following flags + * into that file, and then add the following code before importing zone.js. + * import './zone-flags.ts'; + * + * The flags allowed in zone-flags.ts are listed here. + * + * The following flags will work for all browsers. + * + * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + * + * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js + * with the following flag, it will bypass `zone.js` patch for IE/Edge + * + * (window as any).__Zone_enable_cross_context_check = true; + * + */ + +/*************************************************************************************************** + * Zone JS is required by default for Angular itself. + */ +import 'zone.js'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ diff --git a/src/robots.txt b/src/robots.txt new file mode 100644 index 0000000..e44c1d4 --- /dev/null +++ b/src/robots.txt @@ -0,0 +1,4 @@ +User-Agent: * +Disallow: /cache +Disallow: /upload +Disallow: / diff --git a/src/styles.less b/src/styles.less new file mode 100644 index 0000000..550dd19 --- /dev/null +++ b/src/styles.less @@ -0,0 +1,5 @@ +/* You can add global styles to this file, and also import other style files */ +@import "~src/assets/openaire-theme/less/_import"; +@import "~src/assets/common-assets/less/general"; +@import "~src/assets/common-assets/less/user"; +@import "~src/assets/common-assets/less/dashboard"; diff --git a/src/test.ts b/src/test.ts new file mode 100644 index 0000000..ae25f27 --- /dev/null +++ b/src/test.ts @@ -0,0 +1,16 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'zone.js/testing'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting(), { + teardown: { destroyAfterEach: false } +} +); diff --git a/src/tsconfig.app.json b/src/tsconfig.app.json new file mode 100644 index 0000000..f3a1b80 --- /dev/null +++ b/src/tsconfig.app.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/app", + "types": [] + }, + "files": [ + "main.ts", + "polyfills.ts" + ], + "include": [ + "src/**/*.d.ts" + ] +} diff --git a/src/tsconfig.spec.json b/src/tsconfig.spec.json new file mode 100644 index 0000000..de77336 --- /dev/null +++ b/src/tsconfig.spec.json @@ -0,0 +1,18 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/spec", + "types": [ + "jasmine", + "node" + ] + }, + "files": [ + "test.ts", + "polyfills.ts" + ], + "include": [ + "**/*.spec.ts", + "**/*.d.ts" + ] +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..668d981 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "downlevelIteration": true, + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "module": "es2020", + "moduleResolution": "node", + "experimentalDecorators": true, + "importHelpers": true, + "target": "ES2022", + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "es2018", + "dom" + ], + "useDefineForClassFields": false + } +}