1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 23:03:32 +00:00

option to not show cards/identities on current tab list

This commit is contained in:
Kyle Spearrin
2018-11-21 14:31:34 -05:00
parent 100f9589bb
commit f043010067
5 changed files with 66 additions and 6 deletions

2
jslib

Submodule jslib updated: 464bca8c4d...1536f161f7

View File

@@ -490,6 +490,18 @@
"addLoginNotificationDesc": { "addLoginNotificationDesc": {
"message": "The \"Add Login Notification\" automatically prompts you to save new logins to your vault whenever you log into them for the first time." "message": "The \"Add Login Notification\" automatically prompts you to save new logins to your vault whenever you log into them for the first time."
}, },
"dontShowCardsCurrentTab": {
"message": "Don't Show Cards on Tab Page"
},
"dontShowCardsCurrentTabDesc": {
"message": "Card items from your vault are listed on the 'Current Tab' page for easy auto-fill access."
},
"dontShowIdentitiesCurrentTab": {
"message": "Don't Show Identities on Tab Page"
},
"dontShowIdentitiesCurrentTabDesc": {
"message": "Identity items from your vault are listed on the 'Current Tab' page for easy auto-fill access."
},
"notificationAddDesc": { "notificationAddDesc": {
"message": "Should Bitwarden remember this password for you?" "message": "Should Bitwarden remember this password for you?"
}, },

View File

@@ -33,6 +33,25 @@
</div> </div>
<div class="box-footer">{{'disableAutoTotpCopyDesc' | i18n}}</div> <div class="box-footer">{{'disableAutoTotpCopyDesc' | i18n}}</div>
</div> </div>
<div class="box">
<div class="box-content">
<div class="box-content-row box-content-row-checkbox" appBoxRow>
<label for="dontShowCards">{{'dontShowCardsCurrentTab' | i18n}}</label>
<input id="dontShowCards" type="checkbox" (change)="updateShowCards()" [(ngModel)]="dontShowCards">
</div>
</div>
<div class="box-footer">{{'dontShowCardsCurrentTabDesc' | i18n}}</div>
</div>
<div class="box">
<div class="box-content">
<div class="box-content-row box-content-row-checkbox" appBoxRow>
<label for="dontShowIdentities">{{'dontShowIdentitiesCurrentTab' | i18n}}</label>
<input id="dontShowIdentities" type="checkbox" (change)="updateShowIdentities()"
[(ngModel)]="dontShowIdentities">
</div>
</div>
<div class="box-footer">{{'dontShowIdentitiesCurrentTabDesc' | i18n}}</div>
</div>
<div class="box"> <div class="box">
<div class="box-content"> <div class="box-content">
<div class="box-content-row box-content-row-checkbox" appBoxRow> <div class="box-content-row box-content-row-checkbox" appBoxRow>

View File

@@ -25,6 +25,8 @@ export class OptionsComponent implements OnInit {
disableContextMenuItem = false; disableContextMenuItem = false;
disableAddLoginNotification = false; disableAddLoginNotification = false;
disableChangedPasswordNotification = false; disableChangedPasswordNotification = false;
dontShowCards = false;
dontShowIdentities = false;
showDisableContextMenu = true; showDisableContextMenu = true;
disableGa = false; disableGa = false;
theme: string; theme: string;
@@ -60,6 +62,9 @@ export class OptionsComponent implements OnInit {
this.disableContextMenuItem = await this.storageService.get<boolean>( this.disableContextMenuItem = await this.storageService.get<boolean>(
ConstantsService.disableContextMenuItemKey); ConstantsService.disableContextMenuItemKey);
this.dontShowCards = await this.storageService.get<boolean>(ConstantsService.dontShowCardsCurrentTab);
this.dontShowIdentities = await this.storageService.get<boolean>(ConstantsService.dontShowIdentitiesCurrentTab);
this.disableAutoTotpCopy = !await this.totpService.isAutoCopyEnabled(); this.disableAutoTotpCopy = !await this.totpService.isAutoCopyEnabled();
this.disableFavicon = await this.storageService.get<boolean>(ConstantsService.disableFaviconKey); this.disableFavicon = await this.storageService.get<boolean>(ConstantsService.disableFaviconKey);
@@ -112,6 +117,18 @@ export class OptionsComponent implements OnInit {
this.callAnalytics('Favicon', !this.disableFavicon); this.callAnalytics('Favicon', !this.disableFavicon);
} }
async updateShowCards() {
await this.storageService.save(ConstantsService.dontShowCardsCurrentTab, this.dontShowCards);
await this.stateService.save(ConstantsService.dontShowCardsCurrentTab, this.dontShowCards);
this.callAnalytics('Show Cards on Current Tab', !this.dontShowCards);
}
async updateShowIdentities() {
await this.storageService.save(ConstantsService.dontShowIdentitiesCurrentTab, this.dontShowIdentities);
await this.stateService.save(ConstantsService.dontShowIdentitiesCurrentTab, this.dontShowIdentities);
this.callAnalytics('Show Identities on Current Tab', !this.dontShowIdentities);
}
async saveTheme() { async saveTheme() {
await this.storageService.save(ConstantsService.themeKey, this.theme); await this.storageService.save(ConstantsService.themeKey, this.theme);
this.analytics.eventTrack.next({ action: 'Set Theme ' + this.theme }); this.analytics.eventTrack.next({ action: 'Set Theme ' + this.theme });

View File

@@ -22,8 +22,11 @@ import { CipherService } from 'jslib/abstractions/cipher.service';
import { I18nService } from 'jslib/abstractions/i18n.service'; import { I18nService } from 'jslib/abstractions/i18n.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { SearchService } from 'jslib/abstractions/search.service'; import { SearchService } from 'jslib/abstractions/search.service';
import { StorageService } from 'jslib/abstractions/storage.service';
import { SyncService } from 'jslib/abstractions/sync.service'; import { SyncService } from 'jslib/abstractions/sync.service';
import { ConstantsService } from 'jslib/services/constants.service';
import { AutofillService } from '../../services/abstractions/autofill.service'; import { AutofillService } from '../../services/abstractions/autofill.service';
import { PopupUtilsService } from '../services/popup-utils.service'; import { PopupUtilsService } from '../services/popup-utils.service';
@@ -59,7 +62,7 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
private i18nService: I18nService, private router: Router, private i18nService: I18nService, private router: Router,
private ngZone: NgZone, private broadcasterService: BroadcasterService, private ngZone: NgZone, private broadcasterService: BroadcasterService,
private changeDetectorRef: ChangeDetectorRef, private syncService: SyncService, private changeDetectorRef: ChangeDetectorRef, private syncService: SyncService,
private searchService: SearchService) { } private searchService: SearchService, private storageService: StorageService) { }
async ngOnInit() { async ngOnInit() {
this.showLeftHeader = !this.platformUtilsService.isSafari(); this.showLeftHeader = !this.platformUtilsService.isSafari();
@@ -203,10 +206,19 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
sender: BroadcasterSubscriptionId, sender: BroadcasterSubscriptionId,
}); });
const ciphers = await this.cipherService.getAllDecryptedForUrl(this.url, [ const otherTypes: CipherType[] = [];
CipherType.Card, const dontShowCards = await this.storageService.get<boolean>(ConstantsService.dontShowCardsCurrentTab);
CipherType.Identity, const dontShowIdentities = await this.storageService.get<boolean>(
]); ConstantsService.dontShowIdentitiesCurrentTab);
if (!dontShowCards) {
otherTypes.push(CipherType.Card);
}
if (!dontShowIdentities) {
otherTypes.push(CipherType.Identity);
}
const ciphers = await this.cipherService.getAllDecryptedForUrl(this.url,
otherTypes.length > 0 ? otherTypes : null);
this.loginCiphers = []; this.loginCiphers = [];
this.cardCiphers = []; this.cardCiphers = [];