|
|
|
|
@@ -136,24 +136,18 @@ export class VaultListItemsContainerComponent implements AfterViewInit {
|
|
|
|
|
*/
|
|
|
|
|
private viewCipherTimeout?: number;
|
|
|
|
|
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
|
|
|
|
// eslint-disable-next-line @angular-eslint/prefer-signals
|
|
|
|
|
ciphers = input<PopupCipherViewLike[]>([]);
|
|
|
|
|
readonly ciphers = input<PopupCipherViewLike[]>([]);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* If true, we will group ciphers by type (Login, Card, Identity)
|
|
|
|
|
* within subheadings in a single container, converted to a WritableSignal.
|
|
|
|
|
*/
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
|
|
|
|
// eslint-disable-next-line @angular-eslint/prefer-signals
|
|
|
|
|
groupByType = input<boolean | undefined>(false);
|
|
|
|
|
readonly groupByType = input<boolean | undefined>(false);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Computed signal for a grouped list of ciphers with an optional header
|
|
|
|
|
*/
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
|
|
|
|
// eslint-disable-next-line @angular-eslint/prefer-signals
|
|
|
|
|
cipherGroups = computed<
|
|
|
|
|
readonly cipherGroups = computed<
|
|
|
|
|
{
|
|
|
|
|
subHeaderKey?: string;
|
|
|
|
|
ciphers: PopupCipherViewLike[];
|
|
|
|
|
@@ -195,9 +189,7 @@ export class VaultListItemsContainerComponent implements AfterViewInit {
|
|
|
|
|
/**
|
|
|
|
|
* Title for the vault list item section.
|
|
|
|
|
*/
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
|
|
|
|
// eslint-disable-next-line @angular-eslint/prefer-signals
|
|
|
|
|
title = input<string | undefined>(undefined);
|
|
|
|
|
readonly title = input<string | undefined>(undefined);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Optionally allow the items to be collapsed.
|
|
|
|
|
@@ -205,24 +197,20 @@ export class VaultListItemsContainerComponent implements AfterViewInit {
|
|
|
|
|
* The key must be added to the state definition in `vault-popup-section.service.ts` since the
|
|
|
|
|
* collapsed state is stored locally.
|
|
|
|
|
*/
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
|
|
|
|
// eslint-disable-next-line @angular-eslint/prefer-signals
|
|
|
|
|
collapsibleKey = input<keyof PopupSectionOpen | undefined>(undefined);
|
|
|
|
|
readonly collapsibleKey = input<keyof PopupSectionOpen | undefined>(undefined);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Optional description for the vault list item section. Will be shown below the title even when
|
|
|
|
|
* no ciphers are available.
|
|
|
|
|
*/
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
|
|
|
|
// eslint-disable-next-line @angular-eslint/prefer-signals
|
|
|
|
|
description = input<string | undefined>(undefined);
|
|
|
|
|
|
|
|
|
|
readonly description = input<string | undefined>(undefined);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Option to show a refresh button in the section header.
|
|
|
|
|
*/
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
|
|
|
|
// eslint-disable-next-line @angular-eslint/prefer-signals
|
|
|
|
|
showRefresh = input(false, { transform: booleanAttribute });
|
|
|
|
|
|
|
|
|
|
readonly showRefresh = input(false, { transform: booleanAttribute });
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Event emitted when the refresh button is clicked.
|
|
|
|
|
@@ -235,20 +223,16 @@ export class VaultListItemsContainerComponent implements AfterViewInit {
|
|
|
|
|
/**
|
|
|
|
|
* Flag indicating that the current tab location is blocked
|
|
|
|
|
*/
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
|
|
|
|
// eslint-disable-next-line @angular-eslint/prefer-signals
|
|
|
|
|
currentURIIsBlocked = toSignal(this.vaultPopupAutofillService.currentTabIsOnBlocklist$);
|
|
|
|
|
readonly currentUriIsBlocked = toSignal(this.vaultPopupAutofillService.currentTabIsOnBlocklist$);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Resolved i18n key to use for suggested cipher items
|
|
|
|
|
*/
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
|
|
|
|
// eslint-disable-next-line @angular-eslint/prefer-signals
|
|
|
|
|
cipherItemTitleKey = computed(() => {
|
|
|
|
|
readonly cipherItemTitleKey = computed(() => {
|
|
|
|
|
return (cipher: CipherViewLike) => {
|
|
|
|
|
const login = CipherViewLikeUtils.getLogin(cipher);
|
|
|
|
|
const hasUsername = login?.username != null;
|
|
|
|
|
const key = !this.currentURIIsBlocked() ? "autofillTitle" : "viewItemTitle";
|
|
|
|
|
const key = !this.currentUriIsBlocked() ? "autofillTitle" : "viewItemTitle";
|
|
|
|
|
return hasUsername ? `${key}WithField` : key;
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
@@ -256,38 +240,25 @@ export class VaultListItemsContainerComponent implements AfterViewInit {
|
|
|
|
|
/**
|
|
|
|
|
* Option to show the autofill button for each item.
|
|
|
|
|
*/
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
|
|
|
|
// eslint-disable-next-line @angular-eslint/prefer-signals
|
|
|
|
|
showAutofillButton = input(false, { transform: booleanAttribute });
|
|
|
|
|
readonly isAutofillList = input(false, { transform: booleanAttribute });
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Flag indicating whether the suggested cipher item autofill button should be shown or not
|
|
|
|
|
* Computed property whether the cipher select action should perform autofill
|
|
|
|
|
*/
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
|
|
|
|
// eslint-disable-next-line @angular-eslint/prefer-signals
|
|
|
|
|
hideAutofillButton = computed(() => !this.showAutofillButton() || this.currentURIIsBlocked());
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Flag indicating whether the cipher item autofill menu options should be shown or not
|
|
|
|
|
*/
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
|
|
|
|
// eslint-disable-next-line @angular-eslint/prefer-signals
|
|
|
|
|
hideAutofillMenuOptions = computed(() => this.currentURIIsBlocked() || this.showAutofillButton());
|
|
|
|
|
readonly shouldAutofillOnSelect = computed(
|
|
|
|
|
() => this.isAutofillList() && !this.currentUriIsBlocked(),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Remove the bottom margin from the bit-section in this component
|
|
|
|
|
* (used for containers at the end of the page where bottom margin is not needed)
|
|
|
|
|
*/
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
|
|
|
|
// eslint-disable-next-line @angular-eslint/prefer-signals
|
|
|
|
|
disableSectionMargin = input(false, { transform: booleanAttribute });
|
|
|
|
|
readonly disableSectionMargin = input(false, { transform: booleanAttribute });
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Remove the description margin
|
|
|
|
|
*/
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
|
|
|
|
// eslint-disable-next-line @angular-eslint/prefer-signals
|
|
|
|
|
disableDescriptionMargin = input(false, { transform: booleanAttribute });
|
|
|
|
|
readonly disableDescriptionMargin = input(false, { transform: booleanAttribute });
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The tooltip text for the organization icon for ciphers that belong to an organization.
|
|
|
|
|
@@ -301,9 +272,7 @@ export class VaultListItemsContainerComponent implements AfterViewInit {
|
|
|
|
|
return collections[0]?.name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
|
|
|
|
// eslint-disable-next-line @angular-eslint/prefer-signals
|
|
|
|
|
protected autofillShortcutTooltip = signal<string | undefined>(undefined);
|
|
|
|
|
protected readonly autofillShortcutTooltip = signal<string | undefined>(undefined);
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
private i18nService: I18nService,
|
|
|
|
|
@@ -328,8 +297,8 @@ export class VaultListItemsContainerComponent implements AfterViewInit {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
primaryActionOnSelect(cipher: PopupCipherViewLike) {
|
|
|
|
|
return !this.currentURIIsBlocked() ? this.doAutofill(cipher) : this.onViewCipher(cipher);
|
|
|
|
|
onCipherSelect(cipher: PopupCipherViewLike) {
|
|
|
|
|
return this.shouldAutofillOnSelect() ? this.doAutofill(cipher) : this.onViewCipher(cipher);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|