mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Merge branch 'main' into w2p-75939_Item-links-by-entity
Conflicts: src/app/+collection-page/collection-page.component.ts
This commit is contained in:
@@ -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`**
|
||||||
|
@@ -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
|
||||||
```
|
```
|
||||||
|
@@ -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
|
||||||
|
19
src/app/shared/pagination/paginationChangeEvent.interface.ts
Normal file
19
src/app/shared/pagination/paginationChangeEvent.interface.ts
Normal 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;
|
||||||
|
}
|
@@ -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',
|
||||||
|
Reference in New Issue
Block a user