Skip to content

fix pagination on external sources #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: dspace-cris-2023_02_x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dspace-angular",
"version": "2023.02.00",
"version": "2023.02.01-SNAPSHOT",
"scripts": {
"ng": "ng",
"config:watch": "nodemon",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class TruncateBreadcrumbItemCharactersPipe implements PipeTransform {
* The maximum number of characters to display in a breadcrumb item
* @type {number}
*/
readonly charLimit: number = environment.breadcrumbCharLimit;
readonly charLimit: number = environment.layout.breadcrumbs.charLimit;

/**
* Truncates the text based on the configured char number allowed per breadcrumb element.
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/form/form.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
title="{{'form.remove' | translate}}"
attr.aria-label="{{'form.remove' | translate}}"
(click)="clearScrollableDropdown($event, model)"
[disabled]="!model.value">
[disabled]="!model.value || model.readOnly">
<span><i class="fas fa-trash" aria-hidden="false"></i></span>
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ <h3 [innerHTML]="dsoTitle" [ngClass]="{'lead': true,'text-muted': !item.firstMet
<span *ngIf="item.hasMetadata(authorMetadata);" class="item-list-authors">
<span *ngIf="item.allMetadataValues(authorMetadata).length === 0">{{'mydspace.results.no-authors' | translate}}</span>
<span *ngFor="let author of item.allMetadata(authorMetadata); let i=index; let last=last;">
<ds-metadata-link-view *ngIf="!!item && !!author" [item]="item" [metadata]="author" [metadataName]="authorMetadata"></ds-metadata-link-view>
<ds-metadata-link-view *ngIf="!!item && !!author" [item]="item" [metadataName]="authorMetadata"
[metadata]="author"></ds-metadata-link-view><span
*ngIf="!last">; </span>
</span>
</span>
</ds-truncatable-part>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ <h3 [innerHTML]="item.firstMetadataValue('dc.title') || ('mydspace.results.no-ti
<span *ngIf="item.allMetadata(authorMetadata).length === 0">{{'mydspace.results.no-authors' | translate}}</span>
<span class="d-flex position-absolute w-100">
<span class="metadata-content" *ngFor="let author of item.allMetadata(authorMetadata); let i=index; let last=last;">
<ds-metadata-link-view [item]="item" [metadata]="author" [metadataName]="authorMetadata"></ds-metadata-link-view>
<ds-metadata-link-view [item]="item" [metadataName]="authorMetadata"
[metadata]="author"></ds-metadata-link-view><span
*ngIf="!last">; </span>
</span>

</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export class SubmissionImportExternalComponent implements OnInit, OnDestroy {
ngOnInit(): void {
this.listId = 'list-submission-external-sources';
this.context = Context.EntitySearchModalWithNameVariants;
this.searchConfigService.setPaginationId(this.initialPagination.id);
this.repeatable = false;
this.routeData = {entity: '', sourceId: '', query: ''};
this.importConfig = {
Expand Down
38 changes: 21 additions & 17 deletions src/config/default-app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,23 +511,23 @@ export class DefaultAppConfig implements AppConfig {
urn: [
{
name: 'doi',
baseUrl: 'https://doi.org/'
baseUrl: 'https://doi.org/',
},
{
name: 'hdl',
baseUrl: 'https://hdl.handle.net/'
baseUrl: 'https://hdl.handle.net/',
},
{
name: 'scopus',
baseUrl: 'https://www.scopus.com/authid/detail.uri?authorId='
baseUrl: 'https://www.scopus.com/authid/detail.uri?authorId=',
},
{
name: 'researcherid',
baseUrl: 'http://www.researcherid.com/rid/'
baseUrl: 'http://www.researcherid.com/rid/',
},
{
name: 'mailto',
baseUrl: 'mailto:'
baseUrl: 'mailto:',
}
],
crisRef: [
Expand All @@ -536,7 +536,7 @@ export class DefaultAppConfig implements AppConfig {
entityStyle: {
default: {
icon: 'fa fa-info',
style: 'text-info'
style: 'text-info',
}
}
},
Expand All @@ -545,7 +545,7 @@ export class DefaultAppConfig implements AppConfig {
entityStyle: {
default: {
icon: 'fa fa-user',
style: 'text-info'
style: 'text-info',
}
}
},
Expand All @@ -554,7 +554,7 @@ export class DefaultAppConfig implements AppConfig {
entityStyle: {
default: {
icon: 'fa fa-university',
style: 'text-info'
style: 'text-info',
}
}
},
Expand All @@ -563,7 +563,7 @@ export class DefaultAppConfig implements AppConfig {
entityStyle: {
default: {
icon: 'fas fa-project-diagram',
style: 'text-info'
style: 'text-info',
}
}
}
Expand All @@ -573,18 +573,18 @@ export class DefaultAppConfig implements AppConfig {
},
itemPage: {
OrgUnit: {
orientation: 'vertical'
orientation: 'vertical',
},
Project: {
orientation: 'vertical'
orientation: 'vertical',
},
default: {
orientation: 'horizontal'
orientation: 'horizontal',
},
},
metadataBox: {
defaultMetadataLabelColStyle: 'col-3',
defaultMetadataValueColStyle: 'col-9'
defaultMetadataValueColStyle: 'col-9',
},
collectionsBox: {
defaultCollectionsLabelColStyle: 'col-3 font-weight-bold',
Expand All @@ -597,6 +597,9 @@ export class DefaultAppConfig implements AppConfig {
navbar: {
// If true, show the "Community and Collections" link in the navbar; otherwise, show it in the admin sidebar
showCommunityCollection: true,
},
breadcrumbs: {
charLimit: 10,
}
};

Expand All @@ -605,17 +608,17 @@ export class DefaultAppConfig implements AppConfig {
{
value: 0,
icon: 'fa fa-globe',
color: 'green'
color: 'green',
},
{
value: 1,
icon: 'fa fa-key',
color: 'orange'
color: 'orange',
},
{
value: 2,
icon: 'fa fa-lock',
color: 'red'
color: 'red',
}
]
};
Expand Down Expand Up @@ -730,11 +733,12 @@ export class DefaultAppConfig implements AppConfig {
name: 'checksum',
type: AdvancedAttachmentElementType.Attribute,
}
]
],
};

searchResult: SearchResultConfig = {
additionalMetadataFields: [],
authorMetadata: ['dc.contributor.author', 'dc.creator', 'dc.contributor.*'],
};

}
5 changes: 5 additions & 0 deletions src/config/layout-config.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export interface NavbarConfig extends Config {
showCommunityCollection: boolean;
}

export interface BreadcrumbsConfig extends Config {
charLimit: number;
}

export interface CrisItemPageConfig extends Config {
[entity: string]: CrisLayoutTypeConfig;
default: CrisLayoutTypeConfig;
Expand All @@ -59,6 +63,7 @@ export interface CrisLayoutConfig extends Config {

export interface LayoutConfig extends Config {
navbar: NavbarConfig;
breadcrumbs: BreadcrumbsConfig;
}

export interface SuggestionConfig extends Config {
Expand Down
6 changes: 5 additions & 1 deletion src/environments/environment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,10 @@ export const environment: BuildConfig = {
navbar: {
// If true, show the "Community and Collections" link in the navbar; otherwise, show it in the admin sidebar
showCommunityCollection: true,
}
},
breadcrumbs: {
charLimit: 10,
},
},
security: {
levels: [
Expand Down Expand Up @@ -553,4 +556,5 @@ export const environment: BuildConfig = {
],
authorMetadata: ['dc.contributor.author', 'dc.contributor.editor', 'dc.contributor.contributor', 'dc.creator'],
},

};