fix(console): dependencies, list my memberships, passwordless texts, privatelabelling issues (#2142)

* fix: list my memberships in console

* show manager context in detail page

* console dependencies (#2161)

* feat: User metadata (#2025)

* feat: user meta data events

* feat: user meta data set tests

* feat: user meta data tests

* feat: user meta data in protos

* feat: user meta data command api

* feat: user meta data query side

* feat: proto correct order, fix handlers

* feat: proto correct order

* feat: fixes of pr comments

* feat: fixes of pr comments

* feat: value as byte array

* feat: metadata feature

* Update internal/auth/repository/eventsourcing/handler/meta_data.go

Co-authored-by: Silvan <silvan.reusser@gmail.com>

* Update internal/command/user_meta_data.go

Co-authored-by: Silvan <silvan.reusser@gmail.com>

* Update proto/zitadel/metadata.proto

Co-authored-by: Silvan <silvan.reusser@gmail.com>

* Update proto/zitadel/metadata.proto

Co-authored-by: Silvan <silvan.reusser@gmail.com>

* fix: rename metadata files and table

* fix: rename meta data to metadat in protos

* Update internal/domain/metadata.go

Co-authored-by: Silvan <silvan.reusser@gmail.com>

* fix: rename vars

* fix: rebiuld docs

* Update internal/iam/repository/view/metadata_view.go

Co-authored-by: Silvan <silvan.reusser@gmail.com>

Co-authored-by: Silvan <silvan.reusser@gmail.com>

* fix(auth): read privacy policy from eventstore if not found (#2125)

* fix(auth): read privacy policy from eventstore if not found

* Update internal/auth/repository/eventsourcing/eventstore/auth_request.go

Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com>

Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com>

* chore(deps-dev): bump @angular/cli from 12.1.1 to 12.2.0 in /console (#2149)

Bumps [@angular/cli](https://github.com/angular/angular-cli) from 12.1.1 to 12.2.0.
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/v12.1.1...12.2.0)

---
updated-dependencies:
- dependency-name: "@angular/cli"
  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 @angular/material-moment-adapter in /console (#2147)

Bumps [@angular/material-moment-adapter](https://github.com/angular/components) from 12.1.1 to 12.2.0.
- [Release notes](https://github.com/angular/components/releases)
- [Changelog](https://github.com/angular/components/blob/master/CHANGELOG.md)
- [Commits](https://github.com/angular/components/compare/12.1.1...12.2.0)

---
updated-dependencies:
- dependency-name: "@angular/material-moment-adapter"
  dependency-type: direct:production
  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-dev): bump ts-node from 9.1.1 to 10.2.0 in /console (#2145)

Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 9.1.1 to 10.2.0.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v9.1.1...v10.2.0)

---
updated-dependencies:
- dependency-name: ts-node
  dependency-type: direct:development
  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>

* chore(deps-dev): bump @types/jasmine from 3.7.7 to 3.8.2 in /console (#2115)

Bumps [@types/jasmine](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jasmine) from 3.7.7 to 3.8.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jasmine)

---
updated-dependencies:
- dependency-name: "@types/jasmine"
  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 libphonenumber-js from 1.9.19 to 1.9.23 in /console (#2114)

Bumps [libphonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js) from 1.9.19 to 1.9.23.
- [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.19...v1.9.23)

---
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): bump @angular/core and @angular/animations in /console (#2072)

Bumps [@angular/core](https://github.com/angular/angular/tree/HEAD/packages/core) and [@angular/animations](https://github.com/angular/angular/tree/HEAD/packages/animations). These dependencies needed to be updated together.

Updates `@angular/core` from 12.0.3 to 12.1.3
- [Release notes](https://github.com/angular/angular/releases)
- [Changelog](https://github.com/angular/angular/blob/master/CHANGELOG.md)
- [Commits](https://github.com/angular/angular/commits/12.1.3/packages/core)

Updates `@angular/animations` from 12.0.3 to 12.1.3
- [Release notes](https://github.com/angular/angular/releases)
- [Changelog](https://github.com/angular/angular/blob/master/CHANGELOG.md)
- [Commits](https://github.com/angular/angular/commits/12.1.3/packages/animations)

---
updated-dependencies:
- dependency-name: "@angular/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: "@angular/animations"
  dependency-type: direct:production
  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-dev): bump stylelint-config-standard in /console (#2065)

Bumps [stylelint-config-standard](https://github.com/stylelint/stylelint-config-standard) from 20.0.0 to 22.0.0.
- [Release notes](https://github.com/stylelint/stylelint-config-standard/releases)
- [Changelog](https://github.com/stylelint/stylelint-config-standard/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint-config-standard/compare/20.0.0...22.0.0)

---
updated-dependencies:
- dependency-name: stylelint-config-standard
  dependency-type: direct:development
  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>

* chore(deps): bump @types/google-protobuf in /console (#2000)

Bumps [@types/google-protobuf](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/google-protobuf) from 3.15.2 to 3.15.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/google-protobuf)

---
updated-dependencies:
- dependency-name: "@types/google-protobuf"
  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>

* package

* angular core

* update angular core, cdk, allow commonjs deps

Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com>
Co-authored-by: Silvan <silvan.reusser@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix labelpolicy max size, double trigger, labels

* lint styles

* disable rule, add passwordless message texts

* lint exceeding linelimit

* login texts

* remove duplicate keyname

* rm unused

* fix: read lockout policy

Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com>
Co-authored-by: Silvan <silvan.reusser@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
Max Peintner 2021-08-16 14:44:20 +02:00 committed by GitHub
parent 490d087d45
commit 90f1647bb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
40 changed files with 1970 additions and 996 deletions

View File

@ -7,6 +7,7 @@
"value-keyword-case": null,
"at-rule-no-unknown": null,
"no-descending-specificity": null,
"no-invalid-position-at-import-rule": null,
"at-rule-empty-line-before": [
"always",
{

View File

@ -35,6 +35,8 @@
],
"allowedCommonJsDependencies": [
"@angular/common/locales/de",
"src/app/proto/generated/zitadel/admin_pb",
"src/app/proto/generated/zitadel/management_pb",
"src/app/proto/generated/**",
"file-saver",
"qrcode"

1792
console/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,23 +10,23 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~12.0.3",
"@angular/cdk": "~12.1.1",
"@angular/common": "~12.0.5",
"@angular/compiler": "~12.0.0",
"@angular/core": "~12.0.0",
"@angular/forms": "~12.0.5",
"@angular/animations": "~12.2.0",
"@angular/cdk": "~12.2.0",
"@angular/common": "~12.2.0",
"@angular/compiler": "~12.2.0",
"@angular/core": "~12.2.0",
"@angular/forms": "~12.2.0",
"@angular/material": "^12.1.1",
"@angular/material-moment-adapter": "^12.1.1",
"@angular/platform-browser": "~12.0.0",
"@angular/platform-browser-dynamic": "~12.0.5",
"@angular/router": "~12.0.5",
"@angular/service-worker": "~12.0.5",
"@angular/material-moment-adapter": "^12.2.0",
"@angular/platform-browser": "~12.2.0",
"@angular/platform-browser-dynamic": "~12.2.0",
"@angular/router": "~12.2.0",
"@angular/service-worker": "~12.2.0",
"@grpc/grpc-js": "^1.3.2",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"@types/file-saver": "^2.0.2",
"@types/google-protobuf": "^3.7.4",
"@types/google-protobuf": "^3.15.3",
"@types/uuid": "^8.3.0",
"angular-oauth2-oidc": "^10.0.3",
"angularx-qrcode": "^11.0.0",
@ -35,7 +35,7 @@
"google-proto-files": "^2.4.0",
"google-protobuf": "^3.17.2",
"grpc-web": "^1.2.1",
"libphonenumber-js": "^1.9.16",
"libphonenumber-js": "^1.9.23",
"moment": "^2.29.1",
"ngx-color": "^7.2.0",
"ngx-image-cropper": "^3.3.5",
@ -49,11 +49,11 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.1.1",
"@angular/cli": "~12.1.1",
"@angular/compiler-cli": "~12.0.5",
"@angular/language-service": "~12.1.0",
"@types/jasmine": "~3.7.7",
"@types/jasminewd2": "~2.0.3",
"@angular/cli": "~12.2.0",
"@angular/compiler-cli": "~12.2.0",
"@angular/language-service": "~12.2.0",
"@types/jasmine": "~3.8.2",
"@types/jasminewd2": "~2.0.10",
"@types/node": "^15.12.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.7.1",
@ -66,9 +66,9 @@
"prettier": "^2.3.1",
"protractor": "~7.0.0",
"stylelint": "^13.10.0",
"stylelint-config-standard": "^20.0.0",
"stylelint-scss": "^3.19.0",
"ts-node": "~9.1.1",
"stylelint-config-standard": "^22.0.0",
"stylelint-scss": "^3.20.1",
"ts-node": "~10.2.0",
"tslint": "~6.1.3",
"typescript": "^4.2.4"
}

View File

@ -1,4 +1,4 @@
<div class="max-width-container">
<div [ngClass]="{'max-width-container': maxWidth, 'enlarged-container': !maxWidth}">
<div class="detail-container">
<div class="detail-left">
<a *ngIf="backRouterLink" [routerLink]="backRouterLink" mat-icon-button>

View File

@ -10,7 +10,6 @@
$lighter-color: rgba(mat.get-color-from-palette($primary, 300), .5);
.detail-container {
width: 100%;
display: flex;
padding-bottom: 3rem;

View File

@ -2,12 +2,13 @@ import { Component, Input } from '@angular/core';
import { RouterLink } from '@angular/router';
@Component({
selector: 'app-detail-layout',
templateUrl: './detail-layout.component.html',
styleUrls: ['./detail-layout.component.scss'],
selector: 'app-detail-layout',
templateUrl: './detail-layout.component.html',
styleUrls: ['./detail-layout.component.scss'],
})
export class DetailLayoutComponent {
@Input() backRouterLink!: RouterLink;
@Input() title: string | null = '';
@Input() description: string | null = '';
@Input() backRouterLink!: RouterLink;
@Input() title: string | null = '';
@Input() description: string | null = '';
@Input() maxWidth: boolean = true;
}

View File

@ -49,7 +49,7 @@
<div class="divider"></div>
<p class="default" *ngIf="isDefault"> {{'POLICY.DEFAULTLABEL' | translate}}</p>
<cnsl-info-section *ngIf="isDefault"> {{'POLICY.DEFAULTLABEL' | translate}}</cnsl-info-section>
<div class="content" *ngIf="features">
<div class="row">
<span class="left-desc">{{'FEATURES.DATA.AUDITLOGRETENTION' | translate}}</span>

View File

@ -1,8 +1,3 @@
.default {
color: var(--color-main);
font-size: 14px;
}
.tier-desc {
color: var(--grey);
font-size: 14px;

View File

@ -1,7 +1,7 @@
<app-detail-layout [backRouterLink]="[ serviceType === PolicyComponentServiceType.ADMIN ? '/iam/policies' : '/org']"
[title]="'POLICY.LOGIN_POLICY.TITLE' | translate"
[description]="(serviceType==PolicyComponentServiceType.MGMT ? 'POLICY.LOGIN_POLICY.DESCRIPTIONCREATEMGMT' : PolicyComponentServiceType.ADMIN ? 'POLICY.LOGIN_POLICY.DESCRIPTIONCREATEADMIN' : '') | translate">
<p class="default" *ngIf="isDefault"> {{'POLICY.DEFAULTLABEL' | translate}}</p>
<cnsl-info-section *ngIf="isDefault"> {{'POLICY.DEFAULTLABEL' | translate}}</cnsl-info-section>
<div class="spinner-wr">
<mat-spinner diameter="30" *ngIf="loading" color="primary"></mat-spinner>

View File

@ -1,8 +1,3 @@
.default {
color: var(--color-main);
margin-top: 0;
}
.spinner-wr {
margin: .5rem 0;
}

View File

@ -19,6 +19,9 @@ import {
MFAProvidersText,
PasswordChangeDoneScreenText,
PasswordChangeScreenText,
PasswordlessPromptScreenText,
PasswordlessRegistrationDoneScreenText,
PasswordlessRegistrationScreenText,
PasswordlessScreenText,
PasswordResetDoneScreenText,
PasswordScreenText,
@ -313,5 +316,39 @@ export function mapRequestValues(map: Partial<Map>, req: Req): Req {
r29.setValidateTokenText(map.verifyMfaU2fText?.validateTokenText ?? '');
req.setVerifyMfaU2fText(r29);
const r30 = new PasswordlessPromptScreenText();
r30.setDescription(map.passwordlessPromptText?.description ?? '');
r30.setDescriptionInit(map.passwordlessPromptText?.descriptionInit ?? '');
r30.setNextButtonText(map.passwordlessPromptText?.nextButtonText ?? '');
r30.setPasswordlessButtonText(map.passwordlessPromptText?.passwordlessButtonText ?? '');
r30.setSkipButtonText(map.passwordlessPromptText?.skipButtonText ?? '');
r30.setTitle(map.passwordlessPromptText?.title ?? '');
req.setPasswordlessPromptText(r30);
const r31 = new PasswordlessRegistrationDoneScreenText();
r31.setDescription(map.passwordlessRegistrationDoneText?.description ?? '');
r31.setNextButtonText(map.passwordlessRegistrationDoneText?.nextButtonText ?? '');
r31.setTitle(map.passwordlessRegistrationDoneText?.title ?? '');
req.setPasswordlessRegistrationDoneText(r31);
const r32 = new PasswordlessRegistrationScreenText();
r32.setDescription(map.passwordlessRegistrationText?.description ?? '');
r32.setErrorRetry(map.passwordlessRegistrationText?.errorRetry ?? '');
r32.setNotSupported(map.passwordlessRegistrationText?.notSupported ?? '');
r32.setRegisterTokenButtonText(map.passwordlessRegistrationText?.registerTokenButtonText ?? '');
r32.setTitle(map.passwordlessRegistrationText?.title ?? '');
r32.setTokenNameLabel(map.passwordlessRegistrationText?.tokenNameLabel ?? '');
req.setPasswordlessRegistrationText(r32);
const r33 = new PasswordlessScreenText();
r33.setDescription(map.passwordlessText?.description ?? '');
r33.setErrorRetry(map.passwordlessText?.errorRetry ?? '');
r33.setLoginWithPwButtonText(map.passwordlessText?.loginWithPwButtonText ?? '');
r33.setNotSupported(map.passwordlessText?.notSupported ?? '');
r33.setTitle(map.passwordlessText?.title ?? '');
r33.setValidateTokenButtonText(map.passwordlessText?.validateTokenButtonText ?? '');
req.setPasswordlessText(r33);
return req;
}

View File

@ -46,7 +46,6 @@ const KeyNamesArray = [
'passwordChangeText',
'passwordResetDoneText',
'passwordText',
'passwordlessText',
'registrationOptionText',
'registrationOrgText',
'registrationUserText',
@ -56,6 +55,10 @@ const KeyNamesArray = [
'usernameChangeText',
'verifyMfaOtpText',
'verifyMfaU2fText',
'passwordlessPromptText',
'passwordlessRegistrationDoneText',
'passwordlessRegistrationText',
'passwordlessText',
];
// tslint:enable

View File

@ -1,4 +1,4 @@
<app-detail-layout [backRouterLink]="[ serviceType === PolicyComponentServiceType.ADMIN ? '/iam/policies' : '/org']"
<app-detail-layout [maxWidth]="false" [backRouterLink]="[ serviceType === PolicyComponentServiceType.ADMIN ? '/iam/policies' : '/org']"
[title]="'POLICY.MESSAGE_TEXTS.TITLE' | translate"
[description]="'POLICY.MESSAGE_TEXTS.DESCRIPTION' | translate">
@ -27,7 +27,7 @@
</cnsl-info-section>
<div class="content" >
<cnsl-edit-text [chips]="chips" [disabled]="serviceType == PolicyComponentServiceType.MGMT && (['custom_text'] | hasFeature | async) == false" label="one" [default$]="getDefaultInitMessageTextMap$" [current$]="getCustomInitMessageTextMap$" (changedValues)="updateCurrentValues(
<cnsl-edit-text [chips]="chips[currentType]" [disabled]="serviceType == PolicyComponentServiceType.MGMT && (['custom_text'] | hasFeature | async) == false" label="one" [default$]="getDefaultInitMessageTextMap$" [current$]="getCustomInitMessageTextMap$" (changedValues)="updateCurrentValues(
$event)"></cnsl-edit-text>
</div>

View File

@ -11,22 +11,26 @@ import {
GetDefaultVerifyPhoneMessageTextRequest as AdminGetDefaultVerifyPhoneMessageTextRequest,
SetDefaultDomainClaimedMessageTextRequest,
SetDefaultInitMessageTextRequest,
SetDefaultPasswordlessRegistrationMessageTextRequest,
SetDefaultPasswordResetMessageTextRequest,
SetDefaultVerifyEmailMessageTextRequest,
SetDefaultVerifyPhoneMessageTextRequest,
} from 'src/app/proto/generated/zitadel/admin_pb';
import {
GetCustomDomainClaimedMessageTextRequest,
GetCustomPasswordlessRegistrationMessageTextRequest,
GetCustomPasswordResetMessageTextRequest,
GetCustomVerifyEmailMessageTextRequest,
GetCustomVerifyPhoneMessageTextRequest,
GetDefaultDomainClaimedMessageTextRequest,
GetDefaultInitMessageTextRequest,
GetDefaultPasswordlessRegistrationMessageTextRequest,
GetDefaultPasswordResetMessageTextRequest,
GetDefaultVerifyEmailMessageTextRequest,
GetDefaultVerifyPhoneMessageTextRequest,
SetCustomDomainClaimedMessageTextRequest,
SetCustomInitMessageTextRequest,
SetCustomPasswordlessRegistrationMessageTextRequest,
SetCustomPasswordResetMessageTextRequest,
SetCustomVerifyEmailMessageTextRequest,
SetCustomVerifyPhoneMessageTextRequest,
@ -46,6 +50,7 @@ enum MESSAGETYPES {
VERIFYEMAIL = 'VE',
PASSWORDRESET = 'PR',
DOMAINCLAIMED = 'DC',
PASSWORDLESS = 'PL',
}
const REQUESTMAP = {
@ -134,6 +139,24 @@ const REQUESTMAP = {
req.setText(map.text ?? '');
req.setTitle(map.title ?? '');
return req;
},
},
[MESSAGETYPES.PASSWORDLESS]: {
get: new GetCustomPasswordlessRegistrationMessageTextRequest(),
set: new SetCustomPasswordlessRegistrationMessageTextRequest(),
getDefault: new GetDefaultPasswordlessRegistrationMessageTextRequest(),
setFcn: (map: Partial<SetCustomPasswordlessRegistrationMessageTextRequest.AsObject>):
SetCustomPasswordlessRegistrationMessageTextRequest => {
const req = new SetCustomPasswordlessRegistrationMessageTextRequest();
req.setButtonText(map.buttonText ?? '');
req.setFooterText(map.footerText ?? '');
req.setGreeting(map.greeting ?? '');
req.setPreHeader(map.preHeader ?? '');
req.setSubject(map.subject ?? '');
req.setText(map.text ?? '');
req.setTitle(map.title ?? '');
return req;
},
},
@ -221,6 +244,23 @@ const REQUESTMAP = {
req.setText(map.text ?? '');
req.setTitle(map.title ?? '');
return req;
},
},
[MESSAGETYPES.PASSWORDLESS]: {
get: new GetDefaultPasswordlessRegistrationMessageTextRequest(),
set: new SetDefaultPasswordlessRegistrationMessageTextRequest(),
setFcn: (map: Partial<SetDefaultPasswordlessRegistrationMessageTextRequest.AsObject>):
SetDefaultPasswordlessRegistrationMessageTextRequest => {
const req = new SetDefaultPasswordlessRegistrationMessageTextRequest();
req.setButtonText(map.buttonText ?? '');
req.setFooterText(map.footerText ?? '');
req.setGreeting(map.greeting ?? '');
req.setPreHeader(map.preHeader ?? '');
req.setSubject(map.subject ?? '');
req.setText(map.text ?? '');
req.setTitle(map.title ?? '');
return req;
},
},
@ -245,12 +285,100 @@ export class MessageTextsComponent implements OnDestroy {
public updateRequest!: SetCustomInitMessageTextRequest | SetDefaultInitMessageTextRequest;
public chips: any[] = [
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.firstname', value: '{{.FirstName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastname', value: '{{.Lastname}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.code', value: '{{.Code}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.preferredLoginName', value: '{{.PreferredLoginName}}' },
];
public chips: {
[messagetype: string]: Array<{ key: string; value: string; }>;
} = {
[MESSAGETYPES.DOMAINCLAIMED]: [
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.preferredLoginName', value: '{{.PreferredLoginName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.domain', value: '{{.Domain}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.tempUsername', value: '{{.TempUsername}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.username', value: '{{.UserName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.firstname', value: '{{.FirstName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastname', value: '{{.Lastname}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.nickName', value: '{{.NickName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.displayName', value: '{{.DisplayName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastEmail', value: '{{.LastEmail}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.verifiedEmail', value: '{{.VerifiedEmail}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastPhone', value: '{{.LastPhone}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.verifiedPhone', value: '{{.VerifiedPhone}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.loginnames', value: '{{.LoginNames}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.changedate', value: '{{.ChangeDate}}' },
],
[MESSAGETYPES.INIT]: [
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.code', value: '{{.Code}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.preferredLoginName', value: '{{.PreferredLoginName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.username', value: '{{.UserName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.firstname', value: '{{.FirstName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastname', value: '{{.Lastname}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.nickName', value: '{{.NickName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.displayName', value: '{{.DisplayName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastEmail', value: '{{.LastEmail}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.verifiedEmail', value: '{{.VerifiedEmail}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastPhone', value: '{{.LastPhone}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.verifiedPhone', value: '{{.VerifiedPhone}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.loginnames', value: '{{.LoginNames}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.changedate', value: '{{.ChangeDate}}' },
],
[MESSAGETYPES.PASSWORDRESET]: [
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.code', value: '{{.Code}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.preferredLoginName', value: '{{.PreferredLoginName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.username', value: '{{.UserName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.firstname', value: '{{.FirstName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastname', value: '{{.Lastname}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.nickName', value: '{{.NickName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.displayName', value: '{{.DisplayName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastEmail', value: '{{.LastEmail}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.verifiedEmail', value: '{{.VerifiedEmail}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastPhone', value: '{{.LastPhone}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.verifiedPhone', value: '{{.VerifiedPhone}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.loginnames', value: '{{.LoginNames}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.changedate', value: '{{.ChangeDate}}' },
],
[MESSAGETYPES.VERIFYEMAIL]: [
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.code', value: '{{.Code}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.preferredLoginName', value: '{{.PreferredLoginName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.username', value: '{{.UserName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.firstname', value: '{{.FirstName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastname', value: '{{.Lastname}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.nickName', value: '{{.NickName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.displayName', value: '{{.DisplayName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastEmail', value: '{{.LastEmail}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.verifiedEmail', value: '{{.VerifiedEmail}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastPhone', value: '{{.LastPhone}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.verifiedPhone', value: '{{.VerifiedPhone}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.loginnames', value: '{{.LoginNames}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.changedate', value: '{{.ChangeDate}}' },
],
[MESSAGETYPES.VERIFYPHONE]: [
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.code', value: '{{.Code}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.preferredLoginName', value: '{{.PreferredLoginName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.username', value: '{{.UserName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.firstname', value: '{{.FirstName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastname', value: '{{.Lastname}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.nickName', value: '{{.NickName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.displayName', value: '{{.DisplayName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastEmail', value: '{{.LastEmail}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.verifiedEmail', value: '{{.VerifiedEmail}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastPhone', value: '{{.LastPhone}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.verifiedPhone', value: '{{.VerifiedPhone}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.loginnames', value: '{{.LoginNames}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.changedate', value: '{{.ChangeDate}}' },
],
[MESSAGETYPES.PASSWORDLESS]: [
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.preferredLoginName', value: '{{.PreferredLoginName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.username', value: '{{.UserName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.firstname', value: '{{.FirstName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastname', value: '{{.Lastname}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.nickName', value: '{{.NickName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.displayName', value: '{{.DisplayName}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastEmail', value: '{{.LastEmail}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.verifiedEmail', value: '{{.VerifiedEmail}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.lastPhone', value: '{{.LastPhone}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.verifiedPhone', value: '{{.VerifiedPhone}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.loginnames', value: '{{.LoginNames}}' },
{ key: 'POLICY.MESSAGE_TEXTS.CHIPS.changedate', value: '{{.ChangeDate}}' },
],
};
public locale: string = 'en';
public LOCALES: string[] = ['en'];
@ -283,9 +411,7 @@ export class MessageTextsComponent implements OnDestroy {
}
return this.route.params;
})).subscribe(() => {
});
})).subscribe();
}
public getDefaultValues(type: MESSAGETYPES, req: any): Promise<any> {
@ -300,6 +426,8 @@ export class MessageTextsComponent implements OnDestroy {
return this.stripDetails((this.service).getDefaultPasswordResetMessageText(req));
case MESSAGETYPES.DOMAINCLAIMED:
return this.stripDetails((this.service).getDefaultDomainClaimedMessageText(req));
case MESSAGETYPES.PASSWORDLESS:
return this.stripDetails((this.service).getDefaultPasswordlessRegistrationMessageText(req));
}
}
@ -316,6 +444,8 @@ export class MessageTextsComponent implements OnDestroy {
return this.stripDetails((this.service as ManagementService).getCustomPasswordResetMessageText(req));
case MESSAGETYPES.DOMAINCLAIMED:
return this.stripDetails((this.service as ManagementService).getCustomDomainClaimedMessageText(req));
case MESSAGETYPES.PASSWORDLESS:
return this.stripDetails((this.service as ManagementService).getCustomPasswordlessRegistrationMessageText(req));
}
} else if (this.serviceType === PolicyComponentServiceType.ADMIN) {
switch (type) {
@ -329,6 +459,8 @@ export class MessageTextsComponent implements OnDestroy {
return this.stripDetails((this.service as AdminService).getCustomPasswordResetMessageText(req));
case MESSAGETYPES.DOMAINCLAIMED:
return this.stripDetails((this.service as AdminService).getCustomDomainClaimedMessageText(req));
case MESSAGETYPES.PASSWORDLESS:
return this.stripDetails((this.service as AdminService).getCustomPasswordlessRegistrationMessageText(req));
}
}
}
@ -380,6 +512,9 @@ export class MessageTextsComponent implements OnDestroy {
return handler((this.service as ManagementService).setCustomPasswordResetMessageText(this.updateRequest));
case MESSAGETYPES.DOMAINCLAIMED:
return handler((this.service as ManagementService).setCustomDomainClaimedMessageCustomText(this.updateRequest));
case MESSAGETYPES.PASSWORDLESS:
return handler((this.service as ManagementService)
.getCustomPasswordlessRegistrationMessageText(this.updateRequest));
}
} else if (this.serviceType === PolicyComponentServiceType.ADMIN) {
switch (this.currentType) {
@ -393,6 +528,9 @@ export class MessageTextsComponent implements OnDestroy {
return handler((this.service as AdminService).setDefaultPasswordResetMessageText(this.updateRequest));
case MESSAGETYPES.DOMAINCLAIMED:
return handler((this.service as AdminService).setDefaultDomainClaimedMessageText(this.updateRequest));
case MESSAGETYPES.PASSWORDLESS:
return handler((this.service as AdminService)
.setDefaultPasswordlessRegistrationMessageText(this.updateRequest));
}
}
}
@ -433,6 +571,10 @@ export class MessageTextsComponent implements OnDestroy {
return handler((this.service as ManagementService).resetCustomPasswordResetMessageTextToDefault(this.locale));
case MESSAGETYPES.DOMAINCLAIMED:
return handler((this.service as ManagementService).resetCustomDomainClaimedMessageTextToDefault(this.locale));
case MESSAGETYPES.DOMAINCLAIMED:
return handler((this.service as ManagementService)
.resetCustomPasswordlessRegistrationMessageTextToDefault(this.locale));
}
}

View File

@ -1,6 +1,6 @@
<app-detail-layout [backRouterLink]="[ serviceType === PolicyComponentServiceType.ADMIN ? '/iam/policies' : '/org']"
[title]="'POLICY.IAM_POLICY.TITLE' | translate" [description]="'POLICY.IAM_POLICY.DESCRIPTION' | translate">
<p class="default" *ngIf="isDefault"> {{'POLICY.DEFAULTLABEL' | translate}}</p>
<cnsl-info-section *ngIf="isDefault"> {{'POLICY.DEFAULTLABEL' | translate}}</cnsl-info-section>
<ng-template appHasRole [appHasRole]="['iam.policy.delete']">
<button *ngIf="serviceType === PolicyComponentServiceType.MGMT && !isDefault"

View File

@ -1,7 +1,7 @@
<app-detail-layout [backRouterLink]="[ serviceType === PolicyComponentServiceType.ADMIN ? '/iam/policies' : '/org']"
[title]="'POLICY.PWD_COMPLEXITY.TITLE' | translate" [description]="'POLICY.PWD_COMPLEXITY.DESCRIPTION' | translate">
<p class="default" *ngIf="isDefault"> {{'POLICY.DEFAULTLABEL' | translate}}</p>
<cnsl-info-section *ngIf="isDefault"> {{'POLICY.DEFAULTLABEL' | translate}}</cnsl-info-section>
<div class="spinner-wr">
<mat-spinner diameter="30" *ngIf="loading" color="primary"></mat-spinner>

View File

@ -1,8 +1,3 @@
.default {
color: var(--color-main);
margin-top: 0;
}
.spinner-wr {
margin: .5rem 0;
}

View File

@ -11,6 +11,7 @@ import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
import { DetailLayoutModule } from 'src/app/modules/detail-layout/detail-layout.module';
import { InputModule } from 'src/app/modules/input/input.module';
import { InfoSectionModule } from '../../info-section/info-section.module';
import { PolicyGridModule } from '../../policy-grid/policy-grid.module';
import { PasswordComplexityPolicyRoutingModule } from './password-complexity-policy-routing.module';
import { PasswordComplexityPolicyComponent } from './password-complexity-policy.component';
@ -31,6 +32,7 @@ import { PasswordComplexityPolicyComponent } from './password-complexity-policy.
DetailLayoutModule,
MatProgressSpinnerModule,
PolicyGridModule,
InfoSectionModule,
],
})
export class PasswordComplexityPolicyModule { }

View File

@ -2,6 +2,8 @@
[title]="'POLICY.PRIVACY_POLICY.TITLE' | translate"
[description]="'POLICY.PRIVACY_POLICY.DESCRIPTION' | translate">
<cnsl-info-section *ngIf="isDefault"> {{'POLICY.DEFAULTLABEL' | translate}}</cnsl-info-section>
<cnsl-info-section class="warn"
*ngIf="serviceType == PolicyComponentServiceType.MGMT && (['privacy_policy'] | hasFeature | async) == false"
type="WARN">

View File

@ -144,4 +144,12 @@ export class PrivacyPolicyComponent implements OnDestroy {
public ngOnDestroy(): void {
this.sub.unsubscribe();
}
public get isDefault(): boolean {
if (this.privacyPolicy && this.serviceType === PolicyComponentServiceType.MGMT) {
return (this.privacyPolicy as PrivacyPolicy.AsObject).isDefault;
} else {
return false;
}
}
}

View File

@ -28,7 +28,6 @@ import { PrivacyPolicyComponent } from './privacy-policy.component';
PrivacyPolicyRoutingModule,
MatSelectModule,
CommonModule,
InfoSectionModule,
ReactiveFormsModule,
FormsModule,
InputModule,
@ -47,6 +46,7 @@ import { PrivacyPolicyComponent } from './privacy-policy.component';
MatDialogModule,
WarnDialogModule,
PolicyGridModule,
InfoSectionModule,
],
})
export class PrivacyPolicyModule { }

View File

@ -25,7 +25,7 @@
</div>
<div class="btn-wrapper">
<button mat-stroked-button [style.color]="theme == Theme.DARK ? policy.fontColorDark : policy.fontColor">{{'POLICY.PRIVATELABELING.PREVIEW.SECONDARYBUTTON' | translate}}</button>
<button mat-stroked-button [style.color]="theme == Theme.DARK ? policy.primaryColorDark : policy.primaryColor">{{'POLICY.PRIVATELABELING.PREVIEW.SECONDARYBUTTON' | translate}}</button>
<button *ngIf="theme == Theme.DARK" mat-raised-button [style.background]="policy.primaryColorDark" [style.color]="policy.primaryColorDark == '#ffffff' ? '#000000' : '#ffffff'">{{'POLICY.PRIVATELABELING.PREVIEW.PRIMARYBUTTON' | translate}}</button>
<button *ngIf="theme == Theme.LIGHT" mat-raised-button [style.background]="policy.primaryColor" [style.color]="policy.primaryColor == '#ffffff' ? '#000000' : '#ffffff'">{{'POLICY.PRIVATELABELING.PREVIEW.PRIMARYBUTTON' | translate}}</button>
</div>

View File

@ -9,7 +9,7 @@
</div>
</div>
<p class="desc">{{'POLICY.PRIVATELABELING.PREVIEW_DESCRIPTION' | translate}}</p>
<p class="default" *ngIf="isDefault"> {{'POLICY.DEFAULTLABEL' | translate}}</p>
<cnsl-info-section *ngIf="isDefault"> {{'POLICY.DEFAULTLABEL' | translate}}</cnsl-info-section>
<div class="spinner-wr">
<mat-spinner diameter="30" *ngIf="loading" color="primary"></mat-spinner>
@ -59,6 +59,8 @@
<p class="description">Your Logo will be used in the Login itself, while the icon is used for smaller UI elements like in the organisation switcher in console</p>
<cnsl-info-section class="max-size-desc"> {{'POLICY.PRIVATELABELING.MAXSIZE' | translate}}</cnsl-info-section>
<!-- <span class="title">{{ theme === Theme.DARK ? ('POLICY.PRIVATELABELING.DARK' | translate) : ('POLICY.PRIVATELABELING.LIGHT' | translate)}}</span> -->
<div class="logo-setup-wrapper">
<div class="part">
@ -93,7 +95,7 @@
<i class="icon las la-image"></i>
<span>{{isHoveringOverDarkLogo ? ('POLICY.PRIVATELABELING.RELEASE' | translate): ('POLICY.PRIVATELABELING.DROP' | translate)}}</span>
<input #selectedFile style="display: none;" class="file-input" type="file" (change)="onDropLogo(theme, $event.target.files)">
<a class="btn" *ngIf="serviceType == PolicyComponentServiceType.ADMIN || (serviceType == PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async))" (click)="selectedFile.click();">{{'POLICY.PRIVATELABELING.BTN' | translate}}</a>
<a class="btn" *ngIf="serviceType == PolicyComponentServiceType.ADMIN || (serviceType == PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async))" (click)="$event.preventDefault(); selectedFile.click();">{{'POLICY.PRIVATELABELING.BTN' | translate}}</a>
</label>
</div>
</div>
@ -132,7 +134,7 @@
<i class="icon las la-image"></i>
<span>{{isHoveringOverDarkIcon ? ('POLICY.PRIVATELABELING.RELEASE' | translate): ('POLICY.PRIVATELABELING.DROP' | translate)}}</span>
<input #selectedFileIcon style="display: none;" class="file-input" type="file" (change)="onDropIcon(theme, $event.target.files)">
<a class="btn" *ngIf="serviceType == PolicyComponentServiceType.ADMIN || (serviceType == PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async))" (click)="selectedFileIcon.click();">{{'POLICY.PRIVATELABELING.BTN' | translate}}</a>
<a class="btn" *ngIf="serviceType == PolicyComponentServiceType.ADMIN || (serviceType == PolicyComponentServiceType.MGMT && (['label_policy.private_label'] | hasFeature | async))" (click)="$event.preventDefault(); selectedFileIcon.click();">{{'POLICY.PRIVATELABELING.BTN' | translate}}</a>
</label>
</div>
</div>
@ -205,6 +207,7 @@
</mat-panel-title>
</mat-expansion-panel-header>
<div class="fonts">
<cnsl-info-section class="info-section">{{'POLICY.PRIVATELABELING.FONTINLOGINONLY' | translate}}</cnsl-info-section>
<div class="font-preview mat-elevation-z3" *ngIf="preview == Preview.PREVIEW && previewData.fontUrl || preview == Preview.CURRENT && data.fontUrl">
<mat-icon class="icon">text_fields</mat-icon>
<span>ABC • abc • 123</span>

View File

@ -28,11 +28,6 @@
}
}
.default {
color: var(--color-main);
margin-top: 0;
}
.desc {
font-size: 14px;
color: var(--grey);
@ -40,6 +35,11 @@
margin-bottom: 2rem;
}
.max-size-desc {
display: block;
margin-bottom: 1rem;
}
.spinner-wr {
margin: .5rem 0;
}
@ -323,6 +323,11 @@
}
.fonts {
.info-section {
display: block;
margin-bottom: 1rem;
}
.title {
display: block;
font-size: 14px;

View File

@ -49,6 +49,7 @@ export enum ColorType {
}
const ORG_STORAGE_KEY = 'organization';
const MAX_ALLOWED_SIZE = 0.5 * 1024 * 1024;
@Component({
selector: 'app-private-labeling-policy',
@ -139,25 +140,28 @@ export class PrivateLabelingPolicyComponent implements OnDestroy {
const file = filelist.item(0);
if (file) {
const formData = new FormData();
formData.append('file', file);
if (theme === Theme.DARK) {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
return this.handleUploadPromise(this.assetService.upload(AssetEndpoint.MGMTDARKLOGO, formData, this.org.id));
case PolicyComponentServiceType.ADMIN:
return this.handleUploadPromise(this.assetService.upload(AssetEndpoint.IAMDARKLOGO, formData, this.org.id));
if (file.size > MAX_ALLOWED_SIZE) {
this.toast.showInfo('POLICY.PRIVATELABELING.MAXSIZEEXCEEDED', true);
} else {
const formData = new FormData();
formData.append('file', file);
if (theme === Theme.DARK) {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
return this.handleUploadPromise(this.assetService.upload(AssetEndpoint.MGMTDARKLOGO, formData, this.org.id));
case PolicyComponentServiceType.ADMIN:
return this.handleUploadPromise(this.assetService.upload(AssetEndpoint.IAMDARKLOGO, formData, this.org.id));
}
}
if (theme === Theme.LIGHT) {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
return this.handleUploadPromise(this.assetService.upload(AssetEndpoint.MGMTLOGO, formData, this.org.id));
case PolicyComponentServiceType.ADMIN:
return this.handleUploadPromise(this.assetService.upload(AssetEndpoint.IAMLOGO, formData, this.org.id));
}
}
}
if (theme === Theme.LIGHT) {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
return this.handleUploadPromise(this.assetService.upload(AssetEndpoint.MGMTLOGO, formData, this.org.id));
case PolicyComponentServiceType.ADMIN:
return this.handleUploadPromise(this.assetService.upload(AssetEndpoint.IAMLOGO, formData, this.org.id));
}
}
}
}
@ -262,26 +266,30 @@ export class PrivateLabelingPolicyComponent implements OnDestroy {
const file = filelist.item(0);
if (file) {
const formData = new FormData();
formData.append('file', file);
if (theme === Theme.DARK) {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
this.handleUploadPromise(this.assetService.upload(AssetEndpoint.MGMTDARKICON, formData, this.org.id));
break;
case PolicyComponentServiceType.ADMIN:
this.handleUploadPromise(this.assetService.upload(AssetEndpoint.IAMDARKICON, formData, this.org.id));
break;
if (file.size > MAX_ALLOWED_SIZE) {
this.toast.showInfo('POLICY.PRIVATELABELING.MAXSIZEEXCEEDED', true);
} else {
const formData = new FormData();
formData.append('file', file);
if (theme === Theme.DARK) {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
this.handleUploadPromise(this.assetService.upload(AssetEndpoint.MGMTDARKICON, formData, this.org.id));
break;
case PolicyComponentServiceType.ADMIN:
this.handleUploadPromise(this.assetService.upload(AssetEndpoint.IAMDARKICON, formData, this.org.id));
break;
}
}
}
if (theme === Theme.LIGHT) {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
this.handleUploadPromise(this.assetService.upload(AssetEndpoint.MGMTICON, formData, this.org.id));
break;
case PolicyComponentServiceType.ADMIN:
this.handleUploadPromise(this.assetService.upload(AssetEndpoint.IAMICON, formData, this.org.id));
break;
if (theme === Theme.LIGHT) {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
this.handleUploadPromise(this.assetService.upload(AssetEndpoint.MGMTICON, formData, this.org.id));
break;
case PolicyComponentServiceType.ADMIN:
this.handleUploadPromise(this.assetService.upload(AssetEndpoint.IAMICON, formData, this.org.id));
break;
}
}
}
}

View File

@ -3,55 +3,75 @@ import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
import { BehaviorSubject, from, Observable, of } from 'rxjs';
import { catchError, finalize, map } from 'rxjs/operators';
import { Membership } 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';
export class MembershipDetailDataSource extends DataSource<Membership.AsObject> {
public totalResult: number = 0;
public viewTimestamp!: Timestamp.AsObject;
public membersSubject: BehaviorSubject<Membership.AsObject[]>
= new BehaviorSubject<Membership.AsObject[]>([]);
private loadingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
public loading$: Observable<boolean> = this.loadingSubject.asObservable();
public totalResult: number = 0;
public viewTimestamp!: Timestamp.AsObject;
public membersSubject: BehaviorSubject<Membership.AsObject[]>
= new BehaviorSubject<Membership.AsObject[]>([]);
private loadingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
public loading$: Observable<boolean> = this.loadingSubject.asObservable();
constructor(private mgmtUserService: ManagementService) {
super();
}
constructor(private mgmtUserService: ManagementService, private authServce: GrpcAuthService) {
super();
}
public loadMemberships(userId: string, pageIndex: number, pageSize: number): void {
const offset = pageIndex * pageSize;
public loadMemberships(userId: string, pageIndex: number, pageSize: number): void {
const offset = pageIndex * pageSize;
this.loadingSubject.next(true);
from(this.mgmtUserService.listUserMemberships(userId, pageSize, offset)).pipe(
map(resp => {
this.totalResult = resp.details?.totalResult || 0;
if (resp.details?.viewTimestamp) {
this.viewTimestamp = resp.details.viewTimestamp;
}
return resp.resultList;
}),
catchError(() => of([])),
finalize(() => this.loadingSubject.next(false)),
).subscribe(members => {
this.membersSubject.next(members);
});
}
this.loadingSubject.next(true);
from(this.mgmtUserService.listUserMemberships(userId, pageSize, offset)).pipe(
map(resp => {
this.totalResult = resp.details?.totalResult || 0;
if (resp.details?.viewTimestamp) {
this.viewTimestamp = resp.details.viewTimestamp;
}
return resp.resultList;
}),
catchError(() => of([])),
finalize(() => this.loadingSubject.next(false)),
).subscribe(members => {
this.membersSubject.next(members);
});
}
public loadMyMemberships(pageIndex: number, pageSize: number): void {
const offset = pageIndex * pageSize;
this.loadingSubject.next(true);
from(this.authServce.listMyMemberships(pageSize, offset)).pipe(
map(resp => {
this.totalResult = resp.details?.totalResult || 0;
if (resp.details?.viewTimestamp) {
this.viewTimestamp = resp.details.viewTimestamp;
}
return resp.resultList;
}),
catchError(() => of([])),
finalize(() => this.loadingSubject.next(false)),
).subscribe(members => {
this.membersSubject.next(members);
});
}
/**
* Connect this data source to the table. The table will only update when
* the returned stream emits new items.
* @returns A stream of the items to be rendered.
*/
public connect(): Observable<Membership.AsObject[]> {
return this.membersSubject.asObservable();
}
/**
* Connect this data source to the table. The table will only update when
* the returned stream emits new items.
* @returns A stream of the items to be rendered.
*/
public connect(): Observable<Membership.AsObject[]> {
return this.membersSubject.asObservable();
}
/**
* Called when the table is being destroyed. Use this function, to clean up
* any open connections or free any held resources that were set up during connect.
*/
public disconnect(): void {
this.membersSubject.complete();
this.loadingSubject.complete();
}
/**
* Called when the table is being destroyed. Use this function, to clean up
* any open connections or free any held resources that were set up during connect.
*/
public disconnect(): void {
this.membersSubject.complete();
this.loadingSubject.complete();
}
}

View File

@ -1,6 +1,11 @@
<app-detail-layout [backRouterLink]="[ '/users', user?.id]"
title="{{user?.human?.displayName}} {{ 'USER.MEMBERSHIPS.TITLE' | translate }}"
description="{{ 'USER.MEMBERSHIPS.DESCRIPTION' | translate }}">
<cnsl-info-section class="context-wrapper">
<span *ngIf="isMe">{{'USER.MEMBERSHIPS.USERCONTEXT' | translate}}</span>
<span *ngIf="!isMe">{{'USER.MEMBERSHIPS.ORGCONTEXT' | translate}}</span>
</cnsl-info-section>
<app-refresh-table class="refresh-table" (refreshed)="refreshPage()" [dataSize]="dataSource?.totalResult"
[timestamp]="dataSource?.viewTimestamp" [selection]="selection" [loading]="dataSource?.loading$ | async">

View File

@ -1,3 +1,8 @@
.context-wrapper {
margin-bottom: 1rem;
display: block;
}
.refresh-table {
width: 100%;
}

View File

@ -3,233 +3,257 @@ import { AfterViewInit, Component, ViewChild } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { MatTable } from '@angular/material/table';
import { ActivatedRoute } from '@angular/router';
import { tap } from 'rxjs/operators';
import { map, switchMap, tap } from 'rxjs/operators';
import { CreationType, MemberCreateDialogComponent } from 'src/app/modules/add-member-dialog/member-create-dialog.component';
import { PaginatorComponent } from 'src/app/modules/paginator/paginator.component';
import { Membership, User } from 'src/app/proto/generated/zitadel/user_pb';
import { AdminService } from 'src/app/services/admin.service';
import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
import { MembershipDetailDataSource } from './membership-detail-datasource';
@Component({
selector: 'app-membership-detail',
templateUrl: './membership-detail.component.html',
styleUrls: ['./membership-detail.component.scss'],
selector: 'app-membership-detail',
templateUrl: './membership-detail.component.html',
styleUrls: ['./membership-detail.component.scss'],
})
export class MembershipDetailComponent implements AfterViewInit {
public user!: User.AsObject;
public user!: User.AsObject;
@ViewChild(PaginatorComponent) public paginator!: PaginatorComponent;
@ViewChild(MatTable) public table!: MatTable<Membership.AsObject>;
public dataSource!: MembershipDetailDataSource;
public selection: SelectionModel<Membership.AsObject>
= new SelectionModel<Membership.AsObject>(true, []);
@ViewChild(PaginatorComponent) public paginator!: PaginatorComponent;
@ViewChild(MatTable) public table!: MatTable<Membership.AsObject>;
public dataSource!: MembershipDetailDataSource;
public selection: SelectionModel<Membership.AsObject>
= new SelectionModel<Membership.AsObject>(true, []);
public memberRoleOptions: string[] = [];
public memberRoleOptions: string[] = [];
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
public displayedColumns: string[] = ['select', 'memberType', 'displayName', 'creationDate', 'changeDate', 'roles', 'actions'];
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
public displayedColumns: string[] = ['select', 'memberType', 'displayName', 'creationDate', 'changeDate', 'roles', 'actions'];
public loading: boolean = false;
public memberships!: Membership.AsObject[];
public loading: boolean = false;
public memberships!: Membership.AsObject[];
constructor(
activatedRoute: ActivatedRoute,
private dialog: MatDialog,
private toast: ToastService,
private mgmtService: ManagementService,
private adminService: AdminService,
) {
activatedRoute.params.subscribe(data => {
const { id } = data;
if (id) {
this.mgmtService.getUserByID(id).then(resp => {
if (resp.user) {
this.user = resp.user;
this.dataSource = new MembershipDetailDataSource(this.mgmtService);
this.dataSource.loadMemberships(
this.user.id,
0,
50,
);
}
}).catch(err => {
console.error(err);
});
}
});
}
public isMe: boolean = false;
public ngAfterViewInit(): void {
this.paginator.page
.pipe(
tap(() => this.loadMembershipsPage()),
)
.subscribe();
}
constructor(
authService: GrpcAuthService,
activatedRoute: ActivatedRoute,
private dialog: MatDialog,
private toast: ToastService,
private mgmtService: ManagementService,
private adminService: AdminService,
) {
activatedRoute.params
.pipe(switchMap(({ id }) => {
return authService.user.pipe(
map(user => user?.id === id),
tap((isMe) => {
this.isMe = isMe;
private loadMembershipsPage(): void {
this.dataSource.loadMemberships(
this.user.id,
this.paginator.pageIndex,
this.paginator.pageSize,
);
}
public isAllSelected(): boolean {
const numSelected = this.selection.selected.length;
const numRows = this.dataSource.membersSubject.value.length;
return numSelected === numRows;
}
public masterToggle(): void {
this.isAllSelected() ?
this.selection.clear() :
this.dataSource.membersSubject.value.forEach(row => this.selection.select(row));
}
public addMember(): void {
const dialogRef = this.dialog.open(MemberCreateDialogComponent, {
width: '400px',
data: {
user: this.user,
},
});
dialogRef.afterClosed().subscribe(resp => {
if (resp && resp.creationType !== undefined) {
switch (resp.creationType) {
case CreationType.IAM:
this.createIamMember(resp);
break;
case CreationType.ORG:
this.createOrgMember(resp);
break;
case CreationType.PROJECT_OWNED:
this.createOwnedProjectMember(resp);
break;
case CreationType.PROJECT_GRANTED:
this.createGrantedProjectMember(resp);
break;
if (isMe) {
this.mgmtService.getUserByID(id).then(resp => {
if (resp.user) {
this.user = resp.user;
this.dataSource = new MembershipDetailDataSource(this.mgmtService, authService);
this.dataSource.loadMyMemberships(
0,
50,
);
}
}).catch(err => {
console.error(err);
});
} else {
this.mgmtService.getUserByID(id).then(resp => {
if (resp.user) {
this.user = resp.user;
this.dataSource = new MembershipDetailDataSource(this.mgmtService, authService);
this.dataSource.loadMemberships(
this.user.id,
0,
50,
);
}
}).catch(err => {
console.error(err);
});
}
}),
);
})).subscribe();
}
public ngAfterViewInit(): void {
this.paginator.page
.pipe(
tap(() => this.loadMembershipsPage()),
)
.subscribe();
}
private loadMembershipsPage(): void {
this.dataSource.loadMemberships(
this.user.id,
this.paginator.pageIndex,
this.paginator.pageSize,
);
}
public isAllSelected(): boolean {
const numSelected = this.selection.selected.length;
const numRows = this.dataSource.membersSubject.value.length;
return numSelected === numRows;
}
public masterToggle(): void {
this.isAllSelected() ?
this.selection.clear() :
this.dataSource.membersSubject.value.forEach(row => this.selection.select(row));
}
public addMember(): void {
const dialogRef = this.dialog.open(MemberCreateDialogComponent, {
width: '400px',
data: {
user: this.user,
},
});
dialogRef.afterClosed().subscribe(resp => {
if (resp && resp.creationType !== undefined) {
switch (resp.creationType) {
case CreationType.IAM:
this.createIamMember(resp);
break;
case CreationType.ORG:
this.createOrgMember(resp);
break;
case CreationType.PROJECT_OWNED:
this.createOwnedProjectMember(resp);
break;
case CreationType.PROJECT_GRANTED:
this.createGrantedProjectMember(resp);
break;
}
}
});
}
public async loadManager(userId: string): Promise<void> {
this.mgmtService.listUserMemberships(userId, 100, 0, []).then(response => {
this.memberships = response.resultList;
this.loading = false;
});
}
public createIamMember(response: any): void {
const users: User.AsObject[] = response.users;
const roles: string[] = response.roles;
if (users && users.length && roles && roles.length) {
Promise.all(users.map(user => {
return this.adminService.addIAMMember(user.id, roles);
})).then(() => {
this.toast.showInfo('IAM.TOAST.MEMBERADDED', true);
setTimeout(() => {
this.refreshPage();
}, 1000);
}).catch(error => {
this.toast.showError(error);
});
}
}
private createOrgMember(response: any): void {
const users: User.AsObject[] = response.users;
const roles: string[] = response.roles;
if (users && users.length && roles && roles.length) {
Promise.all(users.map(user => {
return this.mgmtService.addOrgMember(user.id, roles);
})).then(() => {
this.toast.showInfo('ORG.TOAST.MEMBERADDED', true);
setTimeout(() => {
this.refreshPage();
}, 1000);
}).catch(error => {
this.toast.showError(error);
});
}
}
private createGrantedProjectMember(response: any): void {
const users: User.AsObject[] = response.users;
const roles: string[] = response.roles;
if (users && users.length && roles && roles.length) {
users.forEach(user => {
return this.mgmtService.addProjectGrantMember(
response.projectId,
response.grantId,
user.id,
roles,
).then(() => {
this.toast.showInfo('PROJECT.TOAST.MEMBERADDED', true);
setTimeout(() => {
this.refreshPage();
}, 1000);
}).catch(error => {
this.toast.showError(error);
});
});
}
}
private createOwnedProjectMember(response: any): void {
const users: User.AsObject[] = response.users;
const roles: string[] = response.roles;
if (users && users.length && roles && roles.length) {
users.forEach(user => {
return this.mgmtService.addProjectMember(response.projectId, user.id, roles)
.then(() => {
this.toast.showInfo('PROJECT.TOAST.MEMBERADDED', true);
setTimeout(() => {
this.refreshPage();
}, 1000);
}).catch(error => {
this.toast.showError(error);
});
});
}
}
public removeMembership(membership: Membership.AsObject): void {
let prom;
if (membership.projectId && membership.projectGrantId && membership.userId) {
prom = this.mgmtService.removeProjectGrantMember(
membership.projectId,
membership.projectGrantId,
membership.userId,
);
} else if (membership.projectId && membership.userId) {
prom = this.mgmtService.removeProjectMember(membership.projectId, membership.userId);
} else if (membership.orgId && membership.userId) {
prom = this.mgmtService.removeOrgMember(membership.userId);
} else if (membership.userId) {
prom = this.adminService.removeIAMMember(membership.userId);
}
public async loadManager(userId: string): Promise<void> {
this.mgmtService.listUserMemberships(userId, 100, 0, []).then(response => {
this.memberships = response.resultList;
this.loading = false;
});
if (prom) {
prom.then(() => {
this.toast.showInfo('PROJECT.TOAST.MEMBERREMOVED', true);
this.refreshPage();
}).catch(error => this.toast.showError(error));
}
}
public createIamMember(response: any): void {
const users: User.AsObject[] = response.users;
const roles: string[] = response.roles;
if (users && users.length && roles && roles.length) {
Promise.all(users.map(user => {
return this.adminService.addIAMMember(user.id, roles);
})).then(() => {
this.toast.showInfo('IAM.TOAST.MEMBERADDED', true);
setTimeout(() => {
this.refreshPage();
}, 1000);
}).catch(error => {
this.toast.showError(error);
});
}
}
private createOrgMember(response: any): void {
const users: User.AsObject[] = response.users;
const roles: string[] = response.roles;
if (users && users.length && roles && roles.length) {
Promise.all(users.map(user => {
return this.mgmtService.addOrgMember(user.id, roles);
})).then(() => {
this.toast.showInfo('ORG.TOAST.MEMBERADDED', true);
setTimeout(() => {
this.refreshPage();
}, 1000);
}).catch(error => {
this.toast.showError(error);
});
}
}
private createGrantedProjectMember(response: any): void {
const users: User.AsObject[] = response.users;
const roles: string[] = response.roles;
if (users && users.length && roles && roles.length) {
users.forEach(user => {
return this.mgmtService.addProjectGrantMember(
response.projectId,
response.grantId,
user.id,
roles,
).then(() => {
this.toast.showInfo('PROJECT.TOAST.MEMBERADDED', true);
setTimeout(() => {
this.refreshPage();
}, 1000);
}).catch(error => {
this.toast.showError(error);
});
});
}
}
private createOwnedProjectMember(response: any): void {
const users: User.AsObject[] = response.users;
const roles: string[] = response.roles;
if (users && users.length && roles && roles.length) {
users.forEach(user => {
return this.mgmtService.addProjectMember(response.projectId, user.id, roles)
.then(() => {
this.toast.showInfo('PROJECT.TOAST.MEMBERADDED', true);
setTimeout(() => {
this.refreshPage();
}, 1000);
}).catch(error => {
this.toast.showError(error);
});
});
}
}
public removeMembership(membership: Membership.AsObject): void {
let prom;
if (membership.projectId && membership.projectGrantId && membership.userId) {
prom = this.mgmtService.removeProjectGrantMember(
membership.projectId,
membership.projectGrantId,
membership.userId,
);
} else if (membership.projectId && membership.userId) {
prom = this.mgmtService.removeProjectMember(membership.projectId, membership.userId);
} else if (membership.orgId && membership.userId) {
prom = this.mgmtService.removeOrgMember(membership.userId);
} else if (membership.userId) {
prom = this.adminService.removeIAMMember(membership.userId);
}
if (prom) {
prom.then(() => {
this.toast.showInfo('PROJECT.TOAST.MEMBERREMOVED', true);
this.refreshPage();
}).catch(error => this.toast.showError(error));
}
}
public refreshPage(): void {
this.selection.clear();
this.dataSource.loadMemberships(this.user.id, this.paginator.pageIndex, this.paginator.pageSize);
}
public refreshPage(): void {
this.selection.clear();
this.dataSource.loadMemberships(this.user.id, this.paginator.pageIndex, this.paginator.pageSize);
}
}

View File

@ -10,6 +10,7 @@ import { RouterModule, Routes } from '@angular/router';
import { TranslateModule } from '@ngx-translate/core';
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
import { DetailLayoutModule } from 'src/app/modules/detail-layout/detail-layout.module';
import { InfoSectionModule } from 'src/app/modules/info-section/info-section.module';
import { PaginatorModule } from 'src/app/modules/paginator/paginator.module';
import { RefreshTableModule } from 'src/app/modules/refresh-table/refresh-table.module';
import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.module';
@ -19,34 +20,35 @@ import { TimestampToDatePipeModule } from 'src/app/pipes/timestamp-to-date-pipe/
import { MembershipDetailComponent } from './membership-detail.component';
const routes: Routes = [
{
path: '',
component: MembershipDetailComponent,
canActivate: [],
data: {
roles: ['user.write'],
},
{
path: '',
component: MembershipDetailComponent,
canActivate: [],
data: {
roles: ['user.write'],
},
},
];
@NgModule({
declarations: [MembershipDetailComponent],
imports: [
CommonModule,
RouterModule.forChild(routes),
TranslateModule,
DetailLayoutModule,
MatCheckboxModule,
MatTableModule,
PaginatorModule,
MatProgressSpinnerModule,
LocalizedDatePipeModule,
TimestampToDatePipeModule,
HasRoleModule,
MatIconModule,
MatButtonModule,
HasRolePipeModule,
RefreshTableModule,
MatTooltipModule,
],
declarations: [MembershipDetailComponent],
imports: [
CommonModule,
RouterModule.forChild(routes),
TranslateModule,
DetailLayoutModule,
MatCheckboxModule,
MatTableModule,
PaginatorModule,
MatProgressSpinnerModule,
LocalizedDatePipeModule,
TimestampToDatePipeModule,
HasRoleModule,
MatIconModule,
MatButtonModule,
HasRolePipeModule,
RefreshTableModule,
MatTooltipModule,
InfoSectionModule,
],
})
export class MembershipDetailModule { }

View File

@ -98,7 +98,7 @@
span {
max-width: 30px;
text-overflow: ellipsis;
font-weight: 800;
font-weight: 300;
display: block;
white-space: nowrap;
overflow: hidden;

View File

@ -55,7 +55,7 @@ export class MembershipsComponent implements OnInit {
public async loadManager(userId: string): Promise<void> {
if (this.auth) {
this.authService.listMyUserGrants(100, 0, []).then(resp => {
this.authService.listMyMemberships(100, 0, []).then(resp => {
this.memberships = resp.resultList;
this.totalResult = resp.details?.totalResult || 0;
this.loading = false;

View File

@ -27,6 +27,8 @@ import {
GetCustomLoginTextsResponse,
GetCustomOrgIAMPolicyRequest,
GetCustomOrgIAMPolicyResponse,
GetCustomPasswordlessRegistrationMessageTextRequest,
GetCustomPasswordlessRegistrationMessageTextResponse,
GetCustomPasswordResetMessageTextRequest,
GetCustomPasswordResetMessageTextResponse,
GetCustomVerifyEmailMessageTextRequest,
@ -41,6 +43,8 @@ import {
GetDefaultInitMessageTextResponse,
GetDefaultLoginTextsRequest,
GetDefaultLoginTextsResponse,
GetDefaultPasswordlessRegistrationMessageTextRequest,
GetDefaultPasswordlessRegistrationMessageTextResponse,
GetDefaultPasswordResetMessageTextRequest,
GetDefaultPasswordResetMessageTextResponse,
GetDefaultVerifyEmailMessageTextRequest,
@ -124,6 +128,8 @@ import {
SetDefaultFeaturesResponse,
SetDefaultInitMessageTextRequest,
SetDefaultInitMessageTextResponse,
SetDefaultPasswordlessRegistrationMessageTextRequest,
SetDefaultPasswordlessRegistrationMessageTextResponse,
SetDefaultPasswordResetMessageTextRequest,
SetDefaultPasswordResetMessageTextResponse,
SetDefaultVerifyEmailMessageTextRequest,
@ -275,6 +281,22 @@ export class AdminService {
return this.grpcService.admin.setDefaultDomainClaimedMessageText(req, null).then(resp => resp.toObject());
}
public getDefaultPasswordlessRegistrationMessageText(req: GetDefaultPasswordlessRegistrationMessageTextRequest):
Promise<GetDefaultPasswordlessRegistrationMessageTextResponse.AsObject> {
return this.grpcService.admin.getDefaultPasswordlessRegistrationMessageText(req, null).then(resp => resp.toObject());
}
public getCustomPasswordlessRegistrationMessageText(req: GetCustomPasswordlessRegistrationMessageTextRequest):
Promise<GetCustomPasswordlessRegistrationMessageTextResponse.AsObject> {
return this.grpcService.admin.getCustomPasswordlessRegistrationMessageText(req, null).then(resp => resp.toObject());
}
public setDefaultPasswordlessRegistrationMessageText(req: SetDefaultPasswordlessRegistrationMessageTextRequest):
Promise<SetDefaultPasswordlessRegistrationMessageTextResponse.AsObject> {
return this.grpcService.admin.setDefaultPasswordlessRegistrationMessageText(req, null).then(resp => resp.toObject());
}
public SetUpOrg(
org: SetUpOrgRequest.Org,
human: SetUpOrgRequest.Human,

View File

@ -26,6 +26,8 @@ import {
ListMyAuthFactorsResponse,
ListMyLinkedIDPsRequest,
ListMyLinkedIDPsResponse,
ListMyMembershipsRequest,
ListMyMembershipsResponse,
ListMyPasswordlessRequest,
ListMyPasswordlessResponse,
ListMyProjectOrgsRequest,
@ -78,7 +80,7 @@ import {
import { ChangeQuery } from '../proto/generated/zitadel/change_pb';
import { ListQuery } from '../proto/generated/zitadel/object_pb';
import { Org, OrgQuery } from '../proto/generated/zitadel/org_pb';
import { Gender, User, WebAuthNVerification } from '../proto/generated/zitadel/user_pb';
import { Gender, MembershipQuery, User, WebAuthNVerification } from '../proto/generated/zitadel/user_pb';
import { GrpcService } from './grpc.service';
import { StorageKey, StorageService } from './storage.service';
@ -350,6 +352,24 @@ export class GrpcAuthService {
return this.grpcService.auth.listMyUserGrants(req, null).then(resp => resp.toObject());
}
public listMyMemberships(limit: number, offset: number,
queryList?: MembershipQuery[],
): Promise<ListMyMembershipsResponse.AsObject> {
const req = new ListMyMembershipsRequest();
const metadata = new ListQuery();
if (limit) {
metadata.setLimit(limit);
}
if (offset) {
metadata.setOffset(offset);
}
if (queryList) {
req.setQueriesList(queryList);
}
req.setQuery(metadata);
return this.grpcService.auth.listMyMemberships(req, null).then(resp => resp.toObject());
}
public getMyEmail(): Promise<GetMyEmailResponse.AsObject> {
const req = new GetMyEmailRequest();
return this.grpcService.auth.getMyEmail(req, null).then(resp => resp.toObject());

View File

@ -3,7 +3,6 @@ import { Empty } from 'google-protobuf/google/protobuf/empty_pb';
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
import { BehaviorSubject } from 'rxjs';
import { GetDefaultDomainClaimedMessageTextRequest } from '../proto/generated/zitadel/admin_pb';
import { AppQuery } from '../proto/generated/zitadel/app_pb';
import { KeyType } from '../proto/generated/zitadel/auth_n_key_pb';
import { ChangeQuery } from '../proto/generated/zitadel/change_pb';
@ -87,12 +86,15 @@ import {
GetCustomInitMessageTextResponse,
GetCustomLoginTextsRequest,
GetCustomLoginTextsResponse,
GetCustomPasswordlessRegistrationMessageTextRequest,
GetCustomPasswordlessRegistrationMessageTextResponse,
GetCustomPasswordResetMessageTextRequest,
GetCustomPasswordResetMessageTextResponse,
GetCustomVerifyEmailMessageTextRequest,
GetCustomVerifyEmailMessageTextResponse,
GetCustomVerifyPhoneMessageTextRequest,
GetCustomVerifyPhoneMessageTextResponse,
GetDefaultDomainClaimedMessageTextRequest,
GetDefaultDomainClaimedMessageTextResponse,
GetDefaultInitMessageTextRequest,
GetDefaultInitMessageTextResponse,
@ -102,6 +104,8 @@ import {
GetDefaultLoginTextsResponse,
GetDefaultPasswordComplexityPolicyRequest,
GetDefaultPasswordComplexityPolicyResponse,
GetDefaultPasswordlessRegistrationMessageTextRequest,
GetDefaultPasswordlessRegistrationMessageTextResponse,
GetDefaultPasswordResetMessageTextRequest,
GetDefaultPasswordResetMessageTextResponse,
GetDefaultVerifyEmailMessageTextRequest,
@ -290,6 +294,8 @@ import {
ResetCustomInitMessageTextToDefaultResponse,
ResetCustomLoginTextsToDefaultRequest,
ResetCustomLoginTextsToDefaultResponse,
ResetCustomPasswordlessRegistrationMessageTextToDefaultRequest,
ResetCustomPasswordlessRegistrationMessageTextToDefaultResponse,
ResetCustomPasswordResetMessageTextToDefaultRequest,
ResetCustomPasswordResetMessageTextToDefaultResponse,
ResetCustomVerifyEmailMessageTextToDefaultRequest,
@ -317,6 +323,8 @@ import {
SetCustomInitMessageTextResponse,
SetCustomLoginTextsRequest,
SetCustomLoginTextsResponse,
SetCustomPasswordlessRegistrationMessageTextRequest,
SetCustomPasswordlessRegistrationMessageTextResponse,
SetCustomPasswordResetMessageTextRequest,
SetCustomPasswordResetMessageTextResponse,
SetCustomVerifyEmailMessageTextRequest,
@ -540,6 +548,30 @@ export class ManagementService {
return this.grpcService.mgmt.resetCustomDomainClaimedMessageTextToDefault(req, null).then(resp => resp.toObject());
}
public getDefaultPasswordlessRegistrationMessageText(req: GetDefaultPasswordlessRegistrationMessageTextRequest):
Promise<GetDefaultPasswordlessRegistrationMessageTextResponse.AsObject> {
return this.grpcService.mgmt.getDefaultPasswordlessRegistrationMessageText(req, null).then(resp => resp.toObject());
}
public getCustomPasswordlessRegistrationMessageText(req: GetCustomPasswordlessRegistrationMessageTextRequest):
Promise<GetCustomPasswordlessRegistrationMessageTextResponse.AsObject> {
return this.grpcService.mgmt.getCustomPasswordlessRegistrationMessageText(req, null).then(resp => resp.toObject());
}
public setCustomPasswordlessRegistrationMessageCustomText(req: SetCustomPasswordlessRegistrationMessageTextRequest):
Promise<SetCustomPasswordlessRegistrationMessageTextResponse.AsObject> {
return this.grpcService.mgmt.setCustomPasswordlessRegistrationMessageCustomText(req, null).then(resp => resp.toObject());
}
public resetCustomPasswordlessRegistrationMessageTextToDefault(lang: string):
Promise<ResetCustomPasswordlessRegistrationMessageTextToDefaultResponse.AsObject> {
const req = new ResetCustomPasswordlessRegistrationMessageTextToDefaultRequest();
req.setLanguage(lang);
return this.grpcService.mgmt.resetCustomPasswordlessRegistrationMessageTextToDefault(req, null)
.then(resp => resp.toObject());
}
public listOrgIDPs(
limit?: number,
offset?: number,

View File

@ -481,6 +481,8 @@
"MEMBERSHIPS": {
"TITLE": "ZITADEL Manager-Rollen",
"DESCRIPTION": "Dies sind alle Mitgliedschaften des Benutzers. Du kannst die entsprechenden Rechte auch auf der Organisations-, Projekt-, oder IAM-Detailseite aufrufen und modifizieren.",
"ORGCONTEXT":"Sie sehen alle Organisationen und Projekte, die mit der aktuell gewählten Organisation in Verbindung stehen.",
"USERCONTEXT":"Sie sehen alle Organisationen und Projekte auf denen Sie berechtigt sind inklusive aller zur Auswahl stehenden Organisationen.",
"CREATIONDATE": "Erstelldatum",
"CHANGEDATE": "Letzte Änderung",
"DISPLAYNAME": "Anzeigename",
@ -690,6 +692,9 @@
"RELEASE":"Jetzt loslassen",
"DROPFONT":"Fontdatei hier ablegen",
"RELEASEFONT":"Jetzt loslassen",
"MAXSIZE":"Die maximale Grösse von Uploads ist mit 524kB begrenzt",
"MAXSIZEEXCEEDED":"Maximale Grösse von 524kB überschritten",
"FONTINLOGINONLY":"Die Schriftart wird momentan nur im Login interface angezeigt.",
"PREVIEW": {
"TITLE":"Anmeldung",
"SECOND":"mit ZITADEL-Konto anmelden.",
@ -770,7 +775,6 @@
"passwordChangeText":"Passwortwechsel",
"passwordResetDoneText":"Passwort zurücksetzen erfolgreich",
"passwordText":"Passwort",
"passwordlessText":"Passwortlose Authentifizierung",
"registrationOptionText":"Registrierungsoptionen",
"registrationOrgText":"Organisation registrieren",
"registrationUserText":"Benutzer registrieren",
@ -779,7 +783,11 @@
"usernameChangeDoneText":"Benutzernamenwechsel erfolgreich",
"usernameChangeText":"Benutzernamenwechsel",
"verifyMfaOtpText":"OTP Verifikation",
"verifyMfaU2fText":"Universeller Zweitfaktor Verifikation"
"verifyMfaU2fText":"Universeller Zweitfaktor Verifikation",
"passwordlessPromptText":"Passwordless Aufforderung",
"passwordlessRegistrationDoneText":"Passwordless setzen erfolgreich",
"passwordlessRegistrationText":"Passwordless Registrierung",
"passwordlessText":"Passwordless"
}
},
"MESSAGE_TEXTS": {
@ -790,13 +798,25 @@
"VE":"Emailverifikation",
"VP":"Telefonnummerverifikation",
"PR":"Password Wiederherstellung",
"DC":"Domainbeanspruchung"
"DC":"Domainbeanspruchung",
"PL":"Passwordless"
},
"CHIPS": {
"firstname":"Vorname",
"lastname":"Nachname",
"code":"Code",
"preferredLoginName":"Bevorzugter Anmeldename"
"preferredLoginName":"Bevorzugter Anmeldename",
"displayName":"Anzeigename",
"nickName":"Spitzname",
"loginnames":"Loginnamen",
"domain":"Domain",
"lastEmail":"Letzte email",
"lastPhone":"Letzte Telefonnummer",
"verifiedEmail":"Verifizierte email",
"verifiedPhone":"Verifizierte Telefonnummer",
"changedate":"Änderungsdatum",
"username":"Username",
"tempUsername":"Temp. Username"
},
"TOAST": {
"UPDATED":"Benutzerdefinierte Texte gespeichert."

View File

@ -481,6 +481,8 @@
"MEMBERSHIPS": {
"TITLE": "ZITADEL Manager Roles",
"DESCRIPTION": "These are all member grants of the user. You can modify them also on organisation, project, or IAM detail pages.",
"ORGCONTEXT":"You see all organizations and projects that are related to the currently selected organization.",
"USERCONTEXT":"You see all organizations and projects to which you are authorized. Including other organizations.",
"CREATIONDATE": "Creation Date",
"CHANGEDATE": "Last Modified",
"DISPLAYNAME": "Display Name",
@ -690,6 +692,9 @@
"RELEASE":"Release",
"DROPFONT":"Drop fontfile here",
"RELEASEFONT":"Release",
"MAXSIZE":"The maximum size is limited to 524kB",
"MAXSIZEEXCEEDED":"Maximum size of 524kB exceeded.",
"FONTINLOGINONLY":"The font is currently only displayed in the login interface.",
"PREVIEW": {
"TITLE":"Login",
"SECOND":"login with your ZITADEL-Account.",
@ -772,7 +777,6 @@
"passwordChangeText":"Password change",
"passwordResetDoneText":"Password reset done",
"passwordText":"Password",
"passwordlessText":"Passwordless",
"registrationOptionText":"Registration Options",
"registrationOrgText":"Register Org",
"registrationUserText":"Register User",
@ -781,7 +785,11 @@
"usernameChangeDoneText":"Username change done",
"usernameChangeText":"Username change",
"verifyMfaOtpText":"Verify OTP",
"verifyMfaU2fText":"Verify Universal Second Factor"
"verifyMfaU2fText":"Verify Universal Second Factor",
"passwordlessPromptText":"Passwordless Prompt",
"passwordlessRegistrationDoneText":"Passwordless Registration Done",
"passwordlessRegistrationText":"Passwordless Registration",
"passwordlessText":"Passwordless"
}
},
"MESSAGE_TEXTS": {
@ -792,13 +800,25 @@
"VE":"Verify Email",
"VP":"Verify Phone",
"PR":"Password Reset",
"DC":"Domain Claim"
"DC":"Domain Claim",
"PL":"Passwordless"
},
"CHIPS": {
"firstname":"Firstname",
"lastname":"Lastname",
"code":"Code",
"preferredLoginName":"Preferred Login Name"
"preferredLoginName":"Preferred Login Name",
"displayName":"Displayname",
"nickName":"Nickname",
"loginnames":"Login names",
"domain":"Domain",
"lastEmail":"Last email",
"lastPhone":"Last phone",
"verifiedEmail":"Verified email",
"verifiedPhone":"Verified phone",
"changedate":"Change date",
"username":"Username",
"tempUsername":"Temp username"
},
"TOAST": {
"UPDATED":"Custom Texts saved."
@ -831,7 +851,7 @@
"HIDEPASSWORDRESET_DESC": "If the option is selected, the user can't reset his password in the login process.",
"HIDELOGINNAMESUFFIX":"Hide Loginname suffix",
"ERRORMSGPOPUP":"Show Error in Dialog",
"DISABLEWATERMARK":"Disable Watermark"
"DISABLEWATERMARK":"Hide Watermark"
},
"RESET": "Reset Policy",
"CREATECUSTOM": "Create Custom Policy",

View File

@ -1,6 +1,3 @@
// Custom Theming for Angular Material
// For more information: https://material.angular.io/guide/theming
@use '~@angular/material' as mat;
@import './component-themes';
@ -332,12 +329,6 @@ $caos-light-app-theme: (
$custom-typography: mat.define-typography-config($font-family: 'Lato');
@include mat.core($custom-typography);
// textarea {
// font-family: 'Lato';
// }
// default theme
@include component-themes($caos-dark-app-theme);
@include mat.all-component-themes($caos-dark-app-theme);

View File

@ -840,10 +840,25 @@ func (repo *AuthRequestRepo) getLockoutPolicy(ctx context.Context, orgID string)
policy, err := repo.View.LockoutPolicyByAggregateID(orgID)
if errors.IsNotFound(err) {
policy, err = repo.View.LockoutPolicyByAggregateID(repo.IAMID)
if err != nil {
if err != nil && !errors.IsNotFound(err) {
return nil, err
}
if err == nil {
return policy.ToDomain(), nil
}
policy = &iam_view_model.LockoutPolicyView{}
events, err := repo.Eventstore.FilterEvents(ctx, es_models.NewSearchQuery().
AggregateIDFilter(repo.IAMID).
AggregateTypeFilter(iam.AggregateType).
EventTypesFilter(es_models.EventType(iam.LockoutPolicyAddedEventType), es_models.EventType(iam.LockoutPolicyChangedEventType)))
if err != nil || len(events) == 0 {
return nil, errors.ThrowNotFound(err, "EVENT-Gfgr2", "IAM.LockoutPolicy.NotExisting")
}
policy.Default = true
for _, event := range events {
policy.AppendEvent(event)
}
return policy.ToDomain(), nil
}
if err != nil {
return nil, err