mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +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 { MetadataSchemaComponent } from './metadata-schema/metadata-schema.component';
|
||||||
import { URLCombiner } from '../../core/url-combiner/url-combiner';
|
import { URLCombiner } from '../../core/url-combiner/url-combiner';
|
||||||
import { getRegistriesModulePath } from '../admin-routing.module';
|
import { getRegistriesModulePath } from '../admin-routing.module';
|
||||||
|
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
|
|
||||||
const BITSTREAMFORMATS_MODULE_PATH = 'bitstream-formats';
|
const BITSTREAMFORMATS_MODULE_PATH = 'bitstream-formats';
|
||||||
|
|
||||||
@@ -14,16 +15,28 @@ export function getBitstreamFormatsModulePath() {
|
|||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
RouterModule.forChild([
|
RouterModule.forChild([
|
||||||
{path: 'metadata', component: MetadataRegistryComponent, data: {title: 'admin.registries.metadata.title'}},
|
|
||||||
{
|
{
|
||||||
path: 'metadata/:schemaName',
|
path: 'metadata',
|
||||||
component: MetadataSchemaComponent,
|
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||||
data: {title: 'admin.registries.schema.title'}
|
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,
|
path: BITSTREAMFORMATS_MODULE_PATH,
|
||||||
|
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||||
loadChildren: './bitstream-formats/bitstream-formats.module#BitstreamFormatsModule',
|
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 { EditBitstreamFormatComponent } from './edit-bitstream-format/edit-bitstream-format.component';
|
||||||
import { BitstreamFormatsComponent } from './bitstream-formats.component';
|
import { BitstreamFormatsComponent } from './bitstream-formats.component';
|
||||||
import { AddBitstreamFormatComponent } from './add-bitstream-format/add-bitstream-format.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_EDIT_PATH = ':id/edit';
|
||||||
const BITSTREAMFORMAT_ADD_PATH = 'add';
|
const BITSTREAMFORMAT_ADD_PATH = 'add';
|
||||||
@@ -17,14 +18,18 @@ const BITSTREAMFORMAT_ADD_PATH = 'add';
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: BITSTREAMFORMAT_ADD_PATH,
|
path: BITSTREAMFORMAT_ADD_PATH,
|
||||||
|
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||||
component: AddBitstreamFormatComponent,
|
component: AddBitstreamFormatComponent,
|
||||||
|
data: {breadcrumbKey: 'admin.registries.bitstream-formats.create'}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: BITSTREAMFORMAT_EDIT_PATH,
|
path: BITSTREAMFORMAT_EDIT_PATH,
|
||||||
component: EditBitstreamFormatComponent,
|
component: EditBitstreamFormatComponent,
|
||||||
resolve: {
|
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)) {
|
if (hasNoValue(key)) {
|
||||||
throw new Error('You provided an i18nBreadcrumbResolver for url \"' + route.url + '\" but no breadcrumbKey in the route\'s data')
|
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 };
|
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.content": "An error occurred while creating the new bitstream format.",
|
||||||
|
|
||||||
"admin.registries.bitstream-formats.create.failure.head": "Failure",
|
"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.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.hint": "",
|
||||||
|
|
||||||
"admin.registries.bitstream-formats.edit.description.label": "Description",
|
"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.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",
|
"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.description": "This is the metadata schema for \"{{namespace}}\".",
|
||||||
|
|
||||||
"admin.registries.schema.fields.head": "Schema metadata fields",
|
"admin.registries.schema.fields.head": "Schema metadata fields",
|
||||||
|
Reference in New Issue
Block a user