Commit 3ac72ae5 authored by Florent Poittevin's avatar Florent Poittevin
Browse files

feat: 722 add label of current item on breadcrumb

parent e0d9fc2e
......@@ -13,6 +13,7 @@ import {
} from "@shared/enums/routes.enum";
import {CanDeactivateGuard} from "@shared/services/can-deactivate-guard.service";
import {TRANSLATE} from "solidify-frontend";
import {AdminFundingAgenciesState} from "./stores/admin-funding-agencies.state";
const routes: Routes = [
{
......@@ -25,6 +26,7 @@ const routes: Routes = [
component: AdminFundingAgenciesDetailRoutable,
data: {
breadcrumb: TRANSLATE("breadcrumb.admin.funding-agencies.detail"),
breadcrumbMemoizedSelector: AdminFundingAgenciesState.currentTitle,
},
},
{
......
......@@ -87,6 +87,14 @@ export class AdminFundingAgenciesState extends ResourceState<FundingAgencyExtend
|| StoreUtil.isLoadingState(state.admin_fundingAgencies_organizationalUnit);
}
@Selector()
static currentTitle(state: AdminFundingAgenciesStateModel): string | undefined {
if (isNullOrUndefined(state.current)) {
return undefined;
}
return state.current.name;
}
@Selector()
static isReadyToBeDisplayed(state: AdminFundingAgenciesStateModel): boolean {
return this.isReadyToBeDisplayedInCreateMode
......
......@@ -2,6 +2,7 @@ import {AdminInstitutionCreateRoutable} from "@admin/institution/components/rout
import {AdminInstitutionDetailRoutable} from "@admin/institution/components/routables/admin-institution-detail/admin-institution-detail.routable";
import {AdminInstitutionEditRoutable} from "@admin/institution/components/routables/admin-institution-edit/admin-institution-edit.routable";
import {AdminInstitutionListRoutable} from "@admin/institution/components/routables/admin-institution-list/admin-institution-list.routable";
import {AdminInstitutionState} from "@admin/institution/stores/admin-institution.state";
import {NgModule} from "@angular/core";
import {
RouterModule,
......@@ -25,6 +26,7 @@ const routes: Routes = [
component: AdminInstitutionDetailRoutable,
data: {
breadcrumb: TRANSLATE("breadcrumb.admin.institution.detail"),
breadcrumbMemoizedSelector: AdminInstitutionState.currentTitle,
},
},
{
......
......@@ -61,6 +61,14 @@ export class AdminInstitutionState extends ResourceState<Institution> {
return this.isLoading(state);
}
@Selector()
static currentTitle(state: AdminInstitutionStateModel): string | undefined {
if (isNullOrUndefined(state.current)) {
return undefined;
}
return state.current.name;
}
@Selector()
static isReadyToBeDisplayed(state: AdminInstitutionStateModel): boolean {
return this.isReadyToBeDisplayedInCreateMode
......
......@@ -2,6 +2,7 @@ import {AdminLicenseCreateRoutable} from "@admin/license/components/routables/ad
import {AdminLicenseDetailRoutable} from "@admin/license/components/routables/admin-license-detail/admin-license-detail.routable";
import {AdminLicenseEditRoutable} from "@admin/license/components/routables/admin-license-edit/admin-license-edit.routable";
import {AdminLicenseListRoutable} from "@admin/license/components/routables/admin-license-list/admin-license-list.routable";
import {AdminLicenseState} from "@admin/license/stores/admin-license.state";
import {NgModule} from "@angular/core";
import {
RouterModule,
......@@ -41,6 +42,7 @@ const routes: Routes = [
component: AdminLicenseDetailRoutable,
data: {
breadcrumb: TRANSLATE("breadcrumb.admin.license.detail"),
breadcrumbMemoizedSelector: AdminLicenseState.currentTitle,
},
},
];
......
......@@ -60,6 +60,14 @@ export class AdminLicenseState extends ResourceState<License> {
return this.isLoading(state);
}
@Selector()
static currentTitle(state: AdminLicenseStateModel): string | undefined {
if (isNullOrUndefined(state.current)) {
return undefined;
}
return state.current.title;
}
@Selector()
static isReadyToBeDisplayed(state: AdminLicenseStateModel): boolean {
return this.isReadyToBeDisplayedInCreateMode
......
......@@ -2,6 +2,7 @@ import {AdminOauth2ClientCreateRoutable} from "@admin/oauth2-client/components/r
import {AdminOAuth2ClientDetailRoutable} from "@admin/oauth2-client/components/routables/admin-oauth2-client-detail/admin-oauth2-client-detail.routable";
import {AdminOauth2ClientEditRoutable} from "@admin/oauth2-client/components/routables/admin-oauth2-client-edit/admin-oauth2-client-edit.routable";
import {AdminOAuth2ClientListRoutable} from "@admin/oauth2-client/components/routables/admin-oauth2-client-list/admin-oauth2-client-list.routable";
import {AdminOAuth2ClientState} from "@admin/oauth2-client/stores/admin-oauth2-client.state";
import {NgModule} from "@angular/core";
import {
RouterModule,
......@@ -25,6 +26,7 @@ const routes: Routes = [
component: AdminOAuth2ClientDetailRoutable,
data: {
breadcrumb: TRANSLATE("breadcrumb.admin.oauth2Client.detail"),
breadcrumbMemoizedSelector: AdminOAuth2ClientState.currentTitle,
},
},
{
......
......@@ -60,6 +60,14 @@ export class AdminOAuth2ClientState extends ResourceState<Oauth2Client> {
return this.isLoading(state);
}
@Selector()
static currentTitle(state: AdminOAuth2ClientStateModel): string | undefined {
if (isNullOrUndefined(state.current)) {
return undefined;
}
return state.current.name;
}
@Selector()
static isReadyToBeDisplayed(state: AdminOAuth2ClientStateModel): boolean {
return this.isReadyToBeDisplayedInCreateMode
......
......@@ -2,6 +2,7 @@ import {AdminOrgunitCreateRoutable} from "@admin/orgunit/components/routables/ad
import {AdminOrgunitDetailRoutable} from "@admin/orgunit/components/routables/admin-orgunit-detail/admin-orgunit-detail.routable";
import {AdminOrgunitEditRoutable} from "@admin/orgunit/components/routables/admin-orgunit-edit/admin-orgunit-edit.routable";
import {AdminOrgunitListRoutable} from "@admin/orgunit/components/routables/admin-orgunit-list/admin-orgunit-list.routable";
import {AdminOrganizationalUnitState} from "@admin/orgunit/stores/admin-organizational-unit.state";
import {NgModule} from "@angular/core";
import {
RouterModule,
......@@ -25,6 +26,7 @@ const routes: Routes = [
component: AdminOrgunitDetailRoutable,
data: {
breadcrumb: TRANSLATE("breadcrumb.admin.organizationalUnit.detail"),
breadcrumbMemoizedSelector: AdminOrganizationalUnitState.currentTitle,
},
},
{
......
......@@ -129,6 +129,14 @@ export class AdminOrganizationalUnitState extends ResourceState<OrganizationalUn
|| StoreUtil.isLoadingState(state.admin_organizationalUnit_institution);
}
@Selector()
static currentTitle(state: AdminOrganizationalUnitStateModel): string | undefined {
if (isNullOrUndefined(state.current)) {
return undefined;
}
return state.current.name;
}
@Selector()
static isReadyToBeDisplayed(state: AdminOrganizationalUnitStateModel): boolean {
return this.isReadyToBeDisplayedInCreateMode
......
......@@ -2,6 +2,7 @@ import {AdminPersonCreateRoutable} from "@admin/person/components/routables/admi
import {AdminPersonDetailRoutable} from "@admin/person/components/routables/admin-person-detail/admin-person-detail.routable";
import {AdminPersonEditRoutable} from "@admin/person/components/routables/admin-person-edit/admin-person-edit.routable";
import {AdminPersonListRoutable} from "@admin/person/components/routables/admin-person-list/admin-person-list.routable";
import {AdminPersonState} from "@admin/person/stores/admin-person.state";
import {NgModule} from "@angular/core";
import {
RouterModule,
......@@ -30,6 +31,7 @@ const routes: Routes = [
component: AdminPersonDetailRoutable,
data: {
breadcrumb: TRANSLATE("breadcrumb.admin.person.detail"),
breadcrumbMemoizedSelector: AdminPersonState.currentTitle,
permission: ApplicationRolePermissionEnum.rootPermission,
},
},
......
......@@ -95,6 +95,14 @@ export class AdminPersonState extends ResourceState<PersonExtended> {
|| StoreUtil.isLoadingState(state.admin_person_institutions);
}
@Selector()
static currentTitle(state: AdminPersonStateModel): string | undefined {
if (isNullOrUndefined(state.current)) {
return undefined;
}
return state.current.fullName;
}
@Selector()
static isReadyToBeDisplayed(state: AdminPersonStateModel): boolean {
return this.isReadyToBeDisplayedInCreateMode
......
......@@ -13,6 +13,7 @@ import {
} from "@shared/enums/routes.enum";
import {CanDeactivateGuard} from "@shared/services/can-deactivate-guard.service";
import {TRANSLATE} from "solidify-frontend";
import {AdminPreservationPolicyState} from "./stores/admin-preservation-policy.state";
const routes: Routes = [
{
......@@ -25,6 +26,7 @@ const routes: Routes = [
component: AdminPreservationPolicyDetailRoutable,
data: {
breadcrumb: TRANSLATE("breadcrumb.admin.preservationPolicy.detail"),
breadcrumbMemoizedSelector: AdminPreservationPolicyState.currentTitle,
},
},
{
......
......@@ -60,6 +60,14 @@ export class AdminPreservationPolicyState extends ResourceState<PreservationPoli
return this.isLoading(state);
}
@Selector()
static currentTitle(state: AdminPreservationPolicyStateModel): string | undefined {
if (isNullOrUndefined(state.current)) {
return undefined;
}
return state.current.name;
}
@Selector()
static isReadyToBeDisplayed(state: AdminPreservationPolicyStateModel): boolean {
return this.isReadyToBeDisplayedInCreateMode
......
import {AdminRoleDetailRoutable} from "@admin/role/components/routables/admin-role-detail/admin-role-detail.routable";
import {AdminRoleEditRoutable} from "@admin/role/components/routables/admin-role-edit/admin-role-edit.routable";
import {AdminRoleListRoutable} from "@admin/role/components/routables/admin-role-list/admin-role-list.routable";
import {AdminRoleState} from "@admin/role/stores/admin-role.state";
import {NgModule} from "@angular/core";
import {
RouterModule,
......@@ -24,6 +25,7 @@ const routes: Routes = [
component: AdminRoleDetailRoutable,
data: {
breadcrumb: TRANSLATE("breadcrumb.admin.role.detail"),
breadcrumbMemoizedSelector: AdminRoleState.currentTitle,
},
},
{
......
......@@ -61,6 +61,14 @@ export class AdminRoleState extends ResourceState<Role> {
return this.isLoading(state);
}
@Selector()
static currentTitle(state: AdminRoleStateModel): string | undefined {
if (isNullOrUndefined(state.current)) {
return undefined;
}
return state.current.name;
}
@Selector()
static isReadyToBeDisplayed(state: AdminRoleStateModel): boolean {
return this.isReadyToBeDisplayedInCreateMode
......
......@@ -60,6 +60,14 @@ export class AdminSubmissionPolicyState extends ResourceState<SubmissionPolicy>
return this.isLoading(state);
}
@Selector()
static currentTitle(state: AdminSubmissionPolicyStateModel): string | undefined {
if (isNullOrUndefined(state.current)) {
return undefined;
}
return state.current.name;
}
@Selector()
static isReadyToBeDisplayed(state: AdminSubmissionPolicyStateModel): boolean {
return this.isReadyToBeDisplayedInCreateMode
......
......@@ -2,6 +2,7 @@ import {AdminSubmissionPolicyCreateRoutable} from "@admin/submission-policy/comp
import {AdminSubmissionPolicyDetailRoutable} from "@admin/submission-policy/components/routables/admin-submission-policy-detail/admin-submission-policy-detail.routable";
import {AdminSubmissionPolicyEditRoutable} from "@admin/submission-policy/components/routables/admin-submission-policy-edit/admin-submission-policy-edit.routable";
import {AdminSubmissionPolicyListRoutable} from "@admin/submission-policy/components/routables/admin-submission-policy-list/admin-submission-policy-list.routable";
import {AdminSubmissionPolicyState} from "@admin/submission-policy/stores/admin-submission-policy.state";
import {NgModule} from "@angular/core";
import {
RouterModule,
......@@ -25,6 +26,7 @@ const routes: Routes = [
component: AdminSubmissionPolicyDetailRoutable,
data: {
breadcrumb: TRANSLATE("breadcrumb.admin.submissionPolicy.detail"),
breadcrumbMemoizedSelector: AdminSubmissionPolicyState.currentTitle,
},
},
{
......
......@@ -68,6 +68,14 @@ export class AdminUserState extends ResourceState<UserExtended> {
return this.isLoading(state);
}
@Selector()
static currentTitle(state: AdminUserStateModel): string | undefined {
if (isNullOrUndefined(state.current)) {
return undefined;
}
return state.current.externalUid;
}
@Selector()
static isReadyToBeDisplayed(state: AdminUserStateModel): boolean {
return this.isReadyToBeDisplayedInCreateMode
......
......@@ -2,6 +2,7 @@ import {AdminUserCreateRoutable} from "@admin/user/components/routables/admin-us
import {AdminUserDetailRoutable} from "@admin/user/components/routables/admin-user-detail/admin-user-detail.routable";
import {AdminUserEditRoutable} from "@admin/user/components/routables/admin-user-edit/admin-user-edit.routable";
import {AdminUserListRoutable} from "@admin/user/components/routables/admin-user-list/admin-user-list.routable";
import {AdminUserState} from "@admin/user/stores/admin-user.state";
import {NgModule} from "@angular/core";
import {
RouterModule,
......@@ -30,6 +31,7 @@ const routes: Routes = [
component: AdminUserDetailRoutable,
data: {
breadcrumb: TRANSLATE("breadcrumb.admin.user.detail"),
breadcrumbMemoizedSelector: AdminUserState.currentTitle,
permission: ApplicationRolePermissionEnum.rootPermission,
},
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment