Skip to content

Commit

Permalink
Merged in DSC-1352 (pull request DSpace#1046)
Browse files Browse the repository at this point in the history
[DSC-1352] Move breadcrumb char limit property inside layout configuration properties

Approved-by: Andrea Barbasso
  • Loading branch information
Davide Negretti authored and Andrea Barbasso committed Dec 5, 2023
2 parents 358ee7c + 2eaf3d8 commit 6b657f5
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 19 deletions.
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
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'],
},

};

0 comments on commit 6b657f5

Please sign in to comment.