1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-22 11:45:59 +01:00

[SM-891] Set SM flag to true for self-hosted (#6088)

* Set SM flag to true for selfhosted

* [SM-890] Add Secrets Manager self-hosted indicator (#6163)

* Add SM self-hosted indicator
This commit is contained in:
Thomas Avery 2023-10-16 15:46:59 -05:00 committed by GitHub
parent c39ffe1991
commit d79ef473c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 1 deletions

View File

@ -7,7 +7,7 @@
"port": 8081
},
"flags": {
"secretsManager": false,
"secretsManager": true,
"showPasswordless": true,
"enableCipherKeyEncryption": false
}

View File

@ -51,6 +51,13 @@
</div>
</div>
<ng-container *ngIf="selfHosted">
<bit-menu-divider></bit-menu-divider>
<span class="tw-break-all tw-px-4 tw-py-1 tw-text-left tw-text-muted">
{{ hostname }}
</span>
</ng-container>
<bit-menu-divider></bit-menu-divider>
<a bitMenuItem routerLink="/settings/account">

View File

@ -5,6 +5,7 @@ import { combineLatest, map, Observable } from "rxjs";
import { VaultTimeoutSettingsService } from "@bitwarden/common/abstractions/vault-timeout/vault-timeout-settings.service";
import { VaultTimeoutAction } from "@bitwarden/common/enums/vault-timeout-action.enum";
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
import { AccountProfile } from "@bitwarden/common/platform/models/domain/account";
@ -26,10 +27,13 @@ export class HeaderComponent {
protected routeData$: Observable<{ titleId: string }>;
protected account$: Observable<AccountProfile>;
protected canLock$: Observable<boolean>;
protected selfHosted: boolean;
protected hostname = location.hostname;
constructor(
private route: ActivatedRoute,
private stateService: StateService,
private platformUtilsService: PlatformUtilsService,
private vaultTimeoutSettingsService: VaultTimeoutSettingsService,
private messagingService: MessagingService
) {
@ -41,6 +45,8 @@ export class HeaderComponent {
})
);
this.selfHosted = this.platformUtilsService.isSelfHost();
this.account$ = combineLatest([
this.stateService.activeAccount$,
this.stateService.accounts$,

View File

@ -13,6 +13,7 @@ import { JslibModule } from "@bitwarden/angular/jslib.module";
import { VaultTimeoutSettingsService } from "@bitwarden/common/abstractions/vault-timeout/vault-timeout-settings.service";
import { VaultTimeoutAction } from "@bitwarden/common/enums/vault-timeout-action.enum";
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
import {
AvatarModule,
@ -50,6 +51,12 @@ class MockVaultTimeoutService {
}
}
class MockPlatformUtilsService {
isSelfHost() {
return false;
}
}
@Component({
selector: "product-switcher",
template: `<button bitIconButton="bwi-filter"></button>`,
@ -97,6 +104,7 @@ export default {
declarations: [HeaderComponent, MockProductSwitcher, MockDynamicAvatar],
providers: [
{ provide: StateService, useClass: MockStateService },
{ provide: PlatformUtilsService, useClass: MockPlatformUtilsService },
{ provide: VaultTimeoutSettingsService, useClass: MockVaultTimeoutService },
{
provide: MessagingService,