fix(console, login): label policy and privacy policy from authservice, login - remove double footer element, mobile (#3795)

fix: cnsl auth policy, lgn footer mobile
This commit is contained in:
Max Peintner 2022-06-10 14:46:59 +02:00 committed by GitHub
parent 3500961fbb
commit d6cb36db31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 136 additions and 128 deletions

View File

@ -17,9 +17,6 @@ import { AuthenticationService } from './services/authentication.service';
import { GrpcAuthService } from './services/grpc-auth.service';
import { KeyboardShortcutsService } from './services/keyboard-shortcuts/keyboard-shortcuts.service';
import { ManagementService } from './services/mgmt.service';
import { NavigationService } from './services/navigation.service';
import { OverlayWorkflowService } from './services/overlay/overlay-workflow.service';
import { StorageService } from './services/storage.service';
import { ThemeService } from './services/theme.service';
import { UpdateService } from './services/update.service';
@ -70,9 +67,6 @@ export class AppComponent implements OnDestroy {
update: UpdateService,
keyboardShortcuts: KeyboardShortcutsService,
private activatedRoute: ActivatedRoute,
private workflowService: OverlayWorkflowService,
private storageService: StorageService,
private navigationService: NavigationService,
@Inject(DOCUMENT) private document: Document,
) {
console.log(

View File

@ -1,6 +1,6 @@
import { Component, Input } from '@angular/core';
import { LabelPolicy, PrivacyPolicy } from 'src/app/proto/generated/zitadel/policy_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
@Component({
selector: 'cnsl-footer',
@ -10,8 +10,8 @@ import { ManagementService } from 'src/app/services/mgmt.service';
export class FooterComponent {
public policy!: PrivacyPolicy.AsObject;
@Input() public privateLabelPolicy!: LabelPolicy.AsObject;
constructor(mgmtService: ManagementService) {
mgmtService.getPrivacyPolicy().then((policyResp) => {
constructor(authService: GrpcAuthService) {
authService.getMyPrivacyPolicy().then((policyResp) => {
if (policyResp.policy) {
this.policy = policyResp.policy;
}

View File

@ -15,10 +15,14 @@ import {
AddMyPasswordlessResponse,
GetMyEmailRequest,
GetMyEmailResponse,
GetMyLabelPolicyRequest,
GetMyLabelPolicyResponse,
GetMyPasswordComplexityPolicyRequest,
GetMyPasswordComplexityPolicyResponse,
GetMyPhoneRequest,
GetMyPhoneResponse,
GetMyPrivacyPolicyRequest,
GetMyPrivacyPolicyResponse,
GetMyProfileRequest,
GetMyProfileResponse,
GetMyUserRequest,
@ -554,4 +558,12 @@ export class GrpcAuthService {
req.setQuery(query);
return this.grpcService.auth.listMyUserChanges(req, null).then((resp) => resp.toObject());
}
public getMyLabelPolicy(): Promise<GetMyLabelPolicyResponse.AsObject> {
return this.grpcService.auth.getMyLabelPolicy(new GetMyLabelPolicyRequest(), null).then((resp) => resp.toObject());
}
public getMyPrivacyPolicy(): Promise<GetMyPrivacyPolicyResponse.AsObject> {
return this.grpcService.auth.getMyPrivacyPolicy(new GetMyPrivacyPolicyRequest(), null).then((resp) => resp.toObject());
}
}

View File

@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';
import { ManagementService } from './mgmt.service';
import { GrpcAuthService } from './grpc-auth.service';
declare const tinycolor: any;
@ -21,7 +21,7 @@ export class ThemeService {
private warnColorPalette: Color[] = [];
private backgroundColorPalette: Color[] = [];
constructor(private mgmtService: ManagementService) {
constructor(private authService: GrpcAuthService) {
const theme = localStorage.getItem('theme');
if (theme) {
if (theme === 'light-theme') {
@ -146,8 +146,8 @@ export class ThemeService {
const isDark = (color: string) => this.isDark(color);
const isLight = (color: string) => this.isLight(color);
this.mgmtService
.getLabelPolicy()
this.authService
.getMyLabelPolicy()
.then((lpresp) => {
const labelpolicy = lpresp.policy;

View File

@ -34,6 +34,11 @@ footer {
.powered {
font-size: 12px;
margin: auto 2px;
display: none;
@media only screen and (min-width: 600px) {
display: inline-block;
}
}
.lgn-logo-watermark {
@ -42,5 +47,4 @@ footer {
margin: auto 2px;
}
}
}

View File

@ -35,7 +35,5 @@
<script src="{{ resourceUrl "scripts/avatar.js" }}"></script>
<script src="{{ resourceUrl "scripts/touched.js" }}"></script>
</body>
<footer>
{{template "footer" .}}
</footer>
{{end}}