Skip to content

Commit

Permalink
feat(4ps): update
Browse files Browse the repository at this point in the history
  • Loading branch information
develite98 committed Jan 4, 2024
1 parent 9900462 commit a140421
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 22 deletions.
25 changes: 25 additions & 0 deletions libs/mix-share/src/bases/base-page-component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {
Directive,
TemplateRef,
ViewChild,
ViewContainerRef,
inject,
} from '@angular/core';
import { ToolbarService } from '@mixcore/share/components';
import { BaseComponent } from './base-component';

@Directive()
export class BasePageComponent extends BaseComponent {
@ViewChild('breadcrumb') public breadcrumb?: TemplateRef<HTMLElement>;
public toolbarService = inject(ToolbarService);
public viewRef = inject(ViewContainerRef);

ngAfterViewInit() {
if (this.breadcrumb) this.toolbarService.add(this.breadcrumb, this.viewRef);
}

override ngOnDestroy() {
super.ngOnDestroy();
this.toolbarService.remove();
}
}
1 change: 1 addition & 0 deletions libs/mix-share/src/bases/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './base-api.service';
export * from './base-appconfig';
export * from './base-component';
export * from './base-crud.store';
export * from './base-page-component';
2 changes: 1 addition & 1 deletion libs/mix-share/src/modules/database/database.layout.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<router-outlet></router-outlet>

<ng-template #contextCtrl>
<ng-template #breadcrumb>
<nav class="flex" aria-label="Breadcrumb">
<ol class="inline-flex items-center space-x-1 md:space-x-2 rtl:space-x-reverse">
<li class="inline-flex items-center">
Expand Down
23 changes: 3 additions & 20 deletions libs/mix-share/src/modules/database/database.layout.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { CommonModule } from '@angular/common';
import {
ChangeDetectionStrategy,
Component,
TemplateRef,
ViewChild,
ViewContainerRef,
inject,
} from '@angular/core';
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { RouterModule } from '@angular/router';
import { BasePageComponent } from '@mixcore/share/base';
import { ToolbarService } from '@mixcore/share/components';
import { TuiLinkModule } from '@taiga-ui/core';
import { TuiBreadcrumbsModule } from '@taiga-ui/kit';
Expand All @@ -34,18 +28,7 @@ import { DbUiStore } from './store/db-ui.store';
}
`,
})
export class DatabaseLayoutComponent {
@ViewChild('contextCtrl') public projectCtrl!: TemplateRef<unknown>;

export class DatabaseLayoutComponent extends BasePageComponent {
public toolbarSrv = inject(ToolbarService);
public viewRef = inject(ViewContainerRef);
public uiStore = inject(DbUiStore);

ngAfterViewInit() {
this.toolbarSrv.add(this.projectCtrl, this.viewRef);
}

ngOnDestroy() {
this.toolbarSrv.remove();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
(expandChange)="onExpandChange()"></mix-main-side-menu>
</aside>

<main class="shadow flex flex-col h-full overflow-auto"
<main class="shadow flex flex-col h-full overflow-auto rounded-tl-xl"
id="canvas">
<mix-main-toolbar [showExpandBtn]="!expand()"
(expandChange)="onExpandChange()"></mix-main-toolbar>
Expand Down

1 comment on commit a140421

@vercel
Copy link

@vercel vercel bot commented on a140421 Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.