Skip to content

Commit

Permalink
NAS-123587 / 24.04 / Refactored tables (#8659)
Browse files Browse the repository at this point in the history
  • Loading branch information
RehanY147 authored Aug 28, 2023
1 parent 0d06005 commit 7d0190b
Show file tree
Hide file tree
Showing 109 changed files with 952 additions and 616 deletions.
3 changes: 3 additions & 0 deletions src/app/interfaces/kerberos-realm.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ export interface KerberosRealm {
kdc: string[];
kpasswd_server: string[];
realm: string;
kdc_string: string;
admin_server_string: string;
kpasswd_server_string: string;
}

export type KerberosRealmUpdate = Omit<KerberosRealm, 'id'>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div class="actions">
<ng-container
*ngFor="let action of actions"
>
<button
*ngIf="action.hidden ? !(action.hidden(row) | async) : true"
mat-icon-button
ixTest="row-edit"
[matTooltip]="action.tooltip || ''"
(click)="$event.stopPropagation(); action.onClick(row)"
>
<ix-icon [name]="action.iconName"></ix-icon>
</button>
</ng-container>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.actions {
display: flex;
gap: 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Component } from '@angular/core';
import { Observable } from 'rxjs';
import { Column, ColumnComponent } from 'app/modules/ix-table2/interfaces/table-column.interface';

@Component({
templateUrl: './ix-cell-actions.component.html',
styleUrls: ['./ix-cell-actions.component.scss'],
})
export class IxCellActionsComponent<T> extends ColumnComponent<T> {
actions: {
iconName: string;
onClick: (row: T) => void;
tooltip?: string;
hidden?: (row: T) => Observable<boolean>;
}[];
}

export function actionsColumn<T>(options: Partial<IxCellActionsComponent<T>>): Column<T, IxCellActionsComponent<T>> {
return { type: IxCellActionsComponent, ...options };
}

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 3 additions & 3 deletions src/app/modules/ix-table2/ix-table2.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import { NgxFilesizeModule } from 'ngx-filesize';
import { CoreComponents } from 'app/core/core-components.module';
import { IxIconModule } from 'app/modules/ix-icon/ix-icon.module';
import { IxTable2EmptyRowComponent } from 'app/modules/ix-table2/components/ix-empty-row/ix-empty-row.component';
import { IxCellActionsComponent } from 'app/modules/ix-table2/components/ix-table-body/cells/ix-cell-actions/ix-cell-actions.component';
import { IxCellCheckboxComponent } from 'app/modules/ix-table2/components/ix-table-body/cells/ix-cell-checkbox/ix-cell-checkbox.component';
import { IxCellDateComponent } from 'app/modules/ix-table2/components/ix-table-body/cells/ix-cell-date/ix-cell-date.component';
import { IxCellDeleteComponent } from 'app/modules/ix-table2/components/ix-table-body/cells/ix-cell-delete/ix-cell-delete.component';
import { IxCellScheduleComponent } from 'app/modules/ix-table2/components/ix-table-body/cells/ix-cell-schedule/ix-cell-schedule.component';
import { IxCellSizeComponent } from 'app/modules/ix-table2/components/ix-table-body/cells/ix-cell-size/ix-cell-size.component';
import { IxCellTextComponent } from 'app/modules/ix-table2/components/ix-table-body/cells/ix-cell-text/ix-cell-text.component';
Expand Down Expand Up @@ -68,7 +68,7 @@ import { IxTableColumnsSelectorComponent } from './components/ix-table-columns-s
IxCellSizeComponent,
IxCellCheckboxComponent,
IxCellYesNoComponent,
IxCellDeleteComponent,
IxCellActionsComponent,
IxCellToggleComponent,
IxCellScheduleComponent,
IxHeaderCellTextComponent,
Expand All @@ -93,7 +93,7 @@ import { IxTableColumnsSelectorComponent } from './components/ix-table-columns-s
IxCellSizeComponent,
IxCellCheckboxComponent,
IxCellYesNoComponent,
IxCellDeleteComponent,
IxCellActionsComponent,
IxCellToggleComponent,
IxCellScheduleComponent,
IxHeaderCellTextComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<ng-template ixPageHeader>
<ix-page-title-header>
<ix-search-input (search)="onListFiltered($event)"></ix-search-input>
<button mat-button color="primary" ixTest="add-idmap" (click)="doAdd()">
{{ 'Add' | translate }}
</button>
</ix-page-title-header>
</ng-template>

<div class="table-container">
<mat-toolbar *ngIf="toolbar" class="table-header">
<div class="heading" [routerLink]="['/', 'directoryservice', 'idmap']">
<h3>{{ 'Idmap' | translate }}</h3>
<ix-icon name="open_in_new"></ix-icon>
</div>
<div class="action">
<button mat-button ixTest="add-idmap" (click)="doAdd()">
{{ 'Add' | translate }}
</button>
</div>
</mat-toolbar>
<ix-table2
[ix-table2-empty]="!dataProvider.rows.length"
[emptyConfig]="emptyService.defaultEmptyConfig(emptyType$ | async)"
>
<thead
ix-table-head
[columns]="columns"
[dataProvider]="dataProvider"
></thead>
<tbody
ix-table-body
[columns]="columns"
[dataProvider]="dataProvider"
>
</tbody>
</ix-table2>
<ix-table-pager *ngIf="paginator" [dataProvider]="dataProvider"></ix-table-pager>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.table-container {
margin: 0.3333rem;

::ng-deep ix-empty-row {
background: var(--bg2);
border-left: 1px solid var(--contrast-lighter);
border-right: 1px solid var(--contrast-lighter);
}
}

.table-header {
background: var(--bg2);
border-left: solid 1px var(--lines);
border-right: solid 1px var(--lines);
border-top: solid 1px var(--lines);
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}

.heading {
cursor: pointer;
display: flex;
gap: 5px;
}

.mat-toolbar-row,
.mat-toolbar-single-row {
height: 48px;
}

.mat-mdc-card {
margin: 0.333333rem;
}

.table-header {
display: flex;
justify-content: space-between;
}
Loading

0 comments on commit 7d0190b

Please sign in to comment.