diff --git a/jslib b/jslib
index 17e7ee4838..f485fbb687 160000
--- a/jslib
+++ b/jslib
@@ -1 +1 @@
-Subproject commit 17e7ee4838071ea836867b06863a71ab047ed443
+Subproject commit f485fbb6870203b60ac27bcbc2e12bb45f24b538
diff --git a/src/app/organizations/vault/attachments.component.ts b/src/app/organizations/vault/attachments.component.ts
index b93dc13250..7f4fc596db 100644
--- a/src/app/organizations/vault/attachments.component.ts
+++ b/src/app/organizations/vault/attachments.component.ts
@@ -11,6 +11,8 @@ import { CipherData } from 'jslib/models/data/cipherData';
import { Cipher } from 'jslib/models/domain/cipher';
import { Organization } from 'jslib/models/domain/organization';
+import { AttachmentView } from 'jslib/models/view/attachmentView';
+
import { AttachmentsComponent as BaseAttachmentsComponent } from '../../vault/attachments.component';
@Component({
@@ -26,6 +28,12 @@ export class AttachmentsComponent extends BaseAttachmentsComponent {
super(cipherService, i18nService, cryptoService, userService, platformUtilsService);
}
+ protected async reupload(attachment: AttachmentView) {
+ if (this.organization.isAdmin && this.showFixOldAttachments(attachment)) {
+ await super.reuploadCipherAttachment(attachment, true);
+ }
+ }
+
protected async loadCipher() {
if (!this.organization.isAdmin) {
return await super.loadCipher();
@@ -44,4 +52,8 @@ export class AttachmentsComponent extends BaseAttachmentsComponent {
}
return this.apiService.deleteCipherAttachmentAdmin(this.cipherId, attachmentId);
}
+
+ protected showFixOldAttachments(attachment: AttachmentView) {
+ return attachment.key == null && this.organization.isAdmin;
+ }
}
diff --git a/src/app/organizations/vault/ciphers.component.ts b/src/app/organizations/vault/ciphers.component.ts
index 85db24f6ab..9ba64aaacd 100644
--- a/src/app/organizations/vault/ciphers.component.ts
+++ b/src/app/organizations/vault/ciphers.component.ts
@@ -103,4 +103,8 @@ export class CiphersComponent extends BaseCiphersComponent {
}
return this.apiService.deleteCipherAdmin(id);
}
+
+ protected showFixOldAttachments(c: CipherView) {
+ return this.organization.isAdmin && c.hasOldAttachments;
+ }
}
diff --git a/src/app/vault/attachments.component.html b/src/app/vault/attachments.component.html
index d3030dc40a..4d9965a8b1 100644
--- a/src/app/vault/attachments.component.html
+++ b/src/app/vault/attachments.component.html
@@ -19,13 +19,21 @@
- {{a.fileName}}
-
+
{{a.sizeName}}
|
-
- {{'close' | i18n}}
+ {{'close'
+ | i18n}}
diff --git a/src/app/vault/attachments.component.ts b/src/app/vault/attachments.component.ts
index 16dfdf8241..343ee3fee6 100644
--- a/src/app/vault/attachments.component.ts
+++ b/src/app/vault/attachments.component.ts
@@ -6,6 +6,8 @@ import { I18nService } from 'jslib/abstractions/i18n.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { UserService } from 'jslib/abstractions/user.service';
+import { AttachmentView } from 'jslib/models/view/attachmentView';
+
import { AttachmentsComponent as BaseAttachmentsComponent } from 'jslib/angular/components/attachments.component';
@Component({
@@ -18,4 +20,14 @@ export class AttachmentsComponent extends BaseAttachmentsComponent {
platformUtilsService: PlatformUtilsService) {
super(cipherService, i18nService, cryptoService, userService, platformUtilsService, window);
}
+
+ protected async reupload(attachment: AttachmentView) {
+ if (this.showFixOldAttachments(attachment)) {
+ await this.reuploadCipherAttachment(attachment, false);
+ }
+ }
+
+ protected showFixOldAttachments(attachment: AttachmentView) {
+ return attachment.key == null && this.cipher.organizationId == null;
+ }
}
diff --git a/src/app/vault/ciphers.component.html b/src/app/vault/ciphers.component.html
index 584bb64663..34dbac67c4 100644
--- a/src/app/vault/ciphers.component.html
+++ b/src/app/vault/ciphers.component.html
@@ -11,7 +11,11 @@
|
{{c.name}}
-
+
+
+
+
{{c.subTitle}}
|
diff --git a/src/app/vault/ciphers.component.ts b/src/app/vault/ciphers.component.ts
index f757bf32a4..32960bdc53 100644
--- a/src/app/vault/ciphers.component.ts
+++ b/src/app/vault/ciphers.component.ts
@@ -127,4 +127,8 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy
protected deleteCipher(id: string) {
return this.cipherService.deleteWithServer(id);
}
+
+ protected showFixOldAttachments(c: CipherView) {
+ return c.hasOldAttachments && c.organizationId == null;
+ }
}
diff --git a/src/app/vault/vault.component.ts b/src/app/vault/vault.component.ts
index 9f146abee5..1edad37abf 100644
--- a/src/app/vault/vault.component.ts
+++ b/src/app/vault/vault.component.ts
@@ -225,6 +225,7 @@ export class VaultComponent implements OnInit, OnDestroy {
let madeAttachmentChanges = false;
childComponent.onUploadedAttachment.subscribe(() => madeAttachmentChanges = true);
childComponent.onDeletedAttachment.subscribe(() => madeAttachmentChanges = true);
+ childComponent.onReuploadedAttachment.subscribe(() => madeAttachmentChanges = true);
this.modal.onClosed.subscribe(async () => {
this.modal = null;
diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json
index 45b3d99810..c3008b30c9 100644
--- a/src/locales/en/messages.json
+++ b/src/locales/en/messages.json
@@ -2539,5 +2539,14 @@
},
"rotateEncKeyConfirmation": {
"message": "Are you sure you want to rotate your account's encryption key?"
+ },
+ "attachmentsNeedFix": {
+ "message": "This item has old attachments that need to be fixed."
+ },
+ "attachmentFixDesc": {
+ "message": "This is an old attachment the needs to be fixed. Click to learn more."
+ },
+ "fix": {
+ "message": "Fix"
}
}