Revision 61361
Added by Antonis Lempesis over 2 years ago
modules/uoa-repository-dashboard-gui/trunk/angular.json | ||
---|---|---|
1 |
{ |
|
2 |
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", |
|
3 |
"version": 1, |
|
4 |
"newProjectRoot": "projects", |
|
5 |
"projects": { |
|
6 |
"uoa-repository-manager-ui": { |
|
7 |
"root": "", |
|
8 |
"sourceRoot": "src", |
|
9 |
"projectType": "application", |
|
10 |
"prefix": "app", |
|
11 |
"schematics": {}, |
|
12 |
"architect": { |
|
13 |
"build": { |
|
14 |
"builder": "@angular-devkit/build-angular:browser", |
|
15 |
"options": { |
|
16 |
"outputPath": "dist/uoa-repository-manager-ui", |
|
17 |
"index": "src/index.html", |
|
18 |
"main": "src/main.ts", |
|
19 |
"polyfills": "src/polyfills.ts", |
|
20 |
"tsConfig": "src/tsconfig.app.json", |
|
21 |
"assets": [ |
|
22 |
"src/favicon.ico", |
|
23 |
"src/assets" |
|
24 |
], |
|
25 |
"styles": [ |
|
26 |
"src/styles.scss" |
|
27 |
], |
|
28 |
"scripts": [ |
|
29 |
"node_modules/jquery/dist/jquery.min.js", |
|
30 |
"node_modules/jquery-bez/lib/jquery.bez.js", |
|
31 |
"node_modules/uikit/dist/js/uikit.min.js", |
|
32 |
"node_modules/uikit/dist/js/uikit-icons.min.js", |
|
33 |
"src/assets/js/altair_admin_common.min.js", |
|
34 |
"src/assets/js/common.min.js", |
|
35 |
"src/assets/js/pages/forms_wizard.js" |
|
36 |
] |
|
37 |
}, |
|
38 |
"configurations": { |
|
39 |
"production": { |
|
40 |
"fileReplacements": [ |
|
41 |
{ |
|
42 |
"replace": "src/environments/environment.ts", |
|
43 |
"with": "src/environments/environment.prod.ts" |
|
44 |
} |
|
45 |
], |
|
46 |
"optimization": true, |
|
47 |
"outputHashing": "all", |
|
48 |
"sourceMap": false, |
|
49 |
"extractCss": true, |
|
50 |
"namedChunks": false, |
|
51 |
"aot": true, |
|
52 |
"extractLicenses": true, |
|
53 |
"vendorChunk": false, |
|
54 |
"buildOptimizer": true |
|
55 |
}, |
|
56 |
"beta": { |
|
57 |
"fileReplacements": [ |
|
58 |
{ |
|
59 |
"replace": "src/environments/environment.ts", |
|
60 |
"with": "src/environments/environment.beta.ts" |
|
61 |
} |
|
62 |
], |
|
63 |
"optimization": true, |
|
64 |
"outputHashing": "all", |
|
65 |
"sourceMap": false, |
|
66 |
"extractCss": true, |
|
67 |
"namedChunks": false, |
|
68 |
"aot": true, |
|
69 |
"extractLicenses": true, |
|
70 |
"vendorChunk": false, |
|
71 |
"buildOptimizer": true |
|
72 |
} |
|
73 |
} |
|
74 |
}, |
|
75 |
"serve": { |
|
76 |
"builder": "@angular-devkit/build-angular:dev-server", |
|
77 |
"options": { |
|
78 |
"browserTarget": "uoa-repository-manager-ui:build", |
|
79 |
"port": 4200, |
|
80 |
"host": "localhost" |
|
81 |
}, |
|
82 |
"configurations": { |
|
83 |
"production": { |
|
84 |
"browserTarget": "uoa-repository-manager-ui:build:production" |
|
85 |
} |
|
86 |
} |
|
87 |
}, |
|
88 |
"extract-i18n": { |
|
89 |
"builder": "@angular-devkit/build-angular:extract-i18n", |
|
90 |
"options": { |
|
91 |
"browserTarget": "uoa-repository-manager-ui:build" |
|
92 |
} |
|
93 |
}, |
|
94 |
"test": { |
|
95 |
"builder": "@angular-devkit/build-angular:karma", |
|
96 |
"options": { |
|
97 |
"main": "src/test.ts", |
|
98 |
"polyfills": "src/polyfills.ts", |
|
99 |
"tsConfig": "src/tsconfig.spec.json", |
|
100 |
"karmaConfig": "src/karma.conf.js", |
|
101 |
"styles": [ |
|
102 |
"src/styles.scss" |
|
103 |
], |
|
104 |
"scripts": [], |
|
105 |
"assets": [ |
|
106 |
"src/favicon.ico", |
|
107 |
"src/assets" |
|
108 |
] |
|
109 |
} |
|
110 |
}, |
|
111 |
"lint": { |
|
112 |
"builder": "@angular-devkit/build-angular:tslint", |
|
113 |
"options": { |
|
114 |
"tsConfig": [ |
|
115 |
"src/tsconfig.app.json", |
|
116 |
"src/tsconfig.spec.json" |
|
117 |
], |
|
118 |
"exclude": [ |
|
119 |
"**/node_modules/**" |
|
120 |
] |
|
121 |
} |
|
122 |
} |
|
123 |
} |
|
124 |
}, |
|
125 |
"uoa-repository-manager-ui-e2e": { |
|
126 |
"root": "e2e/", |
|
127 |
"projectType": "application", |
|
128 |
"architect": { |
|
129 |
"e2e": { |
|
130 |
"builder": "@angular-devkit/build-angular:protractor", |
|
131 |
"options": { |
|
132 |
"protractorConfig": "e2e/protractor.conf.js", |
|
133 |
"devServerTarget": "uoa-repository-manager-ui:serve" |
|
134 |
}, |
|
135 |
"configurations": { |
|
136 |
"production": { |
|
137 |
"devServerTarget": "uoa-repository-manager-ui:serve:production" |
|
138 |
} |
|
139 |
} |
|
140 |
}, |
|
141 |
"lint": { |
|
142 |
"builder": "@angular-devkit/build-angular:tslint", |
|
143 |
"options": { |
|
144 |
"tsConfig": "e2e/tsconfig.e2e.json", |
|
145 |
"exclude": [ |
|
146 |
"**/node_modules/**" |
|
147 |
] |
|
148 |
} |
|
149 |
} |
|
150 |
} |
|
151 |
} |
|
152 |
}, |
|
153 |
"defaultProject": "uoa-repository-manager-ui" |
|
154 |
} |
|
0 | 155 |
modules/uoa-repository-dashboard-gui/trunk/package.json | ||
---|---|---|
1 |
{ |
|
2 |
"name": "uoa-repository-manager-ui", |
|
3 |
"version": "0.0.0", |
|
4 |
"scripts": { |
|
5 |
"ng": "ng", |
|
6 |
"start": "ng serve", |
|
7 |
"start:proxy": "ng serve --proxy-config proxy.conf.json", |
|
8 |
"build": "rm -rf dist; ng build --prod", |
|
9 |
"test": "ng test", |
|
10 |
"lint": "ng lint", |
|
11 |
"e2e": "ng e2e" |
|
12 |
}, |
|
13 |
"private": true, |
|
14 |
"dependencies": { |
|
15 |
"@angular/animations": "^6.0.3", |
|
16 |
"@angular/common": "^6.0.3", |
|
17 |
"@angular/compiler": "^6.0.3", |
|
18 |
"@angular/core": "^6.0.3", |
|
19 |
"@angular/forms": "^6.0.3", |
|
20 |
"@angular/http": "^6.0.3", |
|
21 |
"@angular/platform-browser": "^6.0.3", |
|
22 |
"@angular/platform-browser-dynamic": "^6.0.3", |
|
23 |
"@angular/router": "^6.0.3", |
|
24 |
"altair": "^1.0.0", |
|
25 |
"angular2-cookie-law": "^6.0.4", |
|
26 |
"bootstrap": "^4.1.3", |
|
27 |
"core-js": "^2.5.4", |
|
28 |
"highcharts": "^7.2.1", |
|
29 |
"highcharts-angular": "^2.4.0", |
|
30 |
"jquery": "^3.4.1", |
|
31 |
"jquery-bez": "^1.0.11", |
|
32 |
"ngx-bootstrap": "^3.0.1", |
|
33 |
"ngx-matomo": "^0.1.2", |
|
34 |
"rxjs": "6.3.3", |
|
35 |
"uikit": "^3.0.0-rc.19", |
|
36 |
"zone.js": "^0.8.26" |
|
37 |
}, |
|
38 |
"devDependencies": { |
|
39 |
"@angular-devkit/build-angular": "~0.6.8", |
|
40 |
"@angular/cli": "~6.0.8", |
|
41 |
"@angular/compiler-cli": "^6.0.3", |
|
42 |
"@angular/language-service": "^6.0.3", |
|
43 |
"@types/jasmine": "~2.8.6", |
|
44 |
"@types/jasminewd2": "~2.0.3", |
|
45 |
"@types/node": "~8.9.4", |
|
46 |
"node-sass": "^4.0.0", |
|
47 |
"codelyzer": "~4.2.1", |
|
48 |
"jasmine-core": "~2.99.1", |
|
49 |
"jasmine-spec-reporter": "~4.2.1", |
|
50 |
"karma": "~4.0.0", |
|
51 |
"karma-chrome-launcher": "~2.2.0", |
|
52 |
"karma-coverage-istanbul-reporter": "~2.0.0", |
|
53 |
"karma-jasmine": "~1.1.1", |
|
54 |
"karma-jasmine-html-reporter": "^0.2.2", |
|
55 |
"protractor": "^5.4.1", |
|
56 |
"ts-node": "~5.0.1", |
|
57 |
"tslint": "~5.9.1", |
|
58 |
"typescript": "~2.7.2" |
|
59 |
} |
|
60 |
} |
|
0 | 61 |
modules/uoa-repository-dashboard-gui/trunk/tsconfig.json | ||
---|---|---|
1 |
{ |
|
2 |
"compileOnSave": false, |
|
3 |
"compilerOptions": { |
|
4 |
"baseUrl": "./", |
|
5 |
"outDir": "./dist/out-tsc", |
|
6 |
"sourceMap": true, |
|
7 |
"declaration": false, |
|
8 |
"moduleResolution": "node", |
|
9 |
"emitDecoratorMetadata": true, |
|
10 |
"experimentalDecorators": true, |
|
11 |
"target": "es5", |
|
12 |
"typeRoots": [ |
|
13 |
"node_modules/@types" |
|
14 |
], |
|
15 |
"lib": [ |
|
16 |
"es2017", |
|
17 |
"dom" |
|
18 |
] |
|
19 |
} |
|
20 |
} |
|
0 | 21 |
modules/uoa-repository-dashboard-gui/trunk/.gitignore | ||
---|---|---|
1 |
# Logs |
|
2 |
logs |
|
3 |
*.log |
|
4 |
|
|
5 |
# Runtime data |
|
6 |
pids |
|
7 |
*.pid |
|
8 |
*.seed |
|
9 |
|
|
10 |
# Directory for instrumented libs generated by jscoverage/JSCover |
|
11 |
lib-cov |
|
12 |
|
|
13 |
# Coverage directory used by tools like istanbul |
|
14 |
coverage |
|
15 |
|
|
16 |
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) |
|
17 |
.grunt |
|
18 |
|
|
19 |
# Compiled binary addons (http://nodejs.org/api/addons.html) |
|
20 |
build/Release |
|
21 |
|
|
22 |
# Users Environment Variables |
|
23 |
.lock-wscript |
|
24 |
|
|
25 |
# OS generated files # |
|
26 |
.DS_Store |
|
27 |
ehthumbs.db |
|
28 |
Icon? |
|
29 |
Thumbs.db |
|
30 |
|
|
31 |
# Node Files # |
|
32 |
/node_modules |
|
33 |
/bower_components |
|
34 |
|
|
35 |
# Coverage # |
|
36 |
/coverage/ |
|
37 |
|
|
38 |
# Typing # |
|
39 |
/src/typings/tsd/ |
|
40 |
/typings/ |
|
41 |
/tsd_typings/ |
|
42 |
|
|
43 |
# Dist # |
|
44 |
/dist |
|
45 |
/public/__build__/ |
|
46 |
/src/*/__build__/ |
|
47 |
__build__/** |
|
48 |
.webpack.json |
|
49 |
|
|
50 |
# Doc # |
|
51 |
/doc/ |
|
52 |
|
|
53 |
# IDE # |
|
54 |
.idea/ |
|
55 |
*.swp |
modules/uoa-repository-dashboard-gui/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 |
"deprecation": { |
|
15 |
"severity": "warn" |
|
16 |
}, |
|
17 |
"eofline": true, |
|
18 |
"forin": true, |
|
19 |
"import-blacklist": [ |
|
20 |
true, |
|
21 |
"rxjs/Rx" |
|
22 |
], |
|
23 |
"import-spacing": true, |
|
24 |
"indent": [ |
|
25 |
true, |
|
26 |
"spaces" |
|
27 |
], |
|
28 |
"interface-over-type-literal": true, |
|
29 |
"label-position": true, |
|
30 |
"max-line-length": [ |
|
31 |
true, |
|
32 |
140 |
|
33 |
], |
|
34 |
"member-access": false, |
|
35 |
"member-ordering": [ |
|
36 |
true, |
|
37 |
{ |
|
38 |
"order": [ |
|
39 |
"static-field", |
|
40 |
"instance-field", |
|
41 |
"static-method", |
|
42 |
"instance-method" |
|
43 |
] |
|
44 |
} |
|
45 |
], |
|
46 |
"no-arg": true, |
|
47 |
"no-bitwise": true, |
|
48 |
"no-console": [ |
|
49 |
true, |
|
50 |
"debug", |
|
51 |
"info", |
|
52 |
"time", |
|
53 |
"timeEnd", |
|
54 |
"trace" |
|
55 |
], |
|
56 |
"no-construct": true, |
|
57 |
"no-debugger": true, |
|
58 |
"no-duplicate-super": true, |
|
59 |
"no-empty": false, |
|
60 |
"no-empty-interface": true, |
|
61 |
"no-eval": true, |
|
62 |
"no-inferrable-types": [ |
|
63 |
true, |
|
64 |
"ignore-params" |
|
65 |
], |
|
66 |
"no-misused-new": true, |
|
67 |
"no-non-null-assertion": true, |
|
68 |
"no-shadowed-variable": true, |
|
69 |
"no-string-literal": false, |
|
70 |
"no-string-throw": true, |
|
71 |
"no-switch-case-fall-through": true, |
|
72 |
"no-trailing-whitespace": true, |
|
73 |
"no-unnecessary-initializer": true, |
|
74 |
"no-unused-expression": true, |
|
75 |
"no-use-before-declare": true, |
|
76 |
"no-var-keyword": true, |
|
77 |
"object-literal-sort-keys": false, |
|
78 |
"one-line": [ |
|
79 |
true, |
|
80 |
"check-open-brace", |
|
81 |
"check-catch", |
|
82 |
"check-else", |
|
83 |
"check-whitespace" |
|
84 |
], |
|
85 |
"prefer-const": true, |
|
86 |
"quotemark": [ |
|
87 |
true, |
|
88 |
"single" |
|
89 |
], |
|
90 |
"radix": true, |
|
91 |
"semicolon": [ |
|
92 |
true, |
|
93 |
"always" |
|
94 |
], |
|
95 |
"triple-equals": [ |
|
96 |
true, |
|
97 |
"allow-null-check" |
|
98 |
], |
|
99 |
"typedef-whitespace": [ |
|
100 |
true, |
|
101 |
{ |
|
102 |
"call-signature": "nospace", |
|
103 |
"index-signature": "nospace", |
|
104 |
"parameter": "nospace", |
|
105 |
"property-declaration": "nospace", |
|
106 |
"variable-declaration": "nospace" |
|
107 |
} |
|
108 |
], |
|
109 |
"unified-signatures": true, |
|
110 |
"variable-name": false, |
|
111 |
"whitespace": [ |
|
112 |
true, |
|
113 |
"check-branch", |
|
114 |
"check-decl", |
|
115 |
"check-operator", |
|
116 |
"check-separator", |
|
117 |
"check-type" |
|
118 |
], |
|
119 |
"no-output-on-prefix": true, |
|
120 |
"use-input-property-decorator": true, |
|
121 |
"use-output-property-decorator": true, |
|
122 |
"use-host-property-decorator": true, |
|
123 |
"no-input-rename": true, |
|
124 |
"no-output-rename": true, |
|
125 |
"use-life-cycle-interface": true, |
|
126 |
"use-pipe-transform-interface": true, |
|
127 |
"component-class-suffix": true, |
|
128 |
"directive-class-suffix": true |
|
129 |
} |
|
130 |
} |
|
0 | 131 |
modules/uoa-repository-dashboard-gui/trunk/src/app/app.component.spec.ts | ||
---|---|---|
1 |
import { TestBed, async } from '@angular/core/testing'; |
|
2 |
import { AppComponent } from './app.component'; |
|
3 |
describe('AppComponent', () => { |
|
4 |
beforeEach(async(() => { |
|
5 |
TestBed.configureTestingModule({ |
|
6 |
declarations: [ |
|
7 |
AppComponent |
|
8 |
], |
|
9 |
}).compileComponents(); |
|
10 |
})); |
|
11 |
it('should create the app', async(() => { |
|
12 |
const fixture = TestBed.createComponent(AppComponent); |
|
13 |
const app = fixture.debugElement.componentInstance; |
|
14 |
expect(app).toBeTruthy(); |
|
15 |
})); |
|
16 |
it(`should have as title 'app'`, async(() => { |
|
17 |
const fixture = TestBed.createComponent(AppComponent); |
|
18 |
const app = fixture.debugElement.componentInstance; |
|
19 |
expect(app.title).toEqual('app'); |
|
20 |
})); |
|
21 |
it('should render title in a h1 tag', async(() => { |
|
22 |
const fixture = TestBed.createComponent(AppComponent); |
|
23 |
fixture.detectChanges(); |
|
24 |
const compiled = fixture.debugElement.nativeElement; |
|
25 |
expect(compiled.querySelector('h1').textContent).toContain('Welcome to uoa-repository-manager-ui!'); |
|
26 |
})); |
|
27 |
}); |
|
0 | 28 |
modules/uoa-repository-dashboard-gui/trunk/src/app/pages/adminPg/adminPg-registrations.component.ts | ||
---|---|---|
1 |
import {Component, OnInit} from '@angular/core'; |
|
2 |
import {loadingReposMessage, noServiceMessage} from '../../domain/shared-messages'; |
|
3 |
import {Country, RepositorySnippet} from '../../domain/typeScriptClasses'; |
|
4 |
import {RepositoryService} from '../../services/repository.service'; |
|
5 |
import {FormBuilder, FormGroup} from '@angular/forms'; |
|
6 |
import {ActivatedRoute, Params, Router} from '@angular/router'; |
|
7 |
import {URLParameter} from '../../domain/url-parameter'; |
|
8 |
|
|
9 |
@Component({ |
|
10 |
selector: 'app-registration', |
|
11 |
templateUrl: 'adminPg-registrations.component.html', |
|
12 |
styleUrls: ['./adminPg-registrations.component.css'] |
|
13 |
}) |
|
14 |
|
|
15 |
export class RegistrationComponent implements OnInit { |
|
16 |
|
|
17 |
errorMessage: string; |
|
18 |
successMessage: string; |
|
19 |
loadingMessage: string; |
|
20 |
countries: Country[] = []; |
|
21 |
repositorySnippet: RepositorySnippet[] = []; |
|
22 |
urlParams: URLParameter[] = []; |
|
23 |
thisIsForBadUse: RepositorySnippet[] = []; // remove if page total is fixed!!! |
|
24 |
|
|
25 |
formPrepare = { |
|
26 |
country: '', |
|
27 |
typology: '', |
|
28 |
officialName: '', |
|
29 |
requestSortBy: 'registrationdate', |
|
30 |
order: 'DESCENDING', |
|
31 |
page: '0', |
|
32 |
size: '25' |
|
33 |
}; |
|
34 |
|
|
35 |
dataForm: FormGroup; |
|
36 |
|
|
37 |
constructor(private repoService: RepositoryService, |
|
38 |
private fb: FormBuilder, |
|
39 |
private route: ActivatedRoute, |
|
40 |
private router: Router) { } |
|
41 |
|
|
42 |
ngOnInit() { |
|
43 |
this.dataForm = this.fb.group(this.formPrepare); |
|
44 |
const tempUrlParams = new Array<URLParameter>(); |
|
45 |
this.route.queryParams |
|
46 |
.subscribe(params => { |
|
47 |
for (const i in params) { |
|
48 |
this.dataForm.get(i).setValue(params[i]); |
|
49 |
} |
|
50 |
for (let i in this.dataForm.controls) { |
|
51 |
if (this.dataForm.get(i).value) { |
|
52 |
tempUrlParams.push({key: i, value: [this.dataForm.get(i).value]}); |
|
53 |
} |
|
54 |
} |
|
55 |
this.handleChange(); |
|
56 |
}, |
|
57 |
error => this.errorMessage = <any>error |
|
58 |
); |
|
59 |
|
|
60 |
this.getCountries(); |
|
61 |
|
|
62 |
|
|
63 |
} |
|
64 |
|
|
65 |
getCountries() { |
|
66 |
this.repoService.getCountries() |
|
67 |
.subscribe( |
|
68 |
countries => this.countries = countries.sort(function (a, b) { |
|
69 |
if (a.name < b.name) { |
|
70 |
return -1; |
|
71 |
} else if (a.name > b.name) { |
|
72 |
return 1; |
|
73 |
} else { |
|
74 |
return 0; |
|
75 |
} |
|
76 |
}), |
|
77 |
error => { |
|
78 |
this.loadingMessage = ''; |
|
79 |
this.errorMessage = noServiceMessage; |
|
80 |
console.log(error); |
|
81 |
} |
|
82 |
); |
|
83 |
} |
|
84 |
|
|
85 |
getRegisteredRepositories(urlParams: URLParameter[]) { |
|
86 |
this.loadingMessage = loadingReposMessage; |
|
87 |
this.repoService.searchRegisteredRepositories(this.dataForm.get('page').value, |
|
88 |
this.dataForm.get('size').value, urlParams).subscribe( |
|
89 |
suc => this.repositorySnippet = suc, |
|
90 |
error => { |
|
91 |
console.log(error); |
|
92 |
this.loadingMessage = ''; |
|
93 |
}, |
|
94 |
() => this.loadingMessage = '' |
|
95 |
); |
|
96 |
} |
|
97 |
|
|
98 |
handleChange() { |
|
99 |
const tempUrlParams = new Array<URLParameter>(); |
|
100 |
const map: { [name: string]: string; } = {}; |
|
101 |
|
|
102 |
for (let i in this.dataForm.controls) { |
|
103 |
if (this.dataForm.get(i).value !== '') { |
|
104 |
tempUrlParams.push({key: i, value: [this.dataForm.get(i).value]}); |
|
105 |
map[i] = this.dataForm.get(i).value; |
|
106 |
} |
|
107 |
} |
|
108 |
|
|
109 |
this.router.navigate([`/admin/registrations`], |
|
110 |
{queryParams: map}); |
|
111 |
this.getRegisteredRepositories(tempUrlParams); |
|
112 |
} |
|
113 |
|
|
114 |
handleChangeAndResetPage() { |
|
115 |
this.dataForm.get('page').setValue(0); |
|
116 |
this.handleChange(); |
|
117 |
} |
|
118 |
|
|
119 |
getCountryName(countryCode): string { |
|
120 |
for (const country of Object.values(this.countries)) { |
|
121 |
if (country.code === countryCode) { |
|
122 |
return country.name; |
|
123 |
} |
|
124 |
} |
|
125 |
} |
|
126 |
|
|
127 |
previousPage() { |
|
128 |
if (this.dataForm.get('page').value > 0) { |
|
129 |
this.dataForm.get('page').setValue(+this.dataForm.get('page').value - 1); |
|
130 |
this.handleChange(); |
|
131 |
} |
|
132 |
} |
|
133 |
|
|
134 |
nextPage() { |
|
135 |
/** remove when page total is fixed!!! **/ |
|
136 |
const tempUrlParams = new Array<URLParameter>(); |
|
137 |
for (let i in this.dataForm.controls) { |
|
138 |
if (this.dataForm.get(i).value !== '') { |
|
139 |
tempUrlParams.push({key: i, value: [this.dataForm.get(i).value]}); |
|
140 |
} |
|
141 |
} |
|
142 |
this.repoService.searchRegisteredRepositories(+this.dataForm.get('page').value + 1, |
|
143 |
this.dataForm.get('size').value, tempUrlParams).subscribe( |
|
144 |
suc => this.thisIsForBadUse = suc, |
|
145 |
error => console.log(error), |
|
146 |
() => { |
|
147 |
if (!(this.thisIsForBadUse.length === 0)) { |
|
148 |
this.dataForm.get('page').setValue(+this.dataForm.get('page').value + 1); |
|
149 |
this.handleChange(); |
|
150 |
} |
|
151 |
} |
|
152 |
); |
|
153 |
/** **/ |
|
154 |
|
|
155 |
} |
|
156 |
|
|
157 |
} |
modules/uoa-repository-dashboard-gui/trunk/src/app/pages/adminPg/adminPg-registrations.component.css | ||
---|---|---|
1 |
.uk-form-horizontal .uk-form-label { |
|
2 |
width: 100px; |
|
3 |
} |
|
4 |
|
|
5 |
.uk-form-horizontal .uk-form-controls { |
|
6 |
margin-left: 115px; |
|
7 |
} |
|
8 |
|
|
9 |
.uk-search-default .uk-search-input { |
|
10 |
padding-left: 15px; |
|
11 |
padding-right: 15px; |
|
12 |
} |
modules/uoa-repository-dashboard-gui/trunk/src/app/pages/adminPg/adminPg.component.ts | ||
---|---|---|
1 |
/* |
|
2 |
* updated by myrto on 19/12/2018 |
|
3 |
*/ |
|
4 |
|
|
5 |
import { Component, OnInit } from '@angular/core'; |
|
6 |
|
|
7 |
@Component ({ |
|
8 |
selector: 'app-admin', |
|
9 |
templateUrl: '../pageContainer.html' |
|
10 |
}) |
|
11 |
|
|
12 |
export class AdminPgComponent implements OnInit { |
|
13 |
|
|
14 |
constructor() {} |
|
15 |
|
|
16 |
ngOnInit() {} |
|
17 |
} |
|
0 | 18 |
modules/uoa-repository-dashboard-gui/trunk/src/app/pages/adminPg/adminPg-metrics.component.html | ||
---|---|---|
1 |
<div id="page_content"> |
|
2 |
|
|
3 |
<div class="repositoryAdminMenu"> |
|
4 |
|
|
5 |
<div class="uk-margin-medium-left uk-margin-medium-right"> |
|
6 |
<div class="uk-padding-small"> |
|
7 |
<h3 class="heading_b"> |
|
8 |
Metrics Admin |
|
9 |
</h3> |
|
10 |
</div> |
|
11 |
|
|
12 |
<div id="top_bar"> |
|
13 |
<div class="md-top-bar"> |
|
14 |
<div class="uk-width-1-2@l uk-margin-auto"> |
|
15 |
<form [formGroup]="dataForm" (ngSubmit)="handleChangeAndResetPage()" class="uk-search uk-search-default uk-width-1-1@m"> |
|
16 |
<div class="md-input-wrapper"> |
|
17 |
<label for="repository_name_search">Search...</label> |
|
18 |
<input class="md-input" type="search" id="repository_name_search" formControlName="searchField"> |
|
19 |
<span class="md-input-bar"></span> |
|
20 |
</div> |
|
21 |
|
|
22 |
</form> |
|
23 |
</div> |
|
24 |
</div> |
|
25 |
</div> |
|
26 |
</div> |
|
27 |
|
|
28 |
</div> |
|
29 |
|
|
30 |
<div id="page_content_inner" class="whiteBackground uk-padding-remove-left uk-padding-remove-right"> |
|
31 |
|
|
32 |
<div class="uk-section uk-background-norepeat uk-background-cover uk-background-top-center" |
|
33 |
style="background-image: url('../../../assets/imgs/landing/abstract2.svg'); !important; min-height: calc(80vh);" uk-height-viewport="offset-top: true; offset-bottom: 20;"> |
|
34 |
|
|
35 |
<!-- TOP HELP CONTENT --> |
|
36 |
<help-content #topHelperContent [position]="'top'" |
|
37 |
[ngClass]="topHelperContent.isPresent()?'uk-margin-medium-top uk-margin-medium-bottom':'clear-style'"> |
|
38 |
</help-content> |
|
39 |
|
|
40 |
<div class="uk-grid"> |
|
41 |
|
|
42 |
<!-- LEFT HELP CONTENT --> |
|
43 |
<aside-help-content #leftHelperContent [position]="'left'" |
|
44 |
[ngClass]="leftHelperContent.isPresent()?'tm-sidebar uk-width-1-4@m uk-first-column':'clear-style'"> |
|
45 |
</aside-help-content> |
|
46 |
|
|
47 |
<!-- MIDDLE --> |
|
48 |
<div class="uk-width-expand@m"> |
|
49 |
|
|
50 |
<div *ngIf="errorMessage" class="uk-alert uk-alert-danger">{{ errorMessage }}</div> |
|
51 |
<div *ngIf="successMessage" class="uk-alert uk-alert-success">{{ successMessage }}</div> |
|
52 |
|
|
53 |
<div *ngIf="!errorMessage" class="uk-container"> |
|
54 |
|
|
55 |
<div class=""> |
|
56 |
<div class=""> |
|
57 |
|
|
58 |
<div class="uk-margin-medium uk-margin-top repositoryAdminActions"> |
|
59 |
|
|
60 |
<form [formGroup]="dataForm" class="uk-form-horizontal uk-flex"> |
|
61 |
|
|
62 |
<div class="uk-margin-right"> |
|
63 |
<div class=""> |
|
64 |
<label class="" for="quantity">Results per page </label> |
|
65 |
<div class="uk-inline"> |
|
66 |
<select class="uk-select" id="quantity" (change)="handleChangeAndResetPage()" formControlName="quantity"> |
|
67 |
<option value="10">10</option> |
|
68 |
<option value="25" selected>25</option> |
|
69 |
<option value="50">50</option> |
|
70 |
<option value="100">100</option> |
|
71 |
</select> |
|
72 |
</div> |
|
73 |
</div> |
|
74 |
</div> |
|
75 |
|
|
76 |
<div class="uk-margin-right"> |
|
77 |
|
|
78 |
<div class="uk-inline uk-margin-right"> |
|
79 |
<label class="" for="orderBy">Order by </label> |
|
80 |
<div class="uk-inline"> |
|
81 |
<select class="uk-select" id="orderBy" (change)="handleChangeAndResetPage()" formControlName="order"> |
|
82 |
<option value="DSC" selected>Descending</option> |
|
83 |
<option value="ASC">Ascending</option> |
|
84 |
</select> |
|
85 |
</div> |
|
86 |
</div> |
|
87 |
|
|
88 |
<div class="uk-inline"> |
|
89 |
<label class="" for="orderField">Sort by </label> |
|
90 |
<div class="uk-inline"> |
|
91 |
<select class="uk-select" id="orderField" (change)="handleChangeAndResetPage()" formControlName="orderField"> |
|
92 |
<option value="CREATION_DATE" selected>Date</option> |
|
93 |
<option value="REPOSITORY_NAME">Name</option> |
|
94 |
</select> |
|
95 |
</div> |
|
96 |
</div> |
|
97 |
|
|
98 |
</div> |
|
99 |
|
|
100 |
<div class="" style="margin-left:auto; margin-right:0;"> |
|
101 |
<button class="uk-button uk-button-link" (click)="downloadCSV()"> |
|
102 |
<i class="fas fa-download uk-margin-small-right"></i>Export to CSV |
|
103 |
</button> |
|
104 |
</div> |
|
105 |
|
|
106 |
</form> |
|
107 |
|
|
108 |
|
|
109 |
</div> |
|
110 |
|
|
111 |
<div class="uk-width-1-1@m"> |
|
112 |
|
|
113 |
<div style="display: flex;justify-content: space-between;"> |
|
114 |
|
|
115 |
<div *ngIf="piwiks" class="resultsInfo" style="margin-top: auto;"> |
|
116 |
<span class="number">{{piwiks.total}}</span> RESULTS, PAGE <span class="number">{{(dataForm.get('page').value)*1 + 1}}</span> OF <span class="number">{{pages.length}}</span> |
|
117 |
</div> |
|
118 |
|
|
119 |
<div class="uk-inline"> |
|
120 |
<ul class="uk-pagination" uk-margin> |
|
121 |
<li><a (click)="previousPage()" class="pagination_arrow"><span uk-pagination-previous></span></a></li> |
|
122 |
<li [ngClass]="{'uk-active': (this.dataForm.get('page').value == page) }" *ngFor="let page of pages"> |
|
123 |
<a (click)="selectPage(page)">{{page+1}}</a> |
|
124 |
</li> |
|
125 |
<li><a (click)="nextPage()" class="pagination_arrow"><span uk-pagination-next></span></a></li> |
|
126 |
</ul> |
|
127 |
</div> |
|
128 |
|
|
129 |
</div> |
|
130 |
|
|
131 |
|
|
132 |
<hr class="adminResultsHeader"> |
|
133 |
|
|
134 |
<div *ngIf="loadingMessage" class="loading-big"> |
|
135 |
<div class="loader-big" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;"> |
|
136 |
{{ loadingMessage }} |
|
137 |
|
|
138 |
</div> |
|
139 |
<div class="transparentFilm"></div> |
|
140 |
</div> |
|
141 |
|
|
142 |
|
|
143 |
<!-- REPOSITORY CARD --> |
|
144 |
<ng-container *ngIf="piwiks && piwiks.results.length>0"> |
|
145 |
<div *ngFor="let piwik of piwiks.results" class="md-card repositoryCard"> |
|
146 |
<div class="md-card-content large-padding"> |
|
147 |
<div class="uk-text-meta"> |
|
148 |
Requested on: {{ piwik.creationDate | date : "yyyy-MM-dd" }} |
|
149 |
<ng-container *ngIf="piwik.validated"> |
|
150 |
. Validated on: {{ piwik.validationDate | date : "yyyy-MM-dd" }} |
|
151 |
</ng-container> |
|
152 |
</div> |
|
153 |
<div> |
|
154 |
<div class="repositoryCardHeader uk-margin-bottom uk-margin-small-top uk-inline"> |
|
155 |
<a *ngIf="piwik.validated" [routerLink]="['/repositoryAdmin/' + piwik.repositoryId + '/getImpact/show']">{{ piwik.repositoryName }}</a> |
|
156 |
<a *ngIf="!piwik.validated" [routerLink]="['/repositoryAdmin/' + piwik.repositoryId + '/getImpact/instructions']">{{ piwik.repositoryName }}</a> |
|
157 |
</div> |
|
158 |
<ng-container *ngIf="!piwik.validated"> |
|
159 |
<button class="uk-button uk-button-primary validate uk-inline uk-float-right" (click)="confirmApproval(piwik.repositoryId)">Validate</button> |
|
160 |
</ng-container> |
|
161 |
</div> |
|
162 |
|
|
163 |
<div class="uk-margin-small-bottom"><span class="uk-badge uk-badge-primary uk-badge-notification uk-margin-small-right">ID</span>{{ piwik.repositoryId }}</div> |
|
164 |
<div class="uk-margin-small-bottom"><span class="mute-title">Requestor: </span><span class="small-content">{{ piwik.requestorName }} - {{ piwik.requestorEmail }}</span></div> |
|
165 |
<div class="uk-margin-small-bottom"><span class="mute-title">Matomo ID: </span><span class="small-content">{{ piwik.siteId }}</span></div> |
|
166 |
<div class=""><span class="mute-title">Authentication Token: </span><span class="small-content">{{ piwik.authenticationToken }}</span></div> |
|
167 |
</div> |
|
168 |
</div> |
|
169 |
</ng-container> |
|
170 |
|
|
171 |
|
|
172 |
<ul class="uk-pagination uk-margin-top uk-flex-right" uk-margin> |
|
173 |
<li><a (click)="previousPage()" class="pagination_arrow"><span uk-pagination-previous></span></a></li> |
|
174 |
<li [ngClass]="{'uk-active': (this.dataForm.get('page').value == page) }" *ngFor="let page of pages"> |
|
175 |
<a (click)="selectPage(page)">{{page+1}}</a> |
|
176 |
</li> |
|
177 |
<li><a (click)="nextPage()" class="pagination_arrow"><span uk-pagination-next></span></a></li> |
|
178 |
</ul> |
|
179 |
|
|
180 |
</div> |
|
181 |
|
|
182 |
</div> |
|
183 |
</div> |
|
184 |
</div> |
|
185 |
|
|
186 |
</div> |
|
187 |
|
|
188 |
<!-- RIGHT HELP CONTENT --> |
|
189 |
<aside-help-content #rightHelperContent [position]="'right'" |
|
190 |
[ngClass]="rightHelperContent.isPresent()?'tm-sidebar uk-width-1-4@m uk-first-column':'clear-style'"> |
|
191 |
</aside-help-content> |
|
192 |
|
|
193 |
</div> |
|
194 |
|
|
195 |
<!-- BOTTOM HELP CONTENT --> |
|
196 |
<help-content #bottomHelperContent [position]="'bottom'" |
|
197 |
[ngClass]="bottomHelperContent.isPresent()?'uk-margin-medium-top uk-margin-medium-bottom':'clear-style'"> |
|
198 |
</help-content> |
|
199 |
|
|
200 |
</div> |
|
201 |
|
|
202 |
|
|
203 |
</div> |
|
204 |
</div> |
|
205 |
|
|
206 |
<confirmation-dialog #confirmApprovalModal [title]="modalTitle" [isModalShown]="isModalShown" |
|
207 |
[confirmActionButton]="modalButton" (emitObject)="confirmedApproval($event)"> |
|
208 |
Are you sure you want to validate the selected piwik site(s)? |
|
209 |
</confirmation-dialog> |
|
0 | 210 |
modules/uoa-repository-dashboard-gui/trunk/src/app/pages/adminPg/adminPg.module.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
import { CommonModule } from '@angular/common'; |
|
3 |
import { TabsModule } from 'ngx-bootstrap'; |
|
4 |
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; |
|
5 |
import { AdminPgRouting } from './adminPg.routing'; |
|
6 |
import { ReusableComponentsModule } from '../../shared/reusablecomponents/reusable-components.module'; |
|
7 |
import { AdminPgComponent } from './adminPg.component'; |
|
8 |
import { AdminPgMetricsComponent } from './adminPg-metrics.component'; |
|
9 |
import {RegistrationComponent} from './adminPg-registrations.component'; |
|
10 |
|
|
11 |
@NgModule ({ |
|
12 |
imports: [ |
|
13 |
CommonModule, |
|
14 |
TabsModule.forRoot(), |
|
15 |
FormsModule, |
|
16 |
ReactiveFormsModule, |
|
17 |
AdminPgRouting, |
|
18 |
ReusableComponentsModule, |
|
19 |
], |
|
20 |
declarations: [ |
|
21 |
AdminPgComponent, |
|
22 |
AdminPgMetricsComponent, |
|
23 |
RegistrationComponent |
|
24 |
] |
|
25 |
}) |
|
26 |
|
|
27 |
export class AdminPgModule {} |
|
0 | 28 |
modules/uoa-repository-dashboard-gui/trunk/src/app/pages/adminPg/adminPg-metrics.component.ts | ||
---|---|---|
1 |
import {Component, Input, OnInit, ViewChild} from '@angular/core'; |
|
2 |
import { PiwikService } from '../../services/piwik.service'; |
|
3 |
import { PiwikInfo } from '../../domain/typeScriptClasses'; |
|
4 |
import { |
|
5 |
enabledMetricsError, |
|
6 |
enablingMetrics, |
|
7 |
loadingReposMessage, |
|
8 |
reposRetrievalError, |
|
9 |
validatePiwikSiteSuccess |
|
10 |
} from '../../domain/shared-messages'; |
|
11 |
import { ConfirmationDialogComponent } from '../../shared/reusablecomponents/confirmation-dialog.component'; |
|
12 |
import {URLParameter} from '../../domain/url-parameter'; |
|
13 |
import {FormBuilder, FormGroup} from '@angular/forms'; |
|
14 |
import {RepositoryService} from '../../services/repository.service'; |
|
15 |
import {ActivatedRoute, Router} from '@angular/router'; |
|
16 |
import {PiwikInfoPage} from '../../domain/page-content'; |
|
17 |
import {environment} from '../../../environments/environment'; |
|
18 |
import {st} from '@angular/core/src/render3'; |
|
19 |
|
|
20 |
@Component ({ |
|
21 |
selector: 'app-admin-metrics', |
|
22 |
templateUrl: 'adminPg-metrics.component.html' |
|
23 |
}) |
|
24 |
|
|
25 |
export class AdminPgMetricsComponent implements OnInit { |
|
26 |
piwiks: PiwikInfoPage; |
|
27 |
urlParams: URLParameter[] = []; |
|
28 |
errorMessage: string; |
|
29 |
successMessage: string; |
|
30 |
loadingMessage: string; |
|
31 |
|
|
32 |
modalTitle = 'Approval Confirmation'; |
|
33 |
modalButton = 'Yes, validate'; |
|
34 |
isModalShown: boolean; |
|
35 |
|
|
36 |
formPrepare = { |
|
37 |
searchField: '', |
|
38 |
orderField: 'REPOSITORY_NAME', |
|
39 |
order: 'ASC', |
|
40 |
page: '0', |
|
41 |
quantity: '25', |
|
42 |
from: '0' |
|
43 |
}; |
|
44 |
|
|
45 |
dataForm: FormGroup; |
|
46 |
|
|
47 |
@ViewChild('confirmApprovalModal') |
|
48 |
public confirmApprovalModal: ConfirmationDialogComponent; |
|
49 |
private pageTotal: number; |
|
50 |
private piwiksTotal: number; |
|
51 |
public pages = []; |
|
52 |
private offset = 2; |
|
53 |
|
|
54 |
constructor(private piwikService: PiwikService, |
|
55 |
private fb: FormBuilder, |
|
56 |
private route: ActivatedRoute, |
|
57 |
private router: Router) {} |
|
58 |
|
|
59 |
ngOnInit() { |
|
60 |
this.dataForm = this.fb.group(this.formPrepare); |
|
61 |
this.urlParams = []; |
|
62 |
this.route.queryParams |
|
63 |
.subscribe(params => { |
|
64 |
for (const i in params) { |
|
65 |
this.dataForm.get(i).setValue(params[i]); |
|
66 |
} |
|
67 |
for (let i in this.dataForm.controls) { |
|
68 |
if (this.dataForm.get(i).value) { |
|
69 |
this.urlParams.push({key: i, value: [this.dataForm.get(i).value]}); |
|
70 |
} |
|
71 |
} |
|
72 |
this.handleChange(); |
|
73 |
}, |
|
74 |
error => this.errorMessage = <any>error |
|
75 |
); |
|
76 |
|
|
77 |
this.isModalShown = false; |
|
78 |
} |
|
79 |
|
|
80 |
downloadCSV() { |
|
81 |
const url = environment.API_ENDPOINT; |
|
82 |
let csvUrlParams = '/piwik/getPiwikSitesForRepos/csv?'; |
|
83 |
for (let i in this.dataForm.controls) { |
|
84 |
if (this.dataForm.get(i).value !== '') { |
|
85 |
csvUrlParams = csvUrlParams.concat(i, '=', this.dataForm.get(i).value, '&'); |
|
86 |
} |
|
87 |
} |
|
88 |
csvUrlParams = csvUrlParams.split('&page=')[0]; |
|
89 |
window.open(url + csvUrlParams, '_blank'); |
|
90 |
} |
|
91 |
|
|
92 |
getPiwiks() { |
|
93 |
this.loadingMessage = loadingReposMessage; |
|
94 |
this.piwikService.getPiwikSitesForRepos(this.urlParams) |
|
95 |
.subscribe( |
|
96 |
piwiks => { |
|
97 |
this.piwiks = piwiks; |
|
98 |
this.getPages(); |
|
99 |
}, |
|
100 |
error => { |
|
101 |
console.log(error); |
|
102 |
this.loadingMessage = ''; |
|
103 |
this.errorMessage = reposRetrievalError; |
|
104 |
}, |
|
105 |
() => { |
|
106 |
this.loadingMessage = ''; |
|
107 |
window.scroll(1, 1); |
|
108 |
} |
|
109 |
); |
|
110 |
} |
|
111 |
|
|
112 |
confirmApproval(repoId: string) { |
|
113 |
this.confirmApprovalModal.ids = [repoId]; |
|
114 |
this.confirmApprovalModal.showModal(); |
|
115 |
} |
|
116 |
|
|
117 |
confirmedApproval(ids: string[]) { |
|
118 |
const id = ids[0]; |
|
119 |
console.log(`approving validation of piwik for repo with id: ${id}`); |
|
120 |
this.approvePiwik(id); |
|
121 |
} |
|
122 |
|
|
123 |
approvePiwik(id: string) { |
|
124 |
this.loadingMessage = enablingMetrics; |
|
125 |
this.errorMessage = ''; |
|
126 |
this.successMessage = ''; |
|
127 |
|
|
128 |
/*this.piwikService.approvePiwikSite(id).subscribe(*/ |
|
129 |
this.piwikService.markPiwikSiteAsValidated(id).subscribe( |
|
130 |
response => console.log(`approvePiwikSite responded: ${JSON.stringify(response)}`), |
|
131 |
error => { |
|
132 |
console.log(error); |
|
133 |
this.loadingMessage = ''; |
|
134 |
this.errorMessage = enabledMetricsError; |
|
135 |
}, |
|
136 |
() => { |
|
137 |
this.loadingMessage = ''; |
|
138 |
this.errorMessage = ''; |
|
139 |
this.successMessage = validatePiwikSiteSuccess; |
|
140 |
this.getPiwiks(); |
|
141 |
} |
|
142 |
); |
|
143 |
} |
|
144 |
|
|
145 |
handleChange() { |
|
146 |
this.urlParams = []; |
|
147 |
const map: { [name: string]: string; } = {}; |
|
148 |
for (let i in this.dataForm.controls) { |
|
149 |
if (this.dataForm.get(i).value !== '') { |
|
150 |
this.urlParams.push({key: i, value: [this.dataForm.get(i).value]}); |
|
151 |
map[i] = this.dataForm.get(i).value; |
|
152 |
} |
|
153 |
} |
|
154 |
|
|
155 |
this.router.navigate([`/admin/metrics`], {queryParams: map}); |
|
156 |
this.getPiwiks(); |
|
157 |
} |
|
158 |
|
|
159 |
handleChangeAndResetPage() { |
|
160 |
this.dataForm.get('page').setValue(0); |
|
161 |
this.dataForm.get('from').setValue(0); |
|
162 |
this.handleChange(); |
|
163 |
} |
|
164 |
|
|
165 |
getPages() { |
|
166 |
let addToEndCounter = 0; |
|
167 |
let addToStartCounter = 0; |
|
168 |
this.pages = []; |
|
169 |
this.pageTotal = Math.ceil(this.piwiks.total / (this.dataForm.get('quantity').value)); |
|
170 |
for ( let i = (+this.dataForm.get('page').value - this.offset); i < (+this.dataForm.get('page').value + 1 + this.offset); ++i ) { |
|
171 |
if ( i < 0 ) { addToEndCounter++; } |
|
172 |
if ( i >= this.pageTotal ) { addToStartCounter++; } |
|
173 |
if ((i >= 0) && (i < this.pageTotal)) { |
|
174 |
this.pages.push(i); |
|
175 |
} |
|
176 |
} |
|
177 |
for ( let i = 0; i < addToEndCounter; ++i ) { |
|
178 |
if (this.pages.length < this.pageTotal) { |
|
179 |
this.pages.push(this.pages.length); |
|
180 |
} |
|
181 |
} |
|
182 |
for ( let i = 0; i < addToStartCounter; ++i ) { |
|
183 |
if (this.pages[0] > 0) { |
|
184 |
this.pages.unshift(this.pages[0] - 1 ); |
|
185 |
} |
|
186 |
} |
|
187 |
} |
|
188 |
|
|
189 |
selectPage(page) { |
|
190 |
this.dataForm.get('page').setValue(page); |
|
191 |
this.dataForm.get('from').setValue(((+this.dataForm.get('page').value) * (+this.dataForm.get('quantity').value))); |
|
192 |
this.handleChange(); |
|
193 |
} |
|
194 |
|
|
195 |
previousPage() { |
|
196 |
if (this.dataForm.get('page').value > 0) { |
|
197 |
this.dataForm.get('page').setValue(+this.dataForm.get('page').value - 1); |
|
198 |
this.dataForm.get('from').setValue(+this.dataForm.get('from').value - +this.dataForm.get('quantity').value); |
|
199 |
this.handleChange(); |
|
200 |
} |
|
201 |
} |
|
202 |
|
|
203 |
nextPage() { |
|
204 |
// if ((this.dataForm.get('searchField').value) !== '') { this.piwiksTotal = this.piwiks.to; } else { this.piwiksTotal = this.piwiks.total; } |
|
205 |
this.pageTotal = Math.ceil(this.piwiks.total / (this.dataForm.get('quantity').value)) - 1; |
|
206 |
if (this.dataForm.get('page').value < this.pageTotal) { |
|
207 |
this.dataForm.get('page').setValue(+this.dataForm.get('page').value + 1); |
|
208 |
this.dataForm.get('from').setValue(+this.dataForm.get('from').value + +this.dataForm.get('quantity').value); |
|
209 |
this.handleChange(); |
|
210 |
} |
|
211 |
} |
|
212 |
|
|
213 |
} |
|
0 | 214 |
modules/uoa-repository-dashboard-gui/trunk/src/app/pages/adminPg/adminPg.routing.ts | ||
---|---|---|
1 |
import { NgModule } from '@angular/core'; |
|
2 |
import { RouterModule, Routes } from '@angular/router'; |
|
3 |
|
|
4 |
import { AdminPgComponent } from './adminPg.component'; |
|
5 |
import { AdminPgMetricsComponent } from './adminPg-metrics.component'; |
|
6 |
import { AuthGuardService } from '../../services/auth-guard.service'; |
|
7 |
import {RegistrationComponent} from './adminPg-registrations.component'; |
|
8 |
|
|
9 |
const adminRoutes: Routes = [ |
|
10 |
{ |
|
11 |
path: '', |
|
12 |
component: AdminPgComponent, |
|
13 |
canActivate: [AuthGuardService], |
|
14 |
canLoad: [AuthGuardService], |
|
15 |
children: [ |
|
16 |
{ |
|
17 |
path: 'metrics', |
|
18 |
component: AdminPgMetricsComponent |
|
19 |
}, |
|
20 |
{ |
|
21 |
path: 'registrations', |
|
22 |
component: RegistrationComponent |
|
23 |
} |
|
24 |
] |
|
25 |
} |
|
26 |
]; |
|
27 |
|
|
28 |
@NgModule ({ |
|
29 |
imports: [RouterModule.forChild(adminRoutes)], |
|
30 |
exports: [RouterModule] |
|
31 |
}) |
|
32 |
|
|
33 |
export class AdminPgRouting {} |
|
0 | 34 |
modules/uoa-repository-dashboard-gui/trunk/src/app/pages/adminPg/adminPg-registrations.component.html | ||
---|---|---|
1 |
<div id="page_content"> |
|
2 |
|
|
3 |
<div class="repositoryAdminMenu"> |
|
4 |
|
|
5 |
<div class="uk-margin-medium-left uk-margin-medium-right"> |
|
6 |
<div class="uk-padding-small"> |
|
7 |
<h3 class="heading_b"> |
|
8 |
Registrations Admin |
|
9 |
</h3> |
|
10 |
</div> |
|
11 |
|
|
12 |
<div id="top_bar"> |
|
13 |
<div class="md-top-bar"> |
|
14 |
<div class="uk-width-1-2@l uk-margin-auto"> |
|
15 |
<form [formGroup]="dataForm" (ngSubmit)="handleChangeAndResetPage()" class="uk-search uk-search-default uk-width-1-1@m"> |
|
16 |
<div class="md-input-wrapper"> |
|
17 |
<label for="repository_name_search">Search (official name) ...</label> |
|
18 |
<input class="md-input" type="search" id="repository_name_search" formControlName="officialName"> |
|
19 |
<span class="md-input-bar"></span> |
|
20 |
</div> |
|
21 |
|
|
22 |
</form> |
|
23 |
</div> |
|
24 |
</div> |
|
25 |
</div> |
|
26 |
</div> |
|
27 |
|
|
28 |
</div> |
|
29 |
|
|
30 |
<div id="page_content_inner" class="whiteBackground uk-padding-remove-left uk-padding-remove-right"> |
|
31 |
|
|
32 |
<div class="uk-section uk-background-norepeat uk-background-contain uk-background-bottom-center" |
|
33 |
style="background-image: url('../../../assets/imgs/landing/abstract2.svg'); !important; min-height: calc(80vh);" uk-height-viewport="offset-top: true; offset-bottom: 20;"> |
|
34 |
|
|
35 |
<!-- TOP HELP CONTENT --> |
|
36 |
<help-content #topHelperContent [position]="'top'" |
|
37 |
[ngClass]="topHelperContent.isPresent()?'uk-margin-medium-top uk-margin-medium-bottom':'clear-style'"> |
|
38 |
</help-content> |
|
39 |
|
|
40 |
<div class="uk-grid"> |
|
41 |
|
|
42 |
<!-- LEFT HELP CONTENT --> |
|
43 |
<aside-help-content #leftHelperContent [position]="'left'" |
|
44 |
[ngClass]="leftHelperContent.isPresent()?'tm-sidebar uk-width-1-4@m uk-first-column':'clear-style'"> |
|
45 |
</aside-help-content> |
|
46 |
|
|
47 |
<!-- MIDDLE --> |
|
48 |
<div class="uk-width-expand@m"> |
|
49 |
|
|
50 |
<div *ngIf="errorMessage" class="uk-alert uk-alert-danger">{{ errorMessage }}</div> |
|
51 |
<div *ngIf="successMessage" class="uk-alert uk-alert-success">{{ successMessage }}</div> |
|
52 |
|
|
53 |
<div *ngIf="!errorMessage" class="uk-container"> |
|
54 |
|
|
55 |
<div class=""> |
|
56 |
<div class=""> |
|
57 |
|
|
58 |
<div class="uk-margin-medium uk-margin-top repositoryAdminActions"> |
|
59 |
<form [formGroup]="dataForm" class="uk-form-horizontal uk-grid"> |
|
60 |
|
|
61 |
<div class="uk-inline"> |
|
62 |
<div class="uk-margin"> |
|
63 |
<label class="" for="size">Results per page </label> |
|
64 |
<div class="uk-inline"> |
|
65 |
<select class="uk-select" id="size" (change)="handleChangeAndResetPage()" formControlName="size"> |
|
66 |
<option value="10">10</option> |
|
67 |
<option value="25" selected>25</option> |
|
68 |
<option value="50">50</option> |
|
69 |
<option value="100">100</option> |
|
70 |
</select> |
|
71 |
</div> |
|
72 |
</div> |
|
73 |
</div> |
|
74 |
|
|
75 |
<div class="uk-inline"> |
|
76 |
|
|
77 |
<div class="uk-inline uk-margin-right"> |
|
78 |
<label class="" for="orderBy">Order by </label> |
|
79 |
<div class="uk-inline"> |
|
80 |
<select class="uk-select" id="orderBy" (change)="handleChangeAndResetPage()" formControlName="order"> |
|
81 |
<option value="DESCENDING" selected>Descending</option> |
|
82 |
<option value="ASCENDING">Ascending</option> |
|
83 |
</select> |
|
84 |
</div> |
|
85 |
</div> |
|
86 |
|
|
87 |
<div class="uk-inline"> |
|
88 |
<label class="" for="sortBy">Sort by </label> |
|
89 |
<div class="uk-inline"> |
|
90 |
<select class="uk-select" id="sortBy" (change)="handleChangeAndResetPage()" formControlName="requestSortBy"> |
|
91 |
<option value="registrationdate" selected>Date</option> |
|
92 |
<option value="officialname">Name</option> |
|
93 |
</select> |
|
94 |
</div> |
|
95 |
</div> |
|
96 |
|
|
97 |
</div> |
|
98 |
|
|
99 |
|
|
100 |
</form> |
|
101 |
</div> |
|
102 |
|
|
103 |
<div class="uk-width-1-1@m"> |
|
104 |
|
|
105 |
<ul class="uk-pagination uk-flex-right" uk-margin> |
|
106 |
<li><a (click)="previousPage()" class="pagination_arrow"><span uk-pagination-previous></span></a></li> |
|
107 |
<li class="uk-active"><span>{{+dataForm.get('page').value + 1}}</span></li> |
|
108 |
<li><a (click)="nextPage()" class="pagination_arrow"><span uk-pagination-next></span></a></li> |
|
109 |
</ul> |
|
110 |
|
|
111 |
<hr class="adminResultsHeader"> |
|
112 |
|
|
113 |
<div *ngIf="loadingMessage" class="loading-big"> |
|
114 |
<div class="loader-big" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;"> |
|
115 |
{{ loadingMessage }} |
|
116 |
|
|
117 |
</div> |
|
118 |
<div class="transparentFilm"></div> |
|
119 |
</div> |
|
120 |
|
|
121 |
<!-- REPOSITORY CARD --> |
|
122 |
<div *ngFor="let res of repositorySnippet" class="md-card repositoryCard"> |
|
123 |
<div class="md-card-content large-padding"> |
|
124 |
<div class="uk-text-meta">{{res.typology.split('::')[0]}} {{res.typology.split('::')[1]}} {{res.typology.split('::')[2]}}</div> |
|
125 |
<div class="repositoryCardHeader uk-margin-bottom uk-margin-small-top"><a [routerLink]="['/repositoryAdmin/' + res.id]">{{res.officialname}}</a></div> |
|
126 |
<div class="uk-margin-small-bottom"><span class="uk-badge uk-badge-primary uk-badge-notification uk-margin-small-right">ID</span>{{res.id}}</div> |
|
127 |
<div class="uk-margin-small-bottom"><span class="uk-badge uk-badge-primary uk-badge-notification uk-margin-small-right">RM</span>{{res.registeredby}}</div> |
|
128 |
<div class="uk-margin-small-bottom"><span class="mute-title">Date: </span><span class="small-content">{{res.registrationdate}}</span></div> |
|
129 |
<div><span class="mute-title">Organization: </span><span *ngFor="let organization of res.organizations; let i=index" class="small-content"><span *ngIf="i>0">, </span>{{organization.legalname + ' (' + getCountryName(organization.country) + ')'}}</span></div> |
|
130 |
</div> |
|
131 |
</div> |
|
132 |
|
|
133 |
<ul class="uk-pagination uk-margin-top uk-flex-right" uk-margin> |
|
134 |
<li><a (click)="previousPage()" class="pagination_arrow"><span uk-pagination-previous></span></a></li> |
|
135 |
<li class="uk-active"><span>{{+dataForm.get('page').value + 1}}</span></li> |
|
136 |
<li><a (click)="nextPage()" class="pagination_arrow"><span uk-pagination-next></span></a></li> |
|
137 |
</ul> |
|
138 |
|
|
139 |
</div> |
|
140 |
|
|
141 |
</div> |
|
142 |
</div> |
|
143 |
</div> |
|
144 |
|
|
145 |
</div> |
|
146 |
|
|
147 |
<!-- RIGHT HELP CONTENT --> |
|
148 |
<aside-help-content #rightHelperContent [position]="'right'" |
|
149 |
[ngClass]="rightHelperContent.isPresent()?'tm-sidebar uk-width-1-4@m uk-first-column':'clear-style'"> |
|
150 |
</aside-help-content> |
|
151 |
|
|
152 |
</div> |
|
153 |
|
|
154 |
<!-- BOTTOM HELP CONTENT --> |
|
155 |
<help-content #bottomHelperContent [position]="'bottom'" |
|
156 |
[ngClass]="bottomHelperContent.isPresent()?'uk-margin-medium-top uk-margin-medium-bottom':'clear-style'"> |
|
157 |
</help-content> |
|
158 |
</div> |
|
159 |
|
|
160 |
</div> |
|
161 |
</div> |
|
162 |
|
|
163 |
<div class="filter-overlay-toolbar uk-animation-scale-up ng-star-inserted"> |
|
164 |
<button class="uk-button filter-overlay-button" type="button" uk-toggle="target: #offcanvas-overlay"> |
|
165 |
<span class=""><i class="fas fa-filter"></i></span> |
|
166 |
</button> |
|
167 |
</div> |
|
168 |
|
|
169 |
<div class="offcanvas-filters" id="offcanvas-overlay" uk-offcanvas="overlay: true"> |
|
170 |
<div class="uk-offcanvas-bar uk-light"> |
|
171 |
|
|
172 |
<button class="uk-offcanvas-close" type="button" uk-close></button> |
|
173 |
|
|
174 |
|
|
175 |
<h4>Filters</h4> |
|
176 |
|
|
177 |
<form [formGroup]="dataForm" class="uk-form-stacked"> |
|
178 |
|
|
179 |
<div class="uk-margin"> |
|
180 |
<h5 class="">Datasource Type</h5> |
|
181 |
<div class="uk-form-controls"> |
|
182 |
<div class="uk-margin-small-bottom"><label><input class="uk-radio" type="radio" value="" (change)="handleChangeAndResetPage()" formControlName="typology"> Any</label></div> |
|
183 |
<div class="uk-margin-small-bottom"><label><input class="uk-radio" type="radio" value="Aggregator" (change)="handleChangeAndResetPage()" formControlName="typology"> Aggregator</label></div> |
|
184 |
<div class="uk-margin-small-bottom"><label><input class="uk-radio" type="radio" value="Journal" (change)="handleChangeAndResetPage()" formControlName="typology"> Journal</label></div> |
|
185 |
<div class="uk-margin-small-bottom"><label><input class="uk-radio" type="radio" value="datarepository" (change)="handleChangeAndResetPage()" formControlName="typology"> Data Repository</label></div> |
|
186 |
<div class="uk-margin-small-bottom"><label><input class="uk-radio" type="radio" value="pubsrepository" (change)="handleChangeAndResetPage()" formControlName="typology"> Public Repository</label></div> |
|
187 |
<div class="uk-margin-small-bottom"><label><input class="uk-radio" type="radio" value="entityregistry" (change)="handleChangeAndResetPage()" formControlName="typology"> Entity Registry</label></div> |
|
188 |
<div class="uk-margin-small-bottom"><label><input class="uk-radio" type="radio" value="Institutional" (change)="handleChangeAndResetPage()" formControlName="typology"> Institutional</label></div> |
|
189 |
<div class="uk-margin-small-bottom"><label><input class="uk-radio" type="radio" value="Thematic" (change)="handleChangeAndResetPage()" formControlName="typology"> Thematic</label></div> |
|
190 |
<div class="uk-margin-small-bottom"><label><input class="uk-radio" type="radio" value="Products" (change)="handleChangeAndResetPage()" formControlName="typology"> Products</label></div> |
|
191 |
<div class="uk-margin-small-bottom"><label><input class="uk-radio" type="radio" value="Unknown" (change)="handleChangeAndResetPage()" formControlName="typology"> Unknown</label></div> |
|
192 |
</div> |
|
193 |
</div> |
|
194 |
|
|
195 |
<hr> |
|
196 |
|
|
197 |
<div class="uk-margin"> |
|
198 |
<h5 class="">Countries</h5> |
|
199 |
<div class="uk-form-controls"> |
|
200 |
<ng-container *ngIf="countries && countries.length>0"> |
|
201 |
<read-more [maxHeight]="238"> |
|
202 |
<div class="uk-margin-small-bottom"><input class="uk-radio" type="radio" value="" (change)="handleChangeAndResetPage()" formControlName="country"> Any</div> |
|
203 |
<ng-container *ngFor="let country of countries"> |
|
204 |
<div class="uk-margin-small-bottom"> |
|
205 |
<input class="uk-radio" type="radio" value="{{country.code}}" |
|
206 |
(change)="handleChangeAndResetPage()" formControlName="country"> {{country.name}} |
|
207 |
</div> |
|
208 |
</ng-container> |
|
209 |
</read-more> |
|
210 |
</ng-container> |
|
211 |
</div> |
|
212 |
</div> |
|
213 |
|
|
214 |
</form> |
|
215 |
|
|
216 |
</div> |
|
217 |
</div> |
|
218 |
|
modules/uoa-repository-dashboard-gui/trunk/src/app/pages/join/join.component.html | ||
---|---|---|
1 |
<div id="page_content"> |
|
2 |
<div id="page_content_inner" class="whiteBackground uk-padding-remove-left uk-padding-remove-right"> |
|
3 |
|
|
4 |
<div *ngIf="loadingMessage" class="loading-big"> |
|
5 |
<div class="loader-big" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;">{{ loadingMessage }}</div> |
|
6 |
<div class="transparentFilm"></div> |
|
7 |
</div> |
|
8 |
|
|
9 |
<div *ngIf="!loadingMessage" class="uk-margin-top"> |
|
10 |
<div class="uk-section"> |
|
11 |
<div class="uk-margin-large-left uk-margin-large-right"> |
|
12 |
<h3 class="heading_b" style="font-weight: 500">You have not yet registered any repositories</h3> |
|
13 |
|
|
14 |
<div class="uk-grid uk-child-width-1-3@l uk-child-width-1-2@m uk-child-width-1-1@s uk-grid-match"> |
|
15 |
|
|
16 |
<div class=""> |
|
17 |
<div class="md-card md-card-hover"> |
|
18 |
<a [routerLink]="['/sources/register']"> |
|
19 |
<div class="md-card-content large-padding" style="min-height: 150px;"> |
|
20 |
<div class=""> |
|
21 |
<strong>Register</strong> |
|
22 |
</div> |
|
23 |
<p>Register data sources in the OpenAIRE infrastructure.</p> |
|
24 |
</div> |
Also available in: Unified diff
making new-ui branch the new trunk