Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
B
BioStudyUISub
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Nestor Diaz
BioStudyUISub
Commits
60a6e73a
Unverified
Commit
60a6e73a
authored
Sep 28, 2020
by
Nestor Diaz
Committed by
GitHub
Sep 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade to Angular 10 (#401)
- Upgrade to Angular 10
parent
55eb8bd8
Pipeline
#100173
passed with stages
in 21 minutes and 19 seconds
Changes
152
Pipelines
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
152 changed files
with
4259 additions
and
4108 deletions
+4259
-4108
.browserslistrc
.browserslistrc
+0
-0
README.md
README.md
+1
-1
angular.json
angular.json
+6
-4
package-lock.json
package-lock.json
+1352
-1087
package.json
package.json
+26
-22
src/app/app.component.ts
src/app/app.component.ts
+9
-4
src/app/app.config.ts
src/app/app.config.ts
+9
-9
src/app/auth-guard.service.ts
src/app/auth-guard.service.ts
+2
-3
src/app/auth/activate/activation-link-req.component.ts
src/app/auth/activate/activation-link-req.component.ts
+6
-6
src/app/auth/auth.module.ts
src/app/auth/auth.module.ts
+3
-1
src/app/auth/password-reset/password-reset-req.component.ts
src/app/auth/password-reset/password-reset-req.component.ts
+5
-5
src/app/auth/password-reset/password-reset.component.ts
src/app/auth/password-reset/password-reset.component.ts
+5
-5
src/app/auth/shared/auth.service.ts
src/app/auth/shared/auth.service.ts
+2
-2
src/app/auth/shared/model/data-base.ts
src/app/auth/shared/model/data-base.ts
+4
-4
src/app/auth/shared/model/email-req-data.ts
src/app/auth/shared/model/email-req-data.ts
+1
-1
src/app/auth/shared/model/password-reset-data.ts
src/app/auth/shared/model/password-reset-data.ts
+1
-1
src/app/auth/shared/model/registration-data.ts
src/app/auth/shared/model/registration-data.ts
+4
-4
src/app/auth/shared/user-cookies.ts
src/app/auth/shared/user-cookies.ts
+30
-21
src/app/auth/shared/user-data.spec.ts
src/app/auth/shared/user-data.spec.ts
+9
-8
src/app/auth/shared/user-data.ts
src/app/auth/shared/user-data.ts
+1
-1
src/app/auth/shared/user-session.ts
src/app/auth/shared/user-session.ts
+10
-18
src/app/auth/signin/signin.component.ts
src/app/auth/signin/signin.component.ts
+8
-8
src/app/auth/signup/signup.component.ts
src/app/auth/signup/signup.component.ts
+6
-6
src/app/core/interceptors/auth-interceptor.service.ts
src/app/core/interceptors/auth-interceptor.service.ts
+4
-3
src/app/core/interceptors/request-status-interceptor.service.ts
...p/core/interceptors/request-status-interceptor.service.ts
+17
-25
src/app/core/logger/log-entry.ts
src/app/core/logger/log-entry.ts
+16
-3
src/app/core/logger/log.service.ts
src/app/core/logger/log.service.ts
+6
-6
src/app/core/logger/publishers/log-webapi.ts
src/app/core/logger/publishers/log-webapi.ts
+2
-2
src/app/global-error.handler.ts
src/app/global-error.handler.ts
+3
-3
src/app/pages/file/file-list/ag-grid/file-actions-cell.component.ts
...ges/file/file-list/ag-grid/file-actions-cell.component.ts
+10
-4
src/app/pages/file/file-list/ag-grid/file-type-cell.component.ts
.../pages/file/file-list/ag-grid/file-type-cell.component.ts
+1
-1
src/app/pages/file/file-list/ag-grid/upload-progress-cell.component.ts
.../file/file-list/ag-grid/upload-progress-cell.component.ts
+1
-1
src/app/pages/file/file-list/directory-path/directory-path.component.ts
...file/file-list/directory-path/directory-path.component.ts
+3
-3
src/app/pages/file/file-list/directory-sidebar/directory-sidebar.component.ts
...ile-list/directory-sidebar/directory-sidebar.component.ts
+11
-14
src/app/pages/file/file-list/file-list.component.html
src/app/pages/file/file-list/file-list.component.html
+5
-5
src/app/pages/file/file-list/file-list.component.ts
src/app/pages/file/file-list/file-list.component.ts
+29
-22
src/app/pages/file/file-select/file-select.component.html
src/app/pages/file/file-select/file-select.component.html
+2
-2
src/app/pages/file/file-select/file-select.component.ts
src/app/pages/file/file-select/file-select.component.ts
+8
-8
src/app/pages/file/file-select/file-tree-dropdown.component.html
.../pages/file/file-select/file-tree-dropdown.component.html
+1
-1
src/app/pages/file/file-select/file-tree-dropdown.component.ts
...pp/pages/file/file-select/file-tree-dropdown.component.ts
+8
-8
src/app/pages/file/file-select/file-tree.component.html
src/app/pages/file/file-select/file-tree.component.html
+1
-1
src/app/pages/file/file-select/file-tree.component.ts
src/app/pages/file/file-select/file-tree.component.ts
+18
-18
src/app/pages/file/file-select/file-tree.store.ts
src/app/pages/file/file-select/file-tree.store.ts
+1
-1
src/app/pages/file/shared/file-upload-list.service.ts
src/app/pages/file/shared/file-upload-list.service.ts
+8
-5
src/app/pages/file/shared/http-upload-client.service.ts
src/app/pages/file/shared/http-upload-client.service.ts
+2
-2
src/app/pages/file/shared/path.ts
src/app/pages/file/shared/path.ts
+2
-2
src/app/pages/file/upload-file-button/upload-file-button.directive.ts
...s/file/upload-file-button/upload-file-button.directive.ts
+6
-6
src/app/pages/file/upload-file-button/upload-file-modal.component.ts
...es/file/upload-file-button/upload-file-modal.component.ts
+5
-5
src/app/pages/submission/id-link/id-link.component.ts
src/app/pages/submission/id-link/id-link.component.ts
+30
-32
src/app/pages/submission/id-link/id-link.model.ts
src/app/pages/submission/id-link/id-link.model.ts
+15
-15
src/app/pages/submission/id-link/id-link.service.spec.ts
src/app/pages/submission/id-link/id-link.service.spec.ts
+4
-4
src/app/pages/submission/id-link/id-link.service.ts
src/app/pages/submission/id-link/id-link.service.ts
+9
-10
src/app/pages/submission/id-link/id-link.validator.directive.ts
...p/pages/submission/id-link/id-link.validator.directive.ts
+2
-1
src/app/pages/submission/id-link/id-link.validator.ts
src/app/pages/submission/id-link/id-link.validator.ts
+4
-4
src/app/pages/submission/pubmedid-search/pubmedid-search.component.ts
...s/submission/pubmedid-search/pubmedid-search.component.ts
+14
-13
src/app/pages/submission/submission-direct/direct-submit-file.component.ts
...mission/submission-direct/direct-submit-file.component.ts
+2
-2
src/app/pages/submission/submission-direct/direct-submit-sidebar.component.html
...on/submission-direct/direct-submit-sidebar.component.html
+2
-2
src/app/pages/submission/submission-direct/direct-submit-sidebar.component.ts
...sion/submission-direct/direct-submit-sidebar.component.ts
+44
-36
src/app/pages/submission/submission-direct/direct-submit.component.ts
...s/submission/submission-direct/direct-submit.component.ts
+19
-27
src/app/pages/submission/submission-direct/direct-submit.service.ts
...ges/submission/submission-direct/direct-submit.service.ts
+57
-57
src/app/pages/submission/submission-edit/shared/control-reference.ts
...es/submission/submission-edit/shared/control-reference.ts
+6
-6
src/app/pages/submission/submission-edit/shared/form-validators.ts
...ages/submission/submission-edit/shared/form-validators.ts
+22
-21
src/app/pages/submission/submission-edit/shared/model/column-control.model.ts
...sion/submission-edit/shared/model/column-control.model.ts
+2
-2
src/app/pages/submission/submission-edit/shared/model/feature-form.model.ts
...ission/submission-edit/shared/model/feature-form.model.ts
+26
-18
src/app/pages/submission/submission-edit/shared/model/form-base.model.ts
...ubmission/submission-edit/shared/model/form-base.model.ts
+4
-4
src/app/pages/submission/submission-edit/shared/model/row-form.model.ts
...submission/submission-edit/shared/model/row-form.model.ts
+4
-4
src/app/pages/submission/submission-edit/shared/model/section-form.model.ts
...ission/submission-edit/shared/model/section-form.model.ts
+19
-14
src/app/pages/submission/submission-edit/shared/subm-edit.service.ts
...es/submission/submission-edit/shared/subm-edit.service.ts
+44
-40
src/app/pages/submission/submission-edit/shared/unique.directive.ts
...ges/submission/submission-edit/shared/unique.directive.ts
+4
-3
src/app/pages/submission/submission-edit/shared/utilis.ts
src/app/pages/submission/submission-edit/shared/utilis.ts
+3
-3
src/app/pages/submission/submission-edit/subm-form-input/input-value.component.ts
.../submission-edit/subm-form-input/input-value.component.ts
+14
-14
src/app/pages/submission/submission-edit/subm-form/feature/feature-grid.component.html
...ission-edit/subm-form/feature/feature-grid.component.html
+1
-1
src/app/pages/submission/submission-edit/subm-form/feature/feature-grid.component.ts
...bmission-edit/subm-form/feature/feature-grid.component.ts
+24
-19
src/app/pages/submission/submission-edit/subm-form/feature/feature-list.component.html
...ission-edit/subm-form/feature/feature-list.component.html
+1
-1
src/app/pages/submission/submission-edit/subm-form/feature/feature-list.component.ts
...bmission-edit/subm-form/feature/feature-list.component.ts
+6
-6
src/app/pages/submission/submission-edit/subm-form/feature/subm-feature.component.html
...ission-edit/subm-form/feature/subm-feature.component.html
+9
-11
src/app/pages/submission/submission-edit/subm-form/feature/subm-feature.component.ts
...bmission-edit/subm-form/feature/subm-feature.component.ts
+13
-13
src/app/pages/submission/submission-edit/subm-form/field/subm-field.component.ts
...n/submission-edit/subm-form/field/subm-field.component.ts
+12
-12
src/app/pages/submission/submission-edit/subm-form/inline-edit/inline-edit.component.ts
...ssion-edit/subm-form/inline-edit/inline-edit.component.ts
+15
-14
src/app/pages/submission/submission-edit/subm-form/native-element-attach.directive.ts
...mission-edit/subm-form/native-element-attach.directive.ts
+3
-3
src/app/pages/submission/submission-edit/subm-navbar/subm-navbar.component.ts
...sion/submission-edit/subm-navbar/subm-navbar.component.ts
+2
-2
src/app/pages/submission/submission-edit/subm-sidebar/add-subm-type-modal/add-subm-type-modal.component.ts
...ebar/add-subm-type-modal/add-subm-type-modal.component.ts
+12
-12
src/app/pages/submission/submission-edit/subm-sidebar/subm-check-sidebar/subm-check-sidebar.component.ts
...idebar/subm-check-sidebar/subm-check-sidebar.component.ts
+5
-5
src/app/pages/submission/submission-edit/subm-sidebar/subm-edit-sidebar/subm-edit-sidebar.component.ts
...-sidebar/subm-edit-sidebar/subm-edit-sidebar.component.ts
+9
-9
src/app/pages/submission/submission-edit/subm-sidebar/subm-sidebar.component.ts
...on/submission-edit/subm-sidebar/subm-sidebar.component.ts
+3
-3
src/app/pages/submission/submission-edit/submission-edit.component.ts
...s/submission/submission-edit/submission-edit.component.ts
+10
-10
src/app/pages/submission/submission-list/ag-grid/action-buttons-cell.component.ts
.../submission-list/ag-grid/action-buttons-cell.component.ts
+20
-19
src/app/pages/submission/submission-list/ag-grid/date-cell.component.ts
...submission/submission-list/ag-grid/date-cell.component.ts
+4
-4
src/app/pages/submission/submission-list/ag-grid/date-filter.component.ts
...bmission/submission-list/ag-grid/date-filter.component.ts
+5
-5
src/app/pages/submission/submission-list/ag-grid/text-filter.component.ts
...bmission/submission-list/ag-grid/text-filter.component.ts
+1
-1
src/app/pages/submission/submission-list/subm-list.component.html
...pages/submission/submission-list/subm-list.component.html
+3
-3
src/app/pages/submission/submission-list/subm-list.component.ts
...p/pages/submission/submission-list/subm-list.component.ts
+10
-10
src/app/pages/submission/submission-other/new-submission-button/add-subm-modal.component.ts
...n-other/new-submission-button/add-subm-modal.component.ts
+2
-2
src/app/pages/submission/submission-other/new-submission-button/new-submission-button.directive.ts
.../new-submission-button/new-submission-button.directive.ts
+7
-7
src/app/pages/submission/submission-results/results-log-node.component.ts
...bmission/submission-results/results-log-node.component.ts
+8
-8
src/app/pages/submission/submission-results/subm-results-modal.component.ts
...ission/submission-results/subm-results-modal.component.ts
+4
-4
src/app/pages/submission/submission-results/tree-view.component.ts
...ages/submission/submission-results/tree-view.component.ts
+4
-4
src/app/pages/submission/submission-shared/model/pagetab/pagetab-attributes.utils.ts
...bmission-shared/model/pagetab/pagetab-attributes.utils.ts
+1
-1
src/app/pages/submission/submission-shared/model/pagetab/pagetab-authors.utils.ts
.../submission-shared/model/pagetab/pagetab-authors.utils.ts
+31
-23
src/app/pages/submission/submission-shared/model/pagetab/pagetab-links.utils.ts
...on/submission-shared/model/pagetab/pagetab-links.utils.ts
+5
-5
src/app/pages/submission/submission-shared/model/pagetab/pagetab-protocols.utils.ts
...ubmission-shared/model/pagetab/pagetab-protocols.utils.ts
+12
-12
src/app/pages/submission/submission-shared/model/pagetab/pagetab.model.ts
...bmission/submission-shared/model/pagetab/pagetab.model.ts
+10
-10
src/app/pages/submission/submission-shared/model/submission/submission.model.attribute.ts
...ion-shared/model/submission/submission.model.attribute.ts
+4
-4
src/app/pages/submission/submission-shared/model/submission/submission.model.feature.spec.ts
...-shared/model/submission/submission.model.feature.spec.ts
+5
-13
src/app/pages/submission/submission-shared/model/submission/submission.model.ts
...on/submission-shared/model/submission/submission.model.ts
+70
-67
src/app/pages/submission/submission-shared/model/submission/submission.model.valuemap.spec.ts
...shared/model/submission/submission.model.valuemap.spec.ts
+3
-3
src/app/pages/submission/submission-shared/model/submission/submission.model.valuemap.ts
...sion-shared/model/submission/submission.model.valuemap.ts
+4
-4
src/app/pages/submission/submission-shared/model/submission/submission.validator.ts
...ubmission-shared/model/submission/submission.validator.ts
+18
-17
src/app/pages/submission/submission-shared/model/templates/arrayexpress.template.ts
...ubmission-shared/model/templates/arrayexpress.template.ts
+53
-52
src/app/pages/submission/submission-shared/model/templates/bia.template.ts
...mission/submission-shared/model/templates/bia.template.ts
+291
-291
src/app/pages/submission/submission-shared/model/templates/default.template.ts
...ion/submission-shared/model/templates/default.template.ts
+278
-276
src/app/pages/submission/submission-shared/model/templates/empty.template.ts
...ssion/submission-shared/model/templates/empty.template.ts
+5
-5
src/app/pages/submission/submission-shared/model/templates/eutoxrisk.template.ts
...n/submission-shared/model/templates/eutoxrisk.template.ts
+304
-305
src/app/pages/submission/submission-shared/model/templates/hecatos.template.ts
...ion/submission-shared/model/templates/hecatos.template.ts
+335
-331
src/app/pages/submission/submission-shared/model/templates/proteindesigns.template.ts
...mission-shared/model/templates/proteindesigns.template.ts
+249
-254
src/app/pages/submission/submission-shared/model/templates/readonly.template.ts
...on/submission-shared/model/templates/readonly.template.ts
+6
-6
src/app/pages/submission/submission-shared/model/templates/submission-type.model.ts
...ubmission-shared/model/templates/submission-type.model.ts
+39
-26
src/app/pages/submission/submission-shared/pagetab-to-submission.service.spec.ts
...n/submission-shared/pagetab-to-submission.service.spec.ts
+1
-1
src/app/pages/submission/submission-shared/pagetab-to-submission.service.ts
...ission/submission-shared/pagetab-to-submission.service.ts
+23
-23
src/app/pages/submission/submission-shared/submission-status.service.ts
...submission/submission-shared/submission-status.service.ts
+1
-1
src/app/pages/submission/submission-shared/submission-to-pagetab.service.spec.ts
...n/submission-shared/submission-to-pagetab.service.spec.ts
+8
-8
src/app/pages/submission/submission-shared/submission-to-pagetab.service.ts
...ission/submission-shared/submission-to-pagetab.service.ts
+30
-22
src/app/pages/submission/submission-shared/submission.service.ts
.../pages/submission/submission-shared/submission.service.ts
+3
-3
src/app/shared/confirm-dialog.component.ts
src/app/shared/confirm-dialog.component.ts
+2
-3
src/app/shared/date-input.component.ts
src/app/shared/date-input.component.ts
+29
-24
src/app/shared/dna-input.component.ts
src/app/shared/dna-input.component.ts
+2
-2
src/app/shared/file-upload-button.component.css
src/app/shared/file-upload-button.component.css
+3
-0
src/app/shared/file-upload-button.component.html
src/app/shared/file-upload-button.component.html
+5
-0
src/app/shared/file-upload-button.component.ts
src/app/shared/file-upload-button.component.ts
+12
-29
src/app/shared/modal.service.ts
src/app/shared/modal.service.ts
+4
-4
src/app/shared/multi-select.component.ts
src/app/shared/multi-select.component.ts
+0
-191
src/app/shared/orcid-input-box.component.ts
src/app/shared/orcid-input-box.component.ts
+19
-18
src/app/shared/plural.pipe.ts
src/app/shared/plural.pipe.ts
+1
-1
src/app/shared/protein-input.component.ts
src/app/shared/protein-input.component.ts
+2
-2
src/app/shared/server-error.handler.ts
src/app/shared/server-error.handler.ts
+3
-3
src/app/shared/shared.module.ts
src/app/shared/shared.module.ts
+0
-5
src/app/shared/validate-onblur.directive.ts
src/app/shared/validate-onblur.directive.ts
+8
-4
src/app/theme/components/error-toast/error-toast.component.ts
...app/theme/components/error-toast/error-toast.component.ts
+5
-5
src/app/theme/components/header/header.component.html
src/app/theme/components/header/header.component.html
+4
-4
src/app/theme/components/header/header.component.ts
src/app/theme/components/header/header.component.ts
+4
-4
src/app/utils/array.utils.ts
src/app/utils/array.utils.ts
+2
-2
src/app/utils/date.utils.ts
src/app/utils/date.utils.ts
+5
-5
src/app/utils/orcid.utils.ts
src/app/utils/orcid.utils.ts
+1
-1
src/app/utils/scroll.utils.ts
src/app/utils/scroll.utils.ts
+3
-3
src/polyfills.ts
src/polyfills.ts
+2
-2
src/tsconfig.spec.json
src/tsconfig.spec.json
+0
-21
src/types.d.ts
src/types.d.ts
+7
-0
tsconfig.app.json
tsconfig.app.json
+15
-0
tsconfig.base.json
tsconfig.base.json
+26
-0
tsconfig.json
tsconfig.json
+15
-27
tsconfig.spec.json
tsconfig.spec.json
+8
-6
tslint.json
tslint.json
+70
-87
No files found.
browserslist
→
.browserslistrc
View file @
60a6e73a
File moved
README.md
View file @
60a6e73a
# BioStudies - Submission Tool
-
Angular v
9
-
Angular v
10
-
ExpressJS v4
-
Node v10.16.2
...
...
angular.json
View file @
60a6e73a
...
...
@@ -7,6 +7,7 @@
"root"
:
""
,
"sourceRoot"
:
"src"
,
"projectType"
:
"application"
,
"prefix"
:
"st"
,
"architect"
:
{
"build"
:
{
"builder"
:
"@angular-devkit/build-angular:browser"
,
...
...
@@ -15,7 +16,7 @@
"outputPath"
:
".build"
,
"index"
:
"src/index.html"
,
"main"
:
"src/main.ts"
,
"tsConfig"
:
"
src/
tsconfig.app.json"
,
"tsConfig"
:
"tsconfig.app.json"
,
"polyfills"
:
"src/polyfills.ts"
,
"assets"
:
[
"src/images"
,
...
...
@@ -81,10 +82,11 @@
"builder"
:
"@angular-devkit/build-angular:tslint"
,
"options"
:
{
"tsConfig"
:
[
"src/tsconfig.app.json"
,
"src/tsconfig.spec.json"
"tsconfig.app.json"
],
"exclude"
:
[]
"exclude"
:
[
"**/node_modules/**"
]
}
}
}
...
...
package-lock.json
View file @
60a6e73a
This diff is collapsed.
Click to expand it.
package.json
View file @
60a6e73a
...
...
@@ -16,6 +16,7 @@
"node:prod"
:
"cross-env NODE_ENV=production node ."
,
"start:dev"
:
"run-p node:dev ng:start"
,
"pretest"
:
"npm run lint"
,
"postinstall"
:
"ngcc"
,
"test"
:
"jest --ci"
},
"jest"
:
{
...
...
@@ -49,14 +50,14 @@
]
},
"dependencies"
:
{
"
@angular/animations
"
:
"
9.1
.12
"
,
"
@angular/common
"
:
"
9.1
.12
"
,
"
@angular/compiler
"
:
"
9.1
.12
"
,
"
@angular/core
"
:
"
9.1
.12
"
,
"
@angular/forms
"
:
"
9.1
.12
"
,
"
@angular/platform-browser
"
:
"
9.1
.12
"
,
"
@angular/platform-browser-dynamic
"
:
"
9.1
.12
"
,
"
@angular/router
"
:
"
9.1
.12
"
,
"
@angular/animations
"
:
"
10.0
.12
"
,
"
@angular/common
"
:
"
10.0
.12
"
,
"
@angular/compiler
"
:
"
10.0
.12
"
,
"
@angular/core
"
:
"
10.0
.12
"
,
"
@angular/forms
"
:
"
10.0
.12
"
,
"
@angular/platform-browser
"
:
"
10.0
.12
"
,
"
@angular/platform-browser-dynamic
"
:
"
10.0
.12
"
,
"
@angular/router
"
:
"
10.0
.12
"
,
"
@biostudies/ckeditor5-build-balloon
"
:
"
19.0.0
"
,
"
@ckeditor/ckeditor5-angular
"
:
"
1.2.3
"
,
"
@ckeditor/ckeditor5-clipboard
"
:
"
19.0.1
"
,
...
...
@@ -64,25 +65,26 @@
"
@rxweb/reactive-form-validators
"
:
"
2.0.0
"
,
"
ag-grid-angular
"
:
"
23.2.1
"
,
"
ag-grid-community
"
:
"
23.2.1
"
,
"
fp-ts
"
:
"
1.
9.0
"
,
"
fp-ts
"
:
"
1.
19.5
"
,
"
helmet
"
:
"
3.21.1
"
,
"
http-status-codes
"
:
"
1.3.2
"
,
"
lodash
"
:
"
4.17.20
"
,
"
lodash.debounce
"
:
"
4.0.8
"
,
"
lodash.isempty
"
:
"
4.4.0
"
,
"
ng-recaptcha
"
:
"
5.0.0
"
,
"
ng2-cookies
"
:
"
1.0.12
"
,
"
ngx-bootstrap
"
:
"
5.6.1
"
,
"
ngx-cookie-service
"
:
"
10.0.1
"
,
"
ngx-markdown
"
:
"
9.1.1
"
,
"
ngx-sortablejs
"
:
"
3.1.4
"
,
"
pluralize
"
:
"
8.0.0
"
,
"
rxjs
"
:
"
6.6.2
"
,
"
sortablejs
"
:
"
1.10.2
"
,
"
tslib
"
:
"
1.1
0.0
"
,
"
zone.js
"
:
"
0.10.
2
"
"
tslib
"
:
"
2.
0.0
"
,
"
zone.js
"
:
"
0.10.
3
"
},
"devDependencies"
:
{
"
@angular-devkit/build-angular
"
:
"
~0.901.12
"
,
"
@angular/cli
"
:
"
9.1.12
"
,
"
@angular/compiler-cli
"
:
"
9.1
.12
"
,
"
@angular-devkit/build-angular
"
:
"
0.1000.7
"
,
"
@angular/cli
"
:
"
10.0.7
"
,
"
@angular/compiler-cli
"
:
"
10.0
.12
"
,
"
@testing-library/angular
"
:
"
10.0.2
"
,
"
@testing-library/jest-dom
"
:
"
5.11.4
"
,
"
@types/amqplib
"
:
"
0.5.13
"
,
...
...
@@ -95,12 +97,12 @@
"
@types/jest
"
:
"
26.0.10
"
,
"
@types/jsdom
"
:
"
16.2.3
"
,
"
@types/node
"
:
"
14.6.0
"
,
"
@types/pluralize
"
:
"
0.0.2
8
"
,
"
@types/pluralize
"
:
"
0.0.2
9
"
,
"
@types/request
"
:
"
2.48.5
"
,
"
@types/sortablejs
"
:
"
1.10.4
"
,
"
amqplib
"
:
"
0.5.6
"
,
"
body-parser
"
:
"
1.19.0
"
,
"
codelyzer
"
:
"
5.1.2
"
,
"
codelyzer
"
:
"
6.0.0
"
,
"
compression
"
:
"
1.7.4
"
,
"
config
"
:
"
3.1.0
"
,
"
cross-env
"
:
"
5.2.1
"
,
...
...
@@ -116,12 +118,14 @@
"
jest-preset-angular
"
:
"
8.3.1
"
,
"
nodemon
"
:
"
1.19.1
"
,
"
npm-run-all
"
:
"
4.1.5
"
,
"
pr
otractor
"
:
"
6.0.0
"
,
"
rxjs-tslint-rules
"
:
"
4.23.1
"
,
"
pr
ettier
"
:
"
^2.1.1
"
,
"
protractor
"
:
"
7.0.0
"
,
"
ts-node
"
:
"
2.0.0
"
,
"
ts-node-dev
"
:
"
1.0.0-pre.50
"
,
"
tslint
"
:
"
5.11.0
"
,
"
typescript
"
:
"
3.8.3
"
,
"
tslint
"
:
"
6.1.0
"
,
"
tslint-config-prettier
"
:
"
1.18.0
"
,
"
tslint-plugin-prettier
"
:
"
2.3.0
"
,
"
typescript
"
:
"
3.9.7
"
,
"
winston
"
:
"
3.3.3
"
}
}
src/app/app.component.ts
View file @
60a6e73a
...
...
@@ -19,17 +19,22 @@ export class AppComponent implements OnInit {
setTheme
(
'
bs3
'
);
}
ngOnInit
()
{
ngOnInit
()
:
void
{
const
bannerEl
=
document
.
createElement
(
'
script
'
);
// Loads the GDPR bottom panel logic.
// NOTE: The banner should be called with 'other' to indicate a framework different from EBI's is in use.
// NOTE: ebiFrameworkRunDataProtectionBanner is defined after the script loads.
bannerEl
.
src
=
this
.
appConfig
.
bannerUrl
;
bannerEl
.
onload
=
function
()
{
window
[
'
ebiFrameworkRunDataProtectionBanner
'
](
'
other
'
);
bannerEl
.
onload
=
()
=>
{
if
(
window
.
ebiFrameworkRunDataProtectionBanner
!==
undefined
)
{
window
.
ebiFrameworkRunDataProtectionBanner
(
'
other
'
);
}
};
document
.
head
!
.
appendChild
(
bannerEl
);
if
(
document
.
head
!==
undefined
)
{
document
.
head
.
appendChild
(
bannerEl
);
}
this
.
userSession
.
init
();
}
...
...
src/app/app.config.ts
View file @
60a6e73a
...
...
@@ -23,7 +23,7 @@ export class AppConfig {
/**
* Synonym getter providing the threshold below which the current screen size will trigger
* tablet/mobile-geared layout.
* @returns
{number}
Upper-limit screen size in pixels for tablet-like devices.
* @returns Upper-limit screen size in pixels for tablet-like devices.
*/
get
tabletBreak
():
number
{
return
this
.
config
.
APP_TABLET_BREAKPOINT
;
...
...
@@ -31,7 +31,7 @@ export class AppConfig {
/**
* Synonym getter providing the format in which dates should be displayed when listing submissions.
* @returns
{string}
Format expressed in Angular's date pipe notation.
* @returns Format expressed in Angular's date pipe notation.
* @see {@link https://angular.io/api/common/DatePipe}
*/
get
dateListFormat
():
string
{
...
...
@@ -40,7 +40,7 @@ export class AppConfig {
/**
* Synonym getter providing the format in which dates should be displayed when editing submissions.
* @returns
{string}
Format following the Moment.js' notation.
* @returns Format following the Moment.js' notation.
* @see {@link https://momentjs.com/docs/#/parsing/string-format/}
*/
get
dateInputFormat
():
string
{
...
...
@@ -50,7 +50,7 @@ export class AppConfig {
/**
* Synonym getter providing the number of years ahead of the current date that the date picker will render
* selectable dates of.
* @returns
{number}
Maximum number of years into the future.
* @returns Maximum number of years into the future.
*/
get
maxDateYears
():
number
{
return
this
.
config
.
APP_MAX_DATE_YEARS
;
...
...
@@ -58,7 +58,7 @@ export class AppConfig {
/**
* Synonym getter providing the maximum number of suggested entries in a typeahead box.
* @returns
{number}
Maximum length of the suggestion list.
* @returns Maximum length of the suggestion list.
*/
get
maxSuggestLength
():
number
{
return
this
.
config
.
APP_MAX_SUGGEST_LENGTH
;
...
...
@@ -66,7 +66,7 @@ export class AppConfig {
/**
* Synonym getter providing the URL for the script containing the GDPR banner's logic.
* @returns
{string}
URL.
* @returns URL.
*/
get
bannerUrl
():
string
{
return
this
.
config
.
GDPR_BANNER_URL
;
...
...
@@ -76,7 +76,7 @@ export class AppConfig {
* Maximum number of concurrent connections supported by the browser. It should be in accordance to
* a ball-park average for different browsers.
* @see {@link http://www.browserscope.org/?category=network&v=top}
* @returns
{number}
Number of allowed concurrent connections.
* @returns Number of allowed concurrent connections.
*/
get
maxConcurrent
():
number
{
return
this
.
config
.
MAX_CONCURRENT
;
...
...
@@ -84,7 +84,7 @@ export class AppConfig {
/**
* The current environment where tha application is running.
* @returns
{string}
Name of the current environment.
* @returns Name of the current environment.
*/
get
environment
():
string
{
return
this
.
config
.
APP_ENV
;
...
...
@@ -97,7 +97,7 @@ export class AppConfig {
* for that through the "APP_INITIALIZER" injector token. However, this feature is still experimental in v4,
* requiring strict use of promises for it to be dependable.
* TODO: Since Angular has been bumped up to v7, the much cleaner "APP_INITIALIZER" approach should be followed instead.
* @returns
{Promise<any>}
Promise fulfilled once the config data has been fetched.
* @returns Promise fulfilled once the config data has been fetched.
* @see {@link /src/app/app.module.ts}
* @see {@link https://stackoverflow.com/a/40222544}
*/
...
...
src/app/auth-guard.service.ts
View file @
60a6e73a
...
...
@@ -9,10 +9,9 @@ import { UserSession } from 'app/auth/shared';
@
Injectable
()
export
class
AuthGuard
implements
CanActivate
{
constructor
(
private
userSession
:
UserSession
,
private
router
:
Router
)
{
}
constructor
(
private
userSession
:
UserSession
,
private
router
:
Router
)
{}
// tslint:disable-next-line: variable-name
canActivate
(
_route
:
ActivatedRouteSnapshot
,
state
:
RouterStateSnapshot
):
boolean
{
if
(
this
.
userSession
.
isAnonymous
())
{
this
.
router
.
navigate
([
'
/signin
'
,
{
next
:
state
.
url
}]);
...
...
src/app/auth/activate/activation-link-req.component.ts
View file @
60a6e73a
...
...
@@ -17,16 +17,16 @@ export class ActivationLinkReqComponent implements AfterViewInit {
showSuccess
:
boolean
=
false
;
@
ViewChild
(
'
emailEl
'
)
private
focusRef
?
:
ElementRef
;
private
focusRef
!
:
ElementRef
;
@
ViewChild
(
'
recaptchaEl
'
)
private
recaptchaRef
?
:
RecaptchaComponent
;
private
recaptchaRef
!
:
RecaptchaComponent
;
constructor
(
private
authService
:
AuthService
)
{}
// TODO: Turn autofocus on render into a directive
ngAfterViewInit
():
void
{
this
.
focusRef
!
.
nativeElement
.
focus
();
this
.
focusRef
.
nativeElement
.
focus
();
}
onRecaptchaResolved
(
captchaToken
:
string
):
void
{
...
...
@@ -50,7 +50,7 @@ export class ActivationLinkReqComponent implements AfterViewInit {
}
}
onSubmit
(
form
:
NgForm
)
{
onSubmit
(
form
:
NgForm
)
:
void
{
if
(
this
.
hasError
)
{
this
.
resetRecaptcha
();
this
.
hasError
=
false
;
...
...
@@ -59,7 +59,7 @@ export class ActivationLinkReqComponent implements AfterViewInit {
if
(
form
.
valid
)
{
this
.
isLoading
=
true
;
this
.
recaptchaRef
!
.
execute
();
this
.
recaptchaRef
.
execute
();
}
else
{
Object
.
keys
(
form
.
controls
).
forEach
((
key
)
=>
{
form
.
controls
[
key
].
markAsTouched
({
onlySelf
:
true
});
...
...
@@ -68,7 +68,7 @@ export class ActivationLinkReqComponent implements AfterViewInit {
}
resetRecaptcha
():
void
{
this
.
recaptchaRef
!
.
reset
();
this
.
recaptchaRef
.
reset
();
this
.
model
.
resetCaptcha
();
}
}
src/app/auth/auth.module.ts
View file @
60a6e73a
...
...
@@ -10,6 +10,7 @@ import { PasswordResetReqComponent } from './password-reset/password-reset-req.c
import
{
PasswordResetComponent
}
from
'
./password-reset/password-reset.component
'
;
import
{
SignUpComponent
}
from
'
./signup/signup.component
'
;
import
{
Equals2Directive
}
from
'
./password-reset/equals2.directive
'
;
import
{
CookieService
}
from
'
ngx-cookie-service
'
;
@
NgModule
({
imports
:
[
...
...
@@ -21,7 +22,8 @@ import { Equals2Directive } from './password-reset/equals2.directive';
providers
:
[
AuthService
,
UserSession
,
UserData
UserData
,
CookieService
],
declarations
:
[
SignInComponent
,
...
...
src/app/auth/password-reset/password-reset-req.component.ts
View file @
60a6e73a
...
...
@@ -17,16 +17,16 @@ export class PasswordResetReqComponent implements AfterViewInit {
showSuccess
:
boolean
=
false
;
@
ViewChild
(
'
emailEl
'
)
private
focusRef
?
:
ElementRef
;
private
focusRef
!
:
ElementRef
;
@
ViewChild
(
'
recaptchaEl
'
)
private
recaptcha
?
:
RecaptchaComponent
;
private
recaptcha
!
:
RecaptchaComponent
;
constructor
(
private
authService
:
AuthService
)
{}
// TODO: Turn autofocus on render into a directive
ngAfterViewInit
():
void
{
this
.
focusRef
!
.
nativeElement
.
focus
();
this
.
focusRef
.
nativeElement
.
focus
();
}
onRecaptchaResolved
(
captchaToken
:
string
):
void
{
...
...
@@ -58,7 +58,7 @@ export class PasswordResetReqComponent implements AfterViewInit {
if
(
form
.
valid
)
{
this
.
isLoading
=
true
;
this
.
recaptcha
!
.
execute
();
this
.
recaptcha
.
execute
();
}
else
{
Object
.
keys
(
form
.
controls
).
forEach
((
key
)
=>
{
form
.
controls
[
key
].
markAsTouched
({
onlySelf
:
true
});
...
...
@@ -67,7 +67,7 @@ export class PasswordResetReqComponent implements AfterViewInit {
}
resetRecaptcha
():
void
{
this
.
recaptcha
!
.
reset
();
this
.
recaptcha
.
reset
();
this
.
model
.
resetCaptcha
();
}
}
src/app/auth/password-reset/password-reset.component.ts
View file @
60a6e73a
...
...
@@ -18,10 +18,10 @@ export class PasswordResetComponent implements OnInit, AfterViewInit {
showSuccess
:
boolean
=
false
;
@
ViewChild
(
'
focusEl
'
)
private
focusRef
?
:
ElementRef
;
private
focusRef
!
:
ElementRef
;
@
ViewChild
(
'
recaptchaEl
'
)
private
recaptcha
?
:
RecaptchaComponent
;
private
recaptcha
!
:
RecaptchaComponent
;
constructor
(
private
authService
:
AuthService
,
...
...
@@ -30,7 +30,7 @@ export class PasswordResetComponent implements OnInit, AfterViewInit {
// TODO: Turn autofocus on render into a directive
ngAfterViewInit
():
void
{
this
.
focusRef
!
.
nativeElement
.
focus
();
this
.
focusRef
.
nativeElement
.
focus
();
}
ngOnInit
():
void
{
...
...
@@ -71,7 +71,7 @@ export class PasswordResetComponent implements OnInit, AfterViewInit {
if
(
form
.
valid
)
{
this
.
isLoading
=
true
;
this
.
recaptcha
!
.
execute
();
this
.
recaptcha
.
execute
();
}
else
{
Object
.
keys
(
form
.
controls
).
forEach
((
key
)
=>
{
form
.
controls
[
key
].
markAsTouched
({
onlySelf
:
true
});
...
...
@@ -80,7 +80,7 @@ export class PasswordResetComponent implements OnInit, AfterViewInit {
}
resetRecaptcha
():
void
{
this
.
recaptcha
!
.
reset
();
this
.
recaptcha
.
reset
();
this
.
model
.
resetCaptcha
();
}
}
src/app/auth/shared/auth.service.ts
View file @
60a6e73a
...
...
@@ -87,12 +87,12 @@ export class AuthService {
this
.
userSession
.
destroy
();
}
return
<
T
>
(
response
.
body
||
{})
;
return
(
response
.
body
||
{})
as
T
;
}
private
checkStatus
<
R
>
(
response
:
HttpResponse
<
R
>
):
R
{
if
(
isSuccessStatusCode
(
response
.
status
))
{
return
<
R
>
(
response
.
body
||
{})
;
return
(
response
.
body
||
{})
as
R
;
}
throw
ServerError
.
dataError
(
response
.
body
);
...
...
src/app/auth/shared/model/data-base.ts
View file @
60a6e73a
...
...
@@ -15,18 +15,18 @@ export class DataWithCaptcha {
}
export
class
DataWithCaptchaAndPath
extends
DataWithCaptcha
{
private
_p
ath
:
string
;
private
innerP
ath
:
string
;
constructor
(
path
:
string
)
{
super
();
this
.
_p
ath
=
path
;
this
.
innerP
ath
=
path
;
}
get
path
():
string
{
return
this
.
_p
ath
;
return
this
.
innerP
ath
;
}
snapshot
():
any
{
return
{
...
super
.
snapshot
(),
'
path
'
:
this
.
path
};
return
{
...
super
.
snapshot
(),
path
:
this
.
path
};
}
}
src/app/auth/shared/model/email-req-data.ts
View file @
60a6e73a
...
...
@@ -8,7 +8,7 @@ class EmailRequestData extends DataWithCaptchaAndPath {
}
snapshot
():
{
[
key
:
string
]:
string
}
{
return
{
...
super
.
snapshot
(),
'
email
'
:
this
.
email
};
return
{
...
super
.
snapshot
(),
email
:
this
.
email
};
}
}
...
...
src/app/auth/shared/model/password-reset-data.ts
View file @
60a6e73a
...
...
@@ -6,6 +6,6 @@ export class PasswordResetData extends DataWithCaptcha {
passwordRepeat
:
string
=
''
;
snapshot
():
{
[
key
:
string
]:
string
}
{
return
{
...
super
.
snapshot
(),
'
activationKey
'
:
this
.
key
,
'
password
'
:
this
.
password
};
return
{
...
super
.
snapshot
(),
activationKey
:
this
.
key
,
password
:
this
.
password
};
}
}
src/app/auth/shared/model/registration-data.ts
View file @
60a6e73a
...
...
@@ -13,10 +13,10 @@ export class RegistrationData extends DataWithCaptchaAndPath {
snapshot
():
any
{
return
{
...
super
.
snapshot
(),
'
aux
'
:
[
`orcid:
${
this
.
orcid
}
`
],
'
email
'
:
this
.
email
,
'
password
'
:
this
.
password
,
'
name
'
:
this
.
name
aux
:
[
`orcid:
${
this
.
orcid
}
`
],
email
:
this
.
email
,
password
:
this
.
password
,
name
:
this
.
name
};
}
}
src/app/auth/shared/user-cookies.ts
View file @
60a6e73a
import
{
Cookie
}
from
'
ng2-cookies/ng2-cookies
'
;
import
{
Cookie
Service
}
from
'
ngx-cookie-service
'
;
import
{
UserInfo
}
from
'
./model
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
const
LOGIN_TOKEN_NAME
=
'
BioStudiesToken
'
;
const
USER
=
'
BioStudiesUser
'
;
const
COOKIE_PATH
=
'
/
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
UserCookies
{
COOKIE_EXPIRES
:
number
=
365
;
COOKIE_NAME
:
string
=
'
BioStudiesToken
'
;
COOKIE_PATH
:
string
=
'
/
'
;
USER
:
string
=
'
BioStudiesUser
'
;
export
function
setLoginToken
(
token
:
string
):
void
{
Cookie
.
set
(
LOGIN_TOKEN_NAME
,
token
,
365
,
COOKIE_PATH
);
}
constructor
(
private
cookieService
:
CookieService
)
{}
export
function
getLoginToken
():
string
{
return
Cookie
.
get
(
LOGIN_TOKEN_NAME
)
||
''
;
}
destroyLoginToken
():
void
{
this
.
cookieService
.
delete
(
this
.
COOKIE_NAME
,
this
.
COOKIE_PATH
)
;
}
export
function
destroyLoginToken
():
void
{
Cookie
.
delete
(
LOGIN_TOKEN_NAME
,
COOKIE_PATH
);
}
destroyUser
():
void
{
localStorage
.
removeItem
(
this
.
USER
);
}
export
function
destroyUser
():
void
{
localStorage
.
removeItem
(
USER
);
}
getLoginToken
():
string
{
return
this
.
cookieService
.
get
(
this
.
COOKIE_NAME
);
}
export
function
setUser
(
user
:
UserInfo
):
void
{
localStorage
.
setItem
(
USER
,
JSON
.
stringify
(
user
));
}
getUser
():
UserInfo
{
return
JSON
.
parse
(
localStorage
.
getItem
(
this
.
USER
)
||
'
{}
'
);
}
setLoginToken
(
token
:
string
):
void
{
this
.
cookieService
.
set
(
this
.
COOKIE_NAME
,
token
,
this
.
COOKIE_EXPIRES
,
this
.
COOKIE_PATH
);
}
export
function
getUser
():
UserInfo
{
return
JSON
.
parse
(
localStorage
.
getItem
(
USER
)
||
'
{}
'
);
setUser
(
user
:
UserInfo
):
void
{
localStorage
.
setItem
(
this
.
USER
,
JSON
.
stringify
(
user
));
}
}
src/app/auth/shared/user-data.spec.ts
View file @
60a6e73a
import
{
async
}
from
'
@angular/core/testing
'
;
import
{
AuthService
,
UserData
,
UserSession
}
from
'
app/auth/shared
'
;
import
{
of
}
from
'
rxjs
'
;
import
{
of
,
Observable
}
from
'
rxjs
'
;
import
{
UserInfo
,
ExtendedUserInfo
}
from
'
./model
'
;
describe
(
'
UserData
'
,
()
=>
{
let
submService
;
let
appConfig
;
let
userCookies
;
beforeEach
(()
=>
{
submService
=
{
getProjects
()
{
getProjects
()
:
Observable
<
[]
>
{
return
of
([]);
}
};
appConfig
=
{
environment
:
'
DEV
'