Project

General

Profile

« Previous | Next » 

Revision 61384

[Admin | Trunk]: Update to Angular 11

View differences:

modules/uoa-admin-portal/trunk/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/trunk/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
    ],
19
    "import-spacing": true,
20
    "indent": [
21
      true,
22
      "spaces"
23
    ],
24
    "interface-over-type-literal": true,
25
    "label-position": true,
26
    "max-line-length": [
27
      true,
28
      140
29
    ],
30
    "member-access": false,
31
    "member-ordering": [
32
      true,
33
      {
34
        "order": [
35
          "static-field",
36
          "instance-field",
37
          "static-method",
38
          "instance-method"
39
        ]
40
      }
41
    ],
42
    "no-arg": true,
43
    "no-bitwise": true,
44
    "no-console": [
45
      true,
46
      "debug",
47
      "info",
48
      "time",
49
      "timeEnd",
50
      "trace"
51
    ],
52
    "no-construct": true,
53
    "no-debugger": true,
54
    "no-duplicate-super": true,
55
    "no-empty": false,
56
    "no-empty-interface": true,
57
    "no-eval": true,
58
    "no-inferrable-types": [
59
      true,
60
      "ignore-params"
61
    ],
62
    "no-misused-new": true,
63
    "no-non-null-assertion": true,
64
    "no-shadowed-variable": true,
65
    "no-string-literal": false,
66
    "no-string-throw": true,
67
    "no-switch-case-fall-through": true,
68
    "no-trailing-whitespace": true,
69
    "no-unnecessary-initializer": true,
70
    "no-unused-expression": true,
71
    "no-use-before-declare": true,
72
    "no-var-keyword": true,
73
    "object-literal-sort-keys": false,
74
    "one-line": [
75
      true,
76
      "check-open-brace",
77
      "check-catch",
78
      "check-else",
79
      "check-whitespace"
80
    ],
81
    "prefer-const": true,
82
    "quotemark": [
83
      true,
84
      "single"
85
    ],
86
    "radix": true,
87
    "semicolon": [
88
      true,
89
      "always"
90
    ],
91
    "triple-equals": [
92
      true,
93
      "allow-null-check"
94
    ],
95
    "typedef-whitespace": [
96
      true,
97
      {
98
        "call-signature": "nospace",
99
        "index-signature": "nospace",
100
        "parameter": "nospace",
101
        "property-declaration": "nospace",
102
        "variable-declaration": "nospace"
103
      }
104
    ],
105
    "typeof-compare": true,
106
    "unified-signatures": true,
107
    "variable-name": false,
108
    "whitespace": [
109
      true,
110
      "check-branch",
111
      "check-decl",
112
      "check-operator",
113
      "check-separator",
114
      "check-type"
115
    ],
116
    "directive-selector": [
117
      true,
118
      "attribute",
119
      "app",
120
      "camelCase"
121
    ],
122
    "component-selector": [
123
      true,
124
      "element",
125
      "app",
126
      "kebab-case"
127
    ],
128
    "use-input-property-decorator": true,
129
    "use-output-property-decorator": true,
130
    "use-host-property-decorator": true,
131
    "no-input-rename": true,
132
    "no-output-rename": true,
133
    "use-life-cycle-interface": true,
134
    "use-pipe-transform-interface": true,
135
    "component-class-suffix": true,
136
    "directive-class-suffix": true,
137
    "no-access-missing-member": true,
138
    "templates-use-public": true,
139
    "invoke-injectable": true
140
  }
141
}
modules/uoa-admin-portal/trunk/karma.conf.js
1
// Karma configuration file, see link for more information
2
// https://karma-runner.github.io/1.0/config/configuration-file.html
3

  
4
module.exports = function (config) {
5
  config.set({
6
    basePath: '',
7
    frameworks: ['jasmine', '@angular-devkit/build-angular'],
8
    plugins: [
9
      require('karma-jasmine'),
10
      require('karma-chrome-launcher'),
11
      require('karma-jasmine-html-reporter'),
12
      require('karma-coverage-istanbul-reporter'),
13
      require('@angular-devkit/build-angular/plugins/karma')
14
    ],
15
    client:{
16
      clearContext: false // leave Jasmine Spec Runner output visible in browser
17
    },
18
    coverageIstanbulReporter: {
19
      dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
20
      fixWebpackSourcePaths: true
21
    },
22
    
23
    reporters: ['progress', 'kjhtml'],
24
    port: 9876,
25
    colors: true,
26
    logLevel: config.LOG_INFO,
27
    autoWatch: true,
28
    browsers: ['Chrome'],
29
    singleRun: false
30
  });
31
};
modules/uoa-admin-portal/trunk/README.txt
1
*******Useful project infrmation***********
2
Project has 2 external folders. Check them using  
3
	svn propget svn:externals ./
4

  
5
Above command should show the following:
6
	./src/app/openaireLibrary https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app
7
	./src/assets/common-assets https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/assets
8

  
9
After initial checkout, you may have to exlude ./src/app/openaireLibrary/app.* files in order the project to run properly.
10
Exclude the files from your local copy, but keep them in the repository.
11

  
12
Use the following command, to exclude the files:
13
	cd ./src/app/openaireLibrary
14
	svn update --set-depth exclude ./app.*
modules/uoa-admin-portal/trunk/protractor.conf.js
1
// Protractor configuration file, see link for more information
2
// https://github.com/angular/protractor/blob/master/lib/config.ts
3

  
4
const { SpecReporter } = require('jasmine-spec-reporter');
5

  
6
exports.config = {
7
  allScriptsTimeout: 11000,
8
  specs: [
9
    './e2e/**/*.e2e-spec.ts'
10
  ],
11
  capabilities: {
12
    'browserName': 'chrome'
13
  },
14
  directConnect: true,
15
  baseUrl: 'http://localhost:4200/',
16
  framework: 'jasmine',
17
  jasmineNodeOpts: {
18
    showColors: true,
19
    defaultTimeoutInterval: 30000,
20
    print: function() {}
21
  },
22
  onPrepare() {
23
    require('ts-node').register({
24
      project: 'e2e/tsconfig.e2e.json'
25
    });
26
    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27
  }
28
};
modules/uoa-admin-portal/trunk/angular.json
1 1
{
2
  "$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
2
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 3
  "version": 1,
4 4
  "newProjectRoot": "projects",
5 5
  "projects": {
6
    "admin-portal": {
6
    "connect-admin": {
7 7
      "root": "",
8 8
      "sourceRoot": "src",
9 9
      "projectType": "application",
10
      "prefix": "app",
11
      "schematics": {
12
        "@schematics/angular:class": {
13
          "skipTests": true
14
        },
15
        "@schematics/angular:component": {
16
          "skipTests": true
17
        },
18
        "@schematics/angular:directive": {
19
          "skipTests": true
20
        },
21
        "@schematics/angular:guard": {
22
          "skipTests": true
23
        },
24
        "@schematics/angular:module": {
25
          "skipTests": true
26
        },
27
        "@schematics/angular:pipe": {
28
          "skipTests": true
29
        },
30
        "@schematics/angular:service": {
31
          "skipTests": true
32
        }
33
      },
10 34
      "architect": {
11 35
        "build": {
12 36
          "builder": "@angular-devkit/build-angular:browser",
13 37
          "options": {
14
            "outputPath": "dist",
38
            "aot": true,
39
            "outputPath": "dist/connect-admin",
15 40
            "index": "src/index.html",
16 41
            "main": "src/main.ts",
42
            "polyfills": "src/polyfills.ts",
17 43
            "tsConfig": "src/tsconfig.app.json",
18
            "polyfills": "src/polyfills.ts",
19 44
            "assets": [
20 45
              "src/assets",
21 46
              "src/robots.txt"
22 47
            ],
23 48
            "styles": [
24 49
              "src/material.scss",
25
              "node_modules/datatables.net-dt/css/jquery.dataTables.css",
26
              "node_modules/interactiveminingv3/assets/css/interactive-mining.css",
27
              "node_modules/interactiveminingv3/assets/css/animations.css",
50
              "src/mining.scss",
28 51
              "src/styles.css"
29 52
            ],
30 53
            "scripts": [
31 54
              "node_modules/jquery/dist/jquery.js",
32
              "node_modules/datatables.net/js/jquery.dataTables.js",
33 55
              "node_modules/interactiveminingv3/assets/js/ResizeSensor.js",
34 56
              "node_modules/interactiveminingv3/assets/js/jquery.sticky-sidebar.js"
35 57
            ]
36 58
          },
37 59
          "configurations": {
38
            "production": {
60
            "development": {
39 61
              "optimization": true,
40 62
              "outputHashing": "all",
41 63
              "sourceMap": false,
42
              "extractCss": true,
43 64
              "namedChunks": false,
44 65
              "aot": true,
45 66
              "extractLicenses": true,
46 67
              "vendorChunk": false,
47 68
              "buildOptimizer": true,
48
              "fileReplacements": [
69
              "budgets": [
49 70
                {
50
                  "replace": "src/environments/environment.ts",
51
                  "with": "src/environments/environment.prod.ts"
71
                  "type": "initial",
72
                  "maximumWarning": "2mb",
73
                  "maximumError": "5mb"
74
                },
75
                {
76
                  "type": "anyComponentStyle",
77
                  "maximumWarning": "6kb"
52 78
                }
53 79
              ]
54 80
            },
55 81
            "beta": {
82
              "fileReplacements": [
83
                {
84
                  "replace": "src/environments/environment.ts",
85
                  "with": "src/environments/environment.beta.ts"
86
                }
87
              ],
56 88
              "optimization": true,
57 89
              "outputHashing": "all",
58 90
              "sourceMap": false,
59
              "extractCss": true,
60 91
              "namedChunks": false,
61 92
              "aot": true,
62 93
              "extractLicenses": true,
63 94
              "vendorChunk": false,
64 95
              "buildOptimizer": true,
96
              "budgets": [
97
                {
98
                  "type": "initial",
99
                  "maximumWarning": "2mb",
100
                  "maximumError": "5mb"
101
                },
102
                {
103
                  "type": "anyComponentStyle",
104
                  "maximumWarning": "6kb"
105
                }
106
              ]
107
            },
108
            "production": {
65 109
              "fileReplacements": [
66 110
                {
67 111
                  "replace": "src/environments/environment.ts",
68
                  "with": "src/environments/environment.beta.ts"
112
                  "with": "src/environments/environment.prod.ts"
69 113
                }
114
              ],
115
              "optimization": true,
116
              "outputHashing": "all",
117
              "sourceMap": false,
118
              "namedChunks": false,
119
              "aot": true,
120
              "extractLicenses": true,
121
              "vendorChunk": false,
122
              "buildOptimizer": true,
123
              "budgets": [
124
                {
125
                  "type": "initial",
126
                  "maximumWarning": "2mb",
127
                  "maximumError": "5mb"
128
                },
129
                {
130
                  "type": "anyComponentStyle",
131
                  "maximumWarning": "6kb"
132
                }
70 133
              ]
71 134
            }
72 135
          }
......
74 137
        "serve": {
75 138
          "builder": "@angular-devkit/build-angular:dev-server",
76 139
          "options": {
77
            "browserTarget": "admin-portal:build"
140
            "browserTarget": "connect-admin:build"
78 141
          },
79 142
          "configurations": {
80 143
            "production": {
81
              "browserTarget": "admin-portal:build:production"
82
            },
83
            "beta": {
84
              "browserTarget": "admin-portal:build:beta"
144
              "browserTarget": "connect-admin:build:production"
85 145
            }
86 146
          }
87 147
        },
88 148
        "extract-i18n": {
89 149
          "builder": "@angular-devkit/build-angular:extract-i18n",
90 150
          "options": {
91
            "browserTarget": "admin-portal:build"
151
            "browserTarget": "connect-admin:build"
92 152
          }
93 153
        },
94 154
        "test": {
95 155
          "builder": "@angular-devkit/build-angular:karma",
96 156
          "options": {
97 157
            "main": "src/test.ts",
98
            "karmaConfig": "./karma.conf.js",
99 158
            "polyfills": "src/polyfills.ts",
100 159
            "tsConfig": "src/tsconfig.spec.json",
101
            "scripts": [
102
              "node_modules/jquery/dist/jquery.js",
103
              "node_modules/datatables.net/js/jquery.dataTables.js",
104
              "node_modules/interactiveminingv3/assets/js/ResizeSensor.js",
105
              "node_modules/interactiveminingv3/assets/js/jquery.sticky-sidebar.js"
106
            ],
160
            "karmaConfig": "src/karma.conf.js",
107 161
            "styles": [
108
              "src/styles.css",
109
              "node_modules/datatables.net-dt/css/jquery.dataTables.css",
110
              "node_modules/interactiveminingv3/assets/css/interactive-mining.css",
111
              "node_modules/interactiveminingv3/assets/css/animations.css"
162
              "src/styles.css"
112 163
            ],
164
            "scripts": [],
113 165
            "assets": [
114
              "src/assets",
115
              "src/robots.txt"
166
              "src/assets"
116 167
            ]
117 168
          }
118 169
        },
......
130 181
        }
131 182
      }
132 183
    },
133
    "admin-portal-e2e": {
134
      "root": "e2e",
135
      "sourceRoot": "e2e",
184
    "connect-admin-e2e": {
185
      "root": "e2e/",
136 186
      "projectType": "application",
187
      "prefix": "",
137 188
      "architect": {
138 189
        "e2e": {
139 190
          "builder": "@angular-devkit/build-angular:protractor",
140 191
          "options": {
141
            "protractorConfig": "./protractor.conf.js",
142
            "devServerTarget": "admin-portal:serve"
192
            "protractorConfig": "e2e/protractor.conf.js",
193
            "devServerTarget": "connect-admin:serve"
194
          },
195
          "configurations": {
196
            "production": {
197
              "devServerTarget": "connect-admin:serve:production"
198
            }
143 199
          }
144 200
        },
145 201
        "lint": {
146 202
          "builder": "@angular-devkit/build-angular:tslint",
147 203
          "options": {
148
            "tsConfig": [
149
              "e2e/tsconfig.e2e.json"
150
            ],
204
            "tsConfig": "e2e/tsconfig.e2e.json",
151 205
            "exclude": [
152 206
              "**/node_modules/**"
153 207
            ]
......
156 210
      }
157 211
    }
158 212
  },
159
  "defaultProject": "admin-portal",
160
  "schematics": {
161
    "@schematics/angular:component": {
162
      "prefix": "app",
163
      "styleext": "css"
164
    },
165
    "@schematics/angular:directive": {
166
      "prefix": "app"
167
    }
168
  }
213
  "defaultProject": "connect-admin"
169 214
}
modules/uoa-admin-portal/trunk/package.json
1 1
{
2
  "name": "admin-portal",
3
  "version": "0.0.0",
4
  "license": "MIT",
2
  "name": "connect-admin",
3
  "version": "1.0.0",
5 4
  "scripts": {
6 5
    "ng": "ng",
7
    "clean-install": "rm -rf node_modules; npm install; npm run mining",
8
    "mining": "./interactivemining-install.sh",
9 6
    "start": "ng serve  --host 0.0.0.0 --disable-host-check --port=5000",
10
    "build": "ng build --prod; npm run after-build-clean",
11
    "build-beta": "ng build --configuration=beta; npm run after-build-clean",
7
    "build": "ng build",
8
    "build-dev": "ng build --configuration=development",
9
    "build-beta": "ng build --configuration=beta",
10
    "build-prod": "ng build --prod",
11
    "webpack-bundle-analyzer": "ng build --stats-json && webpack-bundle-analyzer dist/monitor-dashboard/browser/stats.json --host 0.0.0.0",
12 12
    "test": "ng test",
13
    "lint": "ng lint",
14 13
    "e2e": "ng e2e",
15
    "after-build-clean": "rm -rf dist/assets/common-assets/.svn/ dist/assets/connect-assets/.svn/ dist/assets/dashboard-theme/.svn/"
14
    "mining": "chmod +x interactivemining-install.sh && ./interactivemining-install.sh",
15
    "postinstall": "chmod +x clean-library.sh && ./clean-library.sh && npm run mining",
16
    "after-build-clean": "rm -rf dist/connect-admin/assets/common-assets/.svn/ dist/connect-admin/assets/dashboard-theme/.svn/"
16 17
  },
17 18
  "private": true,
18 19
  "dependencies": {
19
    "@angular/animations": "7.2.14",
20
    "@angular/cdk": "^7.3.7",
21
    "@angular/common": "7.2.14",
22
    "@angular/compiler": "7.2.14",
23
    "@angular/core": "7.2.14",
24
    "@angular/forms": "7.2.14",
25
    "@angular/http": "7.2.14",
26
    "@angular/material": "^7.3.7",
27
    "@angular/platform-browser": "7.2.14",
28
    "@angular/platform-browser-dynamic": "7.2.14",
29
    "@angular/router": "7.2.14",
30
    "@nguniversal/express-engine": "^6.0.0",
31
    "@types/express": "^4.16.1",
32
    "angular-datatables": "^4.4.1",
33
    "citation-js": "^0.3.4",
34
    "ng2-ckeditor": "1.1.9",
20
    "@angular/animations": "~11.2.14",
21
    "@angular/cdk": "^11.2.13",
22
    "@angular/common": "~11.2.14",
23
    "@angular/compiler": "~11.2.14",
24
    "@angular/core": "~11.2.14",
25
    "@angular/forms": "~11.2.14",
26
    "@angular/localize": "^11.2.14",
27
    "@angular/material": "^11.2.13",
28
    "@angular/platform-browser": "~11.2.14",
29
    "@angular/platform-browser-dynamic": "~11.2.14",
30
    "@angular/router": "~11.2.14",
35 31
    "clipboard": "^1.5.16",
36
    "core-js": "2.6.8",
37
    "datatables.net": "^1.10.19",
38
    "datatables.net-dt": "^1.10.19",
39
    "interactiveminingv3": "file:interactiveminingv3.tgz",
32
    "core-js": "^2.5.4",
33
    "express": "^4.15.2",
40 34
    "jquery": "^3.4.1",
41
    "ng-recaptcha": "^3.0.5",
42
    "ngx-bootstrap": "^1.6.6",
35
    "ng-recaptcha": "^7.0.1",
36
    "ng2-ckeditor": "1.3.1",
43 37
    "ngx-color-picker": "^8.1.0",
44
    "ngx-json-ld": "0.1.6",
38
    "rxjs": "^6.5.1",
45 39
    "ts-md5": "^1.2.0",
46
    "tslib": "^1.9.0",
47
    "zone.js": "0.8.29"
40
    "tslib": "^2.0.0",
41
    "zone.js": "~0.10.2",
42
    "sass-loader": "7.3.1"
48 43
  },
49 44
  "devDependencies": {
50
    "@angular-devkit/build-angular": "~0.13.0",
51
    "@angular/cli": "7.3.9",
52
    "@angular/compiler-cli": "7.2.14",
53
    "@angular/language-service": "7.2.14",
54
    "@types/datatables.net": "^1.10.17",
55
    "@types/jasmine": "~2.8.8",
45
    "@angular-devkit/build-angular": "~0.1102.14",
46
    "@angular/cli": "~11.2.14",
47
    "@angular/compiler-cli": "~11.2.14",
48
    "@angular/language-service": "~11.2.14",
49
    "@types/express": "^4.17.0",
50
    "@types/node": "^12.11.1",
51
    "@types/jasmine": "~3.6.0",
56 52
    "@types/jasminewd2": "~2.0.3",
57
    "@types/jquery": "^3.3.29",
58
    "@types/node": "^8.0.30",
59
    "codelyzer": "~4.5.0",
60
    "jasmine-core": "~2.99.1",
61
    "jasmine-spec-reporter": "~4.2.1",
62
    "karma": "~3.0.0",
63
    "karma-chrome-launcher": "~2.1.1",
64
    "karma-cli": "~1.0.1",
65
    "karma-coverage-istanbul-reporter": "~2.0.1",
66
    "karma-jasmine": "~1.1.2",
67
    "karma-jasmine-html-reporter": "^0.2.2",
68
    "protractor": "~5.4.0",
53
    "codelyzer": "^6.0.0",
54
    "jasmine-core": "~3.8.0",
55
    "jasmine-spec-reporter": "~5.0.0",
56
    "karma": "~6.3.4",
57
    "karma-chrome-launcher": "~3.1.0",
58
    "karma-coverage-istanbul-reporter": "~3.0.2",
59
    "karma-jasmine": "~4.0.0",
60
    "karma-jasmine-html-reporter": "^1.6.0",
61
    "protractor": "~7.0.0",
69 62
    "ts-node": "~7.0.0",
70
    "tslint": "^5.7.0",
71
    "typescript": "3.2.4",
72
    "rxjs": "6.5.1",
73
    "rxjs-compat": "^6.5.1",
74
    "rxjs-tslint": "^0.1.7"
63
    "typescript": "~4.0.7"
75 64
  }
76 65
}
modules/uoa-admin-portal/trunk/tsconfig.json
1 1
{
2 2
  "compileOnSave": false,
3 3
  "compilerOptions": {
4
    "importHelpers": true,
4
    "baseUrl": "./",
5
    "downlevelIteration": true,
5 6
    "outDir": "./dist/out-tsc",
6 7
    "sourceMap": true,
7 8
    "declaration": false,
9
    "module": "es2020",
8 10
    "moduleResolution": "node",
9 11
    "emitDecoratorMetadata": true,
10 12
    "experimentalDecorators": true,
11
    "target": "es5",
13
    "importHelpers": true,
14
    "target": "es2015",
12 15
    "typeRoots": [
13 16
      "node_modules/@types"
14 17
    ],
15 18
    "lib": [
16
      "es2017",
19
      "es2018",
17 20
      "dom"
18
    ],
19
    "module": "es2015",
20
    "baseUrl": "./"
21
    ]
21 22
  }
22
}
23
}
modules/uoa-admin-portal/trunk/.browserslistrc
1
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
2
# For additional information regarding the format and rule options, please see:
3
# https://github.com/browserslist/browserslist#queries
4
#
5
# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
6

  
7
> 0.5%
8
last 2 versions
9
Firefox ESR
10
not dead
11
not IE 9-11
modules/uoa-admin-portal/trunk/src/typings.d.ts
1
/* SystemJS module definition */
2
declare var module: NodeModule;
3
interface NodeModule {
4
  id: string;
5
}
modules/uoa-admin-portal/trunk/src/app/polyfills.ts
1
/**
2
 * Created by stefanos on 25/4/2017.
3
 */
4
// Polyfills
5

  
6
// import 'ie-shim'; // Internet Explorer 9 support
7
import 'reflect-metadata';
8
// import 'core-js/es6';
9
// Added parts of es6 which are necessary for your project or your browser support requirements.
10
import 'core-js/es6/symbol';
11
import 'core-js/es6/object';
12
import 'core-js/es6/function';
13
import 'core-js/es6/parse-int';
14
import 'core-js/es6/parse-float';
15
import 'core-js/es6/number';
16
import 'core-js/es6/math';
17
import 'core-js/es6/string';
18
import 'core-js/es6/date';
19
import 'core-js/es6/array';
20
import 'core-js/es6/regexp';
21
import 'core-js/es6/map';
22
import 'core-js/es6/set';
23
import 'core-js/es6/weak-map';
24
import 'core-js/es6/weak-set';
25
import 'core-js/es6/typed';
26
import 'core-js/es6/reflect';
27
// see issue https://github.com/AngularClass/angular2-webpack-starter/issues/709
28
// import 'core-js/es6/promise';
29

  
30
import 'intl';
31
import 'intl/locale-data/jsonp/en';
32

  
33
import 'core-js/es7/reflect';
34
import 'zone.js/dist/zone';
35

  
36
// import 'ng2-ckeditor/lib';
37

  
38
// if ('production' === ENV) {
39
//     // Production
40
//
41
// } else {
42
//
43
//     // Development
44
//     Error.stackTraceLimit = Infinity;
45
//
46
//     /* tslint:disable no-var-requires */
47
//     require('zone.js/dist/long-stack-trace-zone');
48
//
49
// }
modules/uoa-admin-portal/trunk/src/app/main.ts
1
/**
2
 * Created by stefania on 10/3/16.
3
 */
4
import './polyfills.ts';
5
//import './vendors.ts';
6

  
7
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
8
import { AppModule } from './app.module';
9
import {enableProdMode} from "@angular/core";
10

  
11
const platform = platformBrowserDynamic();
12
if(process.env.PRODUCTION) {enableProdMode();}
13
platform.bootstrapModule(AppModule);
modules/uoa-admin-portal/trunk/src/app/pages/mining/mining.component.ts
8 8
  template: `
9 9
    <div page-content>
10 10
      <div inner>
11
        <router-outlet></router-outlet>
11
        <div class="mining">
12
          <router-outlet></router-outlet>
13
        </div>
12 14
      </div>
13 15
    </div>
14 16
  `
modules/uoa-admin-portal/trunk/src/app/pages/mining/mining.module.ts
10 10
    RouterModule.forChild([
11 11
      {
12 12
        path: '', component: MiningComponent, children: [
13
          {path: '', loadChildren: './mining-routing.module#MiningRoutingModule'}
13
          {path: '', loadChildren: () => import('./mining-routing.module').then(m => m.MiningRoutingModule)}
14 14
        ]
15 15
      }
16 16
    ]),
modules/uoa-admin-portal/trunk/src/app/pages/subjects/subjects-edit-form/subjects-edit-form.component.ts
6 6
import {EnvProperties} from '../../../openaireLibrary/utils/properties/env-properties';
7 7
import {Session} from '../../../openaireLibrary/login/utils/helper.class';
8 8
import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class';
9

  
10
import {concat} from 'rxjs/observable/concat';
11 9
import {Title} from '@angular/platform-browser';
12 10
import {properties} from '../../../../environments/environment';
13 11
import {AlertModal} from '../../../openaireLibrary/utils/modal/alert';
14 12
import {SearchInputComponent} from '../../../openaireLibrary/sharedComponents/search-input/search-input.component';
15
import {Subscription} from 'rxjs';
13
import {Subscription, zip} from 'rxjs';
16 14
import {CommunityInfo} from '../../../openaireLibrary/connect/community/communityInfo';
15
import {concat} from 'rxjs/operators';
17 16

  
18 17
declare var UIkit;
19 18

  
......
156 155
        const subjectsToDelete = this.getNonEmptyItems(subjectsToDeleteAr);
157 156
        const subjectsToAdd = this.getNonEmptyItems(subjectsToAddAr);
158 157
        if (subjectsToAdd.length > 0 && subjectsToDelete.length > 0) {
159
          const obs = concat(this._subjectsService.addSubjects(
160
            this.properties.communityAPI + this.communityId + '/subjects', subjectsToAdd),
161
            this._subjectsService.removeSubjects(
162
              this.properties.communityAPI + this.communityId + '/subjects', subjectsToDelete));
163
          this.subscriptions.push(obs.subscribe(res => {
164
              if (res['method'] === 'delete') {
165
                this.afterUpdateActions(res, "updated");
166
              }
167
            },
168
            error => this.handleUpdateError('System error updating subjects', error)
169
          ));
158
          this.subscriptions.push(this._subjectsService.removeSubjects(
159
              this.properties.communityAPI + this.communityId + '/subjects', subjectsToDelete).subscribe(res =>{
160
              this.subscriptions.push(this._subjectsService.addSubjects(
161
                this.properties.communityAPI + this.communityId + '/subjects', subjectsToAdd).subscribe(res => {
162
                  this.afterUpdateActions(res, "added");
163
              }));
164
          }));
170 165
        } else if (subjectsToAdd.length > 0) {
171 166
          this.subscriptions.push(this._subjectsService.addSubjects(
172 167
            this.properties.communityAPI + this.communityId + '/subjects', subjectsToAdd).subscribe(res => {
modules/uoa-admin-portal/trunk/src/app/pages/community-routing.module.ts
6 6
  imports: [RouterModule.forChild([
7 7
    {
8 8
      path: 'info',
9
      loadChildren: './community-info/community-info-routing.module#CommunityInfoRoutingModule',
9
      loadChildren: () => import('./community-info/community-info-routing.module').then(m => m.CommunityInfoRoutingModule),
10 10
    },
11 11
    {
12 12
      path: 'users',
13
      loadChildren: './users/users-routing.module#UsersRoutingModule'
13
      loadChildren: () => import('./users/users-routing.module').then(m => m.UsersRoutingModule)
14 14
    },
15 15
    {
16 16
      path: 'mining',
17
      loadChildren: './mining/mining.module#MiningModule',
17
      loadChildren: () => import('./mining/mining.module').then(m => m.MiningModule),
18 18
      canActivateChild: [ConnectRIGuard]
19 19
    },
20 20
    {
21 21
      path: 'admin-tools',
22
      loadChildren: './admin-tools/admin-tools-routing.module#AdminToolsRoutingModule',
22
      loadChildren: () => import('./admin-tools/admin-tools-routing.module').then(m => m.AdminToolsRoutingModule),
23 23
      data: {
24 24
        param: 'community'
25 25
      }
26 26
    },
27 27
    {
28 28
      path: 'stats',
29
      loadChildren: './stats/stats.module#StatsModule'
29
      loadChildren: () => import('./stats/stats.module').then(m => m.StatsModule)
30 30
    },
31 31
    {
32 32
      path: 'customize-layout',
33
      loadChildren: './customization/customization.module#CustomizationModule',
33
      loadChildren: () => import('./customization/customization.module').then(m => m.CustomizationModule),
34 34
    }
35 35
  ])]
36 36
})
modules/uoa-admin-portal/trunk/src/app/pages/content-providers/manage-content-providers.component.ts
44 44
export class ManageContentProvidersComponent implements OnInit {
45 45
  @Input() communityContentProviders = [];
46 46
  @ViewChild(RemoveContentProvidersComponent) removeContentProvidersComponent: RemoveContentProvidersComponent;
47
  @ViewChild('fsModal') fullscreen: FullScreenModalComponent;
47
  @ViewChild('fsModal', { static: true }) fullscreen: FullScreenModalComponent;
48 48

  
49 49
  public toggle: boolean = false;
50 50

  
modules/uoa-admin-portal/trunk/src/app/pages/admin-tools/portal-admin-tools-routing.module.ts
3 3

  
4 4
@NgModule({
5 5
  imports: [RouterModule.forChild([
6
    {path: '', loadChildren: './admin-tools-routing.module#AdminToolsRoutingModule'},
7
    {path: 'portals', loadChildren: '../../openaireLibrary/dashboard/portal/portals.module#PortalsModule'},
8
    {path: 'classes', loadChildren: '../../openaireLibrary/dashboard/divId/divIds.module#DivIdsModule'}
6
    {path: '', loadChildren: () => import('./admin-tools-routing.module').then(m => m.AdminToolsRoutingModule)},
7
    {path: 'portals', loadChildren: () => import('../../openaireLibrary/dashboard/portal/portals.module').then(m => m.PortalsModule)},
8
    {path: 'classes', loadChildren: () => import('../../openaireLibrary/dashboard/divId/divIds.module').then(m => m.DivIdsModule)}
9 9
  ])]
10 10
})
11 11
export class PortalAdminToolsRoutingModule {
modules/uoa-admin-portal/trunk/src/app/pages/admin-tools/admin-tools-routing.module.ts
6 6
    RouterModule.forChild([
7 7
      {
8 8
        path: 'entities',
9
        loadChildren: '../../openaireLibrary/dashboard/entity/entities.module#EntitiesModule',
9
        loadChildren: () => import('../../openaireLibrary/dashboard/entity/entities.module').then(m => m.EntitiesModule),
10 10
        pathMatch: 'full'
11 11
      },
12 12
      {
13 13
        path: 'classContents',
14
        loadChildren: '../../openaireLibrary/dashboard/divhelpcontent/class-help-contents.module#ClassHelpContentsModule',
14
        loadChildren: () => import('../../openaireLibrary/dashboard/divhelpcontent/class-help-contents.module').then(m => m.ClassHelpContentsModule),
15 15
        pathMatch: 'full'
16 16
      },
17 17
      {
18 18
        path: 'classContents/edit',
19
        loadChildren: '../../openaireLibrary/dashboard/divhelpcontent/class-help-content-form.module#ClassHelpContentFormModule',
19
        loadChildren: () => import('../../openaireLibrary/dashboard/divhelpcontent/class-help-content-form.module').then(m => m.ClassHelpContentFormModule),
20 20
        pathMatch: 'full'
21 21
      },
22 22
      {
23 23
        path: 'helptexts',
24
        loadChildren: '../../openaireLibrary/dashboard/helpTexts/page-help-contents.module#PageHelpContentsModule',
24
        loadChildren: () => import('../../openaireLibrary/dashboard/helpTexts/page-help-contents.module').then(m => m.PageHelpContentsModule),
25 25
        pathMatch: 'full'
26 26
      },
27 27
      {
28 28
        path: 'helptexts/edit',
29
        loadChildren: '../../openaireLibrary/dashboard/helpTexts/page-help-content-form.module#PageHelpContentFormModule',
29
        loadChildren: () => import('../../openaireLibrary/dashboard/helpTexts/page-help-content-form.module').then(m => m.PageHelpContentFormModule),
30 30
        pathMatch: 'full'
31 31
      },
32 32
      {
33 33
        path: 'pages',
34
        loadChildren: '../../openaireLibrary/dashboard/page/pages.module#PagesModule',
34
        loadChildren: () => import('../../openaireLibrary/dashboard/page/pages.module').then(m => m.PagesModule),
35 35
        pathMatch: 'full'
36 36
      }
37 37
    ])
modules/uoa-admin-portal/trunk/src/app/pages/zenodo-communities/zenodo-communities.component.ts
58 58
  zenodoSearchUtils: SearchUtilsClass = new SearchUtilsClass();
59 59
  public errorCodes: ErrorCodes = new ErrorCodes();
60 60
  subscriptions = [];
61
  @ViewChild('fsModal') fullscreen: FullScreenModalComponent;
61
  @ViewChild('fsModal', { static: true }) fullscreen: FullScreenModalComponent;
62 62
  @ViewChild('manage') manage: ManageZenodoCommunitiesComponent;
63 63
  
64 64
  constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router,
......
122 122
    this.fullscreen.title = "Search and Add Zenodo Communities";
123 123
    this.fullscreen.okButtonText = "Done";
124 124
    this.fullscreen.okButton = true;
125
    
126
    
127 125
  }
128 126
  
129 127
  ngOnDestroy() {
modules/uoa-admin-portal/trunk/src/app/pages/projects/manage-projects.component.ts
43 43
export class ManageProjectsComponent implements OnInit {
44 44
  @Input() communityProjects = [];
45 45
  @ViewChild(RemoveProjectsComponent) removeProjectsComponent: RemoveProjectsComponent;
46
  @ViewChild('fsModal') fullscreen: FullScreenModalComponent;
46
  @ViewChild('fsModal', { static: true }) fullscreen: FullScreenModalComponent;
47 47

  
48 48
  public toggle: boolean = false;
49 49

  
......
69 69
        this.body = "[Please write your message here]";
70 70
        this.body = StringUtils.URIEncode(this.body);
71 71
      }
72
      this.fullscreen.title = "Search and Add Projects";
73
      this.fullscreen.okButtonText = "Done";
74
      this.fullscreen.okButton = true;
72 75
    }));
73

  
74
    this.fullscreen.title = "Search and Add Projects";
75
    this.fullscreen.okButtonText = "Done";
76
    this.fullscreen.okButton = true;
77 76
  }
78 77

  
79 78
  public ngOnDestroy() {
modules/uoa-admin-portal/trunk/src/app/pages/stats/stats.module.ts
3 3
import {CommonModule} from '@angular/common';
4 4
import {StatsComponent} from './stats.component';
5 5
import {StatsRoutingModule} from './stats-routing.module';
6
import {MatSlideToggleModule} from '@angular/material';
6
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
7 7

  
8 8
@NgModule({
9 9
    imports: [
modules/uoa-admin-portal/trunk/src/app/pages/users/users-routing.module.ts
5 5
  imports: [
6 6
    RouterModule.forChild([
7 7
      {path: '', redirectTo: 'managers', pathMatch: 'full'},
8
      {path: 'managers', loadChildren: './users-managers/users-managers.module#UsersManagersModule'},
9
      {path: 'subscribers', loadChildren: './users-subscribers/users-subscribers.module#UsersSubscribersModule'},
8
      {path: 'managers', loadChildren: () => import('./users-managers/users-managers.module').then(m => m.UsersManagersModule)},
9
      {path: 'subscribers', loadChildren: () => import('./users-subscribers/users-subscribers.module').then(m => m.UsersSubscribersModule)},
10 10
      {
11 11
        path: 'notifications',
12
        loadChildren: '../usernotifications/manage-user-notifications.module#ManageUserNotificationsModule'
12
        loadChildren: () => import('../usernotifications/manage-user-notifications.module').then(m => m.ManageUserNotificationsModule)
13 13
      },
14
      {path: 'claims', loadChildren: '../claims/claims.module#ClaimsModule'},
15
      {path: 'personal', loadChildren: './personal-info/personal-info.module#PersonalInfoModule'}
14
      {path: 'claims', loadChildren: () => import('../claims/claims.module').then(m => m.ClaimsModule)},
15
      {path: 'personal', loadChildren: () => import('./personal-info/personal-info.module').then(m => m.PersonalInfoModule)}
16 16
    ])
17 17
  ]
18 18
})
modules/uoa-admin-portal/trunk/src/app/pages/usernotifications/manage-user-notifications.module.ts
9 9
import {ManageUserNotificationsRoutingModule} from './manage-user-notifications-routing.module';
10 10
import {UsersTabsModule} from '../users/users-tabs.module';
11 11
import {PageContentModule} from '../../openaireLibrary/dashboard/sharedComponents/page-content/page-content.module';
12
import {MatSelectModule, MatSlideToggleModule} from '@angular/material';
12
import { MatSelectModule } from '@angular/material/select';
13
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
13 14
import {LoadingModule} from '../../openaireLibrary/utils/loading/loading.module';
14 15
import {SharedModule} from '../../openaireLibrary/shared/shared.module';
15 16

  
modules/uoa-admin-portal/trunk/src/app/pages/customization/customization.module.ts
16 16
import {QuickLookComponent} from './quickLook.component';
17 17
import {QuickLookBackgroundsComponent} from './quickLook-backgrounds.component';
18 18
import {QuickLookButtonsComponent} from './quickLook-buttons.component';
19
import {MatFormFieldModule, MatSelectModule, MatSlideToggleModule} from '@angular/material';
19
import { MatFormFieldModule } from '@angular/material/form-field';
20
import { MatSelectModule } from '@angular/material/select';
21
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
20 22
import {CustomizeButtonsComponent} from './customize-buttons.component';
21 23
import {IconsModule} from '../../openaireLibrary/utils/icons/icons.module';
22 24
import {IconsService} from '../../openaireLibrary/utils/icons/icons.service';
modules/uoa-admin-portal/trunk/src/app/pages/customization/Border.component.ts
4 4
@Component({
5 5
  selector: 'border',
6 6
  template: `
7
    <div class="uk-grid uk-child-width-1-2" >
7
    <div class="uk-grid uk-child-width-1-2">
8 8
      <div class="uk-margin-remove">
9 9
        <div class="uk-text-bold uk-form-label uk-margin-small-bottom"> Border radius (px)</div>
10
  <!--      <div class="uk-margin-bottom uk-form-hint ">hint</div>-->
10
        <!--      <div class="uk-margin-bottom uk-form-hint ">hint</div>-->
11 11
        <div class="input-box">
12
           <input class="uk-input " [(ngModel)]="radius" (ngModelChange)="borderChanged()" type="number" min="0"  />
12
          <input class="uk-input" [(ngModel)]="radius" (input)="borderChanged()" type="number" min="0"/>
13 13
        </div>
14 14
      </div>
15 15
      <div class="uk-margin-remove">
16 16
        <div class="uk-text-bold uk-form-label uk-margin-small-bottom"> Border width (px)</div>
17 17
        <!--      <div class="uk-margin-bottom uk-form-hint "> hint</div>-->
18 18
        <div class="input-box">
19
          <input class="uk-input  " [(ngModel)]="width" (ngModelChange)="borderChanged()" type="number" min="0"  />
19
          <input class="uk-input" [(ngModel)]="width" (input)="borderChanged()" type="number" min="0"/>
20 20
        </div>
21 21
      </div>
22 22
      <div class="uk-margin-small-top">
......
24 24
        <!--      <div class="uk-margin-bottom uk-form-hint "> hint</div>-->
25 25
        <div class="input-box ">
26 26
          <mat-form-field class="uk-width-1-1">
27
            <mat-select class=""  [(ngModel)]="style" name="{{'select_type_'}}"
27
            <mat-select class="" [(ngModel)]="style" name="{{'select_type_'}}"
28 28
                        (ngModelChange)="borderChanged()"
29 29
                        [disableOptionCentering]="true"
30 30
                        panelClass="">
31
              <mat-option [value]="'solid'" >solid</mat-option>
32
              <mat-option [value]="'dotted'" >dotted</mat-option>
33
              <mat-option [value]="'dashed'" >dashed</mat-option>
31
              <mat-option [value]="'solid'">solid</mat-option>
32
              <mat-option [value]="'dotted'">dotted</mat-option>
33
              <mat-option [value]="'dashed'">dashed</mat-option>
34 34

  
35 35
            </mat-select>
36 36
          </mat-form-field>
37 37
        </div>
38 38
      </div>
39 39
    </div>
40
    
41
   
42 40
  `
43 41
})
44 42

  
45 43
export class BorderComponent implements OnInit {
46
  @Input() radius:number =0;
47
  @Input() width:number =0;
44
  @Input() radius: number = 0;
45
  @Input() width: number = 0;
48 46
  @Input() style = 'solid';
49 47
  // @Input() addMargin: boolean = false;
50 48
  @Output() borderChange = new EventEmitter();
51

  
52

  
49
  
50
  
53 51
  constructor() {
54 52
  }
55

  
56

  
53
  
54
  
57 55
  ngOnInit() {
58 56
  }
59

  
57
  
60 58
  borderChanged() {
61
    this.borderChange.emit({radius:this.radius, width:this.width, style:this.style});
59
    console.log(this.radius);
60
    this.borderChange.emit({radius: this.radius, width: this.width, style: this.style});
62 61
  }
63

  
64

  
62
  
63
  
65 64
}
modules/uoa-admin-portal/trunk/src/app/pages/customization/Color.component.ts
8 8
    <div [class]="(addMargin?'uk-margin-small-top':'') + ' colorPicker uk-flex uk-flex-middle'">
9 9
      <div class=" uk-flex">
10 10
        <div class="">
11
          <input id="colorPickerInput" class="uk-margin-small-left uk-width-small "  color-picker [colorPicker]="color"   [style.background]="color"
11
          <input class="uk-margin-small-left uk-width-small" color-picker [colorPicker]="color"   [style.background]="color"
12 12
                 (colorPickerChange)="color=$event; colorChanged();"/>
13 13
        </div>
14 14
        <div class="uk-margin-small-left"> {{label}}</div>
modules/uoa-admin-portal/trunk/src/app/pages/community-info/profile/profile.component.ts
56 56
  public properties: EnvProperties = properties;
57 57
  public loading: boolean = false;
58 58
  private subscriptions: any[] = [];
59
  @ViewChild('editCommunityComponent') editCommunityComponent: EditCommunityComponent;
59
  @ViewChild('editCommunityComponent', { static: true }) editCommunityComponent: EditCommunityComponent;
60 60
  
61 61
  constructor(private communityService: CommunityService,
62 62
              private title: Title) {
modules/uoa-admin-portal/trunk/src/app/pages/community-info/community-info-routing.module.ts
6 6
  imports: [
7 7
    RouterModule.forChild([
8 8
      {path: '', redirectTo: 'profile', pathMatch: 'full'},
9
      {path: 'profile', loadChildren: './profile/profile.module#ProfileModule'},
10
      {path: 'organizations', loadChildren: '../affiliations/affiliations.module#AffiliationsModule'},
11
      {path: 'projects', loadChildren: '../projects/communityProjects.module#CommunityProjectsModule'},
12
      {path: 'content-providers', loadChildren: '../content-providers/communityContentProviders.module#CommunityContentProvidersModule'},
13
      {path: 'content-providers/:provider', loadChildren: '../content-providers/criteria/criteria.module#CriteriaModule'},
14
      {path: 'zenodo-communities', loadChildren: '../zenodo-communities/zenodo-communities.module#ZenodoCommunitiesModule'},
15
      {path: 'subjects', canActivateChild: [ConnectCommunityGuard], loadChildren: '../subjects/subjects-edit-form/subjects-edit-form.module#SubjectsEditFormModule'},
9
      {path: 'profile', loadChildren: () => import('./profile/profile.module').then(m => m.ProfileModule)},
10
      {path: 'organizations', loadChildren: () => import('../affiliations/affiliations.module').then(m => m.AffiliationsModule)},
11
      {path: 'projects', loadChildren: () => import('../projects/communityProjects.module').then(m => m.CommunityProjectsModule)},
12
      {path: 'content-providers', loadChildren: () => import('../content-providers/communityContentProviders.module').then(m => m.CommunityContentProvidersModule)},
13
      {path: 'content-providers/:provider', loadChildren: () => import('../content-providers/criteria/criteria.module').then(m => m.CriteriaModule)},
14
      {path: 'zenodo-communities', loadChildren: () => import('../zenodo-communities/zenodo-communities.module').then(m => m.ZenodoCommunitiesModule)},
15
      {path: 'subjects', canActivateChild: [ConnectCommunityGuard], loadChildren: () => import('../subjects/subjects-edit-form/subjects-edit-form.module').then(m => m.SubjectsEditFormModule)},
16 16
    ])
17 17
  ],
18 18
  providers: [ConnectCommunityGuard]
modules/uoa-admin-portal/trunk/src/app/services/help-content.service.ts
1 1
/**
2 2
 * Created by stefania on 7/13/17.
3 3
 */
4
import { Injectable } from '@angular/core';
5
import {HttpClient, HttpErrorResponse, HttpHeaders} from "@angular/common/http";
6
import {Observable, Subscription} from 'rxjs';
7
import { Page } from "../domain/page";
8
import { PageHelpContent } from "../domain/page-help-content";
9
import { Portal } from "../domain/portal";
10
import { Entity } from "../domain/entity";
11
import { DivId } from "../domain/divId";
12
import { DivHelpContent } from "../domain/div-help-content";
4
import {Injectable} from '@angular/core';
5
import {HttpClient, HttpErrorResponse} from '@angular/common/http';
6
import {Observable, throwError} from 'rxjs';
7
import {Page} from '../domain/page';
8
import {PageHelpContent} from '../domain/page-help-content';
9
import {Portal} from '../domain/portal';
10
import {Entity} from '../domain/entity';
11
import {DivId} from '../domain/divId';
12
import {DivHelpContent} from '../domain/div-help-content';
13 13
import {StatisticsDisplay, StatisticsSummary} from '../openaireLibrary/connect/statistics/statisticsEntities';
14
import { CustomOptions } from '../openaireLibrary/services/servicesUtils/customOptions.class';
15
import {catchError, map} from "rxjs/operators";
16
import {COOKIE} from "../openaireLibrary/login/utils/helper.class";
17
import {properties} from "../../environments/environment";
14
import {CustomOptions} from '../openaireLibrary/services/servicesUtils/customOptions.class';
15
import {catchError, map} from 'rxjs/operators';
16
import {properties} from '../../environments/environment';
18 17

  
19 18

  
20 19
@Injectable()
......
426 425
      // in a real world app, we may send the error to some remote logging infrastructure
427 426
      // instead of just logging it to the console
428 427
      console.error(error);
429
      return Observable.throw(error.error || 'Server error');
428
      return throwError(error.error || 'Server error');
430 429
  }
431 430

  
432 431
    // getDataProviders() {
modules/uoa-admin-portal/trunk/src/app/services/manageContentProviders.service.ts
2 2
import {HttpClient, HttpHeaders} from '@angular/common/http';
3 3
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
4 4
import {ContentProvider} from '../openaireLibrary/utils/entities/contentProvider';
5
import {Observable} from 'rxjs/Observable';
5
import {Observable} from 'rxjs';
6 6

  
7 7
@Injectable()
8 8
export class ManageCommunityContentProvidersService {
modules/uoa-admin-portal/trunk/src/app/app.component.ts
1 1
import {ChangeDetectorRef, Component, HostListener, OnInit} from '@angular/core';
2 2
import {MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu';
3
import {ActivatedRoute, NavigationEnd, Params, Router} from '@angular/router';
3
import {ActivatedRoute, Data, NavigationEnd, Params, Router} from '@angular/router';
4 4
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
5 5
import {Session, User} from './openaireLibrary/login/utils/helper.class';
6 6
import {UserManagementService} from './openaireLibrary/services/user-management.service';
......
12 12
import {CommunityService} from "./openaireLibrary/connect/community/community.service";
13 13
import {arrow_left} from "./openaireLibrary/utils/icons/icons";
14 14
import {SmoothScroll} from "./openaireLibrary/utils/smooth-scroll";
15
import {ConnectHelper} from './openaireLibrary/connect/connectHelper';
16
import {ConfigurationService} from './openaireLibrary/utils/configuration/configuration.service';
15 17

  
16 18
@Component({
17 19
  selector: 'app-root',
......
22 24
  properties: EnvProperties = properties;
23 25
  user: User;
24 26
  params: BehaviorSubject<Params> = new BehaviorSubject<Params>(null);
27
  data: BehaviorSubject<Data> = new BehaviorSubject<Data>(null);
25 28
  hasSidebar: boolean = false;
26 29
  hasHeader: boolean = false;
27 30
  hasAdminMenu: boolean = false;
......
55 58
              private cdr: ChangeDetectorRef,
56 59
              private smoothScroll: SmoothScroll,
57 60
              private layoutService: LayoutService,
58
              private userManagementService: UserManagementService) {
61
              private userManagementService: UserManagementService,
62
              private configurationService: ConfigurationService) {
59 63
    this.subscriptions.push(this.router.events.subscribe(event => {
60 64
      if (event instanceof NavigationEnd) {
61 65
        let r = this.route;
62
        let params = r.snapshot.params;
63
        while (r.firstChild && !params['community']) {
66
        while (r.firstChild) {
64 67
          r = r.firstChild;
65
          params = r.snapshot.params
66 68
        }
67 69
        this.paramsResolved = true;
68
        this.params.next(params);
70
        this.params.next(r.snapshot.params);
71
        this.data.next(r.snapshot.data);
69 72
      }
70 73
    }));
71 74
  }
......
104 107
            this.subscriptions.push(this.communityService.getCommunity(params['community']).subscribe(community => {
105 108
              if (community) {
106 109
                this.community = community;
110
                this.setProperties(community.communityId);
107 111
                this.buildMenu();
108 112
                this.loading = false;
109 113
              } else {
......
125 129
        }
126 130
      }
127 131
    }));
132
    this.subscriptions.push(this.data.subscribe(data => {
133
      if(data && data.portal) {
134
        this.setProperties(data.portal);
135
        this.configurationService.initCommunityInformation(this.properties, this.properties.adminToolsCommunity);
136
      }
137
    }));
128 138
    this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
129 139
      this.user = user;
130 140
      if (this.user) {
......
158 168
    this.smoothScroll.clearSubscriptions();
159 169
  }
160 170
  
171
  setProperties(id, type = null){
172
    this.properties.adminToolsCommunity = id;
173
    if(type) {
174
      this.properties.adminToolsPortalType = type;
175
    } else {
176
      ConnectHelper.setPortalTypeFromPid(id);
177
    }
178
    this.configurationService.initCommunityInformation(this.properties, this.properties.adminToolsCommunity);
179
  }
180
  
161 181
  public get open() {
162 182
    return this.layoutService.open;
163 183
  }
modules/uoa-admin-portal/trunk/src/app/app.module.ts
11 11
import {AdminErrorPageComponent} from './pages/error/errorPage.component';
12 12
import {ErrorModule} from './openaireLibrary/error/error.module';
13 13
import {TitleCasePipe} from '@angular/common';
14
import {InteractiveMiningModule} from 'interactiveminingv3';
15 14
import {CommunityService} from './openaireLibrary/connect/community/community.service';
16 15
import {SubscribeService} from './openaireLibrary/utils/subscribe/subscribe.service';
17 16
import {ConnectRIGuard} from './openaireLibrary/connect/communityGuard/connectRIGuard.guard';
......
23 22
import {DEFAULT_TIMEOUT, TimeoutInterceptor} from "./openaireLibrary/timeout-interceptor.service";
24 23
import {AdminLoginGuard} from "./openaireLibrary/login/adminLoginGuard.guard";
25 24
import {LoginGuard} from "./openaireLibrary/login/loginGuard.guard";
25
import {InteractiveMiningModule} from 'interactiveminingv3';
26 26

  
27 27
@NgModule({
28 28
  imports: [
modules/uoa-admin-portal/trunk/src/app/app.routing.ts
9 9
const routes: Routes = [
10 10
    {
11 11
        path: '',
12
        loadChildren: './pages/manage-communities/manage-communities.module#ManageCommunitiesModule',
12
        loadChildren: () => import('./pages/manage-communities/manage-communities.module').then(m => m.ManageCommunitiesModule),
13 13
        canActivateChild: [LoginGuard]
14 14
    },
15 15
    {
16 16
        path: 'reload',
17
        loadChildren: './reload/libReload.module#LibReloadModule',
17
        loadChildren: () => import('./reload/libReload.module').then(m => m.LibReloadModule),
18 18
        data: {hasSidebar: false, hasHeader: false}
19 19
    },
20 20
    {
21 21
        path: 'user-info',
22
        loadChildren: './login/libUser.module#LibUserModule',
22
        loadChildren: () => import('./login/libUser.module').then(m => m.LibUserModule),
23 23
        data: {hasSidebar: false}
24 24
    },
25 25
    {   path: 'error',
......
29 29
    },
30 30
    {
31 31
        path: 'connect/admin-tools',
32
        loadChildren: './pages/admin-tools/admin-tools-routing.module#AdminToolsRoutingModule',
32
        loadChildren: () => import('./pages/admin-tools/admin-tools-routing.module').then(m => m.AdminToolsRoutingModule),
33 33
        canActivateChild: [AdminLoginGuard],
34 34
        data: {portal: 'connect'}
35 35
    },
36 36
    {
37 37
        path: 'openaire/admin-tools',
38
        loadChildren: './pages/admin-tools/admin-tools-routing.module#AdminToolsRoutingModule',
38
        loadChildren: () => import('./pages/admin-tools/admin-tools-routing.module').then(m => m.AdminToolsRoutingModule),
39 39
        canActivateChild: [AdminLoginGuard],
40 40
        data: {portal: 'openaire'}
41 41
    },
42 42
    {
43 43
        path: 'admin-tools',
44
        loadChildren: './pages/admin-tools/portal-admin-tools-routing.module#PortalAdminToolsRoutingModule',
44
        loadChildren: () => import('./pages/admin-tools/portal-admin-tools-routing.module').then(m => m.PortalAdminToolsRoutingModule),
45 45
        canActivateChild: [AdminLoginGuard]
46 46
    },
47 47
    {
......
49 49
    },
50 50
    {
51 51
        path: ':community',
52
        loadChildren: './pages/community-routing.module#CommunityRoutingModule',
52
        loadChildren: () => import('./pages/community-routing.module').then(m => m.CommunityRoutingModule),
53 53
        canActivateChild: [IsCommunity, ConnectAdminLoginGuard]
54 54
    },
55 55
    {   path: '**',
......
62 62
@NgModule({
63 63
    imports: [RouterModule.forRoot(routes, {
64 64
        preloadingStrategy: PreloadAllModules,
65
        onSameUrlNavigation: "reload",
66
        relativeLinkResolution: 'corrected'
65
        onSameUrlNavigation: "reload"
67 66
    })],
68 67
    exports: [ RouterModule ]
69 68
})
modules/uoa-admin-portal/trunk/src/polyfills.ts
1
/***************************************************************************************************
2
 * Load `$localize` onto the global scope - used if i18n tags appear in Angular templates.
3
 */
4
import '@angular/localize/init';
1 5
/**
2 6
 * This file includes polyfills needed by Angular and is loaded before the app.
3 7
 * You can add your own extra polyfills to this file.
......
11 15
 * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12 16
 * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13 17
 *
14
 * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
18
 * Learn more in https://angular.io/guide/browser-support
15 19
 */
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff