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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 1 deletions

View File

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

View File

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

View File

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

View File

@ -65,6 +65,7 @@ export class VaultComponent implements OnInit, OnDestroy {
showUpdateKey = false;
showPremiumCallout = false;
deleted: boolean = false;
trashCleanupWarning: string = null;
modal: ModalComponent = null;
@ -79,6 +80,9 @@ export class VaultComponent implements OnInit, OnDestroy {
async ngOnInit() {
this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
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 => {
await this.syncService.fullSync(false);

View File

@ -3875,5 +3875,11 @@
"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."
}
}