Merge branch 'main' into w2p-75939_Item-links-by-entity

Conflicts:
	src/app/+collection-page/collection-page.component.ts
This commit is contained in:
Kristof De Langhe
2021-01-28 12:56:05 +01:00
5 changed files with 34 additions and 11 deletions

View File

@@ -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.: The same settings can also be overwritten by setting system environment variables instead, E.g.:
```bash ```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`** The priority works as follows: **environment variable** overrides **variable in `.env` file** overrides **`environment.(prod, dev or test).ts`** overrides **`environment.common.ts`**

View File

@@ -39,7 +39,7 @@ export const environment = {
// The REST API server settings. // The REST API server settings.
rest: { rest: {
ssl: true, ssl: true,
host: 'dspace7.4science.cloud', host: 'api7.dspace.org',
port: 443, port: 443,
// NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript // NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
nameSpace: '/server' 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: 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_SSL=true
DSPACE_REST_HOST=dspace7.4science.cloud DSPACE_REST_HOST=api7.dspace.org
DSPACE_REST_PORT=443 DSPACE_REST_PORT=443
DSPACE_REST_NAMESPACE=/server DSPACE_REST_NAMESPACE=/server
``` ```

View File

@@ -26,6 +26,7 @@ import { fadeIn, fadeInOut } from '../shared/animations/fade';
import { hasValue, isNotEmpty } from '../shared/empty.util'; import { hasValue, isNotEmpty } from '../shared/empty.util';
import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model'; import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model';
import { AuthService } from '../core/auth/auth.service'; import { AuthService } from '../core/auth/auth.service';
import {PaginationChangeEvent} from '../shared/pagination/paginationChangeEvent.interface';
import { getCollectionPageRoute } from './collection-page-routing-paths'; import { getCollectionPageRoute } from './collection-page-routing-paths';
@Component({ @Component({
@@ -111,7 +112,6 @@ export class CollectionPageComponent implements OnInit {
this.route.queryParams.pipe(take(1)).subscribe((params) => { this.route.queryParams.pipe(take(1)).subscribe((params) => {
this.metadata.processRemoteData(this.collectionRD$); this.metadata.processRemoteData(this.collectionRD$);
this.onPaginationChange(params);
}); });
} }
@@ -119,12 +119,16 @@ export class CollectionPageComponent implements OnInit {
return isNotEmpty(object); return isNotEmpty(object);
} }
onPaginationChange(event) { onPaginationChange(event: PaginationChangeEvent) {
this.paginationConfig.currentPage = +event.page || this.paginationConfig.currentPage; this.paginationConfig = Object.assign(new PaginationComponentOptions(), {
this.paginationConfig.pageSize = +event.pageSize || this.paginationConfig.pageSize; currentPage: event.pagination.currentPage || this.paginationConfig.currentPage,
this.sortConfig.direction = event.sortDirection || this.sortConfig.direction; pageSize: event.pagination.pageSize || this.paginationConfig.pageSize,
this.sortConfig.field = event.sortField || this.sortConfig.field; 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({ this.paginationChanges$.next({
paginationConfig: this.paginationConfig, paginationConfig: this.paginationConfig,
sortConfig: this.sortConfig sortConfig: this.sortConfig

View File

@@ -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;
}

View File

@@ -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. // NOTE: these must be "synced" with the 'dspace.server.url' setting in your backend's local.cfg.
rest: { rest: {
ssl: true, ssl: true,
host: 'dspace7.4science.cloud', host: 'api7.dspace.org',
port: 443, port: 443,
// NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript // NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
nameSpace: '/server', nameSpace: '/server',