mirror of
https://github.com/bitwarden/web
synced 2025-12-06 00:03:28 +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,
|
||||
canActivate: [PermissionsGuard],
|
||||
data: {
|
||||
permissions: [
|
||||
NavigationPermissionsService.getPermissions("manage").concat(Permissions.ManageSso),
|
||||
],
|
||||
permissions: NavigationPermissionsService.getPermissions("manage").concat(
|
||||
Permissions.ManageSso
|
||||
),
|
||||
},
|
||||
children: [
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ export class LoginComponent extends BaseLoginComponent {
|
||||
if (qParams.premium != null) {
|
||||
this.routerService.setPreviousUrl("/settings/premium");
|
||||
} else if (qParams.org != null) {
|
||||
const route = this.router.createUrlTree(["settings/create-organization"], {
|
||||
const route = this.router.createUrlTree(["create-organization"], {
|
||||
queryParams: { plan: qParams.org },
|
||||
});
|
||||
this.routerService.setPreviousUrl(route.toString());
|
||||
|
||||
@@ -71,7 +71,7 @@ export class RegisterComponent extends BaseRegisterComponent {
|
||||
} else if (qParams.org != null) {
|
||||
this.showCreateOrgMessage = true;
|
||||
this.referenceData.flow = qParams.org;
|
||||
const route = this.router.createUrlTree(["settings/create-organization"], {
|
||||
const route = this.router.createUrlTree(["create-organization"], {
|
||||
queryParams: { plan: qParams.org },
|
||||
});
|
||||
this.routerService.setPreviousUrl(route.toString());
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</li>
|
||||
<bit-menu-divider></bit-menu-divider>
|
||||
<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>
|
||||
{{ "newOrganization" | i18n }}</a
|
||||
>
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
<li class="nav-item" routerLinkActive="active">
|
||||
<a class="nav-link" routerLink="/reports">{{ "reports" | i18n }}</a>
|
||||
</li>
|
||||
<li *ngIf="organizations.length >= 1" class="nav-item" routerLinkActive="active">
|
||||
<a class="nav-link" [routerLink]="['/organizations', organizations[0].id]">{{
|
||||
<li *ngIf="(organizations$ | async).length >= 1" class="nav-item" routerLinkActive="active">
|
||||
<a class="nav-link" [routerLink]="['/organizations', (organizations$ | async)[0].id]">{{
|
||||
"organizations" | i18n
|
||||
}}</a>
|
||||
</li>
|
||||
@@ -38,7 +38,7 @@
|
||||
<li>
|
||||
<button
|
||||
[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-caret-down bwi-sm" aria-hidden="true"></i>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { Observable, map } from "rxjs";
|
||||
|
||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
||||
@@ -22,7 +23,7 @@ export class NavbarComponent implements OnInit {
|
||||
name: string;
|
||||
email: string;
|
||||
providers: Provider[] = [];
|
||||
organizations: Organization[] = [];
|
||||
organizations$ = new Observable<Organization[]>();
|
||||
|
||||
constructor(
|
||||
private messagingService: MessagingService,
|
||||
@@ -49,10 +50,17 @@ export class NavbarComponent implements OnInit {
|
||||
}
|
||||
this.providers = await this.providerService.getAll();
|
||||
|
||||
const allOrgs = await this.organizationService.getAll();
|
||||
this.organizations = allOrgs
|
||||
.filter((org) => OrgNavigationPermissionsService.canAccessAdmin(org))
|
||||
.sort(Utils.getSortFunction(this.i18nService, "name"));
|
||||
this.organizations$ = await this.buildOrganizations();
|
||||
}
|
||||
|
||||
async buildOrganizations() {
|
||||
return this.organizations$.pipe(
|
||||
map((orgs) => {
|
||||
return orgs
|
||||
.filter((org) => OrgNavigationPermissionsService.canAccessAdmin(org))
|
||||
.sort(Utils.getSortFunction(this.i18nService, "name"));
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
lock() {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</li>
|
||||
<li class="filter-option">
|
||||
<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>
|
||||
{{ "newOrganization" | i18n }}
|
||||
</a>
|
||||
@@ -47,9 +47,9 @@
|
||||
</button>
|
||||
<a
|
||||
href="#"
|
||||
routerLink="/settings/create-organization"
|
||||
routerLink="/create-organization"
|
||||
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>
|
||||
</a>
|
||||
@@ -112,9 +112,9 @@
|
||||
</button>
|
||||
<a
|
||||
href="#"
|
||||
routerLink="/settings/create-organization"
|
||||
routerLink="/create-organization"
|
||||
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>
|
||||
</a>
|
||||
|
||||
@@ -95,7 +95,10 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<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 }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -155,6 +155,11 @@ const routes: Routes = [
|
||||
.IndividualVaultModule,
|
||||
},
|
||||
{ path: "sends", component: SendComponent, data: { title: "Send" } },
|
||||
{
|
||||
path: "create-organization",
|
||||
component: CreateOrganizationComponent,
|
||||
data: { titleId: "newOrganization" },
|
||||
},
|
||||
{
|
||||
path: "settings",
|
||||
component: SettingsComponent,
|
||||
@@ -181,11 +186,6 @@ const routes: Routes = [
|
||||
loadChildren: async () =>
|
||||
(await import("./settings/subscription-routing.module")).SubscriptionRoutingModule,
|
||||
},
|
||||
{
|
||||
path: "create-organization",
|
||||
component: CreateOrganizationComponent,
|
||||
data: { titleId: "newOrganization" },
|
||||
},
|
||||
{
|
||||
path: "emergency-access",
|
||||
children: [
|
||||
|
||||
@@ -68,6 +68,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
||||
if (await this.keyConnectorService.getUsesKeyConnector()) {
|
||||
this.router.navigate(["/settings/security/two-factor"]);
|
||||
}
|
||||
await super.ngOnInit();
|
||||
}
|
||||
|
||||
async rotateEncKeyClicked() {
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<div class="page-header">
|
||||
<h1>{{ "newOrganization" | i18n }}</h1>
|
||||
<div class="container page-content">
|
||||
<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>
|
||||
<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 { I18nService } from "jslib-common/abstractions/i18n.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 { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||
@@ -68,7 +69,8 @@ export class OrganizationPlansComponent implements OnInit {
|
||||
private syncService: SyncService,
|
||||
private policyService: PolicyService,
|
||||
private organizationService: OrganizationService,
|
||||
private logService: LogService
|
||||
private logService: LogService,
|
||||
private messagingService: MessagingService
|
||||
) {
|
||||
this.selfHosted = platformUtilsService.isSelfHost();
|
||||
}
|
||||
|
||||
@@ -73,10 +73,14 @@ export class TaxInfoComponent {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} else {
|
||||
const taxInfo = await this.apiService.getTaxInfo();
|
||||
if (taxInfo) {
|
||||
this.taxInfo.postalCode = taxInfo.postalCode;
|
||||
this.taxInfo.country = taxInfo.country || "US";
|
||||
try {
|
||||
const taxInfo = await this.apiService.getTaxInfo();
|
||||
if (taxInfo) {
|
||||
this.taxInfo.postalCode = taxInfo.postalCode;
|
||||
this.taxInfo.country = taxInfo.country || "US";
|
||||
}
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
}
|
||||
this.pristine = Object.assign({}, this.taxInfo);
|
||||
@@ -86,9 +90,16 @@ export class TaxInfoComponent {
|
||||
}
|
||||
});
|
||||
|
||||
const taxRates = await this.apiService.getTaxRates();
|
||||
this.taxRates = taxRates.data;
|
||||
this.loading = false;
|
||||
try {
|
||||
const taxRates = await this.apiService.getTaxRates();
|
||||
if (taxRates) {
|
||||
this.taxRates = taxRates.data;
|
||||
}
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
get taxRate() {
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
</button>
|
||||
<a
|
||||
href="#"
|
||||
routerLink="/settings/create-organization"
|
||||
routerLink="/create-organization"
|
||||
class="btn btn-primary"
|
||||
*ngIf="!organizations || !organizations.length"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user