mirror of
https://github.com/bitwarden/web
synced 2025-12-11 05:43:16 +00:00
Compare commits
1 Commits
license-do
...
feature/co
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e96e3cefd1 |
@@ -3,10 +3,6 @@ const { AngularWebpackPlugin } = require("@ngtools/webpack");
|
|||||||
const webpackConfig = require("../webpack.config");
|
const webpackConfig = require("../webpack.config");
|
||||||
|
|
||||||
webpackConfig.entry["app/main"] = "./bitwarden_license/src/app/main.ts";
|
webpackConfig.entry["app/main"] = "./bitwarden_license/src/app/main.ts";
|
||||||
webpackConfig.plugins[webpackConfig.plugins.length - 1] = new AngularWebpackPlugin({
|
webpackConfig.plugins[webpackConfig.plugins.length - 1].entryModule = "bitwarden_license/src/app/app.module#AppModule";
|
||||||
tsConfigPath: "tsconfig.json",
|
|
||||||
entryModule: "bitwarden_license/src/app/app.module#AppModule",
|
|
||||||
sourceMap: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = webpackConfig;
|
module.exports = webpackConfig;
|
||||||
|
|||||||
17
config.js
17
config.js
@@ -30,7 +30,24 @@ function loadConfig(configName) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function generateSubstitutions(configObj) {
|
||||||
|
let result = {};
|
||||||
|
|
||||||
|
Object.keys(configObj.compileFlags ?? {}).forEach(key => {
|
||||||
|
result = { ...result, ...generateSubstitutionsForFlag(key) };
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateSubstitutionsForFlag(flagName) {
|
||||||
|
return {
|
||||||
|
"featureFlag: (.*)[\\s\\S]*?\\/\\/ endFeatureFlag": ""
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
load,
|
load,
|
||||||
log,
|
log,
|
||||||
|
generateSubstitutions,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,5 +7,8 @@
|
|||||||
"proxyIdentity": "http://localhost:33656",
|
"proxyIdentity": "http://localhost:33656",
|
||||||
"proxyEvents": "http://localhost:46273",
|
"proxyEvents": "http://localhost:46273",
|
||||||
"proxyNotifications": "http://localhost:61840"
|
"proxyNotifications": "http://localhost:61840"
|
||||||
|
},
|
||||||
|
"compileFlags": {
|
||||||
|
"Test": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
0
config/empty.ts
Normal file
0
config/empty.ts
Normal file
2
jslib
2
jslib
Submodule jslib updated: 54c6a4b3c3...e4cd0af2f9
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "@bitwarden/web-vault",
|
"name": "bitwarden-web",
|
||||||
"version": "2.25.1",
|
"version": "2.25.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@bitwarden/web-vault",
|
"name": "bitwarden-web",
|
||||||
"version": "2.25.1",
|
"version": "2.25.1",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "@bitwarden/web-vault",
|
"name": "bitwarden-web",
|
||||||
"version": "2.25.1",
|
"version": "2.25.1",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"repository": "https://github.com/bitwarden/web",
|
"repository": "https://github.com/bitwarden/web",
|
||||||
|
|||||||
@@ -12,8 +12,6 @@ import { OrganizationService } from "jslib-common/abstractions/organization.serv
|
|||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
|
|
||||||
import { PlanType } from "jslib-common/enums/planType";
|
import { PlanType } from "jslib-common/enums/planType";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
|
||||||
import { ProductType } from "jslib-common/enums/productType";
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-org-subscription",
|
selector: "app-org-subscription",
|
||||||
@@ -29,7 +27,6 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
|||||||
adjustStorageAdd = true;
|
adjustStorageAdd = true;
|
||||||
showAdjustStorage = false;
|
showAdjustStorage = false;
|
||||||
showUpdateLicense = false;
|
showUpdateLicense = false;
|
||||||
canDownloadLicense = false;
|
|
||||||
showDownloadLicense = false;
|
showDownloadLicense = false;
|
||||||
showChangePlan = false;
|
showChangePlan = false;
|
||||||
sub: OrganizationSubscriptionResponse;
|
sub: OrganizationSubscriptionResponse;
|
||||||
@@ -45,7 +42,6 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
|||||||
private apiService: ApiService,
|
private apiService: ApiService,
|
||||||
private platformUtilsService: PlatformUtilsService,
|
private platformUtilsService: PlatformUtilsService,
|
||||||
private i18nService: I18nService,
|
private i18nService: I18nService,
|
||||||
private stateService: StateService,
|
|
||||||
private messagingService: MessagingService,
|
private messagingService: MessagingService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private organizationService: OrganizationService,
|
private organizationService: OrganizationService,
|
||||||
@@ -70,13 +66,6 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.userOrg = await this.organizationService.get(this.organizationId);
|
this.userOrg = await this.organizationService.get(this.organizationId);
|
||||||
this.sub = await this.apiService.getOrganizationSubscription(this.organizationId);
|
this.sub = await this.apiService.getOrganizationSubscription(this.organizationId);
|
||||||
|
|
||||||
const orgs = await this.stateService.getOrganizations();
|
|
||||||
const isAllowedOrgType = Object.values(orgs).some(org => org.planProductType === (ProductType.Enterprise | ProductType.Families));
|
|
||||||
const canDownload = (this.sub.planType !== PlanType.Free && this.subscription == null) ||
|
|
||||||
(this.subscription != null && !this.subscription.cancelled);
|
|
||||||
this.canDownloadLicense = canDownload && isAllowedOrgType;
|
|
||||||
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,22 +204,14 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get subscriptionMarkedForCancel() {
|
get subscriptionMarkedForCancel() {
|
||||||
return (
|
return (
|
||||||
this.subscription != null && !this.subscription.cancelled && this.subscription.cancelAtEndDate
|
this.subscription != null && !this.subscription.cancelled && this.subscription.cancelAtEndDate
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get subscription() {
|
get subscription() {
|
||||||
const now = new Date();
|
return this.sub != null ? this.sub.subscription : null;
|
||||||
const fiveDays = now.setDate(now.getDate() + 5);
|
|
||||||
if(this.sub === null) return null;
|
|
||||||
if(this.sub.subscription == null) {
|
|
||||||
this.sub.subscription = ({ cancelled: true, cancelAtEndDate: (fiveDays as any)} as any);
|
|
||||||
this.sub.subscription.items = new Array({sponsoredSubscriptionItem: false} as any);
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.sub.subscription;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get nextInvoice() {
|
get nextInvoice() {
|
||||||
@@ -276,6 +257,13 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
|||||||
return this.sub.subscription?.items.some((i) => i.sponsoredSubscriptionItem);
|
return this.sub.subscription?.items.some((i) => i.sponsoredSubscriptionItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get canDownloadLicense() {
|
||||||
|
return (
|
||||||
|
(this.sub.planType !== PlanType.Free && this.subscription == null) ||
|
||||||
|
(this.subscription != null && !this.subscription.cancelled)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
get subscriptionDesc() {
|
get subscriptionDesc() {
|
||||||
if (this.sub.planType === PlanType.Free) {
|
if (this.sub.planType === PlanType.Free) {
|
||||||
return this.i18nService.t("subscriptionFreePlan", this.sub.seats.toString());
|
return this.i18nService.t("subscriptionFreePlan", this.sub.seats.toString());
|
||||||
|
|||||||
@@ -52,10 +52,6 @@ import { VaultTimeoutService as VaultTimeoutServiceAbstraction } from "jslib-com
|
|||||||
|
|
||||||
import { ThemeType } from "jslib-common/enums/themeType";
|
import { ThemeType } from "jslib-common/enums/themeType";
|
||||||
|
|
||||||
import { AccountFactory } from "jslib-common/models/domain/account";
|
|
||||||
|
|
||||||
import { Account } from "../../models/account";
|
|
||||||
|
|
||||||
export function initFactory(
|
export function initFactory(
|
||||||
window: Window,
|
window: Window,
|
||||||
storageService: StorageServiceAbstraction,
|
storageService: StorageServiceAbstraction,
|
||||||
@@ -182,19 +178,7 @@ export function initFactory(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
provide: StateServiceAbstraction,
|
provide: StateServiceAbstraction,
|
||||||
useFactory: (
|
useClass: StateService,
|
||||||
storageService: StorageServiceAbstraction,
|
|
||||||
secureStorageService: StorageServiceAbstraction,
|
|
||||||
logService: LogService,
|
|
||||||
stateMigrationService: StateMigrationServiceAbstraction
|
|
||||||
) =>
|
|
||||||
new StateService(
|
|
||||||
storageService,
|
|
||||||
secureStorageService,
|
|
||||||
logService,
|
|
||||||
stateMigrationService,
|
|
||||||
new AccountFactory(Account)
|
|
||||||
),
|
|
||||||
deps: [
|
deps: [
|
||||||
StorageServiceAbstraction,
|
StorageServiceAbstraction,
|
||||||
"SECURE_STORAGE",
|
"SECURE_STORAGE",
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ import { SyncService } from "jslib-common/abstractions/sync.service";
|
|||||||
import { TokenService } from "jslib-common/abstractions/token.service";
|
import { TokenService } from "jslib-common/abstractions/token.service";
|
||||||
|
|
||||||
import { ModalService } from "jslib-angular/services/modal.service";
|
import { ModalService } from "jslib-angular/services/modal.service";
|
||||||
|
// featureFlag: Test
|
||||||
|
import { TestService } from 'jslib-common/services/test.service';
|
||||||
|
// endFeatureFlag
|
||||||
|
|
||||||
const BroadcasterSubscriptionId = "VaultComponent";
|
const BroadcasterSubscriptionId = "VaultComponent";
|
||||||
|
|
||||||
@@ -89,10 +92,12 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
private ngZone: NgZone,
|
private ngZone: NgZone,
|
||||||
private stateService: StateService,
|
private stateService: StateService,
|
||||||
private organizationService: OrganizationService,
|
private organizationService: OrganizationService,
|
||||||
private providerService: ProviderService
|
private providerService: ProviderService,
|
||||||
|
/* featureFlag: Test */private testService: TestService, // endFeatureFlag
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
/** featureFlag: Test */ this.testService.Print("test service was loaded"); // endFeatureFlag
|
||||||
this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
|
this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
|
||||||
this.showBrowserOutdated = window.navigator.userAgent.indexOf("MSIE") !== -1;
|
this.showBrowserOutdated = window.navigator.userAgent.indexOf("MSIE") !== -1;
|
||||||
this.trashCleanupWarning = this.i18nService.t(
|
this.trashCleanupWarning = this.i18nService.t(
|
||||||
|
|||||||
@@ -3164,7 +3164,7 @@
|
|||||||
"description": "A 'fingerprint phrase' is a unique word phrase (similar to a passphrase) that a user can use to authenticate their public key with another user, for the purposes of sharing."
|
"description": "A 'fingerprint phrase' is a unique word phrase (similar to a passphrase) that a user can use to authenticate their public key with another user, for the purposes of sharing."
|
||||||
},
|
},
|
||||||
"dontAskFingerprintAgain": {
|
"dontAskFingerprintAgain": {
|
||||||
"message": "Never prompt to verify fingerprint phrases for invited users (Not recommended)",
|
"message": "Don't ask to verify fingerprint phrase again",
|
||||||
"description": "A 'fingerprint phrase' is a unique word phrase (similar to a passphrase) that a user can use to authenticate their public key with another user, for the purposes of sharing."
|
"description": "A 'fingerprint phrase' is a unique word phrase (similar to a passphrase) that a user can use to authenticate their public key with another user, for the purposes of sharing."
|
||||||
},
|
},
|
||||||
"free": {
|
"free": {
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
{
|
{
|
||||||
"extends": "./jslib/shared/tsconfig",
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"module": "commonjs",
|
||||||
|
"target": "es2015",
|
||||||
|
"lib": ["es5", "es6", "dom"],
|
||||||
|
"sourceMap": true,
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"tldjs": ["jslib/common/src/misc/tldjs.noop"],
|
"tldjs": ["jslib/common/src/misc/tldjs.noop"],
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ const NODE_ENV = process.env.NODE_ENV == null ? "development" : process.env.NODE
|
|||||||
const envConfig = config.load(ENV);
|
const envConfig = config.load(ENV);
|
||||||
config.log(envConfig);
|
config.log(envConfig);
|
||||||
|
|
||||||
|
const fileReplacements = {};
|
||||||
|
const substitutions = config.generateSubstitutions(envConfig);
|
||||||
|
|
||||||
const moduleRules = [
|
const moduleRules = [
|
||||||
{
|
{
|
||||||
test: /\.ts$/,
|
test: /\.ts$/,
|
||||||
@@ -155,6 +158,8 @@ const plugins = [
|
|||||||
tsConfigPath: "tsconfig.json",
|
tsConfigPath: "tsconfig.json",
|
||||||
entryModule: "src/app/app.module#AppModule",
|
entryModule: "src/app/app.module#AppModule",
|
||||||
sourceMap: true,
|
sourceMap: true,
|
||||||
|
fileReplacements: fileReplacements,
|
||||||
|
substitutions: substitutions,
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user