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/app/+collection-page/collection-page.component.ts b/src/app/+collection-page/collection-page.component.ts index 734d84e6b7..5d76ce7859 100644 --- a/src/app/+collection-page/collection-page.component.ts +++ b/src/app/+collection-page/collection-page.component.ts @@ -26,6 +26,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'; import { getCollectionPageRoute } from './collection-page-routing-paths'; @Component({ @@ -111,7 +112,6 @@ export class CollectionPageComponent implements OnInit { this.route.queryParams.pipe(take(1)).subscribe((params) => { this.metadata.processRemoteData(this.collectionRD$); - this.onPaginationChange(params); }); } @@ -119,12 +119,16 @@ export class CollectionPageComponent implements OnInit { return isNotEmpty(object); } - 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; - + onPaginationChange(event: PaginationChangeEvent) { + 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 diff --git a/src/app/shared/pagination/paginationChangeEvent.interface.ts b/src/app/shared/pagination/paginationChangeEvent.interface.ts new file mode 100644 index 0000000000..ccd2f2174d --- /dev/null +++ b/src/app/shared/pagination/paginationChangeEvent.interface.ts @@ -0,0 +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; +} 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',