1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

Add auto delete warning to trash page (#953)

* Add warning to trash page
This commit is contained in:
Oscar Hinton
2021-04-27 18:49:02 +02:00
committed by GitHub
parent 19f92e74f5
commit dd56c9bc87
5 changed files with 24 additions and 1 deletions

View File

@@ -29,6 +29,9 @@
</button> </button>
</div> </div>
</div> </div>
<app-callout type="warning" *ngIf="deleted" icon="fa-warning">
{{trashCleanupWarning}}
</app-callout>
<app-org-vault-ciphers (onCipherClicked)="editCipher($event)" <app-org-vault-ciphers (onCipherClicked)="editCipher($event)"
(onAttachmentsClicked)="editCipherAttachments($event)" (onAddCipher)="addCipher()" (onAttachmentsClicked)="editCipherAttachments($event)" (onAddCipher)="addCipher()"
(onCollectionsClicked)="editCipherCollections($event)" (onEventsClicked)="viewEvents($event)" (onCollectionsClicked)="editCipherCollections($event)" (onEventsClicked)="viewEvents($event)"

View File

@@ -15,6 +15,7 @@ import {
import { I18nService } from 'jslib/abstractions/i18n.service'; import { I18nService } from 'jslib/abstractions/i18n.service';
import { MessagingService } from 'jslib/abstractions/messaging.service'; import { MessagingService } from 'jslib/abstractions/messaging.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { SyncService } from 'jslib/abstractions/sync.service'; import { SyncService } from 'jslib/abstractions/sync.service';
import { UserService } from 'jslib/abstractions/user.service'; import { UserService } from 'jslib/abstractions/user.service';
@@ -52,6 +53,7 @@ export class VaultComponent implements OnInit, OnDestroy {
collectionId: string = null; collectionId: string = null;
type: CipherType = null; type: CipherType = null;
deleted: boolean = false; deleted: boolean = false;
trashCleanupWarning: string = null;
modal: ModalComponent = null; modal: ModalComponent = null;
@@ -59,9 +61,14 @@ export class VaultComponent implements OnInit, OnDestroy {
private router: Router, private changeDetectorRef: ChangeDetectorRef, private router: Router, private changeDetectorRef: ChangeDetectorRef,
private syncService: SyncService, private i18nService: I18nService, private syncService: SyncService, private i18nService: I18nService,
private componentFactoryResolver: ComponentFactoryResolver, private messagingService: MessagingService, private componentFactoryResolver: ComponentFactoryResolver, private messagingService: MessagingService,
private broadcasterService: BroadcasterService, private ngZone: NgZone) { } private broadcasterService: BroadcasterService, private ngZone: NgZone,
private platformUtilsService: PlatformUtilsService) { }
ngOnInit() { ngOnInit() {
this.trashCleanupWarning = this.i18nService.t(
this.platformUtilsService.isSelfHost() ? 'trashCleanupWarningSelfHosted' : 'trashCleanupWarning'
);
const queryParams = this.route.parent.params.subscribe(async params => { const queryParams = this.route.parent.params.subscribe(async params => {
this.organization = await this.userService.getOrganization(params.organizationId); this.organization = await this.userService.getOrganization(params.organizationId);
this.groupingsComponent.organization = this.organization; this.groupingsComponent.organization = this.organization;

View File

@@ -28,6 +28,9 @@
</button> </button>
</div> </div>
</div> </div>
<app-callout type="warning" *ngIf="deleted" icon="fa-warning">
{{trashCleanupWarning}}
</app-callout>
<app-vault-ciphers (onCipherClicked)="editCipher($event)" <app-vault-ciphers (onCipherClicked)="editCipher($event)"
(onAttachmentsClicked)="editCipherAttachments($event)" (onAddCipher)="addCipher()" (onAttachmentsClicked)="editCipherAttachments($event)" (onAddCipher)="addCipher()"
(onShareClicked)="shareCipher($event)" (onCollectionsClicked)="editCipherCollections($event)" (onShareClicked)="shareCipher($event)" (onCollectionsClicked)="editCipherCollections($event)"

View File

@@ -65,6 +65,7 @@ export class VaultComponent implements OnInit, OnDestroy {
showUpdateKey = false; showUpdateKey = false;
showPremiumCallout = false; showPremiumCallout = false;
deleted: boolean = false; deleted: boolean = false;
trashCleanupWarning: string = null;
modal: ModalComponent = null; modal: ModalComponent = null;
@@ -79,6 +80,9 @@ export class VaultComponent implements OnInit, OnDestroy {
async ngOnInit() { async ngOnInit() {
this.showVerifyEmail = !(await this.tokenService.getEmailVerified()); this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
this.showBrowserOutdated = window.navigator.userAgent.indexOf('MSIE') !== -1; this.showBrowserOutdated = window.navigator.userAgent.indexOf('MSIE') !== -1;
this.trashCleanupWarning = this.i18nService.t(
this.platformUtilsService.isSelfHost() ? 'trashCleanupWarningSelfHosted' : 'trashCleanupWarning'
);
const queryParamsSub = this.route.queryParams.subscribe(async params => { const queryParamsSub = this.route.queryParams.subscribe(async params => {
await this.syncService.fullSync(false); await this.syncService.fullSync(false);

View File

@@ -3875,5 +3875,11 @@
"example": "John Smith" "example": "John Smith"
} }
} }
},
"trashCleanupWarning": {
"message": "Ciphers that have been in Trash more than 30 days will be automatically deleted."
},
"trashCleanupWarningSelfHosted": {
"message": "Ciphers that have been in Trash for a while will be automatically deleted."
} }
} }