mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
70834: Registry breadcrumbs
This commit is contained in:
@@ -4,6 +4,7 @@ import { NgModule } from '@angular/core';
|
||||
import { MetadataSchemaComponent } from './metadata-schema/metadata-schema.component';
|
||||
import { URLCombiner } from '../../core/url-combiner/url-combiner';
|
||||
import { getRegistriesModulePath } from '../admin-routing.module';
|
||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
|
||||
const BITSTREAMFORMATS_MODULE_PATH = 'bitstream-formats';
|
||||
|
||||
@@ -14,16 +15,28 @@ export function getBitstreamFormatsModulePath() {
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{path: 'metadata', component: MetadataRegistryComponent, data: {title: 'admin.registries.metadata.title'}},
|
||||
{
|
||||
path: 'metadata/:schemaName',
|
||||
component: MetadataSchemaComponent,
|
||||
data: {title: 'admin.registries.schema.title'}
|
||||
path: 'metadata',
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
data: {title: 'admin.registries.metadata.title', breadcrumbKey: 'admin.registries.metadata'},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: MetadataRegistryComponent
|
||||
},
|
||||
{
|
||||
path: ':schemaName',
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
component: MetadataSchemaComponent,
|
||||
data: {title: 'admin.registries.schema.title', breadcrumbKey: 'admin.registries.schema'}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: BITSTREAMFORMATS_MODULE_PATH,
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
loadChildren: './bitstream-formats/bitstream-formats.module#BitstreamFormatsModule',
|
||||
data: {title: 'admin.registries.bitstream-formats.title'}
|
||||
data: {title: 'admin.registries.bitstream-formats.title', breadcrumbKey: 'admin.registries.bitstream-formats'}
|
||||
},
|
||||
])
|
||||
]
|
||||
|
@@ -4,6 +4,7 @@ import { BitstreamFormatsResolver } from './bitstream-formats.resolver';
|
||||
import { EditBitstreamFormatComponent } from './edit-bitstream-format/edit-bitstream-format.component';
|
||||
import { BitstreamFormatsComponent } from './bitstream-formats.component';
|
||||
import { AddBitstreamFormatComponent } from './add-bitstream-format/add-bitstream-format.component';
|
||||
import { I18nBreadcrumbResolver } from '../../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
|
||||
const BITSTREAMFORMAT_EDIT_PATH = ':id/edit';
|
||||
const BITSTREAMFORMAT_ADD_PATH = 'add';
|
||||
@@ -17,14 +18,18 @@ const BITSTREAMFORMAT_ADD_PATH = 'add';
|
||||
},
|
||||
{
|
||||
path: BITSTREAMFORMAT_ADD_PATH,
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
component: AddBitstreamFormatComponent,
|
||||
data: {breadcrumbKey: 'admin.registries.bitstream-formats.create'}
|
||||
},
|
||||
{
|
||||
path: BITSTREAMFORMAT_EDIT_PATH,
|
||||
component: EditBitstreamFormatComponent,
|
||||
resolve: {
|
||||
bitstreamFormat: BitstreamFormatsResolver
|
||||
}
|
||||
bitstreamFormat: BitstreamFormatsResolver,
|
||||
breadcrumb: I18nBreadcrumbResolver
|
||||
},
|
||||
data: {breadcrumbKey: 'admin.registries.bitstream-formats.edit'}
|
||||
},
|
||||
])
|
||||
],
|
||||
|
@@ -23,7 +23,17 @@ export class I18nBreadcrumbResolver implements Resolve<BreadcrumbConfig<string>>
|
||||
if (hasNoValue(key)) {
|
||||
throw new Error('You provided an i18nBreadcrumbResolver for url \"' + route.url + '\" but no breadcrumbKey in the route\'s data')
|
||||
}
|
||||
const fullPath = route.url.join('');
|
||||
const fullPath = this.getResolvedUrl(route);
|
||||
return { provider: this.breadcrumbService, key: key, url: fullPath };
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the full URL of an ActivatedRouteSnapshot
|
||||
* @param route
|
||||
*/
|
||||
getResolvedUrl(route: ActivatedRouteSnapshot): string {
|
||||
return route.pathFromRoot
|
||||
.map((v) => v.url.map((segment) => segment.toString()).join('/'))
|
||||
.join('/');
|
||||
}
|
||||
}
|
||||
|
@@ -8,6 +8,10 @@
|
||||
|
||||
|
||||
|
||||
"admin.registries.bitstream-formats.breadcrumbs": "Format registry",
|
||||
|
||||
"admin.registries.bitstream-formats.create.breadcrumbs": "Bitstream format",
|
||||
|
||||
"admin.registries.bitstream-formats.create.failure.content": "An error occurred while creating the new bitstream format.",
|
||||
|
||||
"admin.registries.bitstream-formats.create.failure.head": "Failure",
|
||||
@@ -30,6 +34,8 @@
|
||||
|
||||
"admin.registries.bitstream-formats.description": "This list of bitstream formats provides information about known formats and their support level.",
|
||||
|
||||
"admin.registries.bitstream-formats.edit.breadcrumbs": "Bitstream format",
|
||||
|
||||
"admin.registries.bitstream-formats.edit.description.hint": "",
|
||||
|
||||
"admin.registries.bitstream-formats.edit.description.label": "Description",
|
||||
@@ -94,6 +100,8 @@
|
||||
|
||||
|
||||
|
||||
"admin.registries.metadata.breadcrumbs": "Metadata registry",
|
||||
|
||||
"admin.registries.metadata.description": "The metadata registry maintains a list of all metadata fields available in the repository. These fields may be divided amongst multiple schemas. However, DSpace requires the qualified Dublin Core schema.",
|
||||
|
||||
"admin.registries.metadata.form.create": "Create metadata schema",
|
||||
@@ -120,6 +128,8 @@
|
||||
|
||||
|
||||
|
||||
"admin.registries.schema.breadcrumbs": "Metadata schema",
|
||||
|
||||
"admin.registries.schema.description": "This is the metadata schema for \"{{namespace}}\".",
|
||||
|
||||
"admin.registries.schema.fields.head": "Schema metadata fields",
|
||||
|
Reference in New Issue
Block a user