mirror of
https://github.com/bitwarden/web
synced 2025-12-11 13:53:17 +00:00
Compare commits
9 Commits
2022.05.0
...
feature/ex
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7fb394d28 | ||
|
|
74bdfe2602 | ||
|
|
9e01d47a3f | ||
|
|
67de7d4bfb | ||
|
|
f5245a280e | ||
|
|
1dc9502676 | ||
|
|
ccf0d64a7b | ||
|
|
dc2078ae58 | ||
|
|
da470ad709 |
@@ -22,9 +22,9 @@ const routes: Routes = [
|
|||||||
component: ManageComponent,
|
component: ManageComponent,
|
||||||
canActivate: [PermissionsGuard],
|
canActivate: [PermissionsGuard],
|
||||||
data: {
|
data: {
|
||||||
permissions: [
|
permissions: NavigationPermissionsService.getPermissions("manage").concat(
|
||||||
NavigationPermissionsService.getPermissions("manage").concat(Permissions.ManageSso),
|
Permissions.ManageSso
|
||||||
],
|
),
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ export class LoginComponent extends BaseLoginComponent {
|
|||||||
if (qParams.premium != null) {
|
if (qParams.premium != null) {
|
||||||
this.routerService.setPreviousUrl("/settings/premium");
|
this.routerService.setPreviousUrl("/settings/premium");
|
||||||
} else if (qParams.org != null) {
|
} else if (qParams.org != null) {
|
||||||
const route = this.router.createUrlTree(["settings/create-organization"], {
|
const route = this.router.createUrlTree(["create-organization"], {
|
||||||
queryParams: { plan: qParams.org },
|
queryParams: { plan: qParams.org },
|
||||||
});
|
});
|
||||||
this.routerService.setPreviousUrl(route.toString());
|
this.routerService.setPreviousUrl(route.toString());
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export class RegisterComponent extends BaseRegisterComponent {
|
|||||||
} else if (qParams.org != null) {
|
} else if (qParams.org != null) {
|
||||||
this.showCreateOrgMessage = true;
|
this.showCreateOrgMessage = true;
|
||||||
this.referenceData.flow = qParams.org;
|
this.referenceData.flow = qParams.org;
|
||||||
const route = this.router.createUrlTree(["settings/create-organization"], {
|
const route = this.router.createUrlTree(["create-organization"], {
|
||||||
queryParams: { plan: qParams.org },
|
queryParams: { plan: qParams.org },
|
||||||
});
|
});
|
||||||
this.routerService.setPreviousUrl(route.toString());
|
this.routerService.setPreviousUrl(route.toString());
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<bit-menu-divider></bit-menu-divider>
|
<bit-menu-divider></bit-menu-divider>
|
||||||
<li class="tw-list-none" role="none">
|
<li class="tw-list-none" role="none">
|
||||||
<a bit-menu-item routerLink="/settings/create-organization">
|
<a bit-menu-item routerLink="/create-organization">
|
||||||
<i class="bwi bwi-plus mr-2"></i>
|
<i class="bwi bwi-plus mr-2"></i>
|
||||||
{{ "newOrganization" | i18n }}</a
|
{{ "newOrganization" | i18n }}</a
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
<li class="nav-item" routerLinkActive="active">
|
<li class="nav-item" routerLinkActive="active">
|
||||||
<a class="nav-link" routerLink="/reports">{{ "reports" | i18n }}</a>
|
<a class="nav-link" routerLink="/reports">{{ "reports" | i18n }}</a>
|
||||||
</li>
|
</li>
|
||||||
<li *ngIf="organizations.length >= 1" class="nav-item" routerLinkActive="active">
|
<li *ngIf="(organizations$ | async).length >= 1" class="nav-item" routerLinkActive="active">
|
||||||
<a class="nav-link" [routerLink]="['/organizations', organizations[0].id]">{{
|
<a class="nav-link" [routerLink]="['/organizations', (organizations$ | async)[0].id]">{{
|
||||||
"organizations" | i18n
|
"organizations" | i18n
|
||||||
}}</a>
|
}}</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<button
|
<button
|
||||||
[bitMenuTriggerFor]="accountMenu"
|
[bitMenuTriggerFor]="accountMenu"
|
||||||
class="tw-border-0 tw-bg-transparent tw-text-contrast tw-opacity-70 hover:tw-opacity-90"
|
class="tw-border-0 tw-bg-transparent tw-text-alt2 tw-opacity-70 hover:tw-opacity-90"
|
||||||
>
|
>
|
||||||
<i class="bwi bwi-user-circle bwi-lg" aria-hidden="true"></i>
|
<i class="bwi bwi-user-circle bwi-lg" aria-hidden="true"></i>
|
||||||
<i class="bwi bwi-caret-down bwi-sm" aria-hidden="true"></i>
|
<i class="bwi bwi-caret-down bwi-sm" aria-hidden="true"></i>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
|
import { Observable, map } from "rxjs";
|
||||||
|
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
||||||
@@ -22,7 +23,7 @@ export class NavbarComponent implements OnInit {
|
|||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
providers: Provider[] = [];
|
providers: Provider[] = [];
|
||||||
organizations: Organization[] = [];
|
organizations$ = new Observable<Organization[]>();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private messagingService: MessagingService,
|
private messagingService: MessagingService,
|
||||||
@@ -49,10 +50,17 @@ export class NavbarComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
this.providers = await this.providerService.getAll();
|
this.providers = await this.providerService.getAll();
|
||||||
|
|
||||||
const allOrgs = await this.organizationService.getAll();
|
this.organizations$ = await this.buildOrganizations();
|
||||||
this.organizations = allOrgs
|
}
|
||||||
.filter((org) => OrgNavigationPermissionsService.canAccessAdmin(org))
|
|
||||||
.sort(Utils.getSortFunction(this.i18nService, "name"));
|
async buildOrganizations() {
|
||||||
|
return this.organizations$.pipe(
|
||||||
|
map((orgs) => {
|
||||||
|
return orgs
|
||||||
|
.filter((org) => OrgNavigationPermissionsService.canAccessAdmin(org))
|
||||||
|
.sort(Utils.getSortFunction(this.i18nService, "name"));
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
lock() {
|
lock() {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="filter-option">
|
<li class="filter-option">
|
||||||
<span class="filter-buttons">
|
<span class="filter-buttons">
|
||||||
<a href="#" routerLink="/settings/create-organization" class="filter-button">
|
<a href="#" routerLink="/create-organization" class="filter-button">
|
||||||
<i class="bwi bwi-plus bwi-fw" aria-hidden="true"></i>
|
<i class="bwi bwi-plus bwi-fw" aria-hidden="true"></i>
|
||||||
{{ "newOrganization" | i18n }}
|
{{ "newOrganization" | i18n }}
|
||||||
</a>
|
</a>
|
||||||
@@ -47,9 +47,9 @@
|
|||||||
</button>
|
</button>
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
routerLink="/settings/create-organization"
|
routerLink="/create-organization"
|
||||||
class="text-muted ml-auto create-organization-link"
|
class="text-muted ml-auto create-organization-link"
|
||||||
appA11yTitle="{{ 'addOrganization' | i18n }}"
|
appA11yTitle="{{ 'newOrganization' | i18n }}"
|
||||||
>
|
>
|
||||||
<i class="bwi bwi-plus bwi-fw" aria-hidden="true"></i>
|
<i class="bwi bwi-plus bwi-fw" aria-hidden="true"></i>
|
||||||
</a>
|
</a>
|
||||||
@@ -112,9 +112,9 @@
|
|||||||
</button>
|
</button>
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
routerLink="/settings/create-organization"
|
routerLink="/create-organization"
|
||||||
class="text-muted ml-auto create-organization-link"
|
class="text-muted ml-auto create-organization-link"
|
||||||
appA11yTitle="{{ 'addOrganization' | i18n }}"
|
appA11yTitle="{{ 'newOrganization' | i18n }}"
|
||||||
>
|
>
|
||||||
<i class="bwi bwi-plus bwi-fw" aria-hidden="true"></i>
|
<i class="bwi bwi-plus bwi-fw" aria-hidden="true"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -95,7 +95,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p>{{ "premiumUpgradeUnlockFeatures" | i18n }}</p>
|
<p>{{ "premiumUpgradeUnlockFeatures" | i18n }}</p>
|
||||||
<a class="btn btn-block btn-outline-secondary" routerLink="/settings/premium">
|
<a
|
||||||
|
class="btn btn-block btn-outline-secondary"
|
||||||
|
routerLink="/settings/subscription/premium"
|
||||||
|
>
|
||||||
{{ "goPremium" | i18n }}
|
{{ "goPremium" | i18n }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -155,6 +155,11 @@ const routes: Routes = [
|
|||||||
.IndividualVaultModule,
|
.IndividualVaultModule,
|
||||||
},
|
},
|
||||||
{ path: "sends", component: SendComponent, data: { title: "Send" } },
|
{ path: "sends", component: SendComponent, data: { title: "Send" } },
|
||||||
|
{
|
||||||
|
path: "create-organization",
|
||||||
|
component: CreateOrganizationComponent,
|
||||||
|
data: { titleId: "newOrganization" },
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "settings",
|
path: "settings",
|
||||||
component: SettingsComponent,
|
component: SettingsComponent,
|
||||||
@@ -181,11 +186,6 @@ const routes: Routes = [
|
|||||||
loadChildren: async () =>
|
loadChildren: async () =>
|
||||||
(await import("./settings/subscription-routing.module")).SubscriptionRoutingModule,
|
(await import("./settings/subscription-routing.module")).SubscriptionRoutingModule,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: "create-organization",
|
|
||||||
component: CreateOrganizationComponent,
|
|
||||||
data: { titleId: "newOrganization" },
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: "emergency-access",
|
path: "emergency-access",
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
|||||||
if (await this.keyConnectorService.getUsesKeyConnector()) {
|
if (await this.keyConnectorService.getUsesKeyConnector()) {
|
||||||
this.router.navigate(["/settings/security/two-factor"]);
|
this.router.navigate(["/settings/security/two-factor"]);
|
||||||
}
|
}
|
||||||
|
await super.ngOnInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
async rotateEncKeyClicked() {
|
async rotateEncKeyClicked() {
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
<div class="page-header">
|
<div class="container page-content">
|
||||||
<h1>{{ "newOrganization" | i18n }}</h1>
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="page-header">
|
||||||
|
<h1>{{ "newOrganization" | i18n }}</h1>
|
||||||
|
</div>
|
||||||
|
<p>{{ "newOrganizationDesc" | i18n }}</p>
|
||||||
|
<app-organization-plans></app-organization-plans>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p>{{ "newOrganizationDesc" | i18n }}</p>
|
|
||||||
<app-organization-plans></app-organization-plans>
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { ApiService } from "jslib-common/abstractions/api.service";
|
|||||||
import { CryptoService } from "jslib-common/abstractions/crypto.service";
|
import { CryptoService } from "jslib-common/abstractions/crypto.service";
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
|
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
||||||
import { OrganizationService } from "jslib-common/abstractions/organization.service";
|
import { OrganizationService } from "jslib-common/abstractions/organization.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||||
@@ -68,7 +69,8 @@ export class OrganizationPlansComponent implements OnInit {
|
|||||||
private syncService: SyncService,
|
private syncService: SyncService,
|
||||||
private policyService: PolicyService,
|
private policyService: PolicyService,
|
||||||
private organizationService: OrganizationService,
|
private organizationService: OrganizationService,
|
||||||
private logService: LogService
|
private logService: LogService,
|
||||||
|
private messagingService: MessagingService
|
||||||
) {
|
) {
|
||||||
this.selfHosted = platformUtilsService.isSelfHost();
|
this.selfHosted = platformUtilsService.isSelfHost();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,10 +73,14 @@ export class TaxInfoComponent {
|
|||||||
this.logService.error(e);
|
this.logService.error(e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const taxInfo = await this.apiService.getTaxInfo();
|
try {
|
||||||
if (taxInfo) {
|
const taxInfo = await this.apiService.getTaxInfo();
|
||||||
this.taxInfo.postalCode = taxInfo.postalCode;
|
if (taxInfo) {
|
||||||
this.taxInfo.country = taxInfo.country || "US";
|
this.taxInfo.postalCode = taxInfo.postalCode;
|
||||||
|
this.taxInfo.country = taxInfo.country || "US";
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.logService.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.pristine = Object.assign({}, this.taxInfo);
|
this.pristine = Object.assign({}, this.taxInfo);
|
||||||
@@ -86,9 +90,16 @@ export class TaxInfoComponent {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const taxRates = await this.apiService.getTaxRates();
|
try {
|
||||||
this.taxRates = taxRates.data;
|
const taxRates = await this.apiService.getTaxRates();
|
||||||
this.loading = false;
|
if (taxRates) {
|
||||||
|
this.taxRates = taxRates.data;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.logService.error(e);
|
||||||
|
} finally {
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get taxRate() {
|
get taxRate() {
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
routerLink="/settings/create-organization"
|
routerLink="/create-organization"
|
||||||
class="btn btn-primary"
|
class="btn btn-primary"
|
||||||
*ngIf="!organizations || !organizations.length"
|
*ngIf="!organizations || !organizations.length"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user