Revision 52749
Added by Argiro Kokogiannaki about 6 years ago
modules/uoa-monitor-portal/trunk/beta-monitor/webpack.server.config.js | ||
---|---|---|
1 |
// Work around for https://github.com/angular/angular-cli/issues/7200 |
|
2 |
|
|
3 |
const path = require('path'); |
|
4 |
const webpack = require('webpack'); |
|
5 |
|
|
6 |
module.exports = { |
|
7 |
entry: { |
|
8 |
// This is our Express server for Dynamic universal |
|
9 |
server: './server.ts', |
|
10 |
// This is an example of Static prerendering (generative) |
|
11 |
prerender: './prerender.ts' |
|
12 |
}, |
|
13 |
target: 'node', |
|
14 |
resolve: { extensions: ['.ts', '.js'] }, |
|
15 |
// Make sure we include all node_modules etc |
|
16 |
externals: [/(node_modules|main\..*\.js)/,], |
|
17 |
output: { |
|
18 |
// Puts the output at the root of the dist folder |
|
19 |
path: path.join(__dirname, 'dist'), |
|
20 |
filename: '[name].js' |
|
21 |
}, |
|
22 |
module: { |
|
23 |
rules: [ |
|
24 |
{ test: /\.ts$/, loader: 'ts-loader' } |
|
25 |
] |
|
26 |
}, |
|
27 |
plugins: [ |
|
28 |
new webpack.ContextReplacementPlugin( |
|
29 |
// fixes WARNING Critical dependency: the request of a dependency is an expression |
|
30 |
/(.+)?angular(\\|\/)core(.+)?/, |
|
31 |
path.join(__dirname, 'src'), // location of your src |
|
32 |
{} // a map of your routes |
|
33 |
), |
|
34 |
new webpack.ContextReplacementPlugin( |
|
35 |
// fixes WARNING Critical dependency: the request of a dependency is an expression |
|
36 |
/(.+)?express(\\|\/)(.+)?/, |
|
37 |
path.join(__dirname, 'src'), |
|
38 |
{} |
|
39 |
) |
|
40 |
] |
|
41 |
} |
|
42 |
|
modules/uoa-monitor-portal/trunk/beta-monitor/monitor-beta-properties.json | ||
---|---|---|
1 |
{ |
|
2 |
"enablePiwikTrack" : true, |
|
3 |
"enableHelper" : true, |
|
4 |
"useCache" : true, |
|
5 |
"showContent" : false, |
|
6 |
"metricsAPIURL" : "https://beta.services.openaire.eu/usagestats/", |
|
7 |
"framesAPIURL" : "https://beta.openaire.eu/stats3/", |
|
8 |
"statisticsAPIURL" : "https://beta.services.openaire.eu/stats-api/", |
|
9 |
"statisticsFrameAPIURL":"https://beta.openaire.eu/stats/", |
|
10 |
"claimsAPIURL" : "https://beta.services.openaire.eu/claims/rest/claimsService/", |
|
11 |
"searchAPIURLLAst" : "https://beta.services.openaire.eu/search/v2/api/", |
|
12 |
"searchResourcesAPIURL" : "https://beta.services.openaire.eu/search/v2/api/resources", |
|
13 |
"csvAPIURL" : "https://beta.services.openaire.eu/search/v2/api/reports", |
|
14 |
"searchCrossrefAPIURL" : "https://api.crossref.org/works", |
|
15 |
"searchDataciteAPIURL" : "https://api.datacite.org/works", |
|
16 |
"searchOrcidURL" : "https://pub.orcid.org/v2.1/", |
|
17 |
"pmidURL" : "http://www.ncbi.nlm.nih.gov/pubmed/", |
|
18 |
"doiURL" : "https://dx.doi.org/", |
|
19 |
"cordisURL" : "http://cordis.europa.eu/projects/", |
|
20 |
"pmcURL" : "http://europepmc.org/articles/", |
|
21 |
"handleURL" : "http://hdl.handle.net/", |
|
22 |
"zenodo" : "https://zenodo.org/", |
|
23 |
"openAccess" : "https://www.openaire.eu/support/faq#article-id-234", |
|
24 |
"openAccessRepo" : "https://www.openaire.eu/support/faq#article-id-310", |
|
25 |
"fp7Guidlines" : "https://www.openaire.eu/open-access-in-fp7-seventh-research-framework-programme", |
|
26 |
"h2020Guidlines" : "https://www.openaire.eu/oa-publications/h2020/open-access-in-horizon-2020", |
|
27 |
"ercGuidlines" : "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf", |
|
28 |
"helpdesk" : "https://www.openaire.eu/support/helpdesk", |
|
29 |
"uploadService" : "https://demo.openaire.eu/upload/", |
|
30 |
|
|
31 |
"vocabulariesAPI" :"https://beta.services.openaire.eu/provision/mvc/vocabularies/", |
|
32 |
|
|
33 |
"piwikBaseUrl" :"https://analytics.openaire.eu/piwik.php?idsite=", |
|
34 |
"piwikSiteId" : "80", |
|
35 |
"loginUrl" :"https://beta.services.openaire.eu/connect-user-management/openid_connect_login", |
|
36 |
|
|
37 |
"logoutUrl" :"https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=", |
|
38 |
|
|
39 |
"logoutOpenaireUrl" :"http://dl067.madgik.di.uoa.gr/idp/profile/Logout", |
|
40 |
|
|
41 |
"cookieDomain" :".openaire.eu", |
|
42 |
|
|
43 |
"feedbackmail" :"openaire.test@gmail.com", |
|
44 |
|
|
45 |
"helperPageUrl" :"http://scoobydoo.di.uoa.gr:16000/api/page/route", |
|
46 |
|
|
47 |
"cacheUrl" :"https://demo.openaire.eu/cache/get?url=", |
|
48 |
|
|
49 |
"datasourcesAPI": "https://beta.services.openaire.eu/openaire/ds/search/", |
|
50 |
|
|
51 |
"adminToolsAPIURL" :"https://beta.services.openaire.eu/uoa-admin-tools", |
|
52 |
|
|
53 |
"adminToolsCommunity" :"openaire", |
|
54 |
"contextsAPI":"https://beta.services.openaire.eu/openaire/context", |
|
55 |
"communityAPI": "https://beta.services.openaire.eu/openaire/community/", |
|
56 |
"communitiesAPI": "https://beta.services.openaire.eu/openaire/community/communities", |
|
57 |
|
|
58 |
"csvLimit": 2000, |
|
59 |
"pagingLimit": 20, |
|
60 |
"resultsPerPage": 10, |
|
61 |
|
|
62 |
"baseLink" : "https://beta.connect.openaire.eu", |
|
63 |
|
|
64 |
"searchLinkToPublication" : "/search/publication?articleId=", |
|
65 |
"searchLinkToProject" : "/search/project?projectId=", |
|
66 |
"searchLinkToDataProvider" : "/search/dataprovider?datasourceId=", |
|
67 |
"searchLinkToDataset" : "/search/dataset?datasetId=", |
|
68 |
"searchLinkToOrganization" : "/search/organization?organizationId=", |
|
69 |
|
|
70 |
"searchLinkToPublications" : "/search/find/publications", |
|
71 |
"searchLinkToDataProviders" : "/search/find/dataproviders", |
|
72 |
"searchLinkToProjects" : "/search/find/projects", |
|
73 |
"searchLinkToDatasets" : "/search/find/datasets", |
|
74 |
"searchLinkToSoftware" : "/search/find/software", |
|
75 |
"searchLinkToOrganizations" : "/search/find/organizations", |
|
76 |
"searchLinkToCompatibleDataProviders" : "/search/content-providers", |
|
77 |
"searchLinkToCompatibleDataProvidersTable" : "/search/content-providers-table", |
|
78 |
"searchLinkToEntityRegistriesDataProviders" : "/search/entity-registries", |
|
79 |
"searchLinkToEntityRegistriesDataProvidersTable" : "/search/entity-registries-table", |
|
80 |
"searchLinkToJournals" : "/search/journals", |
|
81 |
"searchLinkToJournalsTable" : "/search/journals-table", |
|
82 |
|
|
83 |
"searchLinkToAdvancedPublications" : "/search/advanced/publications", |
|
84 |
"searchLinkToAdvancedProjects" : "/search/advanced/projects", |
|
85 |
"searchLinkToAdvancedDatasets" : "/search/advanced/datasets", |
|
86 |
"searchLinkToAdvancedSoftware" : "/search/advanced/software", |
|
87 |
"searchLinkToAdvancedDataProviders" : "/search/advanced/dataproviders", |
|
88 |
"searchLinkToAdvancedOrganizations" : "/search/advanced/organizations", |
|
89 |
"searchLinkToAdvancedPeople" : "/search/advanced/people" |
|
90 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/package.json | ||
---|---|---|
1 |
{ |
|
2 |
"name": "openaire-connect", |
|
3 |
"version": "1.0.0", |
|
4 |
"license": "Openaire", |
|
5 |
"contributors": [ |
|
6 |
"Argiro Kokogiannaki <argirok@di.uoa.gr>", |
|
7 |
"Konstantina Galouni <kgalouni@di.uoa.gr>" |
|
8 |
], |
|
9 |
"scripts": { |
|
10 |
"ng": "ng", |
|
11 |
"start": " ng serve --disable-host-check --host 0.0.0.0", |
|
12 |
"start:dynamic": "PORT=5000 npm run build:dynamic && npm run serve:dynamic", |
|
13 |
"start:static": "npm run build:static && npm run serve:static", |
|
14 |
"build": "ng build", |
|
15 |
"build:client-and-server-bundles": "ng build --prod -sm --stats-json && ng build --prod --app 1 --output-hashing=false", |
|
16 |
"build:static": "npm run build:client-and-server-bundles && npm run webpack:server && npm run generate:static", |
|
17 |
"build:dynamic": "npm run build:client-and-server-bundles && npm run webpack:server", |
|
18 |
"generate:static": "cd dist && node prerender", |
|
19 |
"webpack:server": "webpack --config webpack.server.config.js --progress --colors", |
|
20 |
"serve:static": "cd dist/browser && http-server", |
|
21 |
"serve:dynamic": "node dist/server" |
|
22 |
}, |
|
23 |
"private": true, |
|
24 |
"dependencies": { |
|
25 |
"@angular/animations": "^4.2.4", |
|
26 |
"@angular/common": "^4.2.4", |
|
27 |
"@angular/compiler": "^4.2.4", |
|
28 |
"@angular/core": "^4.2.4", |
|
29 |
"@angular/forms": "^4.2.4", |
|
30 |
"@angular/http": "^4.2.4", |
|
31 |
"@angular/platform-browser": "^4.2.4", |
|
32 |
"@angular/platform-browser-dynamic": "^4.2.4", |
|
33 |
"@angular/platform-server": "^4.2.4", |
|
34 |
"@angular/router": "^4.2.4", |
|
35 |
"@nguniversal/express-engine": "^1.0.0-beta.3", |
|
36 |
"@nguniversal/module-map-ngfactory-loader": "^1.0.0-beta.3", |
|
37 |
"angular-datatables": "^4.4.0", |
|
38 |
"citation-js": "^0.3.4", |
|
39 |
"clipboard": "^1.5.16", |
|
40 |
"core-js": "^2.4.1", |
|
41 |
"datatables.net": "^1.10.16", |
|
42 |
"datatables.net-dt": "^1.10.16", |
|
43 |
"jquery": "^3.2.1", |
|
44 |
"ngx-json-ld": "0.1.6", |
|
45 |
"rxjs": "^5.4.2", |
|
46 |
"ts-md5": "^1.2.0", |
|
47 |
"wikidata-sdk": "^5.2.9", |
|
48 |
"zone.js": "^0.8.14" |
|
49 |
}, |
|
50 |
"devDependencies": { |
|
51 |
"@angular/cli": "^1.3.0", |
|
52 |
"@angular/compiler-cli": "^4.2.4", |
|
53 |
"@angular/language-service": "^4.2.4", |
|
54 |
"@types/datatables.net": "^1.10.8", |
|
55 |
"@types/jquery": "^3.2.17", |
|
56 |
"@types/node": "^8.0.30", |
|
57 |
"cpy-cli": "^1.0.1", |
|
58 |
"http-server": "^0.10.0", |
|
59 |
"reflect-metadata": "^0.1.10", |
|
60 |
"ts-loader": "^2.3.7", |
|
61 |
"typescript": "~2.3.3" |
|
62 |
} |
|
63 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/.angular-cli.json | ||
---|---|---|
1 |
{ |
|
2 |
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", |
|
3 |
"project": { |
|
4 |
"name": "ng-universal-demo" |
|
5 |
}, |
|
6 |
"apps": [ |
|
7 |
{ |
|
8 |
"root": "src", |
|
9 |
"outDir": "dist/browser", |
|
10 |
"assets": [ |
|
11 |
"assets", |
|
12 |
"favicon.ico" |
|
13 |
], |
|
14 |
"index": "index.html", |
|
15 |
"main": "main.ts", |
|
16 |
"polyfills": "polyfills.ts", |
|
17 |
"test": "test.ts", |
|
18 |
"tsconfig": "tsconfig.app.json", |
|
19 |
"testTsconfig": "tsconfig.spec.json", |
|
20 |
"prefix": "app", |
|
21 |
"styles": [ |
|
22 |
"styles.css", |
|
23 |
"../node_modules/datatables.net-dt/css/jquery.dataTables.css" |
|
24 |
], |
|
25 |
"scripts": [ |
|
26 |
"../node_modules/jquery/dist/jquery.js", |
|
27 |
"../node_modules/datatables.net/js/jquery.dataTables.js" |
|
28 |
], |
|
29 |
"environmentSource": "environments/environment.ts", |
|
30 |
"environments": { |
|
31 |
"dev": "environments/environment.ts", |
|
32 |
"prod": "environments/environment.prod.ts" |
|
33 |
} |
|
34 |
}, |
|
35 |
{ |
|
36 |
"platform": "server", |
|
37 |
"root": "src", |
|
38 |
"outDir": "dist/server", |
|
39 |
"assets": [ |
|
40 |
"assets", |
|
41 |
"favicon.ico" |
|
42 |
], |
|
43 |
"index": "index.html", |
|
44 |
"main": "main.server.ts", |
|
45 |
"test": "test.ts", |
|
46 |
"tsconfig": "tsconfig.server.json", |
|
47 |
"testTsconfig": "tsconfig.spec.json", |
|
48 |
"prefix": "app", |
|
49 |
"styles": [ |
|
50 |
"styles.css" |
|
51 |
], |
|
52 |
"scripts": [], |
|
53 |
"environmentSource": "environments/environment.ts", |
|
54 |
"environments": { |
|
55 |
"dev": "environments/environment.ts", |
|
56 |
"prod": "environments/environment.prod.ts" |
|
57 |
} |
|
58 |
} |
|
59 |
], |
|
60 |
"e2e": { |
|
61 |
"protractor": { |
|
62 |
"config": "./protractor.conf.js" |
|
63 |
} |
|
64 |
}, |
|
65 |
"lint": [ |
|
66 |
{ |
|
67 |
"project": "src/tsconfig.app.json", |
|
68 |
"exclude": "**/node_modules/**" |
|
69 |
}, |
|
70 |
{ |
|
71 |
"project": "src/tsconfig.spec.json", |
|
72 |
"exclude": "**/node_modules/**" |
|
73 |
}, |
|
74 |
{ |
|
75 |
"project": "e2e/tsconfig.e2e.json", |
|
76 |
"exclude": "**/node_modules/**" |
|
77 |
} |
|
78 |
], |
|
79 |
"test": { |
|
80 |
"karma": { |
|
81 |
"config": "./karma.conf.js" |
|
82 |
} |
|
83 |
}, |
|
84 |
"defaults": { |
|
85 |
"styleExt": "css", |
|
86 |
"component": { |
|
87 |
"spec": false, |
|
88 |
"inlineStyle": true, |
|
89 |
"inlineTemplate": true |
|
90 |
}, |
|
91 |
"directive": { |
|
92 |
"spec": false |
|
93 |
}, |
|
94 |
"class": { |
|
95 |
"spec": false |
|
96 |
}, |
|
97 |
"guard": { |
|
98 |
"spec": false |
|
99 |
}, |
|
100 |
"module": { |
|
101 |
"spec": false |
|
102 |
}, |
|
103 |
"pipe": { |
|
104 |
"spec": false |
|
105 |
}, |
|
106 |
"service": { |
|
107 |
"spec": false |
|
108 |
} |
|
109 |
} |
|
110 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/prepareDeploy.sh | ||
---|---|---|
1 |
##ATTENTION |
|
2 |
## DON'T run it in svn folder - it *REMOVES* files |
|
3 |
## Copy project in another file "deploy-folder" |
|
4 |
## cd "deploy-folder" |
|
5 |
## run the script |
|
6 |
|
|
7 |
## uncommect from here--> |
|
8 |
# cp monitor-beta-properties.json src/assets/env-properties.json; |
|
9 |
# rm -rf src/assets/common-assets/.svn/; |
|
10 |
# rm -rf src/app/openaireLibrary/.svn/; |
|
11 |
# pico src/app/openaireLibrary/utils/properties/environment-specific.service.ts; |
|
12 |
# npm run build:dynamic; |
|
13 |
# rm -rf src node_modules .idea/ connect-production-properties.json installOpenaireLib.sh; |
|
14 |
# echo 'Ready!'; |
|
15 |
# echo 'Now copy to the server!' |
|
16 |
##<-- to here |
|
17 |
|
|
18 |
##copy "deploy-folder" in beta.connect.openaire.eu |
|
19 |
##coppies of previous deployments exist in "/home/argiro.kokogiannaki/connect-portal/connectYYYY-MM-DD" |
|
20 |
##run "npm i" |
|
21 |
##become nodejs user: "sudo su nodejs -s /bin/bash" |
|
22 |
##go to "cd /srv/www/portal" |
|
23 |
##cp files from "cp -r HOME_PATH/deploy-folder/* ." |
|
24 |
##restart portal "pm2 restart connect" |
|
0 | 25 |
modules/uoa-monitor-portal/trunk/beta-monitor/tsconfig.json | ||
---|---|---|
1 |
{ |
|
2 |
"compileOnSave": false, |
|
3 |
"compilerOptions": { |
|
4 |
"outDir": "./dist/out-tsc", |
|
5 |
"sourceMap": true, |
|
6 |
"declaration": false, |
|
7 |
"moduleResolution": "node", |
|
8 |
"emitDecoratorMetadata": true, |
|
9 |
"experimentalDecorators": true, |
|
10 |
"target": "es5", |
|
11 |
"typeRoots": [ |
|
12 |
"node_modules/@types" |
|
13 |
], |
|
14 |
"lib": [ |
|
15 |
"es2017", |
|
16 |
"dom" |
|
17 |
] |
|
18 |
} |
|
19 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/utils/subscribe/invite.service.ts | ||
---|---|---|
1 |
import { Injectable } from '@angular/core'; |
|
2 |
import { Http, Response, Headers, RequestOptions } from '@angular/http'; |
|
3 |
import { Observable } from 'rxjs/Rx'; |
|
4 |
import {COOKIE} from "../../openaireLibrary/login/utils/helper.class" |
|
5 |
|
|
6 |
|
|
7 |
@Injectable() |
|
8 |
export class InviteService { |
|
9 |
|
|
10 |
constructor(private http:Http) { |
|
11 |
} |
|
12 |
inviteUsers(url:string, subject:string, body:string, recipients:string[]){ |
|
13 |
var email = {"subject":subject, "body":body, recipients: recipients }; |
|
14 |
return this.http.post(url+"/email", JSON.stringify(email), this.getAuthOptionsWithBody()) |
|
15 |
.map(res => <any> res.json()) |
|
16 |
.do(res => {console.log("Response is "+res)}); |
|
17 |
} |
|
18 |
public getAuthOptionsWithBody():RequestOptions{ |
|
19 |
let headers = new Headers(); |
|
20 |
headers.append('Content-Type', 'application/json'); |
|
21 |
headers.append('X-XSRF-TOKEN', COOKIE.getCookie(COOKIE.cookieName_id)); |
|
22 |
let options = new RequestOptions({ headers: headers, withCredentials:true }); |
|
23 |
return options; |
|
24 |
} |
|
25 |
|
|
26 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/utils/subscribe/invite.component.ts | ||
---|---|---|
1 |
import { Component, Input, ViewChild } from '@angular/core'; |
|
2 |
import { Location } from '@angular/common'; |
|
3 |
import {ActivatedRoute} from '@angular/router'; |
|
4 |
import { EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; |
|
5 |
|
|
6 |
import {InviteService} from './invite.service'; |
|
7 |
import {Session} from '../../openaireLibrary/login/utils/helper.class'; |
|
8 |
@Component({ |
|
9 |
selector: 'invite', |
|
10 |
template: ` |
|
11 |
<form class="uk-form-stacked"> |
|
12 |
<div> |
|
13 |
<label class="uk-form-label">Subject</label> |
|
14 |
<input type="text" placeholder="Subject" [(ngModel)]=subject name="subject"> |
|
15 |
</div> |
|
16 |
<div> |
|
17 |
<div class="uk-form-label">Message</div> |
|
18 |
<textarea cols="" rows="6" placeholder="Email message..." [(ngModel)]=body name="body"></textarea> |
|
19 |
</div> |
|
20 |
<a class="uk-button uk-button-primary" (click)="invite()"> Invite</a> |
|
21 |
</form> |
|
22 |
|
|
23 |
` |
|
24 |
}) |
|
25 |
|
|
26 |
export class InviteComponent { |
|
27 |
@Input() communityName:boolean; |
|
28 |
@Input() communityId:string; |
|
29 |
properties:EnvProperties; |
|
30 |
|
|
31 |
subject:string; |
|
32 |
body:string; |
|
33 |
recipients:string[] = []; |
|
34 |
|
|
35 |
constructor (private route: ActivatedRoute, |
|
36 |
private _inviteService: InviteService |
|
37 |
) { |
|
38 |
} |
|
39 |
|
|
40 |
public ngOnInit() { |
|
41 |
this.route.data |
|
42 |
.subscribe((data: { envSpecific: EnvProperties }) => { |
|
43 |
this.properties = data.envSpecific; |
|
44 |
this.subject = "["+this.communityName+"] Invitation to join community"; |
|
45 |
this.body = "Dear sir or madame, \n\nWe would like to invite you to join "+this.communityName + |
|
46 |
" OpenAIRE community (beta."+this.communityId+".openaire.eu)"; |
|
47 |
}); |
|
48 |
|
|
49 |
|
|
50 |
} |
|
51 |
|
|
52 |
invite(){ |
|
53 |
var email = Session.getUserEmail(); |
|
54 |
//TODO |
|
55 |
this._inviteService.inviteUsers( this.properties.adminToolsAPIURL,this.subject, this.body, ["argirok@di.uoa.gr"]).subscribe ( |
|
56 |
res => { |
|
57 |
console.log(res); |
|
58 |
|
|
59 |
}); |
|
60 |
} |
|
61 |
|
|
62 |
|
|
63 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/utils/subscribe/invite.module.ts | ||
---|---|---|
1 |
import { NgModule} from '@angular/core'; |
|
2 |
import { CommonModule } from '@angular/common'; |
|
3 |
import { RouterModule } from '@angular/router'; |
|
4 |
import {FormsModule} from '@angular/forms'; |
|
5 |
|
|
6 |
import { InviteService } from './invite.service'; |
|
7 |
import {InviteComponent} from './invite.component'; |
|
8 |
import {AlertModalModule} from '../../openaireLibrary/utils/modal/alertModal.module'; |
|
9 |
|
|
10 |
@NgModule({ |
|
11 |
imports: [ |
|
12 |
CommonModule, RouterModule, AlertModalModule, FormsModule |
|
13 |
], |
|
14 |
declarations: [ |
|
15 |
InviteComponent |
|
16 |
], |
|
17 |
providers:[ |
|
18 |
InviteService |
|
19 |
], |
|
20 |
exports: [ |
|
21 |
InviteComponent |
|
22 |
] |
|
23 |
}) |
|
24 |
export class InviteModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/utils/subscribe/subscribe.component.ts | ||
---|---|---|
1 |
import { Component, Input, ViewChild } from '@angular/core'; |
|
2 |
import { Location } from '@angular/common'; |
|
3 |
import {ActivatedRoute} from '@angular/router'; |
|
4 |
import { EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; |
|
5 |
import {AlertModal} from '../../openaireLibrary/utils/modal/alert'; |
|
6 |
|
|
7 |
import {SubscribeService} from '../../openaireLibrary/utils/subscribe/subscribe.service'; |
|
8 |
import {Session} from '../../openaireLibrary/login/utils/helper.class'; |
|
9 |
@Component({ |
|
10 |
selector: 'subscribe', |
|
11 |
template: ` |
|
12 |
|
|
13 |
<span *ngIf="subscribed != null && !showNumbers"> |
|
14 |
<div *ngIf="!subscribed && showLoginAlert" class="uk-alert-warning uk-animation-slide-bottom" uk-alert="" > |
|
15 |
<a class="uk-alert-close" uk-close></a> |
|
16 |
<p>Please login first to subscribe</p> |
|
17 |
</div> |
|
18 |
<a *ngIf="!subscribed" class="uk-button uk-button-primary" (click)="subscribe()"> Subscribe</a> |
|
19 |
<a *ngIf="subscribed" class="uk-button uk-button-danger" (click)="confirmOpen()"> Unsubscribe</a> |
|
20 |
</span> |
|
21 |
|
|
22 |
<span *ngIf="showNumbers && subscribers !=null && subscribers > 0" > |
|
23 |
Members: {{subscribers}} |
|
24 |
</span> |
|
25 |
<modal-alert (alertOutput)="confirmClose($event)"> |
|
26 |
</modal-alert> |
|
27 |
` |
|
28 |
}) |
|
29 |
|
|
30 |
export class SubscribeComponent { |
|
31 |
// @Input() showSubscribe:boolean = true; |
|
32 |
@Input() showNumbers:boolean; |
|
33 |
@Input() communityId:string; |
|
34 |
|
|
35 |
|
|
36 |
subscribed:boolean = null; |
|
37 |
properties:EnvProperties; |
|
38 |
subscribers:number= null; |
|
39 |
showLoginAlert:Boolean = false; |
|
40 |
@ViewChild(AlertModal) alert; |
|
41 |
constructor (private route: ActivatedRoute, |
|
42 |
private _subscribeService: SubscribeService |
|
43 |
) { |
|
44 |
} |
|
45 |
|
|
46 |
public ngOnInit() { |
|
47 |
this.route.data |
|
48 |
.subscribe((data: { envSpecific: EnvProperties }) => { |
|
49 |
this.properties = data.envSpecific; |
|
50 |
if(!this.showNumbers){ |
|
51 |
var email = Session.getUserEmail(); |
|
52 |
if(email == null){ |
|
53 |
this.subscribed = false; |
|
54 |
}else{ |
|
55 |
this._subscribeService.isSubscribedToCommunity(this.communityId, email,this.properties.adminToolsAPIURL).subscribe ( |
|
56 |
res => { |
|
57 |
this.subscribed = res; |
|
58 |
}); |
|
59 |
} |
|
60 |
}else{ |
|
61 |
this._subscribeService.getCommunitySubscribers(this.communityId, this.properties.adminToolsAPIURL).subscribe ( |
|
62 |
res => { |
|
63 |
|
|
64 |
this.subscribers = (res && res.subscribers && res.subscribers.length )?res.subscribers.length:0; |
|
65 |
|
|
66 |
}); |
|
67 |
} |
|
68 |
}); |
|
69 |
|
|
70 |
|
|
71 |
} |
|
72 |
|
|
73 |
subscribe(){ |
|
74 |
var email = Session.getUserEmail(); |
|
75 |
if(email == null){ |
|
76 |
this.subscribed = false; |
|
77 |
this.showLoginAlert = true; |
|
78 |
}else{ |
|
79 |
this.showLoginAlert = false; |
|
80 |
this._subscribeService.subscribeToCommunity(this.communityId, email, this.properties.adminToolsAPIURL).subscribe ( |
|
81 |
res => { |
|
82 |
console.log(res); |
|
83 |
if(!this.subscribed){ |
|
84 |
this.subscribed = true; |
|
85 |
} |
|
86 |
}); |
|
87 |
} |
|
88 |
} |
|
89 |
|
|
90 |
unsubscribe(){ |
|
91 |
var email = Session.getUserEmail(); |
|
92 |
if(email == null){ |
|
93 |
this.subscribed = false; |
|
94 |
}else{ |
|
95 |
//this.properties.adminToolsAPIURL |
|
96 |
this._subscribeService.unSubscribeToCommunity(this.communityId, email,this.properties.adminToolsAPIURL).subscribe ( |
|
97 |
res => { |
|
98 |
console.log(res); |
|
99 |
if(this.subscribed){ |
|
100 |
this.subscribed = false; |
|
101 |
} |
|
102 |
}); |
|
103 |
} |
|
104 |
} |
|
105 |
|
|
106 |
confirmOpen(){ |
|
107 |
|
|
108 |
this.alert.cancelButton = true; |
|
109 |
this.alert.okButton = true; |
|
110 |
this.alert.alertTitle = "Unsubscribe community "; |
|
111 |
this.alert.message = "Do you want to proceed? "; |
|
112 |
this.alert.okButtonText = "Yes"; |
|
113 |
this.alert.cancelButtonText = "No"; |
|
114 |
this.alert.open(); |
|
115 |
} |
|
116 |
confirmClose(data){ |
|
117 |
this.unsubscribe(); |
|
118 |
} |
|
119 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/utils/subscribe/subscribe.module.ts | ||
---|---|---|
1 |
import { NgModule} from '@angular/core'; |
|
2 |
import { CommonModule } from '@angular/common'; |
|
3 |
import { RouterModule } from '@angular/router'; |
|
4 |
|
|
5 |
import { SubscribeService } from '../../openaireLibrary/utils/subscribe/subscribe.service'; |
|
6 |
import {SubscribeComponent} from './subscribe.component'; |
|
7 |
import {AlertModalModule} from '../../openaireLibrary/utils/modal/alertModal.module'; |
|
8 |
|
|
9 |
@NgModule({ |
|
10 |
imports: [ |
|
11 |
CommonModule, RouterModule, AlertModalModule |
|
12 |
], |
|
13 |
declarations: [ |
|
14 |
SubscribeComponent |
|
15 |
], |
|
16 |
providers:[ |
|
17 |
SubscribeService |
|
18 |
], |
|
19 |
exports: [ |
|
20 |
SubscribeComponent |
|
21 |
] |
|
22 |
}) |
|
23 |
export class SubscribeModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/utils/services/statistics.service.ts | ||
---|---|---|
1 |
import { Injectable } from '@angular/core'; |
|
2 |
import { Http, Response, Headers, RequestOptions } from '@angular/http'; |
|
3 |
import { Observable } from 'rxjs/Rx'; |
|
4 |
import {StatisticsDisplay, StatisticsSummary} from "../../openaireLibrary/connect/statistics/statisticsEntities"; |
|
5 |
|
|
6 |
|
|
7 |
@Injectable() |
|
8 |
export class StatisticsService { |
|
9 |
|
|
10 |
|
|
11 |
constructor(private http:Http) { } |
|
12 |
|
|
13 |
getCommunityStatistics(apiUrl: string, communityId: string): Observable<StatisticsSummary> { |
|
14 |
let url = `${apiUrl}communities/${communityId}`; |
|
15 |
console.log(`getting statistics summary from: ${url}`); |
|
16 |
return this.http.get(url) |
|
17 |
.map(res => <any>res.json()) |
|
18 |
.do(res => {console.log(res)}) |
|
19 |
.map(res => res.statistics) |
|
20 |
.do(res => {console.log(res)}); |
|
21 |
} |
|
22 |
|
|
23 |
getCommunityAdminStatisticsChoices(apiUrl: string, communityId: string): Observable<StatisticsDisplay> { |
|
24 |
let url = `${apiUrl}/statistics/${communityId}`; |
|
25 |
console.log(`getting admin choices for statistics from: ${url}`); |
|
26 |
return this.http.get(url) |
|
27 |
.map(stats => <StatisticsDisplay>stats.json()) |
|
28 |
.catch(this.handleError); |
|
29 |
} |
|
30 |
|
|
31 |
|
|
32 |
private handleError (error: Response) { |
|
33 |
// in a real world app, we may send the error to some remote logging infrastructure |
|
34 |
// instead of just logging it to the console |
|
35 |
console.log(error); |
|
36 |
return Observable.throw(error || 'Server error'); |
|
37 |
} |
|
38 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/utils/manage/manage.module.ts | ||
---|---|---|
1 |
import { NgModule} from '@angular/core'; |
|
2 |
import { CommonModule } from '@angular/common'; |
|
3 |
import { RouterModule } from '@angular/router'; |
|
4 |
|
|
5 |
import {CommunityService} from '../../openaireLibrary/connect/community/community.service'; |
|
6 |
import {ManageComponent} from './manage.component'; |
|
7 |
import {AlertModalModule} from '../../openaireLibrary/utils/modal/alertModal.module'; |
|
8 |
|
|
9 |
@NgModule({ |
|
10 |
imports: [ |
|
11 |
CommonModule, RouterModule, AlertModalModule |
|
12 |
], |
|
13 |
declarations: [ |
|
14 |
ManageComponent |
|
15 |
], |
|
16 |
providers:[ |
|
17 |
CommunityService |
|
18 |
], |
|
19 |
exports: [ |
|
20 |
ManageComponent |
|
21 |
] |
|
22 |
}) |
|
23 |
export class ManageModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/utils/manage/manage.component.ts | ||
---|---|---|
1 |
import { Component, Input, ViewChild } from '@angular/core'; |
|
2 |
import { Location } from '@angular/common'; |
|
3 |
import {ActivatedRoute} from '@angular/router'; |
|
4 |
import { EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; |
|
5 |
import {CommunityService} from '../../openaireLibrary/connect/community/community.service'; |
|
6 |
import {Session} from '../../openaireLibrary/login/utils/helper.class'; |
|
7 |
@Component({ |
|
8 |
selector: 'manage', |
|
9 |
template: ` |
|
10 |
|
|
11 |
|
|
12 |
<a *ngIf="isManager" [href]="'https://beta.admin.connect.openaire.eu/dashboard?communityId='+communityId" class="uk-button uk-button-default uk-margin-left" target="_blank" > |
|
13 |
<span class="uk-margin-small-right uk-icon" uk-icon="cog"> </span>Manage</a> |
|
14 |
|
|
15 |
|
|
16 |
` |
|
17 |
}) |
|
18 |
|
|
19 |
export class ManageComponent { |
|
20 |
@Input() communityId:string; |
|
21 |
|
|
22 |
|
|
23 |
isManager:boolean = false; |
|
24 |
properties:EnvProperties; |
|
25 |
constructor (private route: ActivatedRoute, |
|
26 |
private _communityService: CommunityService |
|
27 |
) { |
|
28 |
} |
|
29 |
|
|
30 |
public ngOnInit() { |
|
31 |
this.route.data |
|
32 |
.subscribe((data: { envSpecific: EnvProperties }) => { |
|
33 |
this.properties = data.envSpecific; |
|
34 |
if(Session.isLoggedIn()){ |
|
35 |
if(Session.isPortalAdministrator()||Session.isCommunityCurator()){ |
|
36 |
this.isManager = true; |
|
37 |
}else if(Session.isLoggedIn()){ |
|
38 |
var email = Session.getUserEmail(); |
|
39 |
this._communityService.iscommunityManager(this.properties, this.properties.communityAPI+ this.communityId, email).subscribe ( |
|
40 |
res => { |
|
41 |
this.isManager = res; |
|
42 |
}); |
|
43 |
} |
|
44 |
} |
|
45 |
}); |
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
} |
|
50 |
|
|
51 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/utils/piwikHelper.ts | ||
---|---|---|
1 |
export class PiwikHelper{ |
|
2 |
public static siteIDs={ |
|
3 |
"connect": 80, |
|
4 |
"dh-ch":81, |
|
5 |
"ee":82, |
|
6 |
"egi":83, |
|
7 |
"elixir-gr":84, |
|
8 |
"fam":85, |
|
9 |
"instruct":86, |
|
10 |
"mes":87, |
|
11 |
"ni":88, |
|
12 |
"oa-pg":89, |
|
13 |
"rda":90, |
|
14 |
"aginfra":93, |
|
15 |
"clarin":100, |
|
16 |
"dariah":103 |
|
17 |
} |
|
18 |
|
|
19 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/app.component.ts | ||
---|---|---|
1 |
import { Component, Directive, ElementRef, Renderer, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core'; |
|
2 |
import {Observable} from 'rxjs/Observable'; |
|
3 |
import {ActivatedRoute} from '@angular/router'; |
|
4 |
|
|
5 |
import { EnvProperties} from './openaireLibrary/utils/properties/env-properties'; |
|
6 |
import{MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu'; |
|
7 |
import { EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service'; |
|
8 |
import {Session} from './openaireLibrary/login/utils/helper.class'; |
|
9 |
|
|
10 |
@Component({ |
|
11 |
//changeDetection: ChangeDetectionStrategy.Default, |
|
12 |
//encapsulation: ViewEncapsulation.Emulated, |
|
13 |
selector: 'app-root', |
|
14 |
styles: [` |
|
15 |
`], |
|
16 |
template: ` |
|
17 |
|
|
18 |
<navbar *ngIf= "properties " portal="monitor" onlyTop=false [userMenuItems]=userMenuItems [menuItems]=menuItems logoPath="assets/" |
|
19 |
[(APIUrl)]="properties.adminToolsAPIURL" [(logInUrl)]="properties.loginUrl" [(logOutUrl)]="properties.logoutUrl" [(cookieDomain)]="properties.cookieDomain" |
|
20 |
></navbar> |
|
21 |
|
|
22 |
|
|
23 |
<div class="custom-main-content" > |
|
24 |
<main> |
|
25 |
<router-outlet></router-outlet> |
|
26 |
</main> |
|
27 |
</div> |
|
28 |
<feedback *ngIf= "isClient && properties" portalName="Connect" [feedbackmail]=properties.feedbackmail></feedback> |
|
29 |
<cookie-law *ngIf= "isClient" position="bottom"> |
|
30 |
OpenAIRE uses cookies in order to function properly.<br> |
|
31 |
Cookies are small pieces of data that websites store in your browser to allow us to give you the best browsing experience possible. |
|
32 |
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"> |
|
33 |
<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> |
|
34 |
</span></a> |
|
35 |
</cookie-law> |
|
36 |
<bottom *ngIf= "isClient" [menuItems]=bottomMenuItems></bottom> |
|
37 |
|
|
38 |
` |
|
39 |
|
|
40 |
}) |
|
41 |
export class AppComponent { |
|
42 |
isClient:boolean = false; |
|
43 |
userMenuItems:MenuItem[] =[]; |
|
44 |
menuItems:RootMenuItem []=[]; |
|
45 |
bottomMenuItems:MenuItem[] =[]; |
|
46 |
properties:EnvProperties; |
|
47 |
|
|
48 |
constructor( private route: ActivatedRoute, private propertiesService:EnvironmentSpecificService ) { |
|
49 |
} |
|
50 |
|
|
51 |
ngOnInit() { |
|
52 |
this.propertiesService.loadEnvironment() |
|
53 |
.then(es => { |
|
54 |
this.propertiesService.setEnvProperties(es); |
|
55 |
this.properties = this.propertiesService.envSpecific; |
|
56 |
this.bottomMenuItems =[ |
|
57 |
new MenuItem("","About","https://beta.openaire.eu/project-factsheets","",false,[],[],{}), |
|
58 |
new MenuItem("","News - Events","https://beta.openaire.eu/news-events","",false,[],[],{}), |
|
59 |
new MenuItem("","Blog","https://blogs.openaire.eu/","",false,[],[],{}), |
|
60 |
new MenuItem("","Contact us","https://beta.openaire.eu/contact-us","",false,[],[],{}) |
|
61 |
]; |
|
62 |
this.userMenuItems =[ |
|
63 |
//new MenuItem("","My links","","/myclaims",false,[],["/myclaims"],{}) |
|
64 |
]; |
|
65 |
// this.route.queryParams.subscribe(data => { |
|
66 |
// |
|
67 |
// }); |
|
68 |
if (typeof document !== 'undefined') { |
|
69 |
try{ |
|
70 |
this.isClient = true; |
|
71 |
}catch (e) { |
|
72 |
} |
|
73 |
} |
|
74 |
}, error => { |
|
75 |
console.log("App couldn't fetch properties"); |
|
76 |
console.log(error); |
|
77 |
|
|
78 |
}); |
|
79 |
} |
|
80 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/reload/libReload.module.ts | ||
---|---|---|
1 |
import { NgModule} from '@angular/core'; |
|
2 |
import { CommonModule } from '@angular/common'; |
|
3 |
import { FormsModule } from '@angular/forms'; |
|
4 |
import { RouterModule } from '@angular/router'; |
|
5 |
|
|
6 |
import{ReloadModule} from '../openaireLibrary/reload/reload.module'; |
|
7 |
|
|
8 |
|
|
9 |
@NgModule({ |
|
10 |
imports: [ |
|
11 |
CommonModule, FormsModule, RouterModule, ReloadModule |
|
12 |
], |
|
13 |
declarations: [ |
|
14 |
|
|
15 |
], |
|
16 |
providers:[ |
|
17 |
|
|
18 |
], |
|
19 |
exports: [ |
|
20 |
|
|
21 |
] |
|
22 |
}) |
|
23 |
export class LibReloadModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/shared/shared.module.ts | ||
---|---|---|
1 |
import { NgModule, ModuleWithProviders } from '@angular/core'; |
|
2 |
import { CommonModule } from '@angular/common'; |
|
3 |
import { RouterModule } from '@angular/router'; |
|
4 |
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; |
|
5 |
|
|
6 |
|
|
7 |
const MODULES = [ |
|
8 |
// Do NOT include UniversalModule, HttpModule, or JsonpModule here |
|
9 |
CommonModule, |
|
10 |
RouterModule, |
|
11 |
FormsModule, |
|
12 |
ReactiveFormsModule |
|
13 |
]; |
|
14 |
|
|
15 |
const PIPES = [ |
|
16 |
// put pipes here |
|
17 |
]; |
|
18 |
|
|
19 |
const COMPONENTS = [ |
|
20 |
// put shared components here |
|
21 |
]; |
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
@NgModule({ |
|
26 |
imports: [ |
|
27 |
...MODULES |
|
28 |
], |
|
29 |
declarations: [ |
|
30 |
...PIPES, |
|
31 |
...COMPONENTS |
|
32 |
], |
|
33 |
exports: [ |
|
34 |
...MODULES, |
|
35 |
...PIPES, |
|
36 |
...COMPONENTS |
|
37 |
] |
|
38 |
}) |
|
39 |
export class SharedModule { |
|
40 |
static forRoot(): ModuleWithProviders { |
|
41 |
return { |
|
42 |
ngModule: SharedModule, |
|
43 |
}; |
|
44 |
} |
|
45 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/deposit/datasets/depositBySubjectResult-routing.module.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
import { RouterModule } from '@angular/router'; |
|
3 |
|
|
4 |
import { OpenaireDepositBySubjectResultComponent } from './depositBySubjectResult.component'; |
|
5 |
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; |
|
6 |
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
|
7 |
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'; |
|
8 |
|
|
9 |
@NgModule({ |
|
10 |
imports: [ |
|
11 |
RouterModule.forChild([ |
|
12 |
{ path: '', component: OpenaireDepositBySubjectResultComponent, canActivate: [FreeGuard, IsRouteEnabled], data: { |
|
13 |
redirect: '/error' |
|
14 |
},canDeactivate: [PreviousRouteRecorder] } |
|
15 |
|
|
16 |
]) |
|
17 |
] |
|
18 |
}) |
|
19 |
export class DepositBySubjectResultsRoutingModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/deposit/datasets/depositDatasetsResults-routing.module.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
import { RouterModule } from '@angular/router'; |
|
3 |
import { OpenaireDepositDatasetsResultComponent } from './depositDatasetsResult.component'; |
|
4 |
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; |
|
5 |
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
|
6 |
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'; |
|
7 |
|
|
8 |
@NgModule({ |
|
9 |
imports: [ |
|
10 |
RouterModule.forChild([ |
|
11 |
{ path: '', component: OpenaireDepositDatasetsResultComponent, canActivate: [FreeGuard, IsRouteEnabled], data: { |
|
12 |
redirect: '/error' |
|
13 |
},canDeactivate: [PreviousRouteRecorder] } |
|
14 |
|
|
15 |
]) |
|
16 |
] |
|
17 |
}) |
|
18 |
export class DepositDatasetsResultsRoutingModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/deposit/datasets/depositDatasetsResult.component.ts | ||
---|---|---|
1 |
import {Component, Input} from '@angular/core'; |
|
2 |
import {PiwikHelper} from '../../utils/piwikHelper'; |
|
3 |
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper'; |
|
4 |
|
|
5 |
@Component({ |
|
6 |
selector: 'openaire-deposit-datasets-result', |
|
7 |
template: ` |
|
8 |
<deposit-datasets-result [piwikSiteId]=piwikSiteId></deposit-datasets-result> |
|
9 |
|
|
10 |
|
|
11 |
` |
|
12 |
}) |
|
13 |
|
|
14 |
export class OpenaireDepositDatasetsResultComponent { |
|
15 |
piwikSiteId = null; |
|
16 |
constructor ( ) { |
|
17 |
var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname); |
|
18 |
this.piwikSiteId = PiwikHelper.siteIDs[communityId]; |
|
19 |
} |
|
20 |
|
|
21 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/deposit/datasets/depositDatasets.component.ts | ||
---|---|---|
1 |
import {Component, Input} from '@angular/core'; |
|
2 |
import {PiwikHelper} from '../../utils/piwikHelper'; |
|
3 |
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper'; |
|
4 |
|
|
5 |
@Component({ |
|
6 |
selector: 'openaire-deposit-datasets', |
|
7 |
template: ` |
|
8 |
<deposit-datasets [piwikSiteId]=piwikSiteId> |
|
9 |
|
|
10 |
</deposit-datasets> |
|
11 |
` |
|
12 |
}) |
|
13 |
|
|
14 |
export class OpenaireDepositDatasetsComponent { |
|
15 |
piwikSiteId = null; |
|
16 |
constructor ( ) { |
|
17 |
var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname); |
|
18 |
this.piwikSiteId = PiwikHelper.siteIDs[communityId]; |
|
19 |
} |
|
20 |
|
|
21 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/deposit/datasets/depositBySubjectResult.component.ts | ||
---|---|---|
1 |
import {Component, Input} from '@angular/core'; |
|
2 |
import {Observable} from 'rxjs/Observable'; |
|
3 |
import {PiwikHelper} from '../../utils/piwikHelper'; |
|
4 |
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper'; |
|
5 |
|
|
6 |
|
|
7 |
@Component({ |
|
8 |
selector: 'openaire-deposit-by-subject-result', |
|
9 |
template:`<deposit-by-subject-result [piwikSiteId]=piwikSiteId></deposit-by-subject-result>` |
|
10 |
}) |
|
11 |
|
|
12 |
export class OpenaireDepositBySubjectResultComponent { |
|
13 |
piwikSiteId = null; |
|
14 |
constructor ( ) { |
|
15 |
var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname); |
|
16 |
this.piwikSiteId = PiwikHelper.siteIDs[communityId]; |
|
17 |
} |
|
18 |
|
|
19 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/deposit/datasets/depositDatasets.module.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
import { CommonModule } from '@angular/common'; |
|
3 |
import { FormsModule } from '@angular/forms'; |
|
4 |
|
|
5 |
import { OpenaireDepositDatasetsComponent } from './depositDatasets.component'; |
|
6 |
import {DepositDatasetsRoutingModule} from './depositDatasets-routing.module'; |
|
7 |
import {DepositDatasetsModule} from '../../openaireLibrary/deposit/datasets/depositDatasets.module'; |
|
8 |
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; |
|
9 |
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
|
10 |
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard' |
|
11 |
@NgModule({ |
|
12 |
imports: [ |
|
13 |
CommonModule, FormsModule, |
|
14 |
DepositDatasetsModule, |
|
15 |
DepositDatasetsRoutingModule |
|
16 |
], |
|
17 |
declarations: [ |
|
18 |
|
|
19 |
OpenaireDepositDatasetsComponent |
|
20 |
|
|
21 |
], |
|
22 |
exports: [ |
|
23 |
OpenaireDepositDatasetsComponent |
|
24 |
], |
|
25 |
providers: [FreeGuard,PreviousRouteRecorder, IsRouteEnabled] |
|
26 |
}) |
|
27 |
export class LibDepositDatasetsModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/deposit/datasets/depositDatasetsResults.module.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
import { CommonModule } from '@angular/common'; |
|
3 |
import { FormsModule } from '@angular/forms'; |
|
4 |
|
|
5 |
import { OpenaireDepositDatasetsResultComponent } from './depositDatasetsResult.component'; |
|
6 |
|
|
7 |
import {DepositDatasetsResultsRoutingModule} from './depositDatasetsResults-routing.module'; |
|
8 |
import {DepositDatasetsResultsModule} from '../../openaireLibrary/deposit/datasets/depositDatasetsResults.module'; |
|
9 |
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; |
|
10 |
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
|
11 |
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard' |
|
12 |
|
|
13 |
@NgModule({ |
|
14 |
imports: [ |
|
15 |
CommonModule, FormsModule, |
|
16 |
DepositDatasetsResultsModule, |
|
17 |
DepositDatasetsResultsRoutingModule |
|
18 |
], |
|
19 |
declarations: [ |
|
20 |
|
|
21 |
OpenaireDepositDatasetsResultComponent, |
|
22 |
|
|
23 |
], |
|
24 |
exports: [ |
|
25 |
OpenaireDepositDatasetsResultComponent, |
|
26 |
], |
|
27 |
providers: [FreeGuard,PreviousRouteRecorder, IsRouteEnabled] |
|
28 |
}) |
|
29 |
export class LibDepositDatasetsResultsModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/deposit/datasets/depositBySubjectResults.module.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
import { CommonModule } from '@angular/common'; |
|
3 |
import { FormsModule } from '@angular/forms'; |
|
4 |
|
|
5 |
import { OpenaireDepositBySubjectResultComponent } from './depositBySubjectResult.component'; |
|
6 |
|
|
7 |
import {DepositBySubjectResultsRoutingModule} from './depositBySubjectResult-routing.module'; |
|
8 |
import {DepositBySubjectResultsModule } from '../../openaireLibrary/deposit/datasets/depositBySubjectResults.module'; |
|
9 |
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; |
|
10 |
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
|
11 |
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard' |
|
12 |
|
|
13 |
@NgModule({ |
|
14 |
imports: [ |
|
15 |
CommonModule, FormsModule, |
|
16 |
DepositBySubjectResultsModule, |
|
17 |
DepositBySubjectResultsRoutingModule |
|
18 |
], |
|
19 |
declarations: [ |
|
20 |
|
|
21 |
OpenaireDepositBySubjectResultComponent |
|
22 |
|
|
23 |
], |
|
24 |
exports: [ |
|
25 |
OpenaireDepositBySubjectResultComponent |
|
26 |
], |
|
27 |
providers: [FreeGuard,PreviousRouteRecorder, IsRouteEnabled] |
|
28 |
}) |
|
29 |
export class LibDepositBySubjectResultsModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/deposit/datasets/depositDatasets-routing.module.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
import { RouterModule } from '@angular/router'; |
|
3 |
|
|
4 |
import { OpenaireDepositDatasetsComponent } from './depositDatasets.component'; |
|
5 |
|
|
6 |
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; |
|
7 |
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
|
8 |
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard' |
|
9 |
@NgModule({ |
|
10 |
imports: [ |
|
11 |
RouterModule.forChild([ |
|
12 |
{ path: '', component: OpenaireDepositDatasetsComponent, canActivate: [FreeGuard, IsRouteEnabled], data: { |
|
13 |
redirect: '/error' |
|
14 |
},canDeactivate: [PreviousRouteRecorder] } |
|
15 |
|
|
16 |
]) |
|
17 |
] |
|
18 |
}) |
|
19 |
export class DepositDatasetsRoutingModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/deposit/publications/depositPublicationsResults.module.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
import { CommonModule } from '@angular/common'; |
|
3 |
import { FormsModule } from '@angular/forms'; |
|
4 |
|
|
5 |
import { OpenaireDepositPublicationsResultComponent } from './depositPublicationsResult.component'; |
|
6 |
|
|
7 |
import {DepositPublicationsResultRoutingModule} from './depositPublicationsResult-routing.module'; |
|
8 |
import {DepositPublicationsResultsModule} from '../../openaireLibrary/deposit/publications/depositPublicationsResults.module'; |
|
9 |
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; |
|
10 |
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
|
11 |
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard' |
|
12 |
@NgModule({ |
|
13 |
imports: [ |
|
14 |
CommonModule, FormsModule, |
|
15 |
DepositPublicationsResultsModule, |
|
16 |
DepositPublicationsResultRoutingModule |
|
17 |
], |
|
18 |
declarations: [ |
|
19 |
OpenaireDepositPublicationsResultComponent |
|
20 |
], |
|
21 |
exports: [ |
|
22 |
OpenaireDepositPublicationsResultComponent |
|
23 |
], |
|
24 |
providers: [FreeGuard,PreviousRouteRecorder, IsRouteEnabled] |
|
25 |
}) |
|
26 |
export class LibDepositPublicationsResultsModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/deposit/publications/depositPublicationsResult-routing.module.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
import { RouterModule } from '@angular/router'; |
|
3 |
import { OpenaireDepositPublicationsResultComponent } from './depositPublicationsResult.component'; |
|
4 |
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; |
|
5 |
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
|
6 |
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard' |
|
7 |
|
|
8 |
@NgModule({ |
|
9 |
imports: [ |
|
10 |
RouterModule.forChild([ |
|
11 |
{ path: '', component: OpenaireDepositPublicationsResultComponent, canActivate: [FreeGuard, IsRouteEnabled], data: { |
|
12 |
redirect: '/error' |
|
13 |
}, canDeactivate: [PreviousRouteRecorder] } |
|
14 |
|
|
15 |
]) |
|
16 |
] |
|
17 |
}) |
|
18 |
export class DepositPublicationsResultRoutingModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/deposit/publications/depositPublications-routing.module.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
import { RouterModule } from '@angular/router'; |
|
3 |
import { OpenaireDepositPublicationsComponent } from './depositPublications.component'; |
|
4 |
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; |
|
5 |
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
|
6 |
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard' |
|
7 |
|
|
8 |
@NgModule({ |
|
9 |
imports: [ |
|
10 |
RouterModule.forChild([ |
|
11 |
{ path: '', component: OpenaireDepositPublicationsComponent, canActivate: [FreeGuard, IsRouteEnabled], data: { |
|
12 |
redirect: '/error' |
|
13 |
}, canDeactivate: [PreviousRouteRecorder] } |
|
14 |
|
|
15 |
]) |
|
16 |
] |
|
17 |
}) |
|
18 |
export class DepositPublicationsRoutingModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/deposit/publications/depositPublicationsResult.component.ts | ||
---|---|---|
1 |
import {Component, Input} from '@angular/core'; |
|
2 |
import {PiwikHelper} from '../../utils/piwikHelper'; |
|
3 |
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper'; |
|
4 |
|
|
5 |
@Component({ |
|
6 |
selector: 'openaire-deposit-publications-result', |
|
7 |
template: ` |
|
8 |
<deposit-publications-result [piwikSiteId]=piwikSiteId></deposit-publications-result> |
|
9 |
` |
|
10 |
}) |
|
11 |
|
|
12 |
export class OpenaireDepositPublicationsResultComponent { |
|
13 |
piwikSiteId = null; |
|
14 |
constructor ( ) { |
|
15 |
var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname); |
|
16 |
this.piwikSiteId = PiwikHelper.siteIDs[communityId]; |
|
17 |
} |
|
18 |
|
|
19 |
|
|
20 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/deposit/publications/depositPublications.component.ts | ||
---|---|---|
1 |
import {Component, Input} from '@angular/core'; |
|
2 |
import {PiwikHelper} from '../../utils/piwikHelper'; |
|
3 |
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper'; |
|
4 |
|
|
5 |
@Component({ |
|
6 |
selector: 'openaire-deposit-publications', |
|
7 |
template: ` |
|
8 |
<deposit-publications [piwikSiteId]=piwikSiteId></deposit-publications> |
|
9 |
` |
|
10 |
}) |
|
11 |
|
|
12 |
export class OpenaireDepositPublicationsComponent { |
|
13 |
piwikSiteId = null; |
|
14 |
constructor ( ) { |
|
15 |
var communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname); |
|
16 |
this.piwikSiteId = PiwikHelper.siteIDs[communityId]; |
|
17 |
} |
|
18 |
|
|
19 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/deposit/publications/depositPublications.module.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
import { CommonModule } from '@angular/common'; |
|
3 |
import { FormsModule } from '@angular/forms'; |
|
4 |
|
|
5 |
import { OpenaireDepositPublicationsComponent } from './depositPublications.component'; |
|
6 |
|
|
7 |
import {DepositPublicationsRoutingModule} from './depositPublications-routing.module'; |
|
8 |
import {DepositPublicationsModule} from '../../openaireLibrary/deposit/publications/depositPublications.module'; |
|
9 |
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; |
|
10 |
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
|
11 |
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard' |
|
12 |
@NgModule({ |
|
13 |
imports: [ |
|
14 |
CommonModule, FormsModule, |
|
15 |
DepositPublicationsModule, |
|
16 |
DepositPublicationsRoutingModule |
|
17 |
], |
|
18 |
declarations: [ |
|
19 |
OpenaireDepositPublicationsComponent |
|
20 |
], |
|
21 |
exports: [ |
|
22 |
OpenaireDepositPublicationsComponent, |
|
23 |
], |
|
24 |
providers: [FreeGuard,PreviousRouteRecorder, IsRouteEnabled] |
|
25 |
}) |
|
26 |
export class LibDepositPublicationsModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/claims/directLinking/directLinking.module.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
|
|
3 |
import { SharedModule } from '../../shared/shared.module'; |
|
4 |
import { OpenaireDirectLinkingComponent } from './directLinking.component'; |
|
5 |
import{ DirectLinkingModule} from '../../openaireLibrary/claims/directLinking/directLinking.module'; |
|
6 |
import {DirectLinkingRoutingModule} from './directLinking-routing.module'; |
|
7 |
import {LoginGuard} from '../../openaireLibrary/login/loginGuard.guard'; |
|
8 |
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
|
9 |
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'; |
|
10 |
import {ConnectSubscriberGuard} from '../../openaireLibrary/connect/communityGuard/connectSubscriber.guard'; |
|
11 |
import {CommunityService} from '../../openaireLibrary/connect/community/community.service'; |
|
12 |
|
|
13 |
@NgModule({ |
|
14 |
imports: [ |
|
15 |
SharedModule, DirectLinkingModule, DirectLinkingRoutingModule |
|
16 |
], |
|
17 |
providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled, ConnectSubscriberGuard, CommunityService], |
|
18 |
declarations: [ |
|
19 |
OpenaireDirectLinkingComponent |
|
20 |
], exports:[OpenaireDirectLinkingComponent] |
|
21 |
}) |
|
22 |
export class LibDirectLinkingModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/claims/directLinking/directLinking-routing.module.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
import { RouterModule } from '@angular/router'; |
|
3 |
|
|
4 |
import { OpenaireDirectLinkingComponent } from './directLinking.component'; |
|
5 |
import {LoginGuard} from '../../openaireLibrary/login/loginGuard.guard'; |
|
6 |
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
|
7 |
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'; |
|
8 |
import {ConnectSubscriberGuard} from '../../openaireLibrary/connect/communityGuard/connectSubscriber.guard'; |
|
9 |
|
|
10 |
@NgModule({ |
|
11 |
imports: [ |
|
12 |
RouterModule.forChild([ |
|
13 |
{ path: '', component: OpenaireDirectLinkingComponent, canActivate: [IsRouteEnabled, LoginGuard, ConnectSubscriberGuard], data: { |
|
14 |
redirect: '/error' |
|
15 |
}, canDeactivate: [PreviousRouteRecorder]}, |
|
16 |
|
|
17 |
]) |
|
18 |
] |
|
19 |
}) |
|
20 |
export class DirectLinkingRoutingModule { } |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/claims/directLinking/directLinking.component.ts | ||
---|---|---|
1 |
import {Component, Input} from '@angular/core'; |
|
2 |
|
|
3 |
@Component({ |
|
4 |
selector: 'openaire-directLinking', |
|
5 |
template: `<directLinking></directLinking>` |
|
6 |
}) |
|
7 |
export class OpenaireDirectLinkingComponent { |
|
8 |
} |
modules/uoa-monitor-portal/trunk/beta-monitor/src/app/claims/myClaimsDemo.component.ts | ||
---|---|---|
1 |
// import {Component, Input} from '@angular/core'; |
|
2 |
// import {Observable} from 'rxjs/Observable'; |
|
3 |
// import { Router } from '@angular/router'; |
|
4 |
// |
|
5 |
// |
|
6 |
// |
|
7 |
// @Component({ |
|
8 |
// selector: 'my-claims-demo', |
|
9 |
// template: ` |
|
10 |
// <div *ngIf="user" class="container"> |
|
11 |
// <div class="page-header"> |
|
12 |
// <h1> My Claims Demo</h1> |
|
13 |
// </div> |
|
14 |
// <div> |
|
15 |
// <div class=""><a routerLink="/Linking">Linking</a></div> |
|
16 |
// <div class=""><a routerLink]="/MyClaims">MyClaims</a></div> |
|
17 |
// <div class=""><a routerLink="/Claims">Claims Admin</a></div> |
|
18 |
// <p> Extra parameters for claims admin</p> |
|
19 |
// <div class=""><a href="claims?fetchBy=User&fetchId=amelie.baecker@uni-bielefeld.de">Claims By user</a></div> |
|
20 |
// <div class=""><a href="claims?fetchBy=Project&fetchId=corda_______::2c37878a0cede85dbbd1081bb9b4a2f8">Claims By project</a></div> |
|
21 |
// <div class=""><a href="claims?fetchBy=Context&fetchId=egi::country::gr">Claims By context</a></div> |
|
22 |
// |
|
23 |
// <!-- <p>Orcid |
|
24 |
// <p>N.M. |
|
25 |
// 0000-0002-3477-3082 |
|
26 |
// </p> |
|
27 |
// </p> --> |
|
28 |
// <div class=""><a href="publication?articleId=od_______908::3a5b2885656a91307156325644e73b92" >Publication od_______908::3a5b2885656a91307156325644e73b92</a></div> |
|
29 |
// <!--<div class=""><a href="publication?articleId=od_______908::3a5b2885656a91307156325644e73b92" >Publication od_______908::3a5b2885656a91307156325644e73b92</a></div> |
|
30 |
// <div class=""><a href="publication?articleId=od_______908::3a5b2885656a91307156325644e73b92" >Publication od_______908::3a5b2885656a91307156325644e73b92</a></div>--> |
|
31 |
// </div> |
|
32 |
// </div> |
|
33 |
// |
|
34 |
// |
|
35 |
// |
|
36 |
// ` |
|
37 |
// //(click)="changeOrderby('target')" |
|
38 |
// //od_______908::3a5b2885656a91307156325644e73b92 |
|
39 |
// |
|
40 |
// }) |
|
41 |
// export class MyClaimsDemoComponent { |
|
42 |
// constructor ( private _router: Router ) { |
|
43 |
// } |
|
44 |
// user:string="argirok@di.uoa.gr"; |
|
45 |
// ngOnInit() { |
|
46 |
// |
|
47 |
// } |
Also available in: Unified diff
Initial commit for beta monitor dashboard