mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-17 20:31:50 +01:00
Display version_name
in AboutComponent (#8931)
This commit is contained in:
parent
7f5efcc18c
commit
a7958c1a56
@ -238,10 +238,6 @@ export class BrowserApi {
|
|||||||
return typeof window !== "undefined" && window === BrowserApi.getBackgroundPage();
|
return typeof window !== "undefined" && window === BrowserApi.getBackgroundPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
static getApplicationVersion(): string {
|
|
||||||
return chrome.runtime.getManifest().version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the extension views that match the given properties. This method is not
|
* Gets the extension views that match the given properties. This method is not
|
||||||
* available within background service worker. As a result, it will return an
|
* available within background service worker. As a result, it will return an
|
||||||
|
@ -175,11 +175,13 @@ export abstract class BrowserPlatformUtilsService implements PlatformUtilsServic
|
|||||||
}
|
}
|
||||||
|
|
||||||
getApplicationVersion(): Promise<string> {
|
getApplicationVersion(): Promise<string> {
|
||||||
return Promise.resolve(BrowserApi.getApplicationVersion());
|
const manifest = chrome.runtime.getManifest();
|
||||||
|
return Promise.resolve(manifest.version_name ?? manifest.version);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getApplicationVersionNumber(): Promise<string> {
|
getApplicationVersionNumber(): Promise<string> {
|
||||||
return (await this.getApplicationVersion()).split(RegExp("[+|-]"))[0].trim();
|
const manifest = chrome.runtime.getManifest();
|
||||||
|
return Promise.resolve(manifest.version.split(RegExp("[+|-]"))[0].trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
supportsWebAuthn(win: Window): boolean {
|
supportsWebAuthn(win: Window): boolean {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<div bitDialogTitle>Bitwarden</div>
|
<div bitDialogTitle>Bitwarden</div>
|
||||||
<div bitDialogContent>
|
<div bitDialogContent>
|
||||||
<p>© Bitwarden Inc. 2015-{{ year }}</p>
|
<p>© Bitwarden Inc. 2015-{{ year }}</p>
|
||||||
<p>{{ "version" | i18n }}: {{ version }}</p>
|
<p>{{ "version" | i18n }}: {{ version$ | async }}</p>
|
||||||
<ng-container *ngIf="data$ | async as data">
|
<ng-container *ngIf="data$ | async as data">
|
||||||
<p *ngIf="data.isCloud">
|
<p *ngIf="data.isCloud">
|
||||||
{{ "serverVersion" | i18n }}: {{ data.serverConfig?.version }}
|
{{ "serverVersion" | i18n }}: {{ data.serverConfig?.version }}
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
import { CommonModule } from "@angular/common";
|
import { CommonModule } from "@angular/common";
|
||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
import { combineLatest, map } from "rxjs";
|
import { Observable, combineLatest, defer, map } from "rxjs";
|
||||||
|
|
||||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||||
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
||||||
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
import { ButtonModule, DialogModule } from "@bitwarden/components";
|
import { ButtonModule, DialogModule } from "@bitwarden/components";
|
||||||
|
|
||||||
import { BrowserApi } from "../../platform/browser/browser-api";
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: "about.component.html",
|
templateUrl: "about.component.html",
|
||||||
standalone: true,
|
standalone: true,
|
||||||
@ -16,7 +15,7 @@ import { BrowserApi } from "../../platform/browser/browser-api";
|
|||||||
})
|
})
|
||||||
export class AboutComponent {
|
export class AboutComponent {
|
||||||
protected year = new Date().getFullYear();
|
protected year = new Date().getFullYear();
|
||||||
protected version = BrowserApi.getApplicationVersion();
|
protected version$: Observable<string>;
|
||||||
|
|
||||||
protected data$ = combineLatest([
|
protected data$ = combineLatest([
|
||||||
this.configService.serverConfig$,
|
this.configService.serverConfig$,
|
||||||
@ -26,5 +25,8 @@ export class AboutComponent {
|
|||||||
constructor(
|
constructor(
|
||||||
private configService: ConfigService,
|
private configService: ConfigService,
|
||||||
private environmentService: EnvironmentService,
|
private environmentService: EnvironmentService,
|
||||||
) {}
|
private platformUtilsService: PlatformUtilsService,
|
||||||
|
) {
|
||||||
|
this.version$ = defer(() => this.platformUtilsService.getApplicationVersion());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user