From f1d4177314e6a46c6a93bfc73a32c1e394cf19ac Mon Sep 17 00:00:00 2001 From: Armin Date: Tue, 27 Aug 2024 22:31:48 +0330 Subject: [PATCH] refactor(graph): Move graph to dashboard :) (#62) --- src/app/app.routes.ts | 4 +- .../sigma/sigma/sigma.component.html | 2 +- .../sigma/sigma/sigma.component.scss | 2 +- .../sigma/sigma/sigma.component.spec.ts | 4 +- .../sigma/sigma/sigma.component.ts | 3 +- .../graph-tool-bar.component.html | 57 ++++++------------- .../graph-tool-bar.component.scss | 14 +++-- .../components/sidebar/sidebar.component.html | 2 +- .../page/dashboard/dashboard.component.scss | 8 +-- src/app/page/graph/graph/graph.component.html | 4 +- src/app/page/graph/graph/graph.component.scss | 2 +- 11 files changed, 42 insertions(+), 60 deletions(-) diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index ec7260d..37187a0 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -15,7 +15,7 @@ export const routes: Routes = [ path: 'dashboard', component: DashboardComponent, children: [ - {path: '' , component: DashboardContentComponent}, + { path: '', component: DashboardContentComponent }, { path: 'profile', component: ProfileComponent, @@ -34,8 +34,8 @@ export const routes: Routes = [ component: EditUserComponent, canActivate: [ManageUsersGuardService], }, + { path: 'graph', component: GraphComponent }, ], canActivate: [DashboardGuardService], }, - { path: 'graph', component: GraphComponent }, ]; diff --git a/src/app/components/graph-components/sigma/sigma/sigma.component.html b/src/app/components/graph-components/sigma/sigma/sigma.component.html index 8af703c..4e774c0 100644 --- a/src/app/components/graph-components/sigma/sigma/sigma.component.html +++ b/src/app/components/graph-components/sigma/sigma/sigma.component.html @@ -28,6 +28,6 @@ - +
diff --git a/src/app/components/graph-components/sigma/sigma/sigma.component.scss b/src/app/components/graph-components/sigma/sigma/sigma.component.scss index 06f6a7e..655d8e2 100644 --- a/src/app/components/graph-components/sigma/sigma/sigma.component.scss +++ b/src/app/components/graph-components/sigma/sigma/sigma.component.scss @@ -1,7 +1,7 @@ #sigma-container { flex-grow: 1; width: calc(100vw - 35rem - 6.4rem); - height: 100vh; + height: 100%; background-color: #f8f6f4; } diff --git a/src/app/components/graph-components/sigma/sigma/sigma.component.spec.ts b/src/app/components/graph-components/sigma/sigma/sigma.component.spec.ts index ca9dd6b..b5deb61 100644 --- a/src/app/components/graph-components/sigma/sigma/sigma.component.spec.ts +++ b/src/app/components/graph-components/sigma/sigma/sigma.component.spec.ts @@ -2,7 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { SigmaComponent } from './sigma.component'; import { NZ_ICONS, NzIconService } from 'ng-zorro-antd/icon'; -import { FullscreenOutline } from '@ant-design/icons-angular/icons'; +import { CloudDownloadOutline, FilterOutline, FullscreenOutline, ImportOutline, SettingOutline } from '@ant-design/icons-angular/icons'; describe('SigmaComponent', () => { let component: SigmaComponent; @@ -15,7 +15,7 @@ describe('SigmaComponent', () => { NzIconService, { provide: NZ_ICONS, - useValue: [FullscreenOutline], + useValue: [FullscreenOutline,ImportOutline , FilterOutline , SettingOutline,CloudDownloadOutline], }, ], }).compileComponents(); diff --git a/src/app/components/graph-components/sigma/sigma/sigma.component.ts b/src/app/components/graph-components/sigma/sigma/sigma.component.ts index 00ba478..b5fb613 100644 --- a/src/app/components/graph-components/sigma/sigma/sigma.component.ts +++ b/src/app/components/graph-components/sigma/sigma/sigma.component.ts @@ -13,13 +13,14 @@ import { EdgeArrowProgram } from 'sigma/rendering'; import { EdgeCurvedArrowProgram } from '@sigma/edge-curve'; import { MockBackService } from '../../../../services/mock-back/mock-back.service'; import { State } from '../../../../models/graph-state'; +import { GraphToolBarComponent } from "../../toolbarl/graph-tool-bar/graph-tool-bar.component"; // ********** This component can be a bit confusing so I have to use comments to ease the understanding (Sorry if the comments are a bit informal ^.^) ********** @Component({ selector: 'app-sigma', standalone: true, - imports: [NzIconModule, NzToolTipModule], + imports: [NzIconModule, NzToolTipModule, GraphToolBarComponent], templateUrl: './sigma.component.html', styleUrl: './sigma.component.scss', }) diff --git a/src/app/components/graph-components/toolbarl/graph-tool-bar/graph-tool-bar.component.html b/src/app/components/graph-components/toolbarl/graph-tool-bar/graph-tool-bar.component.html index b132807..e56bc8a 100644 --- a/src/app/components/graph-components/toolbarl/graph-tool-bar/graph-tool-bar.component.html +++ b/src/app/components/graph-components/toolbarl/graph-tool-bar/graph-tool-bar.component.html @@ -1,17 +1,13 @@ -
- - -
- -
+
+
- -
- -
- - - -
@@ -110,9 +88,8 @@
-
- +
-
\ No newline at end of file + diff --git a/src/app/components/graph-components/toolbarl/graph-tool-bar/graph-tool-bar.component.scss b/src/app/components/graph-components/toolbarl/graph-tool-bar/graph-tool-bar.component.scss index 08e90fb..126c835 100644 --- a/src/app/components/graph-components/toolbarl/graph-tool-bar/graph-tool-bar.component.scss +++ b/src/app/components/graph-components/toolbarl/graph-tool-bar/graph-tool-bar.component.scss @@ -1,16 +1,19 @@ .toolbar-container { - inline-size: 6.4rem; - height: 100vh; + width: 100%; + justify-content: center; overflow-x: hidden; - background: #fff; padding-right: 0; padding-left: 0; display: flex; - flex-direction: column; + flex-direction: row; padding-block-end: 0.25rem; - + position: absolute; +z-index: 999999999999999999999999; &__btn-container{ gap: 2rem !important; + padding-inline: 1rem; + background-color: #fff; + border-radius: 2rem; } &__logo{ @@ -50,6 +53,7 @@ .active{ background-color: #1f66a8; color: #fff; + border-radius: 50%; } ::ng-deep { diff --git a/src/app/components/sidebar/sidebar.component.html b/src/app/components/sidebar/sidebar.component.html index 003b543..b5654b9 100644 --- a/src/app/components/sidebar/sidebar.component.html +++ b/src/app/components/sidebar/sidebar.component.html @@ -74,7 +74,7 @@

Negar

nzOpen nzTitle="Graph" nzIcon="team" - routerLink="/graph" + routerLink="/dashboard/graph" routerLinkActive="ant-menu-item-selected" [routerLinkActiveOptions]="{ exact: true }" > diff --git a/src/app/page/dashboard/dashboard.component.scss b/src/app/page/dashboard/dashboard.component.scss index 859147f..2a49fad 100644 --- a/src/app/page/dashboard/dashboard.component.scss +++ b/src/app/page/dashboard/dashboard.component.scss @@ -20,7 +20,7 @@ nz-content { padding-block: 2.4rem; - inline-size: 125rem; + // inline-size: 125rem; display: flex; flex-direction: column; gap: 4rem; @@ -30,6 +30,6 @@ nz-content { } } -.app-layout__content { - padding-inline: 5rem; -} \ No newline at end of file +// .app-layout__content { +// // padding-inline: 5rem; +// } \ No newline at end of file diff --git a/src/app/page/graph/graph/graph.component.html b/src/app/page/graph/graph/graph.component.html index d5fa5d5..661fbee 100644 --- a/src/app/page/graph/graph/graph.component.html +++ b/src/app/page/graph/graph/graph.component.html @@ -1,6 +1,6 @@
- + - +
diff --git a/src/app/page/graph/graph/graph.component.scss b/src/app/page/graph/graph/graph.component.scss index f228f97..d8e7c04 100644 --- a/src/app/page/graph/graph/graph.component.scss +++ b/src/app/page/graph/graph/graph.component.scss @@ -1,6 +1,6 @@ .graph-page-container { width: 100%; - height: 100vh; + height: 100%; display: flex; flex-direction: row;