Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(daffio): add DaffioRouteWithSidebars #3025

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/daffio/src/app/core/router/route.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { DaffDocKind } from '@daffodil/docs-utils';
import { DaffRouteWithNamedViews } from '@daffodil/router';

import { DaffioRouteWithNavLinks } from '../nav/link/route.type';
import { DaffioRouteWithSidebars } from '../sidebar/models/route.type';

/**
* A route config that possibly contains different kinds of data used in the application.
Expand All @@ -12,6 +13,7 @@ export interface DaffioRoute extends Route {
data?: Route['data']
& DaffRouteWithNamedViews['data']
& DaffioRouteWithNavLinks['data']
& DaffioRouteWithSidebars['data']
& {
docKind?: DaffDocKind;
};
Expand Down
20 changes: 20 additions & 0 deletions apps/daffio/src/app/core/sidebar/models/route.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Route } from '@angular/router';

import {
DaffSidebarModeEnum,
DaffSidebarRegistration,
} from '@daffodil/design/sidebar';

export interface DaffioRouteWithSidebars extends Route {
data?: Route['data'] & {
/**
* A collection of sidebars available on the current page.
*/
daffioSidebars?: Record<DaffSidebarRegistration['id'], DaffSidebarRegistration>;
/**
* The sidebar that should be shown automatically (if any) when the viewport enters big tablet.
*/
daffioDockedSidebar?: DaffSidebarRegistration['id'];
sidebarMode?: DaffSidebarModeEnum;
};
}
Loading