mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 03:47:33 +00:00
fix: label policy fixes (#1886)
* fix: check correct permission for label policy in console policy grid * fix: add next steps for label policy detail * fix: add label policy link in console home * fix: i18n of EN features * fix: set font color on preview * fix: handle label policy remove in write model * fix: add more content-types for font upload * fix: add label policy link in console home * fix: dont return error when bucket does not exists * fix: iam access pref * fix: EN i18n for apply button
This commit is contained in:
@@ -6,11 +6,11 @@
|
|||||||
|
|
||||||
<img *ngIf="images['previewDarkLogo'] && theme == Theme.DARK" [src]="images['previewDarkLogo']" alt="logo-mock" />
|
<img *ngIf="images['previewDarkLogo'] && theme == Theme.DARK" [src]="images['previewDarkLogo']" alt="logo-mock" />
|
||||||
|
|
||||||
<h1>{{'POLICY.PRIVATELABELING.PREVIEW.TITLE' | translate}}</h1>
|
<h1 [style.color]="theme == Theme.DARK ? policy.fontColorDark : policy.fontColor">{{'POLICY.PRIVATELABELING.PREVIEW.TITLE' | translate}}</h1>
|
||||||
<p class="desc-text">{{'POLICY.PRIVATELABELING.PREVIEW.SECOND' | translate}}</p>
|
<p [style.color]="theme == Theme.DARK ? policy.fontColorDark : policy.fontColor" class="desc-text">{{'POLICY.PRIVATELABELING.PREVIEW.SECOND' | translate}}</p>
|
||||||
<cnsl-form-field class="formfield">
|
<cnsl-form-field class="formfield">
|
||||||
<cnsl-label>Loginname</cnsl-label>
|
<cnsl-label>Loginname</cnsl-label>
|
||||||
<input cnslInput value="road.runner"/>
|
<input cnslInput [style.color]="theme == Theme.DARK ? policy.fontColorDark : policy.fontColor" value="road.runner"/>
|
||||||
</cnsl-form-field>
|
</cnsl-form-field>
|
||||||
|
|
||||||
<div class="error-msg" [style.color]="theme == Theme.DARK ? policy.warnColorDark : policy.warnColor">
|
<div class="error-msg" [style.color]="theme == Theme.DARK ? policy.warnColorDark : policy.warnColor">
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-wrapper">
|
<div class="btn-wrapper">
|
||||||
<button mat-stroked-button>{{'POLICY.PRIVATELABELING.PREVIEW.SECONDARYBUTTON' | translate}}</button>
|
<button mat-stroked-button [style.color]="theme == Theme.DARK ? policy.fontColorDark : policy.fontColor">{{'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.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>
|
<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>
|
</div>
|
||||||
|
@@ -25,7 +25,14 @@ import { StorageService } from 'src/app/services/storage.service';
|
|||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
|
||||||
import { CnslLinks } from '../../links/links.component';
|
import { CnslLinks } from '../../links/links.component';
|
||||||
import { IAM_COMPLEXITY_LINK, IAM_LOGIN_POLICY_LINK, IAM_POLICY_LINK } from '../../policy-grid/policy-links';
|
import {
|
||||||
|
IAM_COMPLEXITY_LINK,
|
||||||
|
IAM_LOGIN_POLICY_LINK,
|
||||||
|
IAM_POLICY_LINK,
|
||||||
|
ORG_COMPLEXITY_LINK,
|
||||||
|
ORG_IAM_POLICY_LINK,
|
||||||
|
ORG_LOGIN_POLICY_LINK,
|
||||||
|
} from '../../policy-grid/policy-links';
|
||||||
import { PolicyComponentServiceType } from '../policy-component-types.enum';
|
import { PolicyComponentServiceType } from '../policy-component-types.enum';
|
||||||
|
|
||||||
export enum Theme {
|
export enum Theme {
|
||||||
@@ -114,9 +121,19 @@ export class PrivateLabelingPolicyComponent implements OnDestroy {
|
|||||||
switch (this.serviceType) {
|
switch (this.serviceType) {
|
||||||
case PolicyComponentServiceType.MGMT:
|
case PolicyComponentServiceType.MGMT:
|
||||||
this.service = this.injector.get(ManagementService as Type<ManagementService>);
|
this.service = this.injector.get(ManagementService as Type<ManagementService>);
|
||||||
|
this.nextLinks = [
|
||||||
|
ORG_IAM_POLICY_LINK,
|
||||||
|
ORG_LOGIN_POLICY_LINK,
|
||||||
|
ORG_COMPLEXITY_LINK,
|
||||||
|
];
|
||||||
break;
|
break;
|
||||||
case PolicyComponentServiceType.ADMIN:
|
case PolicyComponentServiceType.ADMIN:
|
||||||
this.service = this.injector.get(AdminService as Type<AdminService>);
|
this.service = this.injector.get(AdminService as Type<AdminService>);
|
||||||
|
this.nextLinks = [
|
||||||
|
IAM_POLICY_LINK,
|
||||||
|
IAM_LOGIN_POLICY_LINK,
|
||||||
|
IAM_COMPLEXITY_LINK,
|
||||||
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -56,18 +56,11 @@
|
|||||||
|
|
||||||
<p class="desc">
|
<p class="desc">
|
||||||
{{'POLICY.IAM_POLICY.DESCRIPTION' | translate}}</p>
|
{{'POLICY.IAM_POLICY.DESCRIPTION' | translate}}</p>
|
||||||
<cnsl-info-section class="warn"
|
|
||||||
*ngIf="type == PolicyGridType.ORG && (['password_complexity_policy'] | hasFeature | async) == false"
|
|
||||||
type="WARN">
|
|
||||||
{{'FEATURES.NOTAVAILABLE' | translate: ({value:
|
|
||||||
'password_complexity_policy'})}}
|
|
||||||
</cnsl-info-section>
|
|
||||||
|
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
<div class="btn-wrapper">
|
<div class="btn-wrapper">
|
||||||
<ng-template appHasRole [appHasRole]="['iam.policy.write']">
|
<ng-template appHasRole [appHasRole]="['iam.policy.write']">
|
||||||
<button
|
<button
|
||||||
[disabled]="type == PolicyGridType.ORG && (['password_complexity_policy'] | hasFeature | async) == false"
|
|
||||||
[routerLink]="[type == PolicyGridType.IAM ? '/iam' : type == PolicyGridType.ORG ? '/org' : '','policy', PolicyComponentType.IAM ]"
|
[routerLink]="[type == PolicyGridType.IAM ? '/iam' : type == PolicyGridType.ORG ? '/org' : '','policy', PolicyComponentType.IAM ]"
|
||||||
mat-stroked-button>{{'POLICY.BTN_EDIT' | translate}}</button>
|
mat-stroked-button>{{'POLICY.BTN_EDIT' | translate}}</button>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
@@ -75,7 +68,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<ng-template appHasRole [appHasRole]="['iam.policy.read']">
|
<ng-template appHasRole [appHasRole]="type == PolicyGridType.IAM ? ['iam.policy.read'] : type == PolicyGridType.ORG ? ['policy.read'] : []">
|
||||||
<div class="p-item card">
|
<div class="p-item card">
|
||||||
<div class="avatar">
|
<div class="avatar">
|
||||||
<i class="icon las la-gem"></i>
|
<i class="icon las la-gem"></i>
|
||||||
@@ -98,7 +91,7 @@
|
|||||||
|
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
<div class="btn-wrapper">
|
<div class="btn-wrapper">
|
||||||
<ng-template appHasRole [appHasRole]="['iam.policy.write']">
|
<ng-template appHasRole [appHasRole]="type == PolicyGridType.IAM ? ['iam.policy.write'] : type == PolicyGridType.ORG ? ['policy.write'] : []">
|
||||||
<button
|
<button
|
||||||
[routerLink]="[type == PolicyGridType.IAM ? '/iam' : type == PolicyGridType.ORG ? '/org' : '','policy', PolicyComponentType.PRIVATELABEL ]"
|
[routerLink]="[type == PolicyGridType.IAM ? '/iam' : type == PolicyGridType.ORG ? '/org' : '','policy', PolicyComponentType.PRIVATELABEL ]"
|
||||||
mat-stroked-button>{{'POLICY.BTN_EDIT' | translate}}</button>
|
mat-stroked-button>{{'POLICY.BTN_EDIT' | translate}}</button>
|
||||||
|
@@ -72,6 +72,8 @@
|
|||||||
| translate}}<i class="las la-link"></i></a>
|
| translate}}<i class="las la-link"></i></a>
|
||||||
<a class="short-link" [routerLink]="[ '/iam', 'policy','login']">{{'HOME.IAM_POLICY_LOGIN' |
|
<a class="short-link" [routerLink]="[ '/iam', 'policy','login']">{{'HOME.IAM_POLICY_LOGIN' |
|
||||||
translate}}<i class="las la-link"></i></a>
|
translate}}<i class="las la-link"></i></a>
|
||||||
|
<a class="short-link" [routerLink]="[ '/iam', 'policy','privatelabel']">{{'HOME.IAM_POLICY_LABEL' |
|
||||||
|
translate}}<i class="las la-link"></i></a>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
@@ -134,6 +136,8 @@
|
|||||||
translate}}<i class="las la-link"></i></a>
|
translate}}<i class="las la-link"></i></a>
|
||||||
<a class="short-link" [routerLink]="[ '/org', 'policy','login']">{{'HOME.ORG_POLICY_LOGIN' |
|
<a class="short-link" [routerLink]="[ '/org', 'policy','login']">{{'HOME.ORG_POLICY_LOGIN' |
|
||||||
translate}}<i class="las la-link"></i></a>
|
translate}}<i class="las la-link"></i></a>
|
||||||
|
<a class="short-link" [routerLink]="[ '/org', 'policy','privatelabel']">{{'HOME.ORG_POLICY_LABEL' |
|
||||||
|
translate}}<i class="las la-link"></i></a>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</div>
|
</div>
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
|
@@ -46,9 +46,11 @@
|
|||||||
"ORG_POLICY_COMPLEXITY": "Passwort Komplexität",
|
"ORG_POLICY_COMPLEXITY": "Passwort Komplexität",
|
||||||
"ORG_POLICY_IAM": "Organisation Zugangseinstellungen",
|
"ORG_POLICY_IAM": "Organisation Zugangseinstellungen",
|
||||||
"ORG_POLICY_LOGIN": "Login Richtlinie",
|
"ORG_POLICY_LOGIN": "Login Richtlinie",
|
||||||
|
"ORG_POLICY_LABEL": "Private Label Richtlinie",
|
||||||
"IAM_POLICY_COMPLEXITY": "Systemweite Passwort Komplexität",
|
"IAM_POLICY_COMPLEXITY": "Systemweite Passwort Komplexität",
|
||||||
"IAM_POLICY_IAM": "Systemweite Zugangseinstellungen",
|
"IAM_POLICY_IAM": "Systemweite Zugangseinstellungen",
|
||||||
"IAN_POLICY_LOGIN": "Systemweite Login Richtlinie",
|
"IAN_POLICY_LOGIN": "Systemweite Login Richtlinie",
|
||||||
|
"IAN_POLICY_LABEL": "Systemweite Private Label Richtlinie",
|
||||||
"USERS": "Erstelle und verwalte Deine Benutzer.",
|
"USERS": "Erstelle und verwalte Deine Benutzer.",
|
||||||
"USERS_DESC": "Überwache Dein Rollenkonzept in Echtzeit. Ergreife sofort Massnahmen.",
|
"USERS_DESC": "Überwache Dein Rollenkonzept in Echtzeit. Ergreife sofort Massnahmen.",
|
||||||
"USERS_HUMANS": "Zeige Benutzer",
|
"USERS_HUMANS": "Zeige Benutzer",
|
||||||
|
@@ -45,10 +45,12 @@
|
|||||||
"ORG_POLICY_COMPLEXITY": "Password Complexity Settings",
|
"ORG_POLICY_COMPLEXITY": "Password Complexity Settings",
|
||||||
"ORG_POLICY_IAM": "Organisation Access Properties",
|
"ORG_POLICY_IAM": "Organisation Access Properties",
|
||||||
"ORG_POLICY_LOGIN": "Login Policy",
|
"ORG_POLICY_LOGIN": "Login Policy",
|
||||||
|
"ORG_POLICY_LABEL": "Private Label Policy",
|
||||||
"IAM_CREATE_ORG": "Create organisation",
|
"IAM_CREATE_ORG": "Create organisation",
|
||||||
"IAM_POLICY_COMPLEXITY": "System Password Complexity Settings",
|
"IAM_POLICY_COMPLEXITY": "System Password Complexity Settings",
|
||||||
"IAM_POLICY_IAM": "System Access Properties",
|
"IAM_POLICY_IAM": "System Access Properties",
|
||||||
"IAM_POLICY_LOGIN": "System Login Policy",
|
"IAM_POLICY_LOGIN": "System Login Policy",
|
||||||
|
"IAM_POLICY_LABEL": "System Private Label Policy",
|
||||||
"USERS": "Create and Manage Your Users",
|
"USERS": "Create and Manage Your Users",
|
||||||
"USERS_DESC": "Monitor your role concept in real time. Take immediate action.",
|
"USERS_DESC": "Monitor your role concept in real time. Take immediate action.",
|
||||||
"USERS_HUMANS": "Show human users",
|
"USERS_HUMANS": "Show human users",
|
||||||
@@ -623,8 +625,8 @@
|
|||||||
"LOGINPOLICYFACTORS": "Login Policy: Multifactors - custom",
|
"LOGINPOLICYFACTORS": "Login Policy: Multifactors - custom",
|
||||||
"LOGINPOLICYPASSWORDLESS": "Login Policy: Passwordless Authentication - custom",
|
"LOGINPOLICYPASSWORDLESS": "Login Policy: Passwordless Authentication - custom",
|
||||||
"LOGINPOLICYCOMPLEXITYPOLICY": "Password Complexity Policy - custom",
|
"LOGINPOLICYCOMPLEXITYPOLICY": "Password Complexity Policy - custom",
|
||||||
"LABELPOLICYPRIVATELABEL": "Label Richtlinie - benutzerdefiniert",
|
"LABELPOLICYPRIVATELABEL": "Label Policy - custom",
|
||||||
"LABELPOLICYWATERMARK": "Label Richtlinie - Wasserzeichen",
|
"LABELPOLICYWATERMARK": "Label Policy - watermark",
|
||||||
"CUSTOMDOMAIN": "Domain Verification - available",
|
"CUSTOMDOMAIN": "Domain Verification - available",
|
||||||
"CUSTOMTEXT": "Custom texts"
|
"CUSTOMTEXT": "Custom texts"
|
||||||
},
|
},
|
||||||
@@ -653,7 +655,7 @@
|
|||||||
"DESCRIPTION":"Give the login your personalized style and modify its behavior.",
|
"DESCRIPTION":"Give the login your personalized style and modify its behavior.",
|
||||||
"PREVIEW_DESCRIPTION":"Changes of the policy will automatically deployed to preview environment.",
|
"PREVIEW_DESCRIPTION":"Changes of the policy will automatically deployed to preview environment.",
|
||||||
"BTN":"Select File",
|
"BTN":"Select File",
|
||||||
"ACTIVATEPREVIEW":"Set preview as current configuration",
|
"ACTIVATEPREVIEW":"Apply configuration",
|
||||||
"DARK":"Dark Mode",
|
"DARK":"Dark Mode",
|
||||||
"LIGHT":"Lighg Mode",
|
"LIGHT":"Lighg Mode",
|
||||||
"CHANGEVIEW":"Change View",
|
"CHANGEVIEW":"Change View",
|
||||||
|
@@ -268,11 +268,11 @@ func (l *labelPolicyIconDownloader) BucketName(ctx context.Context, id string) s
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *Handler) UploadDefaultLabelPolicyFont() Uploader {
|
func (h *Handler) UploadDefaultLabelPolicyFont() Uploader {
|
||||||
return &labelPolicyFontUploader{h.idGenerator, true, []string{"font/"}, 1 << 19}
|
return &labelPolicyFontUploader{h.idGenerator, true, []string{"font/", "application/octet-stream"}, 1 << 19}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Handler) UploadOrgLabelPolicyFont() Uploader {
|
func (h *Handler) UploadOrgLabelPolicyFont() Uploader {
|
||||||
return &labelPolicyFontUploader{h.idGenerator, false, []string{"font/"}, 1 << 19}
|
return &labelPolicyFontUploader{h.idGenerator, false, []string{"font/", "application/octet-stream"}, 1 << 19}
|
||||||
}
|
}
|
||||||
|
|
||||||
type labelPolicyFontUploader struct {
|
type labelPolicyFontUploader struct {
|
||||||
|
@@ -30,6 +30,8 @@ func (wm *OrgLabelPolicyWriteModel) AppendEvents(events ...eventstore.EventReade
|
|||||||
wm.LabelPolicyWriteModel.AppendEvents(&e.LabelPolicyAddedEvent)
|
wm.LabelPolicyWriteModel.AppendEvents(&e.LabelPolicyAddedEvent)
|
||||||
case *org.LabelPolicyChangedEvent:
|
case *org.LabelPolicyChangedEvent:
|
||||||
wm.LabelPolicyWriteModel.AppendEvents(&e.LabelPolicyChangedEvent)
|
wm.LabelPolicyWriteModel.AppendEvents(&e.LabelPolicyChangedEvent)
|
||||||
|
case *org.LabelPolicyRemovedEvent:
|
||||||
|
wm.LabelPolicyWriteModel.AppendEvents(&e.LabelPolicyRemovedEvent)
|
||||||
case *org.LabelPolicyLogoAddedEvent:
|
case *org.LabelPolicyLogoAddedEvent:
|
||||||
wm.LabelPolicyWriteModel.AppendEvents(&e.LabelPolicyLogoAddedEvent)
|
wm.LabelPolicyWriteModel.AppendEvents(&e.LabelPolicyLogoAddedEvent)
|
||||||
case *org.LabelPolicyLogoRemovedEvent:
|
case *org.LabelPolicyLogoRemovedEvent:
|
||||||
@@ -65,6 +67,7 @@ func (wm *OrgLabelPolicyWriteModel) Query() *eventstore.SearchQueryBuilder {
|
|||||||
EventTypes(
|
EventTypes(
|
||||||
org.LabelPolicyAddedEventType,
|
org.LabelPolicyAddedEventType,
|
||||||
org.LabelPolicyChangedEventType,
|
org.LabelPolicyChangedEventType,
|
||||||
|
org.LabelPolicyRemovedEventType,
|
||||||
org.LabelPolicyLogoAddedEventType,
|
org.LabelPolicyLogoAddedEventType,
|
||||||
org.LabelPolicyLogoRemovedEventType,
|
org.LabelPolicyLogoRemovedEventType,
|
||||||
org.LabelPolicyIconAddedEventType,
|
org.LabelPolicyIconAddedEventType,
|
||||||
|
@@ -162,8 +162,12 @@ func (m *Minio) RemoveObjects(ctx context.Context, bucketName, path string, recu
|
|||||||
defer close(objectsCh)
|
defer close(objectsCh)
|
||||||
objects, cancel := m.listObjects(ctx, bucketName, path, recursive)
|
objects, cancel := m.listObjects(ctx, bucketName, path, recursive)
|
||||||
for object := range objects {
|
for object := range objects {
|
||||||
if object.Err != nil {
|
if err := object.Err; err != nil {
|
||||||
cancel()
|
cancel()
|
||||||
|
if errResp := minio.ToErrorResponse(err); errResp.StatusCode == http.StatusNotFound {
|
||||||
|
logging.LogWithFields("MINIO-ss8va", "bucketName", bucketName, "path", path).Warn("list objects for remove failed with not found")
|
||||||
|
continue
|
||||||
|
}
|
||||||
return caos_errs.ThrowInternal(object.Err, "MINIO-WQF32", "Errors.Assets.Object.ListFailed")
|
return caos_errs.ThrowInternal(object.Err, "MINIO-WQF32", "Errors.Assets.Object.ListFailed")
|
||||||
}
|
}
|
||||||
objectsCh <- object
|
objectsCh <- object
|
||||||
|
Reference in New Issue
Block a user