Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdminUI: Filtering and ordering for overview tables #350

Merged
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
cc1880a
feat: register odata and add identities odata controller
daniel-almeida-konkconsulting Sep 22, 2023
e14fbd7
feat: remove GetIdentities from Identities(Rest)Controller
daniel-almeida-konkconsulting Sep 22, 2023
7e08074
feat: use odata endpoint to retrieve identities
daniel-almeida-konkconsulting Sep 22, 2023
88d4e86
feat: enable camel lower case to keep consistency with standard api
daniel-almeida-konkconsulting Sep 22, 2023
ec5a3ed
feat: add filters for identities through OData
daniel-almeida-konkconsulting Oct 10, 2023
5d14757
feat: remove pagination from tiers endpoint
daniel-almeida-konkconsulting Oct 10, 2023
9798a9a
feat: add filter and sorting to clients page.
daniel-almeida-konkconsulting Oct 13, 2023
02b86d7
fix: identity layout and filter behaviour
daniel-almeida-konkconsulting Oct 13, 2023
e08664e
Merge branch 'main' into filtering-and-ordering-for-overview-tables
daniel-almeida-konkconsulting Oct 13, 2023
c76e626
fix: change ClientOverview entity after merge with main
daniel-almeida-konkconsulting Oct 16, 2023
718aea9
feat: use pagination with OData
daniel-almeida-konkconsulting Oct 16, 2023
1c00875
feat: add ordering by client id and display name
daniel-almeida-konkconsulting Oct 16, 2023
895e763
test: adjust integration tests to account for new odata route
daniel-almeida-konkconsulting Oct 16, 2023
3dba7b5
fix: eslint errors
daniel-almeida-konkconsulting Oct 16, 2023
c331e5f
fix: remove unused import
daniel-almeida-konkconsulting Oct 16, 2023
326a30f
fix: run prettier on all files
daniel-almeida-konkconsulting Oct 16, 2023
9db8bfb
Merge branch 'main' into filtering-and-ordering-for-overview-tables
daniel-almeida-konkconsulting Oct 16, 2023
76280a4
Merge branch 'main' into filtering-and-ordering-for-overview-tables
daniel-almeida-konkconsulting Oct 17, 2023
a959be4
feat: add filters for new client overview columns
daniel-almeida-konkconsulting Oct 17, 2023
9984226
fix: fix identity filters that were not behaving properly
daniel-almeida-konkconsulting Oct 17, 2023
6ecc4a0
feat: remove up and down arrows from numeric inputs
daniel-almeida-konkconsulting Oct 17, 2023
b76661b
fix: eslint errors
daniel-almeida-konkconsulting Oct 18, 2023
3ffcf0c
fix: odata filter now correctly builds taking into consideration AND/…
daniel-almeida-konkconsulting Oct 18, 2023
1f55ed1
refactor: use const instead of var
daniel-almeida-konkconsulting Oct 18, 2023
132c582
refactor: run prettier on codebase
daniel-almeida-konkconsulting Oct 18, 2023
cf6a72d
fix: add missing default cases for switch statements
daniel-almeida-konkconsulting Oct 18, 2023
c77c6cf
Merge branch 'main' into filtering-and-ordering-for-overview-tables
daniel-almeida-konkconsulting Oct 18, 2023
75d2846
refactor: rename client service
daniel-almeida-konkconsulting Oct 19, 2023
d0cf5a0
fix: remove unused is ODataRequest property
daniel-almeida-konkconsulting Oct 19, 2023
d918078
refactor: rename viewChild parameters
daniel-almeida-konkconsulting Oct 19, 2023
817f9b6
Merge main into filtering-and-ordering-for-overview-tables
github-actions[bot] Oct 19, 2023
8d1e9a4
refactor: simplify odata filter concatenation
daniel-almeida-konkconsulting Oct 19, 2023
823386a
Merge branch 'filtering-and-ordering-for-overview-tables' of https://…
daniel-almeida-konkconsulting Oct 19, 2023
cff8508
refactor: remove unused error property from ODataResponseContent
daniel-almeida-konkconsulting Oct 19, 2023
6db8b1b
refactor: make methods that aren't used by the html template private
daniel-almeida-konkconsulting Oct 19, 2023
54f73f7
Merge main into filtering-and-ordering-for-overview-tables
github-actions[bot] Oct 20, 2023
40b98e7
Merge main into filtering-and-ordering-for-overview-tables
github-actions[bot] Oct 23, 2023
7ef46d6
Merge main into filtering-and-ordering-for-overview-tables
github-actions[bot] Oct 23, 2023
e9a90ec
ci: trigger pipelines
daniel-almeida-konkconsulting Oct 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AdminUi/src/AdminUi/AdminUi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OData" Version="8.2.3" />
<PackageReference Include="Microsoft.AspNetCore.SpaProxy" Version="7.0.12" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.12">
Expand Down
6 changes: 6 additions & 0 deletions AdminUi/src/AdminUi/ClientApp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions AdminUi/src/AdminUi/ClientApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"bootstrap": "^5.2.3",
"jquery": "^3.6.3",
"ngx-logger": "^5.0.12",
"odata-filter-builder": "^1.0.0",
"oidc-client": "^1.11.5",
"popper.js": "^1.16.0",
"run-script-os": "^1.1.6",
Expand Down
3 changes: 2 additions & 1 deletion AdminUi/src/AdminUi/ClientApp/src/app/app.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

.layout-content {
padding: 1rem;
max-width: 1350px;
min-width: 1350px;
margin: auto;
width: fit-content;
}

.login-layout {
Expand Down
6 changes: 6 additions & 0 deletions AdminUi/src/AdminUi/ClientApp/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { MatButtonModule } from "@angular/material/button";
import { MatCardModule } from "@angular/material/card";
import { MatCheckboxModule } from "@angular/material/checkbox";
import { MatChipsModule } from "@angular/material/chips";
import { MatNativeDateModule } from "@angular/material/core";
import { MatDatepickerModule } from "@angular/material/datepicker";
import { MatDialogModule } from "@angular/material/dialog";
import { MatExpansionModule } from "@angular/material/expansion";
import { MatFormFieldModule } from "@angular/material/form-field";
Expand All @@ -29,6 +31,7 @@ import { MatTableModule } from "@angular/material/table";
import { MatToolbarModule } from "@angular/material/toolbar";
import { MatTooltipModule } from "@angular/material/tooltip";

import { MatSortModule } from "@angular/material/sort";
import { environment } from "src/environments/environment";
import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";
Expand Down Expand Up @@ -103,7 +106,10 @@ import { XSRFInterceptor } from "./shared/interceptors/xsrf.interceptor";
MatButtonModule,
MatIconModule,
MatSidenavModule,
MatDatepickerModule,
MatNativeDateModule,
MatCheckboxModule,
MatSortModule,
MatListModule,
MatGridListModule,
MatTableModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@
}

.mat-column-numberOfIdentities {
width: 10%;
max-width: 200px;
word-break: normal;
}

.mat-column-createdAt {
width: 15%;
max-width: 370px;
word-break: normal;
}

.mat-column-actions {
width: 20%;
max-width: 300px;
word-break: normal;
}

.actions-button {
min-height: 36px;
min-width: 200px;
height: auto;
}

Expand All @@ -39,6 +40,10 @@
color: blue;
}

.inline-action-buttons ::ng-deep .mat-mdc-form-field-icon-suffix {
display: inherit;
}

.loading {
display: flex;
justify-content: center;
Expand All @@ -50,6 +55,18 @@
height: 100%;
}

.complex-filter-container {
display: flex;
flex-direction: row;
justify-content: space-between;
padding-top: 10px;
}

.header-container {
display: flex;
flex-direction: column;
}

.no-data {
padding: 25px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h2 class="header-title">{{ header }}</h2>
<mat-icon>add</mat-icon>
</button>
</div>
<table mat-table class="responsive" [dataSource]="clients" *ngIf="!loading">
<table mat-table matSort (matSortChange)="onTableSort($event)" class="responsive" [dataSource]="clients" *ngIf="!loading">
<ng-container matColumnDef="select">
<th mat-header-cell *matHeaderCellDef>
<mat-checkbox
Expand All @@ -37,37 +37,101 @@ <h2 class="header-title">{{ header }}</h2>
</td>
</ng-container>
<ng-container matColumnDef="clientId">
<th mat-header-cell *matHeaderCellDef>Client Id</th>
<th mat-header-cell *matHeaderCellDef mat-sort-header sortActionDescription="Sort by client ID" style="text-align: center">
<div class="header-container">
<span>Client Id</span>
<mat-form-field style="width: 100%; padding-top: 10px">
<input matInput type="text" [(ngModel)]="filter.clientId" (input)="filterClients()" />
<button *ngIf="filter.clientId" matSuffix mat-icon-button aria-label="Clear" (click)="clearFilter('clientId')">
<mat-icon>close</mat-icon>
</button>
</mat-form-field>
</div>
</th>
<td mat-cell *matCellDef="let client" data-label="Client Id:" (click)="editClient(client.clientId)">
{{ client.clientId }}
</td>
</ng-container>
<ng-container matColumnDef="displayName">
<th mat-header-cell *matHeaderCellDef>Display Name</th>
<th mat-header-cell mat-sort-header *matHeaderCellDef style="text-align: center">
<div class="header-container">
<span>Display Name</span>
<mat-form-field style="width: 100%; padding-top: 10px">
<input matInput type="text" [(ngModel)]="filter.displayName" (input)="filterClients()" />
<button *ngIf="filter.displayName" matSuffix mat-icon-button aria-label="Clear" (click)="clearFilter('displayName')">
<mat-icon>close</mat-icon>
</button>
</mat-form-field>
</div>
</th>
<td mat-cell *matCellDef="let client" data-label="Display Name:" (click)="editClient(client.clientId)">
{{ client.displayName }}
</td>
</ng-container>
<ng-container matColumnDef="defaultTier">
<th mat-header-cell *matHeaderCellDef>Default Tier</th>
<th mat-header-cell *matHeaderCellDef style="text-align: center">
<div class="header-container">
<span>Default Tier</span>
<mat-form-field style="width: 100%; padding-top: 10px">
<mat-label>Tiers</mat-label>
<mat-select multiple [(ngModel)]="filter.tiers" (selectionChange)="filterClients()">
<mat-option *ngFor="let tier of tiers" [value]="tier.id">{{ tier.id }}</mat-option>
</mat-select>
</mat-form-field>
</div>
</th>
<td mat-cell *matCellDef="let client" data-label="Default Tier:" (click)="goToTier(client.defaultTier)" class="tier-navigation">
{{ client.defaultTier }}
</td>
</ng-container>
<ng-container matColumnDef="numberOfIdentities">
<th mat-header-cell *matHeaderCellDef>Number of Identities</th>
<td mat-cell *matCellDef="let client" data-label="Number of Identities:" (click)="editClient(client.clientId)">
<th mat-header-cell *matHeaderCellDef style="text-align: center">
<div class="header-container">
<span>Number of Identities</span>
<div class="complex-filter-container">
<mat-form-field style="width: 45%">
<mat-select [(ngModel)]="filter.numberOfIdentities.operator" (selectionChange)="filterClients()">
<mat-option *ngFor="let operator of operators" [value]="operator">{{ operator }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%">
<input matInput type="number" [(ngModel)]="filter.numberOfIdentities.value" (input)="filterClients()" />
</mat-form-field>
</div>
</div>
</th>
<td mat-cell *matCellDef="let client" data-label="Number of Identities:" (click)="editClient(client.clientId)" style="text-align: center">
{{ client.numberOfIdentities }}
</td>
</ng-container>
<ng-container matColumnDef="createdAt">
<th mat-header-cell *matHeaderCellDef>Created At</th>
<td mat-cell *matCellDef="let client" data-label="Created At:" (click)="editClient(client.clientId)">
<th mat-header-cell *matHeaderCellDef style="text-align: center">
<div class="header-container">
<span>Created At</span>
<div class="complex-filter-container">
<mat-form-field style="width: 25%">
<mat-select [(ngModel)]="filter.createdAt.operator" (selectionChange)="filterClients()">
<mat-option *ngFor="let operator of operators" [value]="operator">{{ operator }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 70%" class="inline-action-buttons">
<mat-label>Choose a date</mat-label>
<input matInput [matDatepicker]="picker" [(ngModel)]="filter.createdAt.value" (dateChange)="filterClients()" />
<mat-datepicker-toggle matIconSuffix [for]="picker"></mat-datepicker-toggle>
<button *ngIf="filter.createdAt.value" matSuffix mat-icon-button aria-label="Clear" (click)="clearFilter('createdAt')">
<mat-icon>close</mat-icon>
</button>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
</div>
</div>
</th>
<td mat-cell *matCellDef="let client" data-label="Created At:" (click)="editClient(client.clientId)" style="text-align: center">
{{ client.createdAt | date }}
</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>Actions</th>
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let client" data-label="">
<button mat-raised-button class="actions-button" color="primary" (click)="openChangeSecretDialog(client.clientId)">Change Client Secret</button>
</td>
Expand Down
Loading