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

feat(console): organization overview table, table, org context filtering, fix grpc error log, cleanup pipes #796

Merged
merged 44 commits into from
Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9b84494
chore(deps-dev): bump @angular/cli from 10.0.8 to 10.1.3 in /console …
dependabot[bot] Sep 28, 2020
22ba6a5
chore(deps-dev): bump @angular-devkit/build-angular in /console (#784)
dependabot[bot] Sep 28, 2020
6ea1054
chore(deps-dev): bump @angular/language-service in /console (#783)
dependabot[bot] Sep 28, 2020
85b075d
chore(deps-dev): bump stylelint from 13.7.1 to 13.7.2 in /console (#782)
dependabot[bot] Sep 28, 2020
558e19d
chore(deps-dev): bump karma from 5.2.1 to 5.2.3 in /console (#781)
dependabot[bot] Sep 28, 2020
b7fde71
chore(deps): bump moment from 2.27.0 to 2.29.0 in /console (#780)
dependabot[bot] Sep 28, 2020
f64a7ea
chore(deps-dev): bump @types/node from 14.6.4 to 14.11.2 in /console …
dependabot[bot] Sep 28, 2020
83965f1
chore(deps-dev): bump prettier from 2.1.1 to 2.1.2 in /console (#757)
dependabot[bot] Sep 28, 2020
586d1bd
chore(deps): bump ts-protoc-gen from 0.12.0 to 0.13.0 in /console (#737)
dependabot[bot] Sep 28, 2020
26b18e8
chore(deps-dev): bump jasmine-spec-reporter in /console (#762)
dependabot[bot] Sep 28, 2020
f8d4be5
fix: package
peintnermax Sep 28, 2020
3391508
change html lang to translation lang
peintnermax Sep 28, 2020
d954a14
disable detail view org idp
peintnermax Sep 28, 2020
c313fd5
catch errorcode 16 in auth response interceptor
peintnermax Sep 29, 2020
1023418
new icons
peintnermax Sep 29, 2020
3d6061b
refactor pipes, idp table config
peintnermax Sep 29, 2020
e6ea3ba
fix router guard
peintnermax Sep 29, 2020
48dffb9
lint
peintnermax Sep 29, 2020
0643f6c
allowed commonjs deps
peintnermax Sep 29, 2020
43aff40
Update console/src/assets/i18n/en.json
peintnermax Sep 29, 2020
f807d79
Update console/src/assets/i18n/de.json
peintnermax Sep 29, 2020
2991396
clear table warning
peintnermax Sep 29, 2020
fdfa322
org overview table, header filter
peintnermax Sep 29, 2020
36dfdea
toolbar filter
peintnermax Sep 29, 2020
c4f235c
user table filter
peintnermax Sep 29, 2020
d41d049
fix org filter themed color, reject error
peintnermax Sep 30, 2020
9f29ad9
Merge branch 'master' into fix/cnsl-table
peintnermax Sep 30, 2020
9a2d548
org context filter
peintnermax Sep 30, 2020
0340c3b
button cleanup
peintnermax Sep 30, 2020
7fd03aa
Merge branch 'fix/cnsl-table' of https://github.com/caos/zitadel into…
peintnermax Sep 30, 2020
c395a37
commonjs deps, remove a11y module
peintnermax Sep 30, 2020
0dea252
replace progressbar with spinner
peintnermax Sep 30, 2020
0cdf5a0
dynamic user, org filter
peintnermax Sep 30, 2020
621f799
ts lint, scss lint
peintnermax Sep 30, 2020
a0f2fc0
cleanup table, row highlighting
peintnermax Sep 30, 2020
c2b8c3f
lint
peintnermax Sep 30, 2020
8b579d8
fix i18n description, refresh idp list in login p
peintnermax Oct 1, 2020
96ffa4b
remove async from grpc services, fix external idp
peintnermax Oct 1, 2020
92967b0
remove external idp
peintnermax Oct 1, 2020
7549c7e
fix theme toggle
peintnermax Oct 1, 2020
ac7dcea
change iam policy header i18n
peintnermax Oct 1, 2020
35c1183
sticky action columns
peintnermax Oct 1, 2020
34cfe4a
lint
peintnermax Oct 1, 2020
d13fa16
add i18n filter to user, remove unused org code
peintnermax Oct 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions console/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
"scripts": [],
"allowedCommonJsDependencies": [
"@angular/common/locales/de",
"src/app/proto/generated/*.js",
"src/app/proto/generated/**/*.js",
"src/app/proto/generated/auth_pb",
"src/app/proto/generated/**",
"file-saver",
"qrcode"
]
Expand Down
32 changes: 32 additions & 0 deletions console/src/app/animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,38 @@ export const navAnimations: Array<AnimationTriggerMetadata> = [
]),
];


export const enterAnimations: Array<AnimationTriggerMetadata> = [
trigger('appearfade', [
transition(':enter', [
style({
transform: 'scale(.9) translateY(-10%)',
opacity: 0,
}),
animate(
'100ms ease-in-out',
style({
transform: 'scale(1) translateY(0%)',
opacity: 1,
}),
),
]),
transition(':leave', [
style({
transform: 'scale(1) translateY(0%)',
opacity: 1,
}),
animate(
'100ms ease-in-out',
style({
transform: 'scale(.9) translateY(-10%)',
opacity: 0,
}),
),
]),
]),
];

export const routeAnimations: AnimationTriggerMetadata = trigger('routeAnimations', [
transition('HomePage => AddPage', [
style({ transform: 'translateX(100%)', opacity: 0.5 }),
Expand Down
21 changes: 15 additions & 6 deletions console/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,31 @@
</ng-template>
</a>

<button (click)="loadOrgs()" *ngIf="profile?.id && org" mat-button
[matMenuTriggerFor]="menu">{{org?.name ? org.name : 'NO NAME'}}
<button (click)="loadOrgs()" *ngIf="profile?.id && org" mat-button [matMenuTriggerFor]="menu"
(menuOpened)="focusFilter()">{{org?.name ? org.name : 'NO NAME'}}
<mat-icon>
arrow_drop_down</mat-icon>
</button>

<mat-menu #menu="matMenu">
<mat-progress-bar *ngIf="orgLoading" color="accent" mode="indeterminate"></mat-progress-bar>
<button class="show-all" mat-menu-item
[routerLink]="[ '/org/overview' ]">{{'MENU.SHOWORGS' | translate}}</button>
<mat-menu class="menu" #menu="matMenu">
<div class="spinner-w">
<mat-spinner diameter="20" *ngIf="orgLoading" color="accent">
</mat-spinner>
</div>

<mat-form-field class="filter-form" appearance="fill">
<input autocomplete="off" matInput (click)="$event.stopPropagation()" (keyup)="applyFilter($event)"
placeholder="{{'ORG.PAGES.FILTERPLACEHOLDER' | translate}}" #input>
</mat-form-field>

<button [ngClass]="{'active': temporg.id === org?.id}" [disabled]="!temporg.id"
*ngFor="let temporg of orgs" mat-menu-item (click)="setActiveOrg(temporg)">
{{temporg?.name ? temporg.name : 'NO NAME'}}
</button>

<button class="show-all" mat-menu-item
[routerLink]="[ '/org/overview' ]">{{'MENU.SHOWORGS' | translate}}</button>

<ng-template appHasRole [appHasRole]="['org.create','iam.write']">
<button mat-menu-item [routerLink]="[ '/org/create' ]">
<mat-icon class="avatar">add</mat-icon>
Expand Down
40 changes: 33 additions & 7 deletions console/src/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import '~@angular/material/theming';

.root-header {
position: fixed;
Expand Down Expand Up @@ -159,13 +160,6 @@
margin-bottom: 1rem;
}
}

.primary-button {
margin: 1rem;
border-radius: 1.5rem;
height: 2.5rem;
padding: 0 1rem;
}
}

.content {
Expand Down Expand Up @@ -229,3 +223,35 @@
flex: 1;
}
}

@mixin textvar($theme) {
.filter-form {
margin: 0 .5rem;
/* stylelint-disable */

$foreground: map-get($theme, foreground);
color: mat-color($foreground, text) !important;
}

.show-all {
$primary: map-get($theme, primary);
color: mat-color($primary, 300) !important;
border-bottom: 2px solid #8795a1;
margin-bottom: .5rem;
}
/* stylelint-enable */
}

.menu {
position: relative;

.spinner-w {
top: 1rem;
left: 0;
right: 0;
position: absolute;
display: flex;
justify-content: center;
align-items: center;
}
}
37 changes: 32 additions & 5 deletions console/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BreakpointObserver } from '@angular/cdk/layout';
import { OverlayContainer } from '@angular/cdk/overlay';
import { DOCUMENT, ViewportScroller } from '@angular/common';
import { Component, HostBinding, Inject, OnDestroy, ViewChild } from '@angular/core';
import { Component, ElementRef, HostBinding, Inject, OnDestroy, ViewChild } from '@angular/core';
import { MatIconRegistry } from '@angular/material/icon';
import { MatDrawer } from '@angular/material/sidenav';
import { DomSanitizer } from '@angular/platform-browser';
Expand All @@ -11,7 +11,13 @@ import { Observable, of, Subscription } from 'rxjs';
import { map } from 'rxjs/operators';

import { accountCard, navAnimations, routeAnimations, toolbarAnimation } from './animations';
import { Org, UserProfileView } from './proto/generated/auth_pb';
import {
MyProjectOrgSearchKey,
MyProjectOrgSearchQuery,
Org,
SearchMethod,
UserProfileView,
} from './proto/generated/auth_pb';
import { AuthenticationService } from './services/authentication.service';
import { GrpcAuthService } from './services/grpc-auth.service';
import { ManagementService } from './services/mgmt.service';
Expand All @@ -32,6 +38,7 @@ import { UpdateService } from './services/update.service';
})
export class AppComponent implements OnDestroy {
@ViewChild('drawer') public drawer!: MatDrawer;
@ViewChild('input', { static: false }) input!: ElementRef;
public isHandset$: Observable<boolean> = this.breakpointObserver
.observe('(max-width: 599px)')
.pipe(map(result => {
Expand Down Expand Up @@ -172,9 +179,17 @@ export class AppComponent implements OnDestroy {
this.orgSub.unsubscribe();
}

public loadOrgs(): void {
public loadOrgs(filter?: string): void {
let query;
if (filter) {
query = new MyProjectOrgSearchQuery();
query.setMethod(SearchMethod.SEARCHMETHOD_CONTAINS_IGNORE_CASE);
query.setKey(MyProjectOrgSearchKey.MYPROJECTORGSEARCHKEY_ORG_NAME);
query.setValue(filter);
}

this.orgLoading = true;
this.authService.SearchMyProjectOrgs(10, 0).then(res => {
this.authService.SearchMyProjectOrgs(10, 0, query ? [query] : undefined).then(res => {
this.orgs = res.toObject().resultList;
this.orgLoading = false;
}).catch(error => {
Expand Down Expand Up @@ -207,7 +222,6 @@ export class AppComponent implements OnDestroy {
this.profile = userprofile;
const lang = userprofile.preferredLanguage.match(/en|de/) ? userprofile.preferredLanguage : 'en';
this.translate.use(lang);
console.log(this.document.documentElement.lang);
this.document.documentElement.lang = lang;
});
}
Expand All @@ -231,5 +245,18 @@ export class AppComponent implements OnDestroy {
}
});
}

public applyFilter(event: Event): void {
const filterValue = (event.target as HTMLInputElement).value;
this.loadOrgs(
filterValue.trim().toLowerCase(),
);
}

focusFilter(): void {
setTimeout(() => {
this.input.nativeElement.focus();
}, 0);
}
}

6 changes: 6 additions & 0 deletions console/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatNativeDateModule } from '@angular/material/core';
import { MatDialogModule } from '@angular/material/dialog';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatMenuModule } from '@angular/material/menu';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatToolbarModule } from '@angular/material/toolbar';
Expand Down Expand Up @@ -104,8 +107,11 @@ const authConfig: AuthConfig = {
MatSidenavModule,
MatCardModule,
OutsideClickModule,
MatFormFieldModule,
MatInputModule,
HasRolePipeModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatToolbarModule,
MatMenuModule,
MatSnackBarModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,4 @@
.ok-button {
margin-left: .5rem;
}

button {
border-radius: .5rem;
}
}
9 changes: 3 additions & 6 deletions console/src/app/modules/changes/changes.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,9 @@ export class ChangesComponent implements OnInit {
this._loading.next(true);

return from(col).pipe(
take(1),
tap((res: Changes) => {
let values = res.toObject().changesList;
// If prepending, reverse the batch order
values = false ? values.reverse() : values;

const values = res.toObject().changesList;
// update source with new values, done loading
this._data.next(values);

Expand All @@ -118,12 +116,11 @@ export class ChangesComponent implements OnInit {
this._done.next(true);
}
}),
catchError(err => {
catchError(_ => {
this._loading.next(false);
this.bottom = true;
return of([]);
}),
take(1),
).subscribe();
}
}
Expand Down
2 changes: 0 additions & 2 deletions console/src/app/modules/idp-create/idp-create.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

.add-line-btn {
margin-bottom: 1rem;
border-radius: .5rem;
}
}

Expand Down Expand Up @@ -55,7 +54,6 @@
margin-top: 3rem;
display: block;
padding: .5rem 4rem;
border-radius: .5rem;

@media only screen and (max-width: 450px) {
margin-top: 1rem;
Expand Down
8 changes: 4 additions & 4 deletions console/src/app/modules/idp-table/idp-table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*ngIf="selection.hasValue() && serviceType!=PolicyComponentServiceType.MGMT" [disabled]="disabled">
<i class="las la-trash"></i>
</button>
<a class="add-button" [routerLink]="createRouterLink" color="primary" mat-raised-button [disabled]="disabled"
<a [routerLink]="createRouterLink" color="primary" mat-raised-button [disabled]="disabled"
*ngIf="serviceType!=PolicyComponentServiceType.MGMT">
<mat-icon class="icon">add</mat-icon>{{ 'ACTIONS.NEW' | translate }}
</a>
Expand Down Expand Up @@ -85,14 +85,14 @@


<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr class="data-row"
<tr class="highlight"
[ngClass]="{'disabled': serviceType==PolicyComponentServiceType.MGMT && row?.providerType == IdpProviderType.IDPPROVIDERTYPE_SYSTEM}"
mat-row *matRowDef="let row; columns: displayedColumns;"
[routerLink]="serviceType==PolicyComponentServiceType.ADMIN ? routerLinkForRow(row): null">
</tr>

</table>
<mat-paginator #paginator class="paginator" [length]="idpResult?.totalResult || 0" [pageSize]="10"
[pageSizeOptions]="[5, 10, 20]" (page)="changePage($event)"></mat-paginator>
</div>
<mat-paginator #paginator class="paginator" [length]="idpResult?.totalResult || 0" [pageSize]="10"
[pageSizeOptions]="[5, 10, 20]" (page)="changePage($event)"></mat-paginator>
</app-refresh-table>
12 changes: 0 additions & 12 deletions console/src/app/modules/idp-table/idp-table.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@
padding-right: 0;
}
}

.data-row {
cursor: pointer;

&:hover {
background-color: #ffffff05;
}
}
}
}

Expand All @@ -38,10 +30,6 @@ tr {
}
}

.add-button {
border-radius: .5rem;
}

.avatar {
height: 30px;
width: 30px;
Expand Down
1 change: 0 additions & 1 deletion console/src/app/modules/idp/idp.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
margin-bottom: 4rem;
display: block;
padding: .5rem 4rem;
border-radius: .5rem;

@media only screen and (max-width: 450px) {
margin-top: 1rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,4 @@
.ok-button {
margin-left: .5rem;
}

button {
border-radius: .5rem;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<app-detail-layout [backRouterLink]="backroutes" [title]="'ORG.POLICY.LOGIN_POLICY.TITLECREATE' | translate"
[description]="serviceType==PolicyComponentServiceType.MGMT ? 'ORG.POLICY.LOGIN_POLICY.DESCRIPTIONCREATEMGMT' : PolicyComponentServiceType.ADMIN ? 'ORG.POLICY.LOGIN_POLICY.DESCRIPTIONCREATEADMIN' : '' | translate">
[description]="(serviceType==PolicyComponentServiceType.MGMT ? 'ORG.POLICY.LOGIN_POLICY.DESCRIPTIONCREATEMGMT' : PolicyComponentServiceType.ADMIN ? 'ORG.POLICY.LOGIN_POLICY.DESCRIPTIONCREATEADMIN' : '') | translate">
<ng-container *ngIf="(['policy.delete'] | hasRole | async) && serviceType == PolicyComponentServiceType.MGMT">
<!--<button matTooltip="{{'ORG.POLICY.DELETE' | translate}}" color="warn" (click)="deletePolicy()"
mat-stroked-button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@

button {
border-radius: .5rem;
}

.content {
padding-top: 1rem;
display: flex;
Expand Down Expand Up @@ -39,7 +34,6 @@ button {
margin-top: 3rem;
display: block;
padding: .5rem 4rem;
border-radius: .5rem;
}
}

Expand Down