This is an automated email from the ASF dual-hosted git repository. linxinyuan pushed a commit to branch xinyuan-improve-dropdown in repository https://gitbox.apache.org/repos/asf/texera.git
commit ba5052d4fd6f0fb808c1457789da2c45b3742346 Author: Xinyuan Lin <[email protected]> AuthorDate: Mon Oct 13 18:21:56 2025 -0700 init --- frontend/src/app/app.module.ts | 2 ++ .../workspace/component/menu/menu.component.html | 29 ++++++++++++++++------ .../app/workspace/component/menu/menu.component.ts | 11 +++----- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index 2080e41ae0..257c2961fa 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -175,6 +175,7 @@ import { NzSliderModule } from "ng-zorro-antd/slider"; import { AdminSettingsComponent } from "./dashboard/component/admin/settings/admin-settings.component"; import { FormlyRepeatDndComponent } from "./common/formly/repeat-dnd/repeat-dnd.component"; import { NzInputNumberModule } from "ng-zorro-antd/input-number"; +import { NzCheckboxModule } from "ng-zorro-antd/checkbox"; registerLocaleData(en); @@ -333,6 +334,7 @@ registerLocaleData(en); NzDividerModule, NzProgressModule, NzInputNumberModule, + NzCheckboxModule, ], providers: [ provideNzI18n(en_US), diff --git a/frontend/src/app/workspace/component/menu/menu.component.html b/frontend/src/app/workspace/component/menu/menu.component.html index fc691f18b7..f158222197 100644 --- a/frontend/src/app/workspace/component/menu/menu.component.html +++ b/frontend/src/app/workspace/component/menu/menu.component.html @@ -144,6 +144,27 @@ </nz-button-group> <ng-template #utilities> <nz-button-group> + <button + nz-dropdown + [nzDropdownMenu]="menu" + nz-button + title="Layers"> + <i + nz-icon + nzType="block"></i> + </button> + <nz-dropdown-menu #menu="nzDropdownMenu"> + <ul nz-menu> + <li nz-menu-item> + <label + nz-checkbox + [(ngModel)]="grid" + (ngModelChange)="onGridChange()" + >Grid</label + > + </li> + </ul> + </nz-dropdown-menu> <button (click)="onClickClosePanels()" nz-button @@ -168,14 +189,6 @@ nz-icon nzType="printer"></i> </button> - <button - (click)="onClickToggleGrids()" - nz-button - title="Toggle Grids"> - <i - nz-icon - nzType="border-outer"></i> - </button> <button (click)="onClickRestoreZoomOffsetDefault()" nz-button diff --git a/frontend/src/app/workspace/component/menu/menu.component.ts b/frontend/src/app/workspace/component/menu/menu.component.ts index 4b5c3835f5..994608fc36 100644 --- a/frontend/src/app/workspace/component/menu/menu.component.ts +++ b/frontend/src/app/workspace/component/menu/menu.component.ts @@ -88,6 +88,7 @@ export class MenuComponent implements OnInit, OnDestroy { public isWorkflowModifiable: boolean = false; public workflowId?: number; public isExportDeactivate: boolean = false; + public grid: boolean = false; protected readonly DASHBOARD_USER_WORKFLOW = DASHBOARD_USER_WORKFLOW; @Input() public writeAccess: boolean = false; @@ -457,14 +458,8 @@ export class MenuComponent implements OnInit, OnDestroy { }); } - /** - * This method will flip the current status of whether to draw grids in jointPaper. - * This option is only for the current session and will be cleared on refresh. - */ - public onClickToggleGrids(): void { - const paper = this.workflowActionService.getJointGraphWrapper().mainPaper; - const current = paper.options.gridSize || 1; - paper.setGridSize((current % 2) + 1); + public onGridChange(): void { + this.workflowActionService.getJointGraphWrapper().mainPaper.setGridSize(this.grid ? 2 : 1); } /**
