Project

General

Profile

« Previous | Next » 

Revision 61396

[Admin]: Delete all branches

View differences:

modules/uoa-admin-portal/branches/angular6/prepareBetaDeploy.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 connect-admin-beta-properties.json  ./src/assets/env-properties.json;
9
# pico src/app/openaireLibrary/utils/properties/environment-specific.service.ts;
10
# npm run build;
11
# rm -rf dist/assets/common-assets/.svn/;
12
# echo 'Ready!';
13
# echo 'Now copy dist to the server!'
14
##<-- to here
15

  
16
##copy "deploy-folder/dist" in demo.openaire.eu
17
##coppies of previous deployments exist in  "/home/argiro.kokogiannaki/uoa-portal/connect-adminYYYY-MM-DD"
18
##become nodejs user: "sudo su nodejs -s /bin/bash"
19
##go to "cd /srv/www/portal-www"
20
##cp files from "cp -r HOME_PATH/deploy-folder/* ."
21 0

  
modules/uoa-admin-portal/branches/angular6/LICENSE
1
MIT License
2

  
3
Copyright (c) 2017 Stefanos Gatsios
4

  
5
Permission is hereby granted, free of charge, to any person obtaining a copy
6
of this software and associated documentation files (the "Software"), to deal
7
in the Software without restriction, including without limitation the rights
8
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
copies of the Software, and to permit persons to whom the Software is
10
furnished to do so, subject to the following conditions:
11

  
12
The above copyright notice and this permission notice shall be included in all
13
copies or substantial portions of the Software.
14

  
15
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
SOFTWARE.
modules/uoa-admin-portal/branches/angular6/.angular-cli.json
1
{
2
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
  "project": {
4
    "name": "admin-portal"
5
  },
6
  "apps": [
7
    {
8
      "root": "src",
9
      "outDir": "dist",
10
      "assets": [
11
        "assets",
12
        "robots.txt"
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
        "../node_modules/interactiveminingv3/assets/css/interactive-mining.css",
25
        "../node_modules/interactiveminingv3/assets/css/animations.css"
26

  
27
      ],
28
      "scripts": [
29
        "../node_modules/jquery/dist/jquery.js",
30
        "../node_modules/datatables.net/js/jquery.dataTables.js",
31
        "../node_modules/interactiveminingv3/assets/js/ResizeSensor.js",
32
        "../node_modules/interactiveminingv3/assets/js/jquery.sticky-sidebar.js"
33
      ],
34
      "environmentSource": "environments/environment.ts",
35
      "environments": {
36
        "dev": "environments/environment.ts",
37
        "prod": "environments/environment.prod.ts"
38
      }
39
    }
40
  ],
41
  "e2e": {
42
    "protractor": {
43
      "config": "./protractor.conf.js"
44
    }
45
  },
46
  "lint": [
47
    {
48
      "project": "src/tsconfig.app.json",
49
      "exclude": "**/node_modules/**"
50
    },
51
    {
52
      "project": "src/tsconfig.spec.json",
53
      "exclude": "**/node_modules/**"
54
    },
55
    {
56
      "project": "e2e/tsconfig.e2e.json",
57
      "exclude": "**/node_modules/**"
58
    }
59
  ],
60
  "test": {
61
    "karma": {
62
      "config": "./karma.conf.js"
63
    }
64
  },
65
  "defaults": {
66
    "styleExt": "css",
67
    "component": {}
68
  }
69
}
modules/uoa-admin-portal/branches/angular6/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-admin-portal/branches/angular6/tslint.json
1
{
2
  "rulesDirectory": [
3
    "node_modules/codelyzer"
4
  ],
5
  "rules": {
6
    "arrow-return-shorthand": true,
7
    "callable-types": true,
8
    "class-name": true,
9
    "comment-format": [
10
      true,
11
      "check-space"
12
    ],
13
    "curly": true,
14
    "eofline": true,
15
    "forin": true,
16
    "import-blacklist": [
17
      true,
18
      "rxjs"
19
    ],
20
    "import-spacing": true,
21
    "indent": [
22
      true,
23
      "spaces"
24
    ],
25
    "interface-over-type-literal": true,
26
    "label-position": true,
27
    "max-line-length": [
28
      true,
29
      140
30
    ],
31
    "member-access": false,
32
    "member-ordering": [
33
      true,
34
      {
35
        "order": [
36
          "static-field",
37
          "instance-field",
38
          "static-method",
39
          "instance-method"
40
        ]
41
      }
42
    ],
43
    "no-arg": true,
44
    "no-bitwise": true,
45
    "no-console": [
46
      true,
47
      "debug",
48
      "info",
49
      "time",
50
      "timeEnd",
51
      "trace"
52
    ],
53
    "no-construct": true,
54
    "no-debugger": true,
55
    "no-duplicate-super": true,
56
    "no-empty": false,
57
    "no-empty-interface": true,
58
    "no-eval": true,
59
    "no-inferrable-types": [
60
      true,
61
      "ignore-params"
62
    ],
63
    "no-misused-new": true,
64
    "no-non-null-assertion": true,
65
    "no-shadowed-variable": true,
66
    "no-string-literal": false,
67
    "no-string-throw": true,
68
    "no-switch-case-fall-through": true,
69
    "no-trailing-whitespace": true,
70
    "no-unnecessary-initializer": true,
71
    "no-unused-expression": true,
72
    "no-use-before-declare": true,
73
    "no-var-keyword": true,
74
    "object-literal-sort-keys": false,
75
    "one-line": [
76
      true,
77
      "check-open-brace",
78
      "check-catch",
79
      "check-else",
80
      "check-whitespace"
81
    ],
82
    "prefer-const": true,
83
    "quotemark": [
84
      true,
85
      "single"
86
    ],
87
    "radix": true,
88
    "semicolon": [
89
      true,
90
      "always"
91
    ],
92
    "triple-equals": [
93
      true,
94
      "allow-null-check"
95
    ],
96
    "typedef-whitespace": [
97
      true,
98
      {
99
        "call-signature": "nospace",
100
        "index-signature": "nospace",
101
        "parameter": "nospace",
102
        "property-declaration": "nospace",
103
        "variable-declaration": "nospace"
104
      }
105
    ],
106
    "typeof-compare": true,
107
    "unified-signatures": true,
108
    "variable-name": false,
109
    "whitespace": [
110
      true,
111
      "check-branch",
112
      "check-decl",
113
      "check-operator",
114
      "check-separator",
115
      "check-type"
116
    ],
117
    "directive-selector": [
118
      true,
119
      "attribute",
120
      "app",
121
      "camelCase"
122
    ],
123
    "component-selector": [
124
      true,
125
      "element",
126
      "app",
127
      "kebab-case"
128
    ],
129
    "use-input-property-decorator": true,
130
    "use-output-property-decorator": true,
131
    "use-host-property-decorator": true,
132
    "no-input-rename": true,
133
    "no-output-rename": true,
134
    "use-life-cycle-interface": true,
135
    "use-pipe-transform-interface": true,
136
    "component-class-suffix": true,
137
    "directive-class-suffix": true,
138
    "no-access-missing-member": true,
139
    "templates-use-public": true,
140
    "invoke-injectable": true
141
  }
142
}
modules/uoa-admin-portal/branches/angular6/src/app/dashboard.component.ts
1
/**
2
 * Created by stefania on 3/21/16.
3
 */
4

  
5
import { Component, ElementRef } from '@angular/core';
6
import {ActivatedRoute} from '@angular/router';
7
import {CommunityService} from "./openaireLibrary/connect/community/community.service";
8
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
9

  
10
@Component({
11
    selector: 'dashboard',
12
    templateUrl: 'dashboard.component.html',
13
})
14

  
15
export class DashboardComponent {
16
  communityId:string= null;
17
  communityType = null;
18
  properties:EnvProperties;
19

  
20
  constructor( private element: ElementRef, private  route: ActivatedRoute,  private _communityService:CommunityService) {}
21

  
22
  ngOnInit() {
23
    this.route.data.subscribe((data: { envSpecific: EnvProperties }) => {
24
        this.properties = data.envSpecific;
25
        this.route.queryParams.subscribe(data => {
26
          this.scroll();
27

  
28
          this.communityId = ((data['communityId'])?data['communityId']:data['community']);
29
          this._communityService.getCommunity(this.properties, this.properties.communityAPI+this.communityId).subscribe (
30
            community => {
31
                this.communityType = community.type;
32
            },
33
            error => {
34
              console.error('Server responded: ' + error);
35
            }
36
          );
37
        });
38
    });
39

  
40
  }
41

  
42
  public scroll() {
43
    console.info("scroll into view");
44
    if (typeof document !== 'undefined') {
45
       this.element.nativeElement.scrollIntoView();
46
    }
47
  }
48
}
modules/uoa-admin-portal/branches/angular6/src/app/services/help-content.service.ts
1
/**
2
 * Created by stefania on 7/13/17.
3
 */
4
import { Injectable } from '@angular/core';
5
import { Http, Response, Headers, RequestOptions } from '@angular/http';
6
import { Observable } from 'rxjs/Rx';
7
import { Page } from "../domain/page";
8
import { PageHelpContent } from "../domain/page-help-content";
9
import { Community } from "../domain/community";
10
import { Entity } from "../domain/entity";
11
import { DivId } from "../domain/divId";
12
import { DivHelpContent } from "../domain/div-help-content";
13
import {COOKIE} from "../openaireLibrary/login/utils/helper.class"
14
import {StatisticsDisplay, StatisticsSummary} from '../openaireLibrary/connect/statistics/statisticsEntities';
15
import { CustomOptions } from '../openaireLibrary/services/servicesUtils/customOptions.class';
16

  
17

  
18
@Injectable()
19
export class HelpContentService {
20

  
21
    constructor(private http:Http) {
22
    }
23

  
24
    static removeNulls(obj){
25
        var isArray = obj instanceof Array;
26
        for (var k in obj){
27
            if (obj[k]===null || obj[k]==='') isArray ? obj.splice(k,1) : delete obj[k];
28
            else if (typeof obj[k]=="object") HelpContentService.removeNulls(obj[k]);
29
        }
30
    }
31

  
32
    getDivIdsFull(page_id: string, helpContentUrl:string) {
33
      if(page_id) {
34
        return this.http.get(helpContentUrl + 'divFull?&page='+page_id)
35
            .map(res => <Array<DivId>> res.json())
36
            .catch(this.handleError);
37
      } else {
38
        return this.http.get(helpContentUrl + 'divFull')
39
            .map(res => <Array<DivId>> res.json())
40
            .catch(this.handleError);
41
      }
42
    }
43

  
44
    updateDivId(divId: DivId, helpContentUrl:string) {
45
        HelpContentService.removeNulls(divId);
46

  
47
        return this.http.post(helpContentUrl + 'div/update', JSON.stringify(divId), CustomOptions.getAuthOptionsWithBody())
48
            .map(res => <DivId> res.json())
49
            .catch(this.handleError);
50
    }
51

  
52
    getDivId(divId: string, helpContentUrl:string) {
53
        return this.http.get(helpContentUrl + 'div/'+divId)
54
            .map(res => <DivId> res.json())
55
            .catch(this.handleError);
56
    }
57

  
58
    getDivIdFull(divId: string, helpContentUrl:string) {
59
        return this.http.get(helpContentUrl + 'divFull/'+divId)
60
            .map(res => <DivId> res.json())
61
            .catch(this.handleError);
62
    }
63

  
64
    saveDivId(divId: DivId, helpContentUrl:string) {
65
        HelpContentService.removeNulls(divId);
66

  
67
        return this.http.post(helpContentUrl + 'div/save', JSON.stringify(divId), CustomOptions.getAuthOptionsWithBody())
68
            .map(res => <DivId> res.json())
69
            .catch(this.handleError);
70
    }
71
/*
72
    getCommunitiesWithDivId(helpContentUrl:string) {
73
        return this.http.get(helpContentUrl + 'community?div=true')
74
            .map(res => <Array<Community>> res.json())
75
            .catch(this.handleError);
76
    }
77
*/
78
    getCommunityPagesWithDivId(community_pid: string, helpContentUrl:string) {
79
        return this.http.get(helpContentUrl + 'community/'+community_pid+'/pages?div=true')
80
            .map(res => <Array<Page>> res.json())
81
            .catch(this.handleError);
82
    }
83

  
84
    getCommunityDivHelpContents(community_pid: string, helpContentUrl:string) {
85
      return this.http.get(helpContentUrl + 'divhelpcontent?community='+community_pid)
86
          .map(res => <Array<DivHelpContent>> res.json())
87
          .catch(this.handleError);
88
    }
89

  
90
    getDivHelpContent(id : string, helpContentUrl:string) {
91
      return this.http.get(helpContentUrl + 'divhelpcontent/' + id)
92
          .map(res => <DivHelpContent> res.json())
93
          .catch(this.handleError);
94
    }
95

  
96
    insertOrUpdateDivHelpContent(divHelpContent: DivHelpContent, helpContentUrl:string) {
97
        HelpContentService.removeNulls(divHelpContent);
98

  
99
        return this.http.post(helpContentUrl + 'divhelpcontent', JSON.stringify(divHelpContent), CustomOptions.getAuthOptionsWithBody())
100
            .map(res => <DivHelpContent> res.json())
101
            .catch(this.handleError);
102
    }
103

  
104
    deleteDivIds(ids : string[], helpContentUrl:string) {
105
        return this.http.post(helpContentUrl + 'div/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
106
            .catch(this.handleError);
107
    }
108

  
109
    deleteDivHelpContents(ids : string[], helpContentUrl:string) {
110
         return this.http.post(helpContentUrl + 'divhelpcontent/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
111
            .catch(this.handleError);
112
    }
113

  
114
    toggleDivHelpContents(ids : string[],status : boolean, helpContentUrl:string) {
115

  
116
        return this.http.post(helpContentUrl + 'divhelpcontent/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
117
            //.map( res => <string[]> res.json())
118
            .catch(this.handleError);
119
    }
120

  
121
    getPagesWithDivIds(community_pid: string, helpContentUrl:string) {
122
        return this.http.get(helpContentUrl + 'div/pages')
123
            .map(res => <Map<string, Set<string>>> res.json())
124
            .catch(this.handleError);
125
    }
126

  
127
    getPages(helpContentUrl:string,pid:string) {
128
        return this.http.get(helpContentUrl + 'page'+(pid?("?pid="+pid):""))
129
            .map(res => <Array<Page>> res.json())
130
            .catch(this.handleError);
131
    }
132

  
133
    getPage(pageId:string, helpContentUrl:string) {
134
        return this.http.get(helpContentUrl + 'page/'+pageId)
135
            .map(res => <Page> res.json())
136
            .catch(this.handleError);
137
    }
138

  
139
    getCommunities( helpContentUrl:string) {
140
        return this.http.get(helpContentUrl + 'community')
141
            .map(res => <Array<Community>> res.json())
142
            .catch(this.handleError);
143
    }
144

  
145
    getCommunity(community_pid: string, helpContentUrl:string) {
146
        return this.http.get(helpContentUrl + 'community/'+community_pid)
147
            .map(res => <Community> res.json())
148
            .catch(this.handleError);
149
    }
150

  
151
    getCommunitiesFull( helpContentUrl:string) {
152
        return this.http.get(helpContentUrl + 'communityFull')
153
            .map(res => <Array<Community>> res.json())
154
            .catch(this.handleError);
155
    }
156

  
157
    getCommunityFull(community_pid: string, helpContentUrl:string) {
158
        return this.http.get(helpContentUrl + 'communityFull/'+community_pid)
159
            .map(res => <Community> res.json())
160
            .catch(this.handleError);
161
    }
162

  
163
    saveCommunity(community: Community, helpContentUrl:string) {
164
        // let headers = new Headers({'Content-Type': 'application/json'});
165
        // let options = new RequestOptions({headers: headers});
166

  
167
        HelpContentService.removeNulls(community);
168

  
169
        return this.http.post(helpContentUrl + 'community/save', JSON.stringify(community),CustomOptions.getAuthOptionsWithBody())
170
            .map(res => <Community> res.json())
171
            .catch(this.handleError);
172
    }
173

  
174
    updateCommunity(community: Community, helpContentUrl:string) {
175
        // let headers = new Headers({'Content-Type': 'application/json'});
176
        // let options = new RequestOptions({headers: headers});
177

  
178
        HelpContentService.removeNulls(community);
179

  
180
        return this.http.post(helpContentUrl + 'community/update', JSON.stringify(community),  CustomOptions.getAuthOptionsWithBody())
181
            .map(res => <Community> res.json())
182
            .catch(this.handleError);
183
    }
184

  
185
    deleteCommunities(ids : string[], helpContentUrl:string) {
186
        // let headers = new Headers({'Content-Type': 'application/json'});
187
        // let options = new RequestOptions({headers: headers});
188

  
189
        return this.http.post(helpContentUrl + 'community/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
190
            .catch(this.handleError);
191
    }
192

  
193
    getCommunityPages(community_pid: string, params: string, helpContentUrl:string) {
194
        return this.http.get(helpContentUrl + 'community/'+community_pid+'/pages'+params)
195
            .map(res => <Array<Page>> res.json())
196
            .catch(this.handleError);
197
    }
198

  
199
    getEntities(helpContentUrl:string) {
200
        return this.http.get(helpContentUrl + 'entity')
201
            .map(res => <Array<Entity>> res.json())
202
            .catch(this.handleError);
203
    }
204

  
205
    getCommunityEntities(community_pid: string, helpContentUrl:string) {
206
        return this.http.get(helpContentUrl + 'community/'+community_pid+'/entities')
207
            .map(res => <Array<Entity>> res.json())
208
            .catch(this.handleError);
209
    }
210

  
211

  
212
    saveEntity(entity: Entity, helpContentUrl:string) {
213
        HelpContentService.removeNulls(entity);
214

  
215
        return this.http.post(helpContentUrl + 'entity/save', JSON.stringify(entity), CustomOptions.getAuthOptionsWithBody())
216
            .map(res => <Entity> res.json())
217
            .catch(this.handleError);
218
    }
219

  
220
    updateEntity(entity: Entity, helpContentUrl:string) {
221
        HelpContentService.removeNulls(entity);
222

  
223
        return this.http.post(helpContentUrl + 'entity/update', JSON.stringify(entity), CustomOptions.getAuthOptionsWithBody())
224
            .map(res => <Entity> res.json())
225
            .catch(this.handleError);
226
    }
227

  
228
    // toggleEntity(selectedCommunityId: string, id : string,status : boolean) {
229
    //     let headers = new Headers({'Content-Type': 'application/json'});
230
    //     let options = new RequestOptions({headers: headers});
231
    //
232
    //     return this.http.post(helpContentUrl + 'community/'+selectedCommunityId+'/entity/toggle?status='+ status.toString()+'&entityId='+id.toString(), options)
233
    //         .catch(this.handleError);
234
    // }
235

  
236
    toggleEntities(selectedCommunityPid: string, ids : string[],status : boolean, helpContentUrl:string) {
237

  
238
        return this.http.post(helpContentUrl +'community/'+selectedCommunityPid+ '/entity/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
239
            //.map( res => <string[]> res.json())
240
            .catch(this.handleError);
241
    }
242

  
243
    deleteEntities(ids : string[], helpContentUrl:string) {
244
        return this.http.post(helpContentUrl + 'entity/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
245
            .catch(this.handleError);
246
    }
247

  
248

  
249
    toggleEntityOfPage(pageId: string, entityId : string,status : boolean, helpContentUrl:string) {
250
        return this.http.post(helpContentUrl + 'page/'+pageId+'/entity/toggle?status='+ status.toString()+'&entityId='+entityId.toString(), CustomOptions.getAuthOptionsWithBody())
251
            .catch(this.handleError);
252
    }
253

  
254
    savePage(page: Page, helpContentUrl:string) {
255
         HelpContentService.removeNulls(page);
256

  
257
        return this.http.post(helpContentUrl + 'page/save', JSON.stringify(page), CustomOptions.getAuthOptionsWithBody())
258
            .map(res => <Page> res.json())
259
            .catch(this.handleError);
260
    }
261

  
262
    updatePage(page: Page, helpContentUrl:string) {
263

  
264
        HelpContentService.removeNulls(page);
265

  
266
        return this.http.post(helpContentUrl + 'page/update', JSON.stringify(page), CustomOptions.getAuthOptionsWithBody())
267
            .map(res => <Page> res.json())
268
            .catch(this.handleError);
269
    }
270

  
271
    togglePages(selectedCommunityPid: string, ids : string[],status : boolean, helpContentUrl:string) {
272

  
273
        return this.http.post(helpContentUrl + 'community/'+selectedCommunityPid+'/page/toggle?status='+ status.toString(),JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
274
            .catch(this.handleError);
275
    }
276

  
277
    deletePages(ids : string[], helpContentUrl:string) {
278

  
279
        return this.http.post(helpContentUrl + 'page/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
280
            .catch(this.handleError);
281
    }
282

  
283
    getPageHelpContents(helpContentUrl:string) {
284
        return this.http.get(helpContentUrl + 'pagehelpcontent')
285
            .map(res => <Array<PageHelpContent>> res.json())
286
            .catch(this.handleError);
287
    }
288

  
289
    getCommunityPageHelpContents(community_pid: string, helpContentUrl:string) {
290
        return this.http.get(helpContentUrl + 'pagehelpcontent?community='+community_pid)
291
            .map(res => <Array<PageHelpContent>> res.json())
292
            .catch(this.handleError);
293
    }
294

  
295
    getPageHelpContent(id : string, helpContentUrl:string) {
296
        return this.http.get(helpContentUrl + 'pagehelpcontent/' + id)
297
            .map(res => <PageHelpContent> res.json())
298
            .catch(this.handleError);
299
    }
300

  
301
    savePageHelpContent(pageHelpContent: PageHelpContent, helpContentUrl:string) {
302
        HelpContentService.removeNulls(pageHelpContent);
303

  
304
        return this.http.post(helpContentUrl + 'pagehelpcontent/save', JSON.stringify(pageHelpContent), CustomOptions.getAuthOptionsWithBody())
305
            .map(res => <PageHelpContent> res.json())
306
            .catch(this.handleError);
307
    }
308

  
309
    updatePageHelpContent(pageHelpContent: PageHelpContent, helpContentUrl:string) {
310
        HelpContentService.removeNulls(pageHelpContent);
311

  
312
        return this.http.post(helpContentUrl + 'pagehelpcontent/update', JSON.stringify(pageHelpContent), CustomOptions.getAuthOptionsWithBody())
313
            .map(res => <PageHelpContent> res.json())
314
            .catch(this.handleError);
315
    }
316

  
317
    deletePageHelpContents(ids : string[], helpContentUrl:string) {
318
          return this.http.post(helpContentUrl + 'pagehelpcontent/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
319
            .catch(this.handleError);
320
    }
321

  
322
    togglePageHelpContents(ids : string[],status : boolean, helpContentUrl:string) {
323
        return this.http.post(helpContentUrl + 'pagehelpcontent/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
324
            //.map( res => <string[]> res.json())
325
            .catch(this.handleError);
326
    }
327

  
328
    private handleError(error: Response) {
329
        // in a real world app, we may send the error to some remote logging infrastructure
330
        // instead of just logging it to the console
331
        console.error(error);
332
        return Observable.throw(error.json().error || 'Server error');
333
    }
334

  
335
    // getDataProviders() {
336
    //     return this.http.get('https://beta.services.openaire.eu/search/v2/api/datasources?format=json').map(res => <any> res.json()).map(res => res.results).do(res => {console.log(res)}).catch(this.handleError);
337
    // }
338

  
339
    getCommunityStatistics(apiUrl: string, communityId: string): Observable<StatisticsSummary> {
340
        const url = `${apiUrl}communities/${communityId}`;
341
        console.log(`getting statistics summary from: ${url}`);
342
        return this.http.get(url)
343
            .map(res => <any>res.json())
344
            .do(res => { console.log(res); })
345
            .map(res => res.statistics)
346
            .do(res => { console.log(res); });
347
    }
348

  
349
    getCommunityAdminStatisticsChoices(apiUrl: string, communityId: string): Observable<StatisticsDisplay> {
350
        const url = `${apiUrl}statistics/${communityId}`;
351
        console.log(`getting admin choices for statistics from: ${url}`);
352
        return this.http.get(url)
353
            .map(stats => <StatisticsDisplay>stats.json())
354
            .catch(this.handleError);
355
    }
356

  
357
    postCommunityAdminStatisticsChoices(apiUrl: string,
358
                                        communityId: string,
359
                                        entity: string,
360
                                        chartsOrNumbers: string,
361
                                        title: string,
362
                                        status: boolean,
363
                                        monitor: boolean): Observable<any> {
364
        const url = `${apiUrl}statistics/${communityId}/${entity}/${chartsOrNumbers}?status=${status.toString()}&monitor=${monitor.toString()}`;
365
        console.log(`getting admin choices for statistics from: ${url}`);
366

  
367
        return this.http.post(url, title, CustomOptions.getAuthOptionsWithBody())
368
            .map(stats => <any>stats.json())
369
            .catch(this.handleError);
370
    }
371
}
modules/uoa-admin-portal/branches/angular6/src/app/services/manageContentProviders.service.ts
1
import {Injectable} from '@angular/core';
2
import {Http, Response, Headers, RequestOptions} from '@angular/http';
3
import {Observable}     from 'rxjs/Observable';
4
import{EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
5

  
6
import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
7
import { ErrorObservable } from 'rxjs/observable/ErrorObservable';
8
import { catchError } from 'rxjs/operators';
9

  
10
@Injectable()
11
export class ManageCommunityContentProvidersService {
12
  constructor(private http: Http ) {}
13

  
14
  removeContentProvider (properties:EnvProperties, communityId: string, id: string):any {
15
    let headers = new Headers({'Content-Type': 'application/json', 'accept': 'application/json'});
16
    let options = new RequestOptions({headers: headers, body: id});
17

  
18
    let url = properties.communityAPI+communityId+"/contentproviders";
19
    console.info(url);
20

  
21
    return this.http.delete(url, options)
22
  }
23

  
24
  addContentProvider(properties:EnvProperties, communityId: string, contentProvider: any) {
25
      let headers = new Headers({'Content-Type': 'application/json'});
26
      let options = new RequestOptions({headers: headers});
27

  
28
      let url = properties.communityAPI+communityId+"/contentproviders";
29
      console.info(url);
30

  
31
      let communityContentProvider = this.convertSearchContentProviderToCommunityContentProvider(contentProvider, communityId);
32
      console.info(contentProvider);
33
      console.info(communityContentProvider);
34

  
35
      return this.http.post(url, JSON.stringify(communityContentProvider), options)
36
                      .map(res => <any> res.json())
37
    }
38

  
39
  convertSearchContentProviderToCommunityContentProvider(contentProvider: any, community: string) : any {
40
    let communityContentProvider = {
41
            "communityId": community,
42
            "officialname": "",
43
            "name": "",
44
            "openaireId": ""
45
    }
46

  
47
    communityContentProvider.officialname = contentProvider.title.name;
48
    communityContentProvider.name = contentProvider.englishname;
49
    communityContentProvider.openaireId = contentProvider.id;
50

  
51
    return communityContentProvider;
52
  }
53

  
54
}
modules/uoa-admin-portal/branches/angular6/src/app/services/manageProjects.service.ts
1
import {Injectable} from '@angular/core';
2
import {Http, Response, Headers, RequestOptions} from '@angular/http';
3
import {Observable}     from 'rxjs/Observable';
4
import{EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
5

  
6
import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
7
import { ErrorObservable } from 'rxjs/observable/ErrorObservable';
8
import { catchError } from 'rxjs/operators';
9

  
10
@Injectable()
11
export class ManageCommunityProjectsService {
12
  constructor(private http: Http ) {}
13

  
14
  removeProject (properties:EnvProperties, communityId: string, id: string):any {
15
    let headers = new Headers({'Content-Type': 'application/json', 'accept': 'application/json'});
16
    let options = new RequestOptions({headers: headers, body: id});
17

  
18
    let url = properties.communityAPI+communityId+"/projects";
19
    console.info(url);
20

  
21
    return this.http.delete(url, options)
22
  }
23

  
24
  addProject(properties:EnvProperties, communityId: string, project: any) {
25
      let headers = new Headers({'Content-Type': 'application/json'});
26
      let options = new RequestOptions({headers: headers});
27

  
28
      let url = properties.communityAPI+communityId+"/projects";
29
      console.info(url);
30

  
31
      let communityProject = this.convertSearchProjectToCommunityProject(project, communityId);
32
      console.info(project);
33
      console.info(communityProject);
34
      let testProject: any = {
35
        "acronym": "test",
36
        "communityId": "egi",
37
        "funder": "test",
38
        "grantId": "test",
39
        "name": "test",
40
        "openaireId": "test"
41
      };
42

  
43
      return this.http.post(url, JSON.stringify(communityProject), options)
44
                      .map(res => <any> res.json())
45
    }
46

  
47
  convertSearchProjectToCommunityProject(project: any, community: string) : any {
48
    let communityProject = {
49
            "acronym": "",
50
            "communityId": community,
51
            "funder": "",
52
            "grantId": "",
53
            "name": "",
54
            "openaireId": ""
55
    }
56

  
57
    communityProject.acronym = project.acronym;
58
    communityProject.name = project.title.name;
59
    communityProject.funder = project.funderShortname;
60
    communityProject.grantId = project.code;
61
    communityProject.openaireId = project.id;
62

  
63
    return communityProject;
64
  }
65

  
66
}
modules/uoa-admin-portal/branches/angular6/src/app/services/manageZenodoCommunities.service.ts
1
import {Injectable} from '@angular/core';
2
import {Http, Response, Headers, RequestOptions} from '@angular/http';
3
import {Observable}     from 'rxjs/Observable';
4
import{EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
5

  
6
import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
7
import { ErrorObservable } from 'rxjs/observable/ErrorObservable';
8
import { catchError } from 'rxjs/operators';
9

  
10
@Injectable()
11
export class  ManageZenodoCommunitiesService {
12
  constructor(private http: Http ) {}
13

  
14
  removeZCommunity (properties:EnvProperties,communityId: string,id: string):any {
15
    let headers = new Headers({'Content-Type': 'application/json', 'accept': 'application/json'});
16
    let options = new RequestOptions({headers: headers, body: id});
17

  
18
    let url = properties.communityAPI+communityId+"/zenodocommunities";
19
    console.info(url);
20

  
21
    return this.http.delete(url, options)
22
  }
23

  
24
  addZCommunity(properties:EnvProperties, communityId: string,zenodoid: string) {
25
      let headers = new Headers({'Content-Type': 'application/json'});
26
      let options = new RequestOptions({headers: headers});
27

  
28
      let url = properties.communityAPI+communityId+"/zenodocommunities";
29
      console.info(url);
30
      var zCommunity: any = {
31
        "communityId": communityId,
32

  
33
        "zenodoid": zenodoid
34
      };
35
       console.info(zCommunity);
36
      return this.http.post(url, JSON.stringify(zCommunity), options)
37
                      .map(res => <any> res.json())
38
    }
39

  
40

  
41

  
42

  
43
}
modules/uoa-admin-portal/branches/angular6/src/app/services/faq.service.ts
1
/**
2
 * Created by stefania on 4/26/17.
3
 */
4
import { Injectable } from '@angular/core';
5
import { Http, Response, Headers, RequestOptions } from '@angular/http';
6
import { Observable } from 'rxjs/Rx';
7
import { Topic } from './../domain/topic';
8
import { Question } from './../domain/question';
9
import { ActiveTopicQuestions } from './../domain/active-topic-questions';
10
import { CustomOptions } from '../openaireLibrary/services/servicesUtils/customOptions.class';
11

  
12
@Injectable()
13
export class FAQService {
14

  
15
    constructor (private http: Http) {}
16

  
17
    private _faqsUrl = process.env.API_ENDPOINT;
18

  
19
    static removeNulls(obj){
20
        var isArray = obj instanceof Array;
21
        for (var k in obj){
22
            if (obj[k]===null || obj[k]==='') isArray ? obj.splice(k,1) : delete obj[k];
23
            else if (typeof obj[k]=="object") FAQService.removeNulls(obj[k]);
24
        }
25
    }
26

  
27
    getTopics() {
28
        return this.http.get(this._faqsUrl + 'topic')
29
                .map(res => <Array<Topic>> res.json())
30
                .catch(this.handleError);
31
    }
32

  
33
    saveTopic(topic: Topic) {
34
        FAQService.removeNulls(topic);
35

  
36
        return this.http.post(this._faqsUrl + 'topic', JSON.stringify(topic), CustomOptions.getAuthOptionsWithBody())
37
            .map(res => <Topic> res.json())
38
            .catch(this.handleError);
39
    }
40

  
41
    updateTopic(topic: Topic) {
42

  
43
        FAQService.removeNulls(topic);
44

  
45
        return this.http.put(this._faqsUrl + 'topic', JSON.stringify(topic), CustomOptions.getAuthOptionsWithBody())
46
            .map(res => <Topic> res.json())
47
            .catch(this.handleError);
48
    }
49

  
50
    deleteTopics(ids : string[]) {
51

  
52

  
53
        return this.http.post(this._faqsUrl + 'topic/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
54
            .catch(this.handleError);
55
    }
56

  
57
    orderTopic(ids: string[], order: string) {
58

  
59
        return this.http.post(this._faqsUrl + 'topic/toggle?order='+ order, JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
60
            .map( res => <string[]> res.json())
61
            .catch(this.handleError);
62
    }
63

  
64
    getQuestions() {
65
        return this.http.get(this._faqsUrl + 'question')
66
            .map(res => <Array<Question>> res.json())
67
            .catch(this.handleError);
68
    }
69

  
70
    saveQuestion(question: Question) {
71

  
72
        FAQService.removeNulls(question);
73

  
74
        return this.http.post(this._faqsUrl + 'question', JSON.stringify(question), CustomOptions.getAuthOptionsWithBody())
75
            .map(res => <Question> res.json())
76
            .catch(this.handleError);
77
    }
78

  
79
    toggleQuestion(ids : string[],status : boolean) {
80

  
81

  
82
        return this.http.post(this._faqsUrl + 'question/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
83
            .map( res => <string[]> res.json())
84
            .catch(this.handleError);
85
    }
86

  
87
    deleteQuestion(id : string) {
88
        return this.http.delete(this._faqsUrl + 'question/' + id)
89
            .catch(this.handleError);
90
    }
91

  
92
    deleteQuestions(ids : string[]) {
93

  
94
        return this.http.post(this._faqsUrl + 'question/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
95
            .catch(this.handleError);
96
    }
97

  
98
    private handleError(error: Response) {
99
        // in a real world app, we may send the error to some remote logging infrastructure
100
        // instead of just logging it to the console
101
        console.error(error);
102
        return Observable.throw(error.json().error || 'Server error');
103
    }
104

  
105

  
106
}
modules/uoa-admin-portal/branches/angular6/src/app/app.component.html
1
<navbar *ngIf= "properties"   portal="connect-admin" logoPath="assets/imgs/" [onlyTop]=false [userMenu]=true  [homeurl] = false [userMenuItems]=userMenuItems [menuItems]=menuItems [(logInUrl)]=logInUrl [(logOutUrl)]=logOutUrl [(community)]=community class="adminMenu"></navbar>
2

  
3

  
4
<div  id="wrapper" class="uk-section uk-margin-top uk-padding-remove-bottom">
5
  <div class="uk-grid" uk-height-viewport="expand: true">
6
    <div *ngIf="communityId && communityId!=''" id="sidebar" class="uk-width-1-5 uk-light sidebar uk-margin-top uk-margin-left">
7
      <ul class="uk-nav uk-nav-default sidebar">
8
        <li class="uk-nav-header uk-parent">
9

  
10
          <a routerLink="/dashboard"  [queryParams]="{communityId: this.communityId}" routerLinkActive="active">
11

  
12
              <span><span class="uk-margin-small-right uk-icon" uk-icon="home"></span> Overview</span>
13
          </a>
14

  
15
        </li>
16
         <li *ngIf="communityId != 'openaire'" class="uk-nav-header uk-parent">
17
           <span class="uk-margin-small-right uk-icon" uk-icon="album"></span>
18
           Community
19

  
20
            <ul class="uk-nav-sub">
21
              <li *ngIf="isPortalAdministrator">
22
                  <a routerLink="/communities" routerLinkActive="active" [queryParams]="{communityId: this.communityId}">
23

  
24
                      <span>Communities</span>
25
                  </a>
26
              </li>
27
              <li >
28
                  <a routerLink="/community-edit-form" routerLinkActive="active" [queryParams]="{communityId: this.communityId}">
29

  
30
                      <span>Community profile</span>
31
                  </a>
32
              </li>
33
            </ul>
34
         </li>
35
         <li *ngIf="communityId != 'openaire'" class="uk-nav-header uk-parent">
36
           <span class="uk-margin-small-right uk-icon" uk-icon="list"></span>
37
           Community content
38

  
39
            <ul class="uk-nav-sub">
40
              <li>
41
                  <a routerLink="/manage-projects" routerLinkActive="active" [queryParams]="{communityId: this.communityId}">
42
                      <span>Projects</span>
43
                  </a>
44
              </li>
45
              <li>
46
                  <a routerLink="/manage-content-providers" routerLinkActive="active" [queryParams]="{communityId: this.communityId}">
47
                      <span>Content providers</span>
48
                  </a>
49
              </li>
50
              <li  *ngIf="communityType && communityType != 'ri'">
51
                  <a routerLink="/manage-subjects" routerLinkActive="active" [queryParams]="{communityId: this.communityId}">
52
                      <span>Subjects</span>
53
                  </a>
54
              </li>
55
              <li>
56
                  <a routerLink="/manage-zenodo-communities" routerLinkActive="active" [queryParams]="{communityId: this.communityId}">
57
                      <span>Zenodo communities</span>
58
                  </a>
59
              </li>
60

  
61
            </ul>
62
         </li>
63
         <li *ngIf="isPortalAdministrator" class="uk-nav-header uk-parent">
64
           Classes for help text
65

  
66
            <ul class="uk-nav-sub">
67
              <li>
68
                  <a routerLink="/classes" routerLinkActive="active" [queryParams]="{communityId: this.communityId}">
69

  
70
                      <span>Classes</span>
71
                  </a>
72
              </li>
73
            </ul>
74
         </li>
75
         <li class="uk-nav-header uk-parent">
76
           <span uk-icon="world" class="uk-icon"></span>
77
           Entities & pages
78

  
79
            <ul class="uk-nav-sub">
80
              <li>
81
                  <a routerLink="/entities" routerLinkActive="active" [queryParams]="{communityId: this.communityId}">
82

  
83
                      <span>Activate entities</span>
84
                  </a>
85
              </li>
86
              <li>
87
                  <a routerLink="/pages" routerLinkActive="active" [routerLinkActiveOptions]="{exact:true}" [queryParams]="{communityId: this.communityId}">
88
                      <span>Pages</span>
89
                  </a>
90
                  <ul class="uk-nav-sub">
91

  
92
                    <li>
93
                        <a routerLink="/pages" routerLinkActive="active" [queryParams]="{type: 'search', communityId: this.communityId}" [routerLinkActiveOptions]="{exact:true}">
94
                            <span>Search</span>
95
                        </a>
96
                    </li>
97
                    <li>
98
                        <a routerLink="/pages" routerLinkActive="active" [queryParams]="{type: 'link', communityId: this.communityId}" [routerLinkActiveOptions]="{exact:true}">
99
                            <span>Link</span>
100
                        </a>
101
                    </li>
102
                    <li>
103
                        <a routerLink="/pages" routerLinkActive="active" [queryParams]="{type: 'share', communityId: this.communityId}" [routerLinkActiveOptions]="{exact:true}">
104
                            <span>Share</span>
105
                        </a>
106
                    </li>
107
                    <li>
108
                        <a routerLink="/pages" routerLinkActive="active" [queryParams]="{type: 'landing', communityId: this.communityId}" [routerLinkActiveOptions]="{exact:true}">
109
                            <span>Landing</span>
110
                        </a>
111
                    </li>
112
                    <li>
113
                        <a routerLink="/pages" routerLinkActive="active" [queryParams]="{type: 'html', communityId: this.communityId}" [routerLinkActiveOptions]="{exact:true}">
114
                            <span>Html</span>
115
                        </a>
116
                    </li>
117
                    <li>
118
                        <a routerLink="/pages" routerLinkActive="active" [queryParams]="{type: 'other', communityId: this.communityId}" [routerLinkActiveOptions]="{exact:true}">
119
                            <span>Other</span>
120
                        </a>
121
                    </li>
122
                  </ul>
123
              </li>
124

  
125
            </ul>
126

  
127
         </li>
128
         <li class="uk-nav-header uk-parent">
129
          <span class="uk-margin-small-right uk-icon" uk-icon="file-edit"></span>
130
           Help texts
131

  
132
            <ul class="uk-nav-sub">
133
              <li>
134
                  <a routerLink="/pageContents" [queryParams]="{communityId: this.communityId}"  routerLinkActive="active">
135

  
136
                      <span>Page help texts</span>
137
                  </a>
138
              </li>
139
              <li>
140
                  <a routerLink="/classContents" [queryParams]="{communityId: this.communityId}" routerLinkActive="active">
141

  
142
                      <span>Class help texts</span>
143
                  </a>
144
              </li>
145
            </ul>
146
         </li>
147
         <li *ngIf="communityId != 'openaire'" class="uk-nav-header uk-parent">
148

  
149
           <a routerLink="/stats"  [queryParams]="{communityId: this.communityId}" routerLinkActive="active">
150

  
151
               <span><span class="uk-margin-small-right uk-icon" uk-icon="image"></span> Statistics & charts</span>
152
           </a>
153

  
154
         </li>
155
         <li *ngIf="communityId != 'openaire'" class="uk-nav-header uk-parent">
156

  
157
           <a routerLink="/claims"  [queryParams]="{communityId: this.communityId}" routerLinkActive="active">
158

  
159
               <span><span class="uk-margin-small-right uk-icon" uk-icon="link"></span> Links</span>
160
           </a>
161

  
162
         </li>
163
         <li   *ngIf="communityType && communityType == 'ri' && communityId!='openaire'" class="uk-nav-header uk-parent">
164

  
165
           <a routerLink="/mining/manage-profiles"  [queryParams]="{communityId: this.communityId}" routerLinkActive="active">
166

  
167
               <span><span class="uk-margin-small-right uk-icon" uk-icon="settings"></span> Text mining rules</span>
168
           </a>
169

  
170
         </li>
171
         <li *ngIf="communityId != 'openaire'" class="uk-nav-header uk-parent">
172
           <span class="uk-margin-small-right uk-icon" uk-icon="user"></span>
173
           Users
174

  
175
            <ul class="uk-nav-sub">
176
              <li>
177
                  <a routerLink="/manage-subscribers" routerLinkActive="active" [queryParams]="{communityId: this.communityId}">
178
                      <span>Subscribers</span>
179
                  </a>
180
              </li>
181
              <li>
182
                  <a  [href]="'https://beta.'+this.communityId+'.openaire.eu/invite'" target="_blank">
183
                      <span>Invite to subscribe</span>
184
                  </a>
185
              </li>
186
               <li>
187
                  <a routerLink="/manage-user-notifications" routerLinkActive="active" [queryParams]="{communityId: this.communityId}">
188
                      <span>Notification settings </span>
189
                  </a>
190
              </li>
191

  
192
            </ul>
193
         </li>
194
      </ul>
195

  
196

  
197

  
198

  
199
    </div>
200

  
201
  <div class="uk-width-expand uk-container uk-margin-large-top uk-margin-medium-bottom">
202

  
203
  <!-- <div class="uk-width-expand"> -->
204
    <router-outlet></router-outlet>
205
  </div>
206
  </div>
207
</div>
208
<!--cookie-law *ngIf= "isClient" position="bottom">
209
    OpenAIRE uses cookies in order to function properly.<br>
210
    Cookies are small pieces of data that websites store in your browser to allow us to give you the best browsing experience possible.
211
    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">
212
    <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>
213
    </span></a>
214
</cookie-law-->
215
 <bottom *ngIf= "isClient"></bottom>
modules/uoa-admin-portal/branches/angular6/src/app/app.module.ts
1
import { NgModule } from '@angular/core';
2
import { BrowserModule } from '@angular/platform-browser';
3
import { HttpModule, JsonpModule } from '@angular/http';
4
import { AppComponent } from "./app.component";
5
import { routing, appRoutingProviders } from "./app.routing";
6
import { DashboardComponent } from "./dashboard.component";
7
import { TopicsComponent } from "./pages/faq/topics.components";
8
import { QuestionsComponent } from "./pages/faq/questions.component";
9
import { FAQService } from "./services/faq.service";
10
import { ModalModule } from 'ngx-bootstrap';
11
//import { CollapseModule } from 'ngx-bootstrap';
12
//import { AccordionModule } from 'ngx-bootstrap';
13
import { TopicsFormComponent } from "./pages/faq/topics-form.component";
14
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
15
import { ModalFormComponent } from "./pages/modal-form.component";
16
import { QuestionsFormComponent } from "./pages/faq/questions-form.component";
17
import { DeleteConfirmationDialogComponent } from "./pages/delete-confirmation-dialog.component";
18
//import { DeleteConfirmationDialogModule } from "./pages/delete-confirmation-dialog.module";
19

  
20
// import { JWBootstrapSwitchModule } from 'jw-bootstrap-switch-ng2';
21
import { PagesComponent } from "./pages/page/pages.component";
22
import { HelpContentService } from "./services/help-content.service";
23
import { PageFormComponent } from "./pages/page/page-form.component";
24
import { PageHelpContentsComponent } from "./pages/helpcontent/page-help-contents.component";
25
import { NewPageHelpContentComponent } from "./pages/helpcontent/new-page-help-content.component";
26
import { CKEditorModule } from 'ng2-ckeditor';
27
import { PageContentFormComponent } from "./pages/helpcontent/page-help-content-form.component";
28
import { EditPageHelpContentComponent } from "./pages/helpcontent/edit-page-help-content.component";
29
import { CommunitiesComponent } from './pages/community/communities.component';
30
import { CommunityFormComponent } from './pages/community/community-form.component';
31
import { EntitiesComponent } from "./pages/entity/entities.component";
32
import { EntityFormComponent } from "./pages/entity/entity-form.component";
33
import { DivIdsComponent } from "./pages/divId/divIds.component";
34
import { DivIdFormComponent } from "./pages/divId/divId-form.component";
35
//import { DivIdModule } from './pages/divId/divId.module';
36
import { DivHelpContentsComponent } from "./pages/divhelpcontent/div-help-contents.component";
37
import { NewDivHelpContentComponent } from "./pages/divhelpcontent/new-div-help-content.component";
38
import { DivContentFormComponent } from "./pages/divhelpcontent/div-help-content-form.component";
39
import { EditDivHelpContentComponent } from "./pages/divhelpcontent/edit-div-help-content.component";
40
//import { DivHelpContentsModule } from './pages/divhelpcontent/divhelpcontent.module';
41

  
42
import { HtmlPageContentModule } from "./pages/htmlpagecontent/htmlpagecontent.module";
43

  
44
import {ClaimsComponent} from './pages/claims/claims.component';
45

  
46
import {NavigationBarModule} from './openaireLibrary/sharedComponents/navigationBar.module';
47
import { CookieLawModule } from './openaireLibrary/sharedComponents/cookie-law/cookie-law.module';
48

  
49
import {BottomModule} from './openaireLibrary/sharedComponents/bottom.module';
50
import {FeedbackModule} from './openaireLibrary/sharedComponents/feedback/feedback.module';
51
import {CommunityEditFormModule} from './pages/community/community-edit-form/community-edit-form.module';
52
import {ZenodoCommunitiesModule} from './pages/zenodo-communities/zenodo-communities.module';
53
import {ManageSubscribersModule} from './pages/subscribers/manage-subscribers.module';
54
import {SubjectsEditFormModule} from './pages/subjects/subjects-edit-form/subjects-edit-form.module';
55
import { LoginGuard} from './openaireLibrary/login/loginGuard.guard';
56

  
57
import {FreeGuard} from './openaireLibrary/login/freeGuard.guard';
58
import { AdminLoginGuard} from './openaireLibrary/login/adminLoginGuard.guard';
59
import { ConnectAdminLoginGuard} from './openaireLibrary/connect/communityGuard/connectAdminLoginGuard.guard';
60
import { EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver';
61
import { EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
62
import{ClaimsAdminModule} from './openaireLibrary/claims/claimsAdmin/claimsAdmin.module';
63
import {StatsComponent} from "./pages/stats/stats.component";
64
//, , ErrorModule CookieLawModule
65
import { DataTablesModule } from 'angular-datatables';
66

  
67
import { CommunityProjectsModule } from './pages/community/projects/communityProjects.module';
68
import { CommunityContentProvidersModule } from './pages/community/content-providers/communityContentProviders.module';
69

  
70
import {InteractiveMiningModule} from 'interactiveminingv3';
71
import {MiningComponent} from './pages/mining/mining.component';
72
import {CommunitiesService} from "./openaireLibrary/connect/communities/communities.service";
73
import{CommunityErrorPageComponent} from './openaireLibrary/connect/communityGuard/communityErrorPage.component';
74
import {IsCommunity} from './openaireLibrary/connect/communityGuard/isCommunity.guard';
75
import {AdminErrorPageComponent} from './pages/error/errorPage.component';
76
import {ErrorModule} from './openaireLibrary/error/error.module';
77
import {CommonModule, TitleCasePipe} from '@angular/common';
78
import {WellcomeComponent} from './pages/wellcome/wellcome.component';
79

  
80
import {AlertModalModule} from './openaireLibrary/utils/modal/alertModal.module';
81
import {FABModule} from './utils/fabModule.module';
82
import {SafeHtmlPipeModule} from './openaireLibrary/utils/pipes/safeHTMLPipe.module';
83

  
84
import {ManageUserNotificationsModule} from './pages/usernotifications/manage-user-notifications.module';
85

  
86
@NgModule({
87
    imports: [
88
        BrowserModule,
89
        routing,
90
        HttpModule,
91
        JsonpModule,
92
        ModalModule.forRoot(),
93
        //CollapseModule.forRoot(),
94
        //AccordionModule.forRoot(),
95
        FormsModule,
96
        ReactiveFormsModule,
97
        // JWBootstrapSwitchModule,
98
        CKEditorModule,
99
        BottomModule, FeedbackModule, NavigationBarModule, CookieLawModule, ClaimsAdminModule,
100
        CommunityProjectsModule,
101
        CommunityContentProvidersModule,
102
        CommunityEditFormModule,
103
        ZenodoCommunitiesModule,
104
        ManageSubscribersModule,
105
        SubjectsEditFormModule,
106
        DataTablesModule,
107
        InteractiveMiningModule,
108
        ErrorModule,
109
        AlertModalModule, SafeHtmlPipeModule, FABModule,
110

  
111
        HtmlPageContentModule,
112
        // DivIdModule,
113
        // DivHelpContentsModule
114
        //DeleteConfirmationDialogModule
115
        // , CookieLawModule, ErrorModule
116
        ManageUserNotificationsModule
117
    ],
118
    declarations: [
119
        AppComponent,
120
        DashboardComponent,
121
        TopicsComponent,
122
        QuestionsComponent,
123
        TopicsFormComponent,
124
        ModalFormComponent,
125
        QuestionsFormComponent,
126
        DeleteConfirmationDialogComponent,
127
        PagesComponent,
128
        PageFormComponent,
129
        PageHelpContentsComponent,
130
        NewPageHelpContentComponent,
131
        PageContentFormComponent,
132
        EditPageHelpContentComponent,
133
        CommunitiesComponent,
134
        CommunityFormComponent,
135
        EntitiesComponent,
136
        EntityFormComponent,
137
        DivIdsComponent,
138
        DivIdFormComponent,
139
        DivHelpContentsComponent,
140
        NewDivHelpContentComponent,
141
        EditDivHelpContentComponent,
142
        DivContentFormComponent,
143
        ClaimsComponent,
144
        StatsComponent,
145
        MiningComponent,
146
        CommunityErrorPageComponent,
147
        AdminErrorPageComponent,
148
        WellcomeComponent
149
    ],
150
    providers: [
151
        FAQService,
152
        HelpContentService,
153
        appRoutingProviders,
154
        FreeGuard, AdminLoginGuard,ConnectAdminLoginGuard,LoginGuard,
155
        EnvironmentSpecificResolver,EnvironmentSpecificService,
156
        IsCommunity, CommunitiesService, TitleCasePipe
157

  
158
    ],
159
    bootstrap: [ AppComponent ]
160
})
161

  
162
export class AppModule { }
modules/uoa-admin-portal/branches/angular6/src/app/app.routing.ts
1
/**
2
 * Created by stefania on 9/16/16.
3
 */
4
import { ModuleWithProviders }  from '@angular/core';
5
import { Routes, RouterModule } from '@angular/router';
6

  
7
import { DashboardComponent } from "./dashboard.component";
8
import { CommunitiesComponent } from './pages/community/communities.component';
9
import { ZenodoCommunitiesComponent } from "./pages/zenodo-communities/zenodo-communities.component";
10
import { ManageSubscribersComponent } from "./pages/subscribers/manage-subscribers.component";
11
import { CommunityEditFormComponent } from "./pages/community/community-edit-form/community-edit-form.component";
12
import { SubjectsEditFormComponent } from "./pages/subjects/subjects-edit-form/subjects-edit-form.component";
13
import { EntitiesComponent } from "./pages/entity/entities.component";
14
import { PagesComponent } from "./pages/page/pages.component";
15
import { PageHelpContentsComponent } from "./pages/helpcontent/page-help-contents.component";
16
import { NewPageHelpContentComponent } from "./pages/helpcontent/new-page-help-content.component";
17
import { EditPageHelpContentComponent } from "./pages/helpcontent/edit-page-help-content.component";
18
import { DivIdsComponent } from "./pages/divId/divIds.component";
19
import { DivHelpContentsComponent } from "./pages/divhelpcontent/div-help-contents.component";
20
import { NewDivHelpContentComponent } from "./pages/divhelpcontent/new-div-help-content.component";
21
import { EditDivHelpContentComponent } from "./pages/divhelpcontent/edit-div-help-content.component";
22
import { EditHtmlPageContentComponent } from "./pages/htmlpagecontent/edit-htmlpage-content.component";
23
import {ClaimsComponent} from './pages/claims/claims.component';
24
import {FreeGuard} from './openaireLibrary/login/freeGuard.guard';
25
import {IsCommunity} from './openaireLibrary/connect/communityGuard/isCommunity.guard';
26
import { AdminLoginGuard} from './openaireLibrary/login/adminLoginGuard.guard';
27
import { LoginGuard} from './openaireLibrary/login/loginGuard.guard';
28
import { ConnectAdminLoginGuard} from './openaireLibrary/connect/communityGuard/connectAdminLoginGuard.guard';
29

  
30
import { EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver';
31
import { EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
32
import{ClaimsAdminComponent} from './openaireLibrary/claims/claimsAdmin/claimsAdmin.component';
33

  
34
import {StatsComponent} from "./pages/stats/stats.component";
35
import {MiningComponent} from './pages/mining/mining.component';
36
import{CommunityErrorPageComponent} from './openaireLibrary/connect/communityGuard/communityErrorPage.component';
37
import {AdminErrorPageComponent} from './pages/error/errorPage.component';
38

  
39
import { ManageProjectsComponent } from './pages/community/projects/manage-projects.component';
40
import { ManageContentProvidersComponent } from './pages/community/content-providers/manage-content-providers.component';
41
import {WellcomeComponent} from './pages/wellcome/wellcome.component';
42

  
43
import {ManageUserNotificationsComponent} from './pages/usernotifications/manage-user-notifications.component';
44

  
45
//TODO replace IsCommunity with ConnectAdminLoginGuard
46
//, IsCommunity
47
const appRoutes: Routes = [
48
    {
49
        path: '',
50
        component: WellcomeComponent,
51
        canActivate: [FreeGuard],resolve: { envSpecific: EnvironmentSpecificResolver  }
52
        // redirectTo: 'dashboard',
53
        // pathMatch: 'full'
54
    },
55
    {
56
        path: 'dashboard',
57
        component: DashboardComponent,
58
        canActivate: [IsCommunity, ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver  }
59
    },
60
    {
61
        path: 'manage-user-notifications',
62
        component: ManageUserNotificationsComponent,
63
        canActivate: [IsCommunity, ConnectAdminLoginGuard], resolve: {envSpecific: EnvironmentSpecificResolver}
64
    },
65
    {
66
      path: 'communities',
67
      component: CommunitiesComponent,
68
      canActivate: [AdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver  }
69
    },
70
    {
71
      path: 'community-edit-form',
72
      component: CommunityEditFormComponent,
73
      canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver  }
74
    },
75
    {
76
      path: 'manage-zenodo-communities',
77
      component: ZenodoCommunitiesComponent,
78
      canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver  }
79
    },
80
    {
81
      path: 'manage-subscribers',
82
      component: ManageSubscribersComponent,
83
      canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver  }
84
    },
85
    {
86
      path: 'manage-subjects',
87
      component: SubjectsEditFormComponent,
88
      canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver  }
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff