mirror of
https://github.com/bitwarden/web
synced 2025-12-22 19:23:42 +00:00
[End User Vault Refresh] Vault - remove Org and Provider cards (#1529)
This commit is contained in:
@@ -1,29 +1,5 @@
|
||||
<ng-container *ngIf="vault">
|
||||
<p *ngIf="!loaded" class="text-muted">
|
||||
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ "loading" | i18n }}</span>
|
||||
</p>
|
||||
<ng-container *ngIf="loaded">
|
||||
<ul class="bwi-ul card-ul carets" *ngIf="providers && providers.length">
|
||||
<li *ngFor="let p of providers">
|
||||
<a [routerLink]="['/providers', p.id]" class="text-body">
|
||||
<i class="bwi bwi-li bwi-caret-right" aria-hidden="true"></i> {{ p.name }}
|
||||
<ng-container *ngIf="!p.enabled">
|
||||
<i
|
||||
class="bwi bwi-exclamation-triangle text-danger"
|
||||
title="{{ 'providerIsDisabled' | i18n }}"
|
||||
aria-hidden="true"
|
||||
></i>
|
||||
<span class="sr-only">{{ "providerIsDisabled" | i18n }}</span>
|
||||
</ng-container>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="!vault">
|
||||
<app-navbar></app-navbar>
|
||||
<div class="container page-content">
|
||||
<app-navbar></app-navbar>
|
||||
<div class="container page-content">
|
||||
<div class="page-header d-flex">
|
||||
<h1>{{ "providers" | i18n }}</h1>
|
||||
</div>
|
||||
@@ -53,6 +29,5 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</ng-container>
|
||||
</div>
|
||||
<app-footer></app-footer>
|
||||
</ng-container>
|
||||
</div>
|
||||
<app-footer></app-footer>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, Input, OnInit } from "@angular/core";
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
|
||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||
import { ProviderService } from "jslib-common/abstractions/provider.service";
|
||||
@@ -10,8 +10,6 @@ import { Provider } from "jslib-common/models/domain/provider";
|
||||
templateUrl: "providers.component.html",
|
||||
})
|
||||
export class ProvidersComponent implements OnInit {
|
||||
@Input() vault = false;
|
||||
|
||||
providers: Provider[];
|
||||
loaded = false;
|
||||
actionPromise: Promise<any>;
|
||||
|
||||
@@ -1,33 +1,4 @@
|
||||
<ng-container *ngIf="vault">
|
||||
<p *ngIf="!loaded" class="text-muted">
|
||||
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ "loading" | i18n }}</span>
|
||||
</p>
|
||||
<ng-container *ngIf="loaded">
|
||||
<ul class="bwi-ul card-ul carets" *ngIf="organizations && organizations.length">
|
||||
<li *ngFor="let o of organizations">
|
||||
<a [routerLink]="['/organizations', o.id]" class="text-body">
|
||||
<i class="bwi bwi-li bwi-caret-right" aria-hidden="true"></i> {{ o.name }}
|
||||
<ng-container *ngIf="!o.enabled">
|
||||
<i
|
||||
class="bwi bwi-exclamation-triangle text-danger"
|
||||
title="{{ 'organizationIsDisabled' | i18n }}"
|
||||
aria-hidden="true"
|
||||
></i>
|
||||
<span class="sr-only">{{ "organizationIsDisabled" | i18n }}</span>
|
||||
</ng-container>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p *ngIf="!organizations || !organizations.length">{{ "noOrganizationsList" | i18n }}</p>
|
||||
</ng-container>
|
||||
<a href="#" routerLink="/settings/create-organization" class="btn btn-block btn-outline-primary">
|
||||
<i class="bwi bwi-plus bwi-fw" aria-hidden="true"></i>
|
||||
{{ "newOrganization" | i18n }}
|
||||
</a>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="!vault">
|
||||
<div class="page-header d-flex">
|
||||
<div class="page-header d-flex">
|
||||
<h1>
|
||||
{{ "organizations" | i18n }}
|
||||
<small [appApiAction]="actionPromise" #action>
|
||||
@@ -50,16 +21,16 @@
|
||||
<i class="bwi bwi-plus bwi-fw" aria-hidden="true"></i>
|
||||
{{ "newOrganization" | i18n }}
|
||||
</a>
|
||||
</div>
|
||||
<ng-container *ngIf="!loaded">
|
||||
</div>
|
||||
<ng-container *ngIf="!loaded">
|
||||
<i
|
||||
class="bwi bwi-spinner bwi-spin text-muted"
|
||||
title="{{ 'loading' | i18n }}"
|
||||
aria-hidden="true"
|
||||
></i>
|
||||
<span class="sr-only">{{ "loading" | i18n }}</span>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="loaded">
|
||||
</ng-container>
|
||||
<ng-container *ngIf="loaded">
|
||||
<ng-container *ngIf="!organizations || !organizations.length">
|
||||
<p>{{ "noOrganizationsList" | i18n }}</p>
|
||||
<a href="#" routerLink="/settings/create-organization" class="btn btn-outline-primary">
|
||||
@@ -151,5 +122,4 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, Input, OnInit } from "@angular/core";
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
|
||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
||||
import { CryptoService } from "jslib-common/abstractions/crypto.service";
|
||||
@@ -19,8 +19,6 @@ import { OrganizationUserResetPasswordEnrollmentRequest } from "jslib-common/mod
|
||||
templateUrl: "organizations.component.html",
|
||||
})
|
||||
export class OrganizationsComponent implements OnInit {
|
||||
@Input() vault = false;
|
||||
|
||||
organizations: Organization[];
|
||||
policies: Policy[];
|
||||
loaded = false;
|
||||
@@ -38,11 +36,9 @@ export class OrganizationsComponent implements OnInit {
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
if (!this.vault) {
|
||||
await this.syncService.fullSync(true);
|
||||
await this.load();
|
||||
}
|
||||
}
|
||||
|
||||
async load() {
|
||||
const orgs = await this.organizationService.getAll();
|
||||
|
||||
@@ -97,40 +97,6 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card mb-4">
|
||||
<div class="card-header d-flex">
|
||||
{{ "organizations" | i18n }}
|
||||
<a
|
||||
class="ml-auto"
|
||||
href="https://bitwarden.com/help/about-organizations/"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
appA11yTitle="{{ 'learnMore' | i18n }}"
|
||||
>
|
||||
<i class="bwi bwi-question-circle" aria-hidden="true"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<app-organizations [vault]="true"></app-organizations>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card mt-4" *ngIf="showProviders">
|
||||
<div class="card-header d-flex">
|
||||
{{ "providers" | i18n }}
|
||||
<a
|
||||
class="ml-auto"
|
||||
href="https://bitwarden.com/help/providers/"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
appA11yTitle="{{ 'learnMore' | i18n }}"
|
||||
>
|
||||
<i class="bwi bwi-question-circle" aria-hidden="true"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<app-providers vault="true"></app-providers>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -17,14 +17,12 @@ import { I18nService } from "jslib-common/abstractions/i18n.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 { ProviderService } from "jslib-common/abstractions/provider.service";
|
||||
import { StateService } from "jslib-common/abstractions/state.service";
|
||||
import { SyncService } from "jslib-common/abstractions/sync.service";
|
||||
import { TokenService } from "jslib-common/abstractions/token.service";
|
||||
import { CipherType } from "jslib-common/enums/cipherType";
|
||||
import { CipherView } from "jslib-common/models/view/cipherView";
|
||||
|
||||
import { OrganizationsComponent } from "../settings/organizations.component";
|
||||
import { UpdateKeyComponent } from "../settings/update-key.component";
|
||||
|
||||
import { AddEditComponent } from "./add-edit.component";
|
||||
@@ -44,8 +42,6 @@ const BroadcasterSubscriptionId = "VaultComponent";
|
||||
export class VaultComponent implements OnInit, OnDestroy {
|
||||
@ViewChild(GroupingsComponent, { static: true }) groupingsComponent: GroupingsComponent;
|
||||
@ViewChild(CiphersComponent, { static: true }) ciphersComponent: CiphersComponent;
|
||||
@ViewChild(OrganizationsComponent, { static: true })
|
||||
organizationsComponent: OrganizationsComponent;
|
||||
@ViewChild("attachments", { read: ViewContainerRef, static: true })
|
||||
attachmentsModalRef: ViewContainerRef;
|
||||
@ViewChild("folderAddEdit", { read: ViewContainerRef, static: true })
|
||||
@@ -66,7 +62,6 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
showBrowserOutdated = false;
|
||||
showUpdateKey = false;
|
||||
showPremiumCallout = false;
|
||||
showProviders = false;
|
||||
deleted = false;
|
||||
trashCleanupWarning: string = null;
|
||||
|
||||
@@ -84,8 +79,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
private broadcasterService: BroadcasterService,
|
||||
private ngZone: NgZone,
|
||||
private stateService: StateService,
|
||||
private organizationService: OrganizationService,
|
||||
private providerService: ProviderService
|
||||
private organizationService: OrganizationService
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
@@ -104,9 +98,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
this.showPremiumCallout =
|
||||
!this.showVerifyEmail && !canAccessPremium && !this.platformUtilsService.isSelfHost();
|
||||
|
||||
this.showProviders = (await this.providerService.getAll()).length > 0;
|
||||
|
||||
await Promise.all([this.groupingsComponent.load(), this.organizationsComponent.load()]);
|
||||
await this.groupingsComponent.load();
|
||||
this.showUpdateKey = !(await this.cryptoService.hasEncKey());
|
||||
|
||||
if (params == null) {
|
||||
@@ -143,7 +135,6 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
if (message.successfully) {
|
||||
await Promise.all([
|
||||
this.groupingsComponent.load(),
|
||||
this.organizationsComponent.load(),
|
||||
this.ciphersComponent.load(this.ciphersComponent.filter),
|
||||
]);
|
||||
this.changeDetectorRef.detectChanges();
|
||||
|
||||
Reference in New Issue
Block a user