Skip to content

Commit

Permalink
fix: update openapi prepared for role view on menu (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryT-CG authored Dec 10, 2024
1 parent b110733 commit 6a6aace
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@


export interface MenuStructureSearchCriteria {
roles?: Array<string>;
workspaceId: string;
}

9 changes: 5 additions & 4 deletions src/app/workspace/workspace-menu/menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<div class="slim-selectbutton filter-selectbutton">
<p-selectButton
inputid="ws_menu_table_header_row_1_switch_tree_label"
styleClass="data-view-control flex flex-nowrap"
styleClass="data-view-control max-w-15rem flex flex flex-wrap row-gap-1"
[options]="treeNodeLabelSwitchItems"
[(ngModel)]="treeNodeLabelSwitchValue"
(onChange)="onTreeNodeLabelSwitchChange($event)"
Expand Down Expand Up @@ -368,15 +368,16 @@
</div>
</td>
<td class="p-2 text-center hidden-md">
<span
<div
*ngIf="!isObjectEmpty(rowData.i18n)"
[id]="'ws_menu_table_row_' + rowData.key + '_i18n'"
class="white-space-nowrap"
class="white-space-nowrap text-responsive max-w-4rem"
[pTooltip]="'DIALOG.MENU.TREE.I18N.ROW.TOOLTIP' | translate"
tooltipPosition="top"
tooltipEvent="hover"
>{{ Object.keys(rowData.i18n).join(', ') }}</span
>
{{ Object.keys(rowData.i18n).sort(sortByLocale).join(', ') }}
</div>
</td>
<td class="p-2 text-center hidden-md">
<span
Expand Down
8 changes: 4 additions & 4 deletions src/app/workspace/workspace-menu/menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export class MenuComponent implements OnInit, OnDestroy {
@ViewChild('roleFilter') roleFilter: HTMLInputElement | undefined

Object = Object
limitText = limitText // utils declarations
public limitText = limitText // utils declarations
public sortByLocale = sortByLocale
private readonly destroy$ = new Subject()
private readonly debug = false // to be removed after finalization
// dialog control
public actions: Action[] = []
public actions$: Observable<Action[]> | undefined
Expand Down Expand Up @@ -428,7 +428,7 @@ export class MenuComponent implements OnInit, OnDestroy {
if (!this.workspace) return
this.menuItem = undefined
this.menu$ = this.menuApi
.getMenuStructure({ menuStructureSearchCriteria: { workspaceId: this.workspace.id! } })
.getMenuStructure({ menuStructureSearchCriteria: { workspaceId: this.workspace.id!, roles: [] } })
.pipe(catchError((error) => of(error)))
this.menu$.subscribe((result) => {
this.loading = true
Expand Down Expand Up @@ -635,7 +635,7 @@ export class MenuComponent implements OnInit, OnDestroy {
this.treeNodeLabelSwitchValueOrg = '' // reset
this.onTreeNodeLabelSwitchChange({ value: this.treeNodeLabelSwitchValue })
// initially open the first menu item if exists
if (!restore && this.menuNodes.length > 1) {
if (!restore && this.menuNodes.length >= 1) {
this.menuNodes[0].expanded = true
this.stateService.getState().treeExpansionState.set(this.menuNodes[0].key!, true)
}
Expand Down
Loading

0 comments on commit 6a6aace

Please sign in to comment.