mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-21 16:18:28 +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:
parent
c39ffe1991
commit
d79ef473c6
@ -7,7 +7,7 @@
|
||||
"port": 8081
|
||||
},
|
||||
"flags": {
|
||||
"secretsManager": false,
|
||||
"secretsManager": true,
|
||||
"showPasswordless": true,
|
||||
"enableCipherKeyEncryption": false
|
||||
}
|
||||
|
@ -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">
|
||||
|
@ -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$,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user