From f8ff75aa1b72a9303a35ba2dd8f061b8922cea6a Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Wed, 23 Mar 2022 06:32:13 +1000 Subject: [PATCH] [End User Vault Refresh] Vault - remove Org and Provider cards (#1529) --- src/app/providers/providers.component.html | 79 ++---- src/app/providers/providers.component.ts | 4 +- src/app/settings/organizations.component.html | 246 ++++++++---------- src/app/settings/organizations.component.ts | 10 +- src/app/vault/vault.component.html | 34 --- src/app/vault/vault.component.ts | 13 +- 6 files changed, 141 insertions(+), 245 deletions(-) diff --git a/src/app/providers/providers.component.html b/src/app/providers/providers.component.html index de63e139..e91b7cb4 100644 --- a/src/app/providers/providers.component.html +++ b/src/app/providers/providers.component.html @@ -1,58 +1,33 @@ - + +
+

{{ "loading" | i18n }}

- + + + + + + + +
+ + + {{ p.name }} + + + {{ "providerIsDisabled" | i18n }} + +
- - - -
- -

- - {{ "loading" | i18n }} -

- - - - - - - - -
- - - {{ p.name }} - - - {{ "providerIsDisabled" | i18n }} - -
-
-
- -
+
+ diff --git a/src/app/providers/providers.component.ts b/src/app/providers/providers.component.ts index bc7c1d85..ca80ef46 100644 --- a/src/app/providers/providers.component.ts +++ b/src/app/providers/providers.component.ts @@ -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; diff --git a/src/app/settings/organizations.component.html b/src/app/settings/organizations.component.html index d0d8881b..14dfc9a1 100644 --- a/src/app/settings/organizations.component.html +++ b/src/app/settings/organizations.component.html @@ -1,13 +1,51 @@ - -

- - {{ "loading" | i18n }} -

- -
    -
  • - - {{ o.name }} + + + + {{ "loading" | i18n }} + + + +

    {{ "noOrganizationsList" | i18n }}

    + + + {{ "newOrganization" | i18n }} + +
    + + + + + + + +
    + + + {{ o.name }} {{ "organizationIsDisabled" | i18n }} - - - -

    {{ "noOrganizationsList" | i18n }}

    - - - - {{ "newOrganization" | i18n }} - - - - - - - {{ "loading" | i18n }} - - - -

    {{ "noOrganizationsList" | i18n }}

    - - - {{ "newOrganization" | i18n }} - -
    - - - - - - + - - -
    - - - {{ o.name }} - - - {{ "organizationIsDisabled" | i18n }} - - - - {{ "enrolledPasswordReset" | i18n }} - - - +
    -
    + +
    diff --git a/src/app/settings/organizations.component.ts b/src/app/settings/organizations.component.ts index 17477a0d..ae780f96 100644 --- a/src/app/settings/organizations.component.ts +++ b/src/app/settings/organizations.component.ts @@ -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,10 +36,8 @@ export class OrganizationsComponent implements OnInit { ) {} async ngOnInit() { - if (!this.vault) { - await this.syncService.fullSync(true); - await this.load(); - } + await this.syncService.fullSync(true); + await this.load(); } async load() { diff --git a/src/app/vault/vault.component.html b/src/app/vault/vault.component.html index bf86bd45..bba76599 100644 --- a/src/app/vault/vault.component.html +++ b/src/app/vault/vault.component.html @@ -97,40 +97,6 @@ -
    -
    - {{ "organizations" | i18n }} - - - -
    -
    - -
    -
    -
    -
    - {{ "providers" | i18n }} - - - -
    -
    - -
    -
    diff --git a/src/app/vault/vault.component.ts b/src/app/vault/vault.component.ts index c3730bfa..bc3af9ba 100644 --- a/src/app/vault/vault.component.ts +++ b/src/app/vault/vault.component.ts @@ -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();