diff --git a/console/src/app/app.component.ts b/console/src/app/app.component.ts index b1499b18ba..3eef1937e8 100644 --- a/console/src/app/app.component.ts +++ b/console/src/app/app.component.ts @@ -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( diff --git a/console/src/app/modules/footer/footer.component.ts b/console/src/app/modules/footer/footer.component.ts index e176f324f7..1fd88b70ff 100644 --- a/console/src/app/modules/footer/footer.component.ts +++ b/console/src/app/modules/footer/footer.component.ts @@ -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; } diff --git a/console/src/app/services/grpc-auth.service.ts b/console/src/app/services/grpc-auth.service.ts index 290e9fadd3..97af838410 100644 --- a/console/src/app/services/grpc-auth.service.ts +++ b/console/src/app/services/grpc-auth.service.ts @@ -5,82 +5,86 @@ import { BehaviorSubject, from, merge, Observable, of, Subject } from 'rxjs'; import { catchError, filter, finalize, map, mergeMap, switchMap, take, timeout } from 'rxjs/operators'; import { - AddMyAuthFactorOTPRequest, - AddMyAuthFactorOTPResponse, - AddMyAuthFactorU2FRequest, - AddMyAuthFactorU2FResponse, - AddMyPasswordlessLinkRequest, - AddMyPasswordlessLinkResponse, - AddMyPasswordlessRequest, - AddMyPasswordlessResponse, - GetMyEmailRequest, - GetMyEmailResponse, - GetMyPasswordComplexityPolicyRequest, - GetMyPasswordComplexityPolicyResponse, - GetMyPhoneRequest, - GetMyPhoneResponse, - GetMyProfileRequest, - GetMyProfileResponse, - GetMyUserRequest, - GetMyUserResponse, - GetSupportedLanguagesRequest, - GetSupportedLanguagesResponse, - ListMyAuthFactorsRequest, - ListMyAuthFactorsResponse, - ListMyLinkedIDPsRequest, - ListMyLinkedIDPsResponse, - ListMyMembershipsRequest, - ListMyMembershipsResponse, - ListMyPasswordlessRequest, - ListMyPasswordlessResponse, - ListMyProjectOrgsRequest, - ListMyProjectOrgsResponse, - ListMyUserChangesRequest, - ListMyUserChangesResponse, - ListMyUserGrantsRequest, - ListMyUserGrantsResponse, - ListMyUserSessionsRequest, - ListMyUserSessionsResponse, - ListMyZitadelPermissionsRequest, - ListMyZitadelPermissionsResponse, - RemoveMyAuthFactorOTPRequest, - RemoveMyAuthFactorOTPResponse, - RemoveMyAuthFactorU2FRequest, - RemoveMyAuthFactorU2FResponse, - RemoveMyAvatarRequest, - RemoveMyAvatarResponse, - RemoveMyLinkedIDPRequest, - RemoveMyLinkedIDPResponse, - RemoveMyPasswordlessRequest, - RemoveMyPasswordlessResponse, - RemoveMyPhoneRequest, - RemoveMyPhoneResponse, - RemoveMyUserRequest, - RemoveMyUserResponse, - ResendMyEmailVerificationRequest, - ResendMyEmailVerificationResponse, - ResendMyPhoneVerificationRequest, - ResendMyPhoneVerificationResponse, - SendMyPasswordlessLinkRequest, - SendMyPasswordlessLinkResponse, - SetMyEmailRequest, - SetMyEmailResponse, - SetMyPhoneRequest, - SetMyPhoneResponse, - UpdateMyPasswordRequest, - UpdateMyPasswordResponse, - UpdateMyProfileRequest, - UpdateMyProfileResponse, - UpdateMyUserNameRequest, - UpdateMyUserNameResponse, - VerifyMyAuthFactorOTPRequest, - VerifyMyAuthFactorOTPResponse, - VerifyMyAuthFactorU2FRequest, - VerifyMyAuthFactorU2FResponse, - VerifyMyPasswordlessRequest, - VerifyMyPasswordlessResponse, - VerifyMyPhoneRequest, - VerifyMyPhoneResponse, + AddMyAuthFactorOTPRequest, + AddMyAuthFactorOTPResponse, + AddMyAuthFactorU2FRequest, + AddMyAuthFactorU2FResponse, + AddMyPasswordlessLinkRequest, + AddMyPasswordlessLinkResponse, + AddMyPasswordlessRequest, + AddMyPasswordlessResponse, + GetMyEmailRequest, + GetMyEmailResponse, + GetMyLabelPolicyRequest, + GetMyLabelPolicyResponse, + GetMyPasswordComplexityPolicyRequest, + GetMyPasswordComplexityPolicyResponse, + GetMyPhoneRequest, + GetMyPhoneResponse, + GetMyPrivacyPolicyRequest, + GetMyPrivacyPolicyResponse, + GetMyProfileRequest, + GetMyProfileResponse, + GetMyUserRequest, + GetMyUserResponse, + GetSupportedLanguagesRequest, + GetSupportedLanguagesResponse, + ListMyAuthFactorsRequest, + ListMyAuthFactorsResponse, + ListMyLinkedIDPsRequest, + ListMyLinkedIDPsResponse, + ListMyMembershipsRequest, + ListMyMembershipsResponse, + ListMyPasswordlessRequest, + ListMyPasswordlessResponse, + ListMyProjectOrgsRequest, + ListMyProjectOrgsResponse, + ListMyUserChangesRequest, + ListMyUserChangesResponse, + ListMyUserGrantsRequest, + ListMyUserGrantsResponse, + ListMyUserSessionsRequest, + ListMyUserSessionsResponse, + ListMyZitadelPermissionsRequest, + ListMyZitadelPermissionsResponse, + RemoveMyAuthFactorOTPRequest, + RemoveMyAuthFactorOTPResponse, + RemoveMyAuthFactorU2FRequest, + RemoveMyAuthFactorU2FResponse, + RemoveMyAvatarRequest, + RemoveMyAvatarResponse, + RemoveMyLinkedIDPRequest, + RemoveMyLinkedIDPResponse, + RemoveMyPasswordlessRequest, + RemoveMyPasswordlessResponse, + RemoveMyPhoneRequest, + RemoveMyPhoneResponse, + RemoveMyUserRequest, + RemoveMyUserResponse, + ResendMyEmailVerificationRequest, + ResendMyEmailVerificationResponse, + ResendMyPhoneVerificationRequest, + ResendMyPhoneVerificationResponse, + SendMyPasswordlessLinkRequest, + SendMyPasswordlessLinkResponse, + SetMyEmailRequest, + SetMyEmailResponse, + SetMyPhoneRequest, + SetMyPhoneResponse, + UpdateMyPasswordRequest, + UpdateMyPasswordResponse, + UpdateMyProfileRequest, + UpdateMyProfileResponse, + UpdateMyUserNameRequest, + UpdateMyUserNameResponse, + VerifyMyAuthFactorOTPRequest, + VerifyMyAuthFactorOTPResponse, + VerifyMyAuthFactorU2FRequest, + VerifyMyAuthFactorU2FResponse, + VerifyMyPasswordlessRequest, + VerifyMyPasswordlessResponse, + VerifyMyPhoneRequest, + VerifyMyPhoneResponse, } from '../proto/generated/zitadel/auth_pb'; import { ChangeQuery } from '../proto/generated/zitadel/change_pb'; import { ListQuery } from '../proto/generated/zitadel/object_pb'; @@ -554,4 +558,12 @@ export class GrpcAuthService { req.setQuery(query); return this.grpcService.auth.listMyUserChanges(req, null).then((resp) => resp.toObject()); } + + public getMyLabelPolicy(): Promise { + return this.grpcService.auth.getMyLabelPolicy(new GetMyLabelPolicyRequest(), null).then((resp) => resp.toObject()); + } + + public getMyPrivacyPolicy(): Promise { + return this.grpcService.auth.getMyPrivacyPolicy(new GetMyPrivacyPolicyRequest(), null).then((resp) => resp.toObject()); + } } diff --git a/console/src/app/services/theme.service.ts b/console/src/app/services/theme.service.ts index 580c7baa22..b53370b1e1 100644 --- a/console/src/app/services/theme.service.ts +++ b/console/src/app/services/theme.service.ts @@ -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; diff --git a/internal/api/ui/login/static/resources/themes/scss/styles/footer/footer.scss b/internal/api/ui/login/static/resources/themes/scss/styles/footer/footer.scss index 04170b2cc7..674f6e08f4 100644 --- a/internal/api/ui/login/static/resources/themes/scss/styles/footer/footer.scss +++ b/internal/api/ui/login/static/resources/themes/scss/styles/footer/footer.scss @@ -3,44 +3,48 @@ $footer-height: 50px; $footer-padding: 0 1rem; footer { - width: 100%; - box-sizing: border-box; - background: #00000020; - min-height: $footer-height; + width: 100%; + box-sizing: border-box; + background: #00000020; + min-height: $footer-height; + display: flex; + align-items: center; + padding: $footer-padding; + + .fill-space { + flex: 1; + } + + a { + font-size: 12px; + margin-left: 1rem; + display: block; + } + + @media only screen and (min-width: 600px) { + position: fixed; + bottom: 0; + left: 0; + right: 0; + } + + .watermark { display: flex; - align-items: center; - padding: $footer-padding; - .fill-space { - flex: 1; + .powered { + font-size: 12px; + margin: auto 2px; + display: none; + + @media only screen and (min-width: 600px) { + display: inline-block; + } } - a { - font-size: 12px; - margin-left: 1rem; - display: block; + .lgn-logo-watermark { + height: 40px; + min-width: 125px; + margin: auto 2px; } - - @media only screen and (min-width: 600px) { - position: fixed; - bottom: 0; - left: 0; - right: 0; - } - - .watermark { - display: flex; - - .powered { - font-size: 12px; - margin: auto 2px; - } - - .lgn-logo-watermark { - height: 40px; - min-width: 125px; - margin: auto 2px; - } - } - -} \ No newline at end of file + } +} diff --git a/internal/api/ui/login/static/templates/main.html b/internal/api/ui/login/static/templates/main.html index 40ed8974fd..cec8e57778 100644 --- a/internal/api/ui/login/static/templates/main.html +++ b/internal/api/ui/login/static/templates/main.html @@ -35,7 +35,5 @@ - +{{template "footer" .}} {{end}}