fix(console): add missing login interface texts, update dependencies, cleanup storage (#2430)

* name

* core cli

* material cdk

* chore(deps): bump libphonenumber-js from 1.9.23 to 1.9.34 in /console (#2386)

Bumps [libphonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js) from 1.9.23 to 1.9.34.
- [Release notes](https://gitlab.com/catamphetamine/libphonenumber-js/tags)
- [Changelog](https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/catamphetamine/libphonenumber-js/compare/v1.9.23...v1.9.34)

---
updated-dependencies:
- dependency-name: libphonenumber-js
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump jasmine-core from 3.7.1 to 3.9.0 in /console (#2373)

Bumps [jasmine-core](https://github.com/jasmine/jasmine) from 3.7.1 to 3.9.0.
- [Release notes](https://github.com/jasmine/jasmine/releases)
- [Changelog](https://github.com/jasmine/jasmine/blob/main/RELEASE.md)
- [Commits](https://github.com/jasmine/jasmine/compare/v3.7.1...v3.9.0)

---
updated-dependencies:
- dependency-name: jasmine-core
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump rxjs from 6.6.7 to 7.3.0 in /console (#2366)

Bumps [rxjs](https://github.com/reactivex/rxjs) from 6.6.7 to 7.3.0.
- [Release notes](https://github.com/reactivex/rxjs/releases)
- [Changelog](https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/reactivex/rxjs/compare/6.6.7...7.3.0)

---
updated-dependencies:
- dependency-name: rxjs
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* add missing login texts, fix application table

* storage cleanup

* storage location local

* org session storage, remember in local

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
Max Peintner 2021-09-30 08:33:58 +02:00 committed by GitHub
parent 440030b20b
commit 7579bf56f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 762 additions and 547 deletions

File diff suppressed because it is too large Load Diff

View File

@ -10,18 +10,18 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~12.2.4",
"@angular/cdk": "~12.2.4",
"@angular/common": "~12.2.4",
"@angular/compiler": "~12.2.4",
"@angular/core": "~12.2.4",
"@angular/forms": "~12.2.4",
"@angular/material": "^12.2.4",
"@angular/material-moment-adapter": "^12.2.4",
"@angular/platform-browser": "~12.2.4",
"@angular/platform-browser-dynamic": "~12.2.4",
"@angular/router": "~12.2.4",
"@angular/service-worker": "~12.2.4",
"@angular/animations": "~12.2.7",
"@angular/cdk": "~12.2.7",
"@angular/common": "~12.2.7",
"@angular/compiler": "~12.2.7",
"@angular/core": "~12.2.7",
"@angular/forms": "~12.2.7",
"@angular/material": "^12.2.7",
"@angular/material-moment-adapter": "^12.2.7",
"@angular/platform-browser": "~12.2.7",
"@angular/platform-browser-dynamic": "~12.2.7",
"@angular/router": "~12.2.7",
"@angular/service-worker": "~12.2.7",
"@grpc/grpc-js": "^1.3.2",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
@ -35,12 +35,12 @@
"google-proto-files": "^2.4.0",
"google-protobuf": "^3.17.2",
"grpc-web": "^1.2.1",
"libphonenumber-js": "^1.9.23",
"libphonenumber-js": "^1.9.34",
"moment": "^2.29.1",
"ngx-color": "^7.2.0",
"ngx-image-cropper": "^3.3.5",
"ngx-quicklink": "^0.2.6",
"rxjs": "~6.6.7",
"rxjs": "~7.3.0",
"tinycolor2": "^1.4.2",
"ts-protoc-gen": "^0.14.0",
"tslib": "^2.2.0",
@ -48,15 +48,15 @@
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.2.4",
"@angular/cli": "~12.2.4",
"@angular/compiler-cli": "~12.2.4",
"@angular/language-service": "~12.2.4",
"@angular-devkit/build-angular": "~12.2.7",
"@angular/cli": "~12.2.7",
"@angular/compiler-cli": "~12.2.7",
"@angular/language-service": "~12.2.7",
"@types/jasmine": "~3.8.2",
"@types/jasminewd2": "~2.0.10",
"@types/node": "^16.7.6",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.7.1",
"jasmine-core": "~3.9.0",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.3.2",
"karma-chrome-launcher": "~3.1.0",

View File

@ -13,7 +13,7 @@ import { GetFeaturesResponse } from 'src/app/proto/generated/zitadel/management_
import { Org } from 'src/app/proto/generated/zitadel/org_pb';
import { AdminService } from 'src/app/services/admin.service';
import { ManagementService } from 'src/app/services/mgmt.service';
import { StorageService } from 'src/app/services/storage.service';
import { StorageKey, StorageLocation, StorageService } from 'src/app/services/storage.service';
import { StripeCustomer, SubscriptionService } from 'src/app/services/subscription.service';
import { ToastService } from 'src/app/services/toast.service';
@ -49,13 +49,14 @@ export class FeaturesComponent implements OnDestroy {
constructor(
private route: ActivatedRoute,
private toast: ToastService,
private sessionStorage: StorageService,
private storage: StorageService,
private injector: Injector,
private adminService: AdminService,
private subService: SubscriptionService,
private dialog: MatDialog,
) {
const temporg = this.sessionStorage.getItem('organization') as Org.AsObject;
const temporg: Org.AsObject | null = this.storage.getItem(StorageKey.organization, StorageLocation.session);
if (temporg) {
this.org = temporg;
}

View File

@ -3,6 +3,7 @@ import { SetCustomLoginTextsRequest } from 'src/app/proto/generated/zitadel/mana
import {
EmailVerificationDoneScreenText,
EmailVerificationScreenText,
ExternalRegistrationUserOverviewScreenText,
ExternalUserNotFoundScreenText,
FooterText,
InitializeUserDoneScreenText,
@ -61,6 +62,11 @@ export function mapRequestValues(map: Partial<Map>, req: Req): Req {
r2.setDescription(map.externalUserNotFoundText?.description ?? '');
r2.setLinkButtonText(map.externalUserNotFoundText?.linkButtonText ?? '');
r2.setTitle(map.externalUserNotFoundText?.title ?? '');
r2.setTosAndPrivacyLabel(map.externalUserNotFoundText?.tosAndPrivacyLabel ?? '');
r2.setTosConfirm(map.externalUserNotFoundText?.tosConfirm ?? '');
r2.setTosConfirmAnd(map.externalUserNotFoundText?.tosConfirmAnd ?? '');
r2.setTosLinkText(map.externalUserNotFoundText?.tosLinkText ?? '');
r2.setPrivacyLinkText(map.externalUserNotFoundText?.privacyLinkText ?? '');
req.setExternalUserNotFoundText(r2);
const r3 = new FooterText();
@ -329,6 +335,7 @@ export function mapRequestValues(map: Partial<Map>, req: Req): Req {
r31.setDescription(map.passwordlessRegistrationDoneText?.description ?? '');
r31.setNextButtonText(map.passwordlessRegistrationDoneText?.nextButtonText ?? '');
r31.setTitle(map.passwordlessRegistrationDoneText?.title ?? '');
r31.setNextButtonText(map.passwordlessRegistrationDoneText?.cancelButtonText ?? '');
req.setPasswordlessRegistrationDoneText(r31);
const r32 = new PasswordlessRegistrationScreenText();
@ -350,5 +357,24 @@ export function mapRequestValues(map: Partial<Map>, req: Req): Req {
r33.setValidateTokenButtonText(map.passwordlessText?.validateTokenButtonText ?? '');
req.setPasswordlessText(r33);
const r34 = new ExternalRegistrationUserOverviewScreenText();
r34.setBackButtonText(map.externalRegistrationUserOverviewText?.backButtonText ?? '');
r34.setDescription(map.externalRegistrationUserOverviewText?.description ?? '');
r34.setEmailLabel(map.externalRegistrationUserOverviewText?.emailLabel ?? '');
r34.setFirstnameLabel(map.externalRegistrationUserOverviewText?.firstnameLabel ?? '');
r34.setLanguageLabel(map.externalRegistrationUserOverviewText?.languageLabel ?? '');
r34.setLastnameLabel(map.externalRegistrationUserOverviewText?.lastnameLabel ?? '');
r34.setNextButtonText(map.externalRegistrationUserOverviewText?.nextButtonText ?? '');
r34.setNicknameLabel(map.externalRegistrationUserOverviewText?.nicknameLabel ?? '');
r34.setPhoneLabel(map.externalRegistrationUserOverviewText?.phoneLabel ?? '');
r34.setPrivacyLinkText(map.externalRegistrationUserOverviewText?.privacyLinkText ?? '');
r34.setTitle(map.externalRegistrationUserOverviewText?.title ?? '');
r34.setTosAndPrivacyLabel(map.externalRegistrationUserOverviewText?.tosAndPrivacyLabel ?? '');
r34.setTosConfirm(map.externalRegistrationUserOverviewText?.tosConfirm ?? '');
r34.setTosConfirmAnd(map.externalRegistrationUserOverviewText?.tosConfirmAnd ?? '');
r34.setTosLinkText(map.externalRegistrationUserOverviewText?.tosLinkText ?? '');
r34.setUsernameLabel(map.externalRegistrationUserOverviewText?.usernameLabel ?? '');
req.setExternalRegistrationUserOverviewText(r34);
return req;
}

View File

@ -59,6 +59,7 @@ const KeyNamesArray = [
'passwordlessRegistrationDoneText',
'passwordlessRegistrationText',
'passwordlessText',
'externalRegistrationUserOverviewText'
];
// tslint:enable

View File

@ -8,7 +8,7 @@ import { Org } from 'src/app/proto/generated/zitadel/org_pb';
import { OrgIAMPolicy } from 'src/app/proto/generated/zitadel/policy_pb';
import { AdminService } from 'src/app/services/admin.service';
import { ManagementService } from 'src/app/services/mgmt.service';
import { StorageService } from 'src/app/services/storage.service';
import { StorageKey, StorageLocation, StorageService } from 'src/app/services/storage.service';
import { ToastService } from 'src/app/services/toast.service';
import { GridPolicy, IAM_POLICY } from '../../policy-grid/policies';
@ -34,11 +34,11 @@ export class OrgIamPolicyComponent implements OnDestroy {
constructor(
private route: ActivatedRoute,
private toast: ToastService,
private sessionStorage: StorageService,
private storage: StorageService,
private injector: Injector,
private adminService: AdminService,
) {
const temporg = this.sessionStorage.getItem('organization') as Org.AsObject;
const temporg = this.storage.getItem(StorageKey.organization, StorageLocation.session) as Org.AsObject;
if (temporg) {
this.org = temporg;
}

View File

@ -21,7 +21,7 @@ import { AdminService } from 'src/app/services/admin.service';
import { AssetEndpoint, AssetService, AssetType } from 'src/app/services/asset.service';
import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
import { ManagementService } from 'src/app/services/mgmt.service';
import { StorageService } from 'src/app/services/storage.service';
import { StorageKey, StorageLocation, StorageService } from 'src/app/services/storage.service';
import { ThemeService } from 'src/app/services/theme.service';
import { ToastService } from 'src/app/services/toast.service';
@ -48,7 +48,6 @@ export enum ColorType {
BACKGROUNDLIGHT,
}
const ORG_STORAGE_KEY = 'organization';
const MAX_ALLOWED_SIZE = 0.5 * 1024 * 1024;
@Component({
@ -96,10 +95,10 @@ export class PrivateLabelingPolicyComponent implements OnDestroy {
private injector: Injector,
private assetService: AssetService,
private sanitizer: DomSanitizer,
private storageService: StorageService,
private storage: StorageService,
private themeService: ThemeService,
) {
const org: Org.AsObject | null = (this.storageService.getItem(ORG_STORAGE_KEY));
const org: Org.AsObject | null = (this.storage.getItem(StorageKey.organization, StorageLocation.session));
if (org) {
this.org = org;

View File

@ -4,7 +4,7 @@ import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from
import { Router } from '@angular/router';
import { Org } from 'src/app/proto/generated/zitadel/org_pb';
import { GrantedProject, ProjectGrantState } from 'src/app/proto/generated/zitadel/project_pb';
import { StorageKey, StorageService } from 'src/app/services/storage.service';
import { StorageKey, StorageLocation, StorageService } from 'src/app/services/storage.service';
@Component({
selector: 'app-granted-project-grid',
@ -81,12 +81,12 @@ export class GrantedProjectGridComponent implements OnChanges {
}
private async getPrefixedItem(key: string): Promise<string | null> {
const org = this.storage.getItem<Org.AsObject>(StorageKey.organization) as Org.AsObject;
const org = this.storage.getItem<Org.AsObject>(StorageKey.organization, StorageLocation.session) as Org.AsObject;
return localStorage.getItem(`${org.id}:${key}`);
}
private async setPrefixedItem(key: string, value: any): Promise<void> {
const org = this.storage.getItem<Org.AsObject>(StorageKey.organization) as Org.AsObject;
const org = this.storage.getItem<Org.AsObject>(StorageKey.organization, StorageLocation.session) as Org.AsObject;
return localStorage.setItem(`${org.id}:${key}`, value);
}

View File

@ -8,7 +8,7 @@
</ng-template>
<div class="table-wrapper">
<table [dataSource]="dataSource" mat-table class="table" matSort aria-label="Elements">
<table [dataSource]="dataSource" mat-table class="table" aria-label="Elements">
<ng-container matColumnDef="select">
<th class="selection" mat-header-cell *matHeaderCellDef>
<mat-checkbox color="primary" (change)="$event ? masterToggle() : null"

View File

@ -1,8 +1,7 @@
import { SelectionModel } from '@angular/cdk/collections';
import { AfterViewInit, Component, Input, OnInit, ViewChild } from '@angular/core';
import { MatSort } from '@angular/material/sort';
import { MatTable } from '@angular/material/table';
import { merge, of } from 'rxjs';
import { merge } from 'rxjs';
import { tap } from 'rxjs/operators';
import { PaginatorComponent } from 'src/app/modules/paginator/paginator.component';
import { App } from 'src/app/proto/generated/zitadel/app_pb';
@ -19,7 +18,6 @@ export class ApplicationsComponent implements AfterViewInit, OnInit {
@Input() public projectId: string = '';
@Input() public disabled: boolean = false;
@ViewChild(PaginatorComponent) public paginator!: PaginatorComponent;
@ViewChild(MatSort) public sort!: MatSort;
@ViewChild(MatTable) public table!: MatTable<App.AsObject>;
public dataSource!: ProjectApplicationsDataSource;
public selection: SelectionModel<App.AsObject> = new SelectionModel<App.AsObject>(true, []);
@ -34,7 +32,7 @@ export class ApplicationsComponent implements AfterViewInit, OnInit {
}
public ngAfterViewInit(): void {
merge(this.sort ? this.sort?.sortChange : of(null), this.paginator.page)
merge(this.paginator.page)
.pipe(
tap(() => this.loadRolesPage()),
)

View File

@ -7,7 +7,7 @@ import { WarnDialogComponent } from 'src/app/modules/warn-dialog/warn-dialog.com
import { Org } from 'src/app/proto/generated/zitadel/org_pb';
import { Project, ProjectState } from 'src/app/proto/generated/zitadel/project_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
import { StorageKey, StorageService } from 'src/app/services/storage.service';
import { StorageKey, StorageLocation, StorageService } from 'src/app/services/storage.service';
import { ToastService } from 'src/app/services/toast.service';
@Component({
@ -105,12 +105,12 @@ export class OwnedProjectGridComponent implements OnChanges {
}
private async getPrefixedItem(key: string): Promise<string | null> {
const org = this.storage.getItem<Org.AsObject>(StorageKey.organization) as Org.AsObject;
const org = this.storage.getItem<Org.AsObject>(StorageKey.organization, StorageLocation.session) as Org.AsObject;
return localStorage.getItem(`${org.id}:${key}`);
}
private async setPrefixedItem(key: string, value: any): Promise<void> {
const org = this.storage.getItem<Org.AsObject>(StorageKey.organization) as Org.AsObject;
const org = this.storage.getItem<Org.AsObject>(StorageKey.organization, StorageLocation.session) as Org.AsObject;
return localStorage.setItem(`${org.id}:${key}`, value);
}

View File

@ -121,7 +121,6 @@ export class OwnedProjectListComponent implements OnInit, OnDestroy {
if (resp.details?.viewTimestamp) {
this.viewTimestamp = resp.details?.viewTimestamp;
}
console.log(resp.resultList);
this.dataSource.data = this.ownedProjectList;
this.loadingSubject.next(false);
}).catch(error => {

View File

@ -9,7 +9,7 @@ import { GrantedProject, Project, Role } from 'src/app/proto/generated/zitadel/p
import { User } from 'src/app/proto/generated/zitadel/user_pb';
import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
import { ManagementService } from 'src/app/services/mgmt.service';
import { StorageKey, StorageService } from 'src/app/services/storage.service';
import { StorageKey, StorageLocation, StorageService } from 'src/app/services/storage.service';
import { ToastService } from 'src/app/services/toast.service';
@Component({
@ -94,7 +94,7 @@ export class UserGrantCreateComponent implements OnDestroy {
}
});
const temporg = this.storage.getItem<Org.AsObject>(StorageKey.organization);
const temporg = this.storage.getItem<Org.AsObject>(StorageKey.organization, StorageLocation.session);
if (temporg) {
this.org = temporg;
}

View File

@ -187,6 +187,7 @@ export class GrpcAuthService {
}
public setActiveOrg(org: Org.AsObject): void {
// Set organization in localstorage to get the last used organization in a new tab
this.storage.setItem(StorageKey.organization, org, StorageLocation.local);
this.storage.setItem(StorageKey.organization, org, StorageLocation.session);
this._activeOrgChanged.next(org);

View File

@ -3,10 +3,9 @@ import { OAuthModuleConfig } from 'angular-oauth2-oidc';
import { Observable } from 'rxjs';
import { Org } from '../../proto/generated/zitadel/org_pb';
import { StorageService } from '../storage.service';
import { StorageKey, StorageLocation, StorageService } from '../storage.service';
const orgKey = 'x-zitadel-orgid';
const ORG_STORAGE_KEY = 'organization';
export abstract class HttpOrgInterceptor implements HttpInterceptor {
private org!: Org.AsObject;
@ -18,7 +17,7 @@ export abstract class HttpOrgInterceptor implements HttpInterceptor {
private storageService: StorageService,
protected oauthModuleConfig: OAuthModuleConfig,
) {
const org: Org.AsObject | null = (this.storageService.getItem(ORG_STORAGE_KEY));
const org: Org.AsObject | null = (this.storageService.getItem(StorageKey.organization, StorageLocation.session));
if (org) {
this.org = org;

View File

@ -2,11 +2,10 @@ import { Injectable } from '@angular/core';
import { Request, UnaryInterceptor, UnaryResponse } from 'grpc-web';
import { Org } from 'src/app/proto/generated/zitadel/org_pb';
import { StorageService } from '../storage.service';
import { StorageKey, StorageLocation, StorageService } from '../storage.service';
const ORG_HEADER_KEY = 'x-zitadel-orgid';
const ORG_STORAGE_KEY = 'organization';
@Injectable({ providedIn: 'root' })
export class OrgInterceptor<TReq = unknown, TResp = unknown> implements UnaryInterceptor<TReq, TResp> {
constructor(private readonly storageService: StorageService) { }
@ -14,7 +13,7 @@ export class OrgInterceptor<TReq = unknown, TResp = unknown> implements UnaryInt
public intercept(request: Request<TReq, TResp>, invoker: any): Promise<UnaryResponse<TReq, TResp>> {
const metadata = request.getMetadata();
const org: Org.AsObject | null = (this.storageService.getItem(ORG_STORAGE_KEY));
const org: Org.AsObject | null = (this.storageService.getItem(StorageKey.organization, StorageLocation.session));
if (org) {
metadata[ORG_HEADER_KEY] = `${org.id}`;
@ -24,7 +23,7 @@ export class OrgInterceptor<TReq = unknown, TResp = unknown> implements UnaryInt
return response;
}).catch((error: any) => {
if (error.code === 7 && error.message.startsWith('Organisation doesn\'t exist')) {
this.storageService.removeItem(ORG_STORAGE_KEY);
this.storageService.removeItem(StorageKey.organization, StorageLocation.session);
}
return Promise.reject(error);
});

View File

@ -820,7 +820,8 @@
"passwordlessPromptText":"Passwordless Aufforderung",
"passwordlessRegistrationDoneText":"Passwordless setzen erfolgreich",
"passwordlessRegistrationText":"Passwordless Registrierung",
"passwordlessText":"Passwordless"
"passwordlessText":"Passwordless",
"externalRegistrationUserOverviewText":"Externe Registrierung Benutzer Übersicht"
}
},
"MESSAGE_TEXTS": {

View File

@ -822,7 +822,8 @@
"passwordlessPromptText":"Passwordless Prompt",
"passwordlessRegistrationDoneText":"Passwordless Registration Done",
"passwordlessRegistrationText":"Passwordless Registration",
"passwordlessText":"Passwordless"
"passwordlessText":"Passwordless",
"externalRegistrationUserOverviewText":"External Registration User Overview"
}
},
"MESSAGE_TEXTS": {