From a54275ae21f6a485da3799d6f5ebd0df6c31a676 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Fri, 22 Jan 2021 16:35:42 +0100 Subject: [PATCH 1/5] update the rest hostname to api7.dspace.org --- README.md | 2 +- docs/Configuration.md | 4 ++-- src/environments/environment.common.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4b4c7dc6cf..9a7bdbbbdb 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ DSPACE_REST_SSL # Whether the angular REST uses SSL [true/false] The same settings can also be overwritten by setting system environment variables instead, E.g.: ```bash -export DSPACE_HOST=dspace7.4science.cloud +export DSPACE_HOST=api7.dspace.org ``` The priority works as follows: **environment variable** overrides **variable in `.env` file** overrides **`environment.(prod, dev or test).ts`** overrides **`environment.common.ts`** diff --git a/docs/Configuration.md b/docs/Configuration.md index ac5ca3ef72..f918622568 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -39,7 +39,7 @@ export const environment = { // The REST API server settings. rest: { ssl: true, - host: 'dspace7.4science.cloud', + host: 'api7.dspace.org', port: 443, // NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript nameSpace: '/server' @@ -50,7 +50,7 @@ export const environment = { Alternately you can set the following environment variables. If any of these are set, it will override all configuration files: ``` DSPACE_REST_SSL=true - DSPACE_REST_HOST=dspace7.4science.cloud + DSPACE_REST_HOST=api7.dspace.org DSPACE_REST_PORT=443 DSPACE_REST_NAMESPACE=/server ``` diff --git a/src/environments/environment.common.ts b/src/environments/environment.common.ts index 65aa95c7f6..d47c3cfcef 100644 --- a/src/environments/environment.common.ts +++ b/src/environments/environment.common.ts @@ -23,7 +23,7 @@ export const environment: GlobalConfig = { // NOTE: these must be "synced" with the 'dspace.server.url' setting in your backend's local.cfg. rest: { ssl: true, - host: 'dspace7.4science.cloud', + host: 'api7.dspace.org', port: 443, // NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript nameSpace: '/server', From a51055cc14a0640c7484b2123f36fc6d8e9003cd Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Tue, 5 Jan 2021 12:36:03 -0500 Subject: [PATCH 2/5] 680 Fix change event reference for recent submission --- .../+collection-page/collection-page.component.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/+collection-page/collection-page.component.ts b/src/app/+collection-page/collection-page.component.ts index b3c10b12df..0ac45384e0 100644 --- a/src/app/+collection-page/collection-page.component.ts +++ b/src/app/+collection-page/collection-page.component.ts @@ -104,11 +104,15 @@ export class CollectionPageComponent implements OnInit { } onPaginationChange(event) { - this.paginationConfig.currentPage = +event.page || this.paginationConfig.currentPage; - this.paginationConfig.pageSize = +event.pageSize || this.paginationConfig.pageSize; - this.sortConfig.direction = event.sortDirection || this.sortConfig.direction; - this.sortConfig.field = event.sortField || this.sortConfig.field; - + this.paginationConfig = Object.assign(new PaginationComponentOptions(), { + currentPage: event.pagination.currentPage || this.paginationConfig.currentPage, + pageSize: event.pagination.pageSize || this.paginationConfig.pageSize, + id: 'collection-page-pagination' + }); + this.sortConfig = Object.assign(new SortOptions('dc.date.accessioned', SortDirection.DESC), { + direction: event.sort.direction || this.sortConfig.direction, + field: event.sort.field || this.sortConfig.field + }); this.paginationChanges$.next({ paginationConfig: this.paginationConfig, sortConfig: this.sortConfig From ee2e3be057a33744d439c1fab2172181114c08de Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Wed, 20 Jan 2021 14:05:22 -0500 Subject: [PATCH 3/5] 680 Add paginationChangeEvent interface and move to PaginationComponent impl for event handling --- src/app/+collection-page/collection-page.component.ts | 6 +++--- .../shared/pagination/paginationChangeEvent.interface.ts | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 src/app/shared/pagination/paginationChangeEvent.interface.ts diff --git a/src/app/+collection-page/collection-page.component.ts b/src/app/+collection-page/collection-page.component.ts index 0ac45384e0..50444cf27f 100644 --- a/src/app/+collection-page/collection-page.component.ts +++ b/src/app/+collection-page/collection-page.component.ts @@ -21,6 +21,7 @@ import { fadeIn, fadeInOut } from '../shared/animations/fade'; import { hasValue, isNotEmpty } from '../shared/empty.util'; import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model'; import { AuthService } from '../core/auth/auth.service'; +import {PaginationChangeEvent} from '../shared/pagination/paginationChangeEvent.interface'; @Component({ selector: 'ds-collection-page', @@ -93,9 +94,8 @@ export class CollectionPageComponent implements OnInit { ) ); - this.route.queryParams.pipe(take(1)).subscribe((params) => { + this.route.queryParams.pipe(take(1)).subscribe((params: PaginationChangeEvent) => { this.metadata.processRemoteData(this.collectionRD$); - this.onPaginationChange(params); }); } @@ -103,7 +103,7 @@ export class CollectionPageComponent implements OnInit { return isNotEmpty(object); } - onPaginationChange(event) { + onPaginationChange(event: PaginationChangeEvent) { this.paginationConfig = Object.assign(new PaginationComponentOptions(), { currentPage: event.pagination.currentPage || this.paginationConfig.currentPage, pageSize: event.pagination.pageSize || this.paginationConfig.pageSize, diff --git a/src/app/shared/pagination/paginationChangeEvent.interface.ts b/src/app/shared/pagination/paginationChangeEvent.interface.ts new file mode 100644 index 0000000000..35be7117f6 --- /dev/null +++ b/src/app/shared/pagination/paginationChangeEvent.interface.ts @@ -0,0 +1,7 @@ +import {PaginationComponentOptions} from './pagination-component-options.model'; +import {SortOptions} from '../../core/cache/models/sort-options.model'; + +export interface PaginationChangeEvent { + pagination: PaginationComponentOptions; + sort: SortOptions; +} From 771183097c38faed14c0426095eb502f600ca945 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Thu, 21 Jan 2021 11:10:25 -0500 Subject: [PATCH 4/5] 680 Untype incorrectly typed params --- src/app/+collection-page/collection-page.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/+collection-page/collection-page.component.ts b/src/app/+collection-page/collection-page.component.ts index 50444cf27f..8065480604 100644 --- a/src/app/+collection-page/collection-page.component.ts +++ b/src/app/+collection-page/collection-page.component.ts @@ -94,7 +94,7 @@ export class CollectionPageComponent implements OnInit { ) ); - this.route.queryParams.pipe(take(1)).subscribe((params: PaginationChangeEvent) => { + this.route.queryParams.pipe(take(1)).subscribe((params) => { this.metadata.processRemoteData(this.collectionRD$); }); } From b143ea7e611a50a20794becd7e59216a6a7dd753 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Tue, 26 Jan 2021 11:41:28 -0500 Subject: [PATCH 5/5] 680 add typedocs to new interface --- .../pagination/paginationChangeEvent.interface.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/shared/pagination/paginationChangeEvent.interface.ts b/src/app/shared/pagination/paginationChangeEvent.interface.ts index 35be7117f6..ccd2f2174d 100644 --- a/src/app/shared/pagination/paginationChangeEvent.interface.ts +++ b/src/app/shared/pagination/paginationChangeEvent.interface.ts @@ -1,7 +1,19 @@ import {PaginationComponentOptions} from './pagination-component-options.model'; import {SortOptions} from '../../core/cache/models/sort-options.model'; + +/** + * The pagination event that contains updated pagination properties + * for a given view + */ export interface PaginationChangeEvent { + /** + * The pagination component object that contains id, current page, max size, page size options, and page size + */ pagination: PaginationComponentOptions; + + /** + * The sort options object that contains which field to sort by and the sorting direction + */ sort: SortOptions; }