fix(console): preserve logo and icon aspect ratios, remove border radius in header (#4585)

This commit is contained in:
Max Peintner
2022-10-22 11:59:38 +02:00
committed by GitHub
parent 5809dec342
commit afa1e2b7c1
12 changed files with 112 additions and 66 deletions
@@ -238,17 +238,38 @@ export class PrivateLabelingPolicyComponent implements OnInit, OnDestroy {
}
break;
case PolicyComponentServiceType.MGMT:
if (type === AssetType.LOGO) {
if (theme === Theme.DARK) {
return previewHandler(this.service.removeLabelPolicyLogoDark());
} else if (theme === Theme.LIGHT) {
return previewHandler(this.service.removeLabelPolicyLogo());
}
} else if (type === AssetType.ICON) {
if (theme === Theme.DARK) {
return previewHandler(this.service.removeLabelPolicyIconDark());
} else if (theme === Theme.LIGHT) {
return previewHandler(this.service.removeLabelPolicyIcon());
if ((this.previewData as LabelPolicy.AsObject).isDefault) {
const req0 = new AddCustomLabelPolicyRequest();
this.overwriteValues(req0);
return (this.service as ManagementService)
.addCustomLabelPolicy(req0)
.then(() => {
if (this.previewData) {
this.previewData.isDefault = false;
}
this.toast.showInfo('POLICY.TOAST.SET', true);
setTimeout(() => {
this.fetchData();
}, 1000);
})
.catch((error: HttpErrorResponse) => {
this.toast.showError(error);
});
} else {
if (type === AssetType.LOGO) {
if (theme === Theme.DARK) {
return previewHandler(this.service.removeLabelPolicyLogoDark());
} else if (theme === Theme.LIGHT) {
return previewHandler(this.service.removeLabelPolicyLogo());
}
} else if (type === AssetType.ICON) {
if (theme === Theme.DARK) {
return previewHandler(this.service.removeLabelPolicyIconDark());
} else if (theme === Theme.LIGHT) {
return previewHandler(this.service.removeLabelPolicyIcon());
}
}
}
break;