();
- const key = orgKey[0].encryptedString;
- const collection = await this.cryptoService.encrypt(
- this.i18nService.t("defaultCollection"),
- orgKey[1],
- );
- const collectionCt = collection.encryptedString;
- const orgKeys = await this.cryptoService.makeKeyPair(orgKey[1]);
-
- if (this.selfHosted) {
- orgId = await this.createSelfHosted(key, collectionCt, orgKeys);
- } else {
- orgId = await this.createCloudHosted(key, collectionCt, orgKeys, orgKey[1]);
- }
-
- this.platformUtilsService.showToast(
- "success",
- this.i18nService.t("organizationCreated"),
- this.i18nService.t("organizationReadyToGo"),
- );
+ if (this.selfHosted) {
+ orgId = await this.createSelfHosted(key, collectionCt, orgKeys);
} else {
- orgId = await this.updateOrganization(orgId);
- this.platformUtilsService.showToast(
- "success",
- null,
- this.i18nService.t("organizationUpgraded"),
- );
+ orgId = await this.createCloudHosted(key, collectionCt, orgKeys, orgKey[1]);
}
- await this.apiService.refreshIdentityToken();
- await this.syncService.fullSync(true);
+ this.platformUtilsService.showToast(
+ "success",
+ this.i18nService.t("organizationCreated"),
+ this.i18nService.t("organizationReadyToGo"),
+ );
+ } else {
+ orgId = await this.updateOrganization(orgId);
+ this.platformUtilsService.showToast(
+ "success",
+ null,
+ this.i18nService.t("organizationUpgraded"),
+ );
+ }
- if (!this.acceptingSponsorship && !this.isInTrialFlow) {
- // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
- this.router.navigate(["/organizations/" + orgId]);
- }
+ await this.apiService.refreshIdentityToken();
+ await this.syncService.fullSync(true);
- if (this.isInTrialFlow) {
- this.onTrialBillingSuccess.emit({
- orgId: orgId,
- subLabelText: this.billingSubLabelText(),
- });
- }
+ if (!this.acceptingSponsorship && !this.isInTrialFlow) {
+ // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
+ this.router.navigate(["/organizations/" + orgId]);
+ }
- return orgId;
- };
+ if (this.isInTrialFlow) {
+ this.onTrialBillingSuccess.emit({
+ orgId: orgId,
+ subLabelText: this.billingSubLabelText(),
+ });
+ }
- this.formPromise = doSubmit();
- const organizationId = await this.formPromise;
- this.onSuccess.emit({ organizationId: organizationId });
- // TODO: No one actually listening to this message?
- this.messagingService.send("organizationCreated", { organizationId });
- } catch (e) {
- this.logService.error(e);
- }
- }
+ return orgId;
+ };
+
+ this.formPromise = doSubmit();
+ const organizationId = await this.formPromise;
+ this.onSuccess.emit({ organizationId: organizationId });
+ // TODO: No one actually listening to this message?
+ this.messagingService.send("organizationCreated", { organizationId });
+ };
private async updateOrganization(orgId: string) {
const request = new OrganizationUpgradeRequest();
@@ -693,14 +698,12 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
}
private async createSelfHosted(key: string, collectionCt: string, orgKeys: [string, EncString]) {
- const fileEl = document.getElementById("file") as HTMLInputElement;
- const files = fileEl.files;
- if (files == null || files.length === 0) {
+ if (!this.selectedFile) {
throw new Error(this.i18nService.t("selectFile"));
}
const fd = new FormData();
- fd.append("license", files[0]);
+ fd.append("license", this.selectedFile);
fd.append("key", key);
fd.append("collectionName", collectionCt);
const response = await this.organizationApiService.createLicense(fd);
diff --git a/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts b/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts
index ea75743a8ce..bdb25cae447 100644
--- a/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts
+++ b/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts
@@ -58,7 +58,7 @@ export class VaultCipherRowComponent {
}
protected editCollections() {
- this.onEvent.emit({ type: "viewCollections", item: this.cipher });
+ this.onEvent.emit({ type: "viewCipherCollections", item: this.cipher });
}
protected events() {
diff --git a/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.html b/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.html
index 897d360b4be..7bad783f197 100644
--- a/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.html
+++ b/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.html
@@ -63,7 +63,7 @@
|
-
-
+
+
+
+
+
+
+
+
|