Skip to content

Commit 6b657f5

Browse files
Davide NegrettiAndrea Barbasso
authored andcommitted
Merged in DSC-1352 (pull request DSpace#1046)
[DSC-1352] Move breadcrumb char limit property inside layout configuration properties Approved-by: Andrea Barbasso
2 parents 358ee7c + 2eaf3d8 commit 6b657f5

File tree

4 files changed

+32
-19
lines changed

4 files changed

+32
-19
lines changed

src/app/breadcrumbs/breadcrumb/truncate-breadcrumb-item-characters.pipe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class TruncateBreadcrumbItemCharactersPipe implements PipeTransform {
1010
* The maximum number of characters to display in a breadcrumb item
1111
* @type {number}
1212
*/
13-
readonly charLimit: number = environment.breadcrumbCharLimit;
13+
readonly charLimit: number = environment.layout.breadcrumbs.charLimit;
1414

1515
/**
1616
* Truncates the text based on the configured char number allowed per breadcrumb element.

src/config/default-app-config.ts

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -511,23 +511,23 @@ export class DefaultAppConfig implements AppConfig {
511511
urn: [
512512
{
513513
name: 'doi',
514-
baseUrl: 'https://doi.org/'
514+
baseUrl: 'https://doi.org/',
515515
},
516516
{
517517
name: 'hdl',
518-
baseUrl: 'https://hdl.handle.net/'
518+
baseUrl: 'https://hdl.handle.net/',
519519
},
520520
{
521521
name: 'scopus',
522-
baseUrl: 'https://www.scopus.com/authid/detail.uri?authorId='
522+
baseUrl: 'https://www.scopus.com/authid/detail.uri?authorId=',
523523
},
524524
{
525525
name: 'researcherid',
526-
baseUrl: 'http://www.researcherid.com/rid/'
526+
baseUrl: 'http://www.researcherid.com/rid/',
527527
},
528528
{
529529
name: 'mailto',
530-
baseUrl: 'mailto:'
530+
baseUrl: 'mailto:',
531531
}
532532
],
533533
crisRef: [
@@ -536,7 +536,7 @@ export class DefaultAppConfig implements AppConfig {
536536
entityStyle: {
537537
default: {
538538
icon: 'fa fa-info',
539-
style: 'text-info'
539+
style: 'text-info',
540540
}
541541
}
542542
},
@@ -545,7 +545,7 @@ export class DefaultAppConfig implements AppConfig {
545545
entityStyle: {
546546
default: {
547547
icon: 'fa fa-user',
548-
style: 'text-info'
548+
style: 'text-info',
549549
}
550550
}
551551
},
@@ -554,7 +554,7 @@ export class DefaultAppConfig implements AppConfig {
554554
entityStyle: {
555555
default: {
556556
icon: 'fa fa-university',
557-
style: 'text-info'
557+
style: 'text-info',
558558
}
559559
}
560560
},
@@ -563,7 +563,7 @@ export class DefaultAppConfig implements AppConfig {
563563
entityStyle: {
564564
default: {
565565
icon: 'fas fa-project-diagram',
566-
style: 'text-info'
566+
style: 'text-info',
567567
}
568568
}
569569
}
@@ -573,18 +573,18 @@ export class DefaultAppConfig implements AppConfig {
573573
},
574574
itemPage: {
575575
OrgUnit: {
576-
orientation: 'vertical'
576+
orientation: 'vertical',
577577
},
578578
Project: {
579-
orientation: 'vertical'
579+
orientation: 'vertical',
580580
},
581581
default: {
582-
orientation: 'horizontal'
582+
orientation: 'horizontal',
583583
},
584584
},
585585
metadataBox: {
586586
defaultMetadataLabelColStyle: 'col-3',
587-
defaultMetadataValueColStyle: 'col-9'
587+
defaultMetadataValueColStyle: 'col-9',
588588
},
589589
collectionsBox: {
590590
defaultCollectionsLabelColStyle: 'col-3 font-weight-bold',
@@ -597,6 +597,9 @@ export class DefaultAppConfig implements AppConfig {
597597
navbar: {
598598
// If true, show the "Community and Collections" link in the navbar; otherwise, show it in the admin sidebar
599599
showCommunityCollection: true,
600+
},
601+
breadcrumbs: {
602+
charLimit: 10,
600603
}
601604
};
602605

@@ -605,17 +608,17 @@ export class DefaultAppConfig implements AppConfig {
605608
{
606609
value: 0,
607610
icon: 'fa fa-globe',
608-
color: 'green'
611+
color: 'green',
609612
},
610613
{
611614
value: 1,
612615
icon: 'fa fa-key',
613-
color: 'orange'
616+
color: 'orange',
614617
},
615618
{
616619
value: 2,
617620
icon: 'fa fa-lock',
618-
color: 'red'
621+
color: 'red',
619622
}
620623
]
621624
};
@@ -730,11 +733,12 @@ export class DefaultAppConfig implements AppConfig {
730733
name: 'checksum',
731734
type: AdvancedAttachmentElementType.Attribute,
732735
}
733-
]
736+
],
734737
};
735738

736739
searchResult: SearchResultConfig = {
737740
additionalMetadataFields: [],
738741
authorMetadata: ['dc.contributor.author', 'dc.creator', 'dc.contributor.*'],
739742
};
743+
740744
}

src/config/layout-config.interfaces.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export interface NavbarConfig extends Config {
3838
showCommunityCollection: boolean;
3939
}
4040

41+
export interface BreadcrumbsConfig extends Config {
42+
charLimit: number;
43+
}
44+
4145
export interface CrisItemPageConfig extends Config {
4246
[entity: string]: CrisLayoutTypeConfig;
4347
default: CrisLayoutTypeConfig;
@@ -59,6 +63,7 @@ export interface CrisLayoutConfig extends Config {
5963

6064
export interface LayoutConfig extends Config {
6165
navbar: NavbarConfig;
66+
breadcrumbs: BreadcrumbsConfig;
6267
}
6368

6469
export interface SuggestionConfig extends Config {

src/environments/environment.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,10 @@ export const environment: BuildConfig = {
421421
navbar: {
422422
// If true, show the "Community and Collections" link in the navbar; otherwise, show it in the admin sidebar
423423
showCommunityCollection: true,
424-
}
424+
},
425+
breadcrumbs: {
426+
charLimit: 10,
427+
},
425428
},
426429
security: {
427430
levels: [
@@ -553,4 +556,5 @@ export const environment: BuildConfig = {
553556
],
554557
authorMetadata: ['dc.contributor.author', 'dc.contributor.editor', 'dc.contributor.contributor', 'dc.creator'],
555558
},
559+
556560
};

0 commit comments

Comments
 (0)