mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00: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:
@@ -7,7 +7,7 @@
|
|||||||
"port": 8081
|
"port": 8081
|
||||||
},
|
},
|
||||||
"flags": {
|
"flags": {
|
||||||
"secretsManager": false,
|
"secretsManager": true,
|
||||||
"showPasswordless": true,
|
"showPasswordless": true,
|
||||||
"enableCipherKeyEncryption": false
|
"enableCipherKeyEncryption": false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</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>
|
<bit-menu-divider></bit-menu-divider>
|
||||||
|
|
||||||
<a bitMenuItem routerLink="/settings/account">
|
<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 { VaultTimeoutSettingsService } from "@bitwarden/common/abstractions/vault-timeout/vault-timeout-settings.service";
|
||||||
import { VaultTimeoutAction } from "@bitwarden/common/enums/vault-timeout-action.enum";
|
import { VaultTimeoutAction } from "@bitwarden/common/enums/vault-timeout-action.enum";
|
||||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
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 { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||||
import { AccountProfile } from "@bitwarden/common/platform/models/domain/account";
|
import { AccountProfile } from "@bitwarden/common/platform/models/domain/account";
|
||||||
|
|
||||||
@@ -26,10 +27,13 @@ export class HeaderComponent {
|
|||||||
protected routeData$: Observable<{ titleId: string }>;
|
protected routeData$: Observable<{ titleId: string }>;
|
||||||
protected account$: Observable<AccountProfile>;
|
protected account$: Observable<AccountProfile>;
|
||||||
protected canLock$: Observable<boolean>;
|
protected canLock$: Observable<boolean>;
|
||||||
|
protected selfHosted: boolean;
|
||||||
|
protected hostname = location.hostname;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private stateService: StateService,
|
private stateService: StateService,
|
||||||
|
private platformUtilsService: PlatformUtilsService,
|
||||||
private vaultTimeoutSettingsService: VaultTimeoutSettingsService,
|
private vaultTimeoutSettingsService: VaultTimeoutSettingsService,
|
||||||
private messagingService: MessagingService
|
private messagingService: MessagingService
|
||||||
) {
|
) {
|
||||||
@@ -41,6 +45,8 @@ export class HeaderComponent {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this.selfHosted = this.platformUtilsService.isSelfHost();
|
||||||
|
|
||||||
this.account$ = combineLatest([
|
this.account$ = combineLatest([
|
||||||
this.stateService.activeAccount$,
|
this.stateService.activeAccount$,
|
||||||
this.stateService.accounts$,
|
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 { VaultTimeoutSettingsService } from "@bitwarden/common/abstractions/vault-timeout/vault-timeout-settings.service";
|
||||||
import { VaultTimeoutAction } from "@bitwarden/common/enums/vault-timeout-action.enum";
|
import { VaultTimeoutAction } from "@bitwarden/common/enums/vault-timeout-action.enum";
|
||||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
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 { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||||
import {
|
import {
|
||||||
AvatarModule,
|
AvatarModule,
|
||||||
@@ -50,6 +51,12 @@ class MockVaultTimeoutService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class MockPlatformUtilsService {
|
||||||
|
isSelfHost() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "product-switcher",
|
selector: "product-switcher",
|
||||||
template: `<button bitIconButton="bwi-filter"></button>`,
|
template: `<button bitIconButton="bwi-filter"></button>`,
|
||||||
@@ -97,6 +104,7 @@ export default {
|
|||||||
declarations: [HeaderComponent, MockProductSwitcher, MockDynamicAvatar],
|
declarations: [HeaderComponent, MockProductSwitcher, MockDynamicAvatar],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: StateService, useClass: MockStateService },
|
{ provide: StateService, useClass: MockStateService },
|
||||||
|
{ provide: PlatformUtilsService, useClass: MockPlatformUtilsService },
|
||||||
{ provide: VaultTimeoutSettingsService, useClass: MockVaultTimeoutService },
|
{ provide: VaultTimeoutSettingsService, useClass: MockVaultTimeoutService },
|
||||||
{
|
{
|
||||||
provide: MessagingService,
|
provide: MessagingService,
|
||||||
|
|||||||
Reference in New Issue
Block a user