Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions apps/browser/src/autofill/popup/fido2/fido2.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ <h2 bitTypography="h6">{{ "chooseCipherForPasskeySave" | i18n }}</h2>
}
}
@if (!displayedCiphers.length) {
<bit-no-items [icon]="noResultsIcon">
<bit-status-layout>
<bit-svg slot="graphic" [content]="noResultsIcon"></bit-svg>
<ng-container slot="title">{{
(hasSearched ? "noItemsMatchSearch" : "noMatchingLoginsForSite") | i18n
}}</ng-container>
Expand All @@ -69,7 +70,7 @@ <h2 bitTypography="h6">{{ "chooseCipherForPasskeySave" | i18n }}</h2>
>
{{ (hasSearched ? "multiSelectClearAll" : "savePasskeyNewLogin") | i18n }}
</button>
</bit-no-items>
</bit-status-layout>
}
</bit-section>
}
Expand Down Expand Up @@ -101,7 +102,8 @@ <h2 bitTypography="h6">{{ "chooseCipherForPasskeySave" | i18n }}</h2>
></app-fido2-cipher-row>
}
} @else {
<bit-no-items [icon]="noResultsIcon">
<bit-status-layout>
<bit-svg slot="graphic" [content]="noResultsIcon"></bit-svg>
<ng-container slot="title">{{
(hasSearched ? "noItemsMatchSearch" : "noMatchingLoginsForSite") | i18n
}}</ng-container>
Expand All @@ -118,7 +120,7 @@ <h2 bitTypography="h6">{{ "chooseCipherForPasskeySave" | i18n }}</h2>
>
{{ (hasSearched ? "multiSelectClearAll" : "savePasskeyNewLogin") | i18n }}
</button>
</bit-no-items>
</bit-status-layout>
}
</bit-section>
}
Expand Down
6 changes: 4 additions & 2 deletions apps/browser/src/autofill/popup/fido2/fido2.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ import {
ButtonModule,
DialogService,
ItemModule,
NoItemsModule,
StatusLayoutComponent,
SearchModule,
SectionComponent,
SectionHeaderComponent,
SvgComponent,
} from "@bitwarden/components";
import { PasswordRepromptService } from "@bitwarden/vault";

Expand Down Expand Up @@ -82,12 +83,13 @@ interface ViewData {
FormsModule,
ItemModule,
JslibModule,
NoItemsModule,
StatusLayoutComponent,
PopupHeaderComponent,
PopupPageComponent,
SearchModule,
SectionComponent,
SectionHeaderComponent,
SvgComponent,
],
})
export class Fido2Component implements OnInit, OnDestroy {
Expand Down
17 changes: 12 additions & 5 deletions apps/browser/src/platform/popup/layout/popup-layout.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Meta, StoryObj, applicationConfig, moduleMetadata } from "@storybook/an
import {
GeneratorActive,
GeneratorInactive,
NoResults,
SendActive,
SendInactive,
SettingsActive,
Expand Down Expand Up @@ -42,10 +43,11 @@ import {
I18nMockService,
IconButtonModule,
ItemModule,
NoItemsModule,
StatusLayoutComponent,
SearchModule,
SectionComponent,
ScrollLayoutDirective,
SvgComponent,
} from "@bitwarden/components";

import { VaultLoadingSkeletonComponent } from "../../../vault/popup/components/vault-loading-skeleton/vault-loading-skeleton.component";
Expand Down Expand Up @@ -723,14 +725,15 @@ export default {
MockSettingsPageComponent,
MockVaultPagePoppedComponent,
MockVaultTablePageComponent,
NoItemsModule,
StatusLayoutComponent,
VaultComponent,
ScrollingModule,
ItemModule,
SectionComponent,
IconButtonModule,
ChipActionComponent,
VaultLoadingSkeletonComponent,
SvgComponent,
],
providers: [
popupLayoutI18nProvider,
Expand Down Expand Up @@ -987,7 +990,10 @@ export const PoppedOut: Story = {

export const CenteredContent: Story = {
Comment thread
BryanCunningham marked this conversation as resolved.
render: (args) => ({
props: args,
props: {
icon: NoResults,
...args,
},
template: /* HTML */ `
<extension-container>
<popup-tab-navigation>
Expand All @@ -997,10 +1003,11 @@ export const CenteredContent: Story = {
class="tw-h-full tw-flex tw-items-center tw-justify-center tw-text-main tw-flex-col"
>
<h2 bitTypography="h2" class="tw-mb-6">Page with no content</h2>
<bit-no-items>
<bit-status-layout>
<bit-svg slot="graphic" [content]="icon"></bit-svg>
<ng-container slot="title">Before centering a div</ng-container>
<ng-container slot="description">One must first center oneself</ng-container>
</bit-no-items>
</bit-status-layout>
</div>
</popup-page>
</popup-tab-navigation>
Expand Down
10 changes: 6 additions & 4 deletions apps/browser/src/tools/popup/send-v2/send-v2.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
*ngIf="listState === sendState.Empty"
class="tw-flex tw-flex-col tw-h-full tw-justify-center"
>
<bit-no-items [icon]="noItemIcon" class="tw-text-main">
<bit-status-layout class="tw-text-main">
<bit-svg slot="graphic" [content]="noItemIcon"></bit-svg>
<ng-container slot="title">{{ "sendsTitleNoItems" | i18n }}</ng-container>
<ng-container slot="description">
<p bitTypography="body2" class="tw-mx-6 tw-mt-2">{{ "sendsBodyNoItems" | i18n }}</p>
Expand All @@ -31,18 +32,19 @@
slot="button"
[buttonType]="'secondary'"
></tools-new-send-dropdown>
</bit-no-items>
</bit-status-layout>
</div>

<ng-container *ngIf="listState !== sendState.Empty && !(showSkeletonsLoaders$ | async)">
<div
*ngIf="listState === sendState.NoResults"
class="tw-flex tw-flex-col tw-justify-center tw-h-auto tw-pt-12"
>
<bit-no-items [icon]="noResultsIcon">
<bit-status-layout>
<bit-svg slot="graphic" [content]="noResultsIcon"></bit-svg>
<ng-container slot="title">{{ "noItemsMatchSearch" | i18n }}</ng-container>
<ng-container slot="description">{{ "clearFiltersOrTryAnother" | i18n }}</ng-container>
</bit-no-items>
</bit-status-layout>
</div>
<app-send-list-items-container [headerText]="title | i18n" [sends]="sends$ | async" />
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.s
import { SendService } from "@bitwarden/common/tools/send/services/send.service.abstraction";
import { SendType } from "@bitwarden/common/tools/send/types/send-type";
import { SearchService } from "@bitwarden/common/vault/abstractions/search.service";
import { ButtonModule, NoItemsModule } from "@bitwarden/components";
import { ButtonModule, StatusLayoutComponent } from "@bitwarden/components";
import {
NewSendDropdownComponent,
SendListItemsContainerComponent,
Expand Down Expand Up @@ -77,7 +77,7 @@ describe("SendV2Component", () => {
JslibModule,
ReactiveFormsModule,
ButtonModule,
NoItemsModule,
StatusLayoutComponent,
NewSendDropdownComponent,
SendListItemsContainerComponent,
SendListFiltersComponent,
Expand Down
6 changes: 4 additions & 2 deletions apps/browser/src/tools/popup/send-v2/send-v2.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { skeletonLoadingDelay } from "@bitwarden/common/vault/utils/skeleton-loa
import {
ButtonModule,
CalloutModule,
NoItemsModule,
StatusLayoutComponent,
SvgComponent,
TypographyModule,
} from "@bitwarden/components";
import {
Expand Down Expand Up @@ -60,14 +61,15 @@ export type SendState = (typeof SendState)[keyof typeof SendState];
PopupHeaderComponent,
PopOutComponent,
CurrentAccountComponent,
NoItemsModule,
StatusLayoutComponent,
JslibModule,
CommonModule,
ButtonModule,
NewSendDropdownComponent,
SendListItemsContainerComponent,
SendListFiltersComponent,
SendSearchComponent,
SvgComponent,
TypographyModule,
VaultFadeInOutSkeletonComponent,
VaultLoadingSkeletonComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
RestrictedCipherType,
RestrictedItemTypesService,
} from "@bitwarden/common/vault/services/restricted-item-types.service";
import { ButtonModule, DialogService, MenuModule, NoItemsModule } from "@bitwarden/components";
import { ButtonModule, DialogService, MenuModule } from "@bitwarden/components";
import { GlobalStateProvider } from "@bitwarden/state";
import { FakeGlobalStateProvider } from "@bitwarden/state-test-utils";

Expand Down Expand Up @@ -71,7 +71,6 @@ describe("NewItemDropdownComponent", () => {
RouterLink,
ButtonModule,
MenuModule,
NoItemsModule,
NewItemDropdownComponent,
],
providers: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ import { CollectionId, OrganizationId } from "@bitwarden/common/types/guid";
import { CipherType } from "@bitwarden/common/vault/enums";
import { RestrictedItemTypesService } from "@bitwarden/common/vault/services/restricted-item-types.service";
import { CipherMenuItem, CIPHER_MENU_ITEMS } from "@bitwarden/common/vault/types/cipher-menu-items";
import {
ButtonModule,
DialogService,
MenuModule,
NoItemsModule,
TooltipDirective,
} from "@bitwarden/components";
import { ButtonModule, DialogService, MenuModule, TooltipDirective } from "@bitwarden/components";
import { AddEditFolderDialogComponent } from "@bitwarden/vault";

import { BrowserApi } from "../../../../../platform/browser/browser-api";
Expand All @@ -37,15 +31,7 @@ export interface NewItemInitialValues {
@Component({
selector: "app-new-item-dropdown",
templateUrl: "new-item-dropdown.component.html",
imports: [
NoItemsModule,
JslibModule,
CommonModule,
ButtonModule,
RouterLink,
MenuModule,
TooltipDirective,
],
imports: [JslibModule, CommonModule, ButtonModule, RouterLink, MenuModule, TooltipDirective],
})
export class NewItemDropdownComponent implements OnInit {
cipherType = CipherType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
@if (vaultState === VaultStateEnum.Empty) {
<vault-fade-in-out>
<div class="tw-flex tw-flex-col tw-h-full tw-justify-center">
<bit-no-items [icon]="vaultIcon">
<bit-status-layout>
<bit-svg slot="graphic" [content]="vaultIcon"></bit-svg>
<ng-container slot="title">{{ "yourVaultIsEmpty" | i18n }}</ng-container>
<ng-container slot="description">
<p bitTypography="body2" class="tw-mx-6 tw-mt-2">
Expand All @@ -30,7 +31,7 @@
>
{{ "newLogin" | i18n }}
</a>
</bit-no-items>
</bit-status-layout>
</div>
</vault-fade-in-out>
}
Expand Down Expand Up @@ -114,23 +115,25 @@
@if (vaultState !== VaultStateEnum.Empty) {
@if (vaultState === VaultStateEnum.NoResults) {
<div class="tw-flex tw-flex-col tw-justify-center tw-h-auto tw-pt-12">
<bit-no-items [icon]="noResultsIcon">
<bit-status-layout>
<bit-svg slot="graphic" [content]="noResultsIcon"></bit-svg>
<ng-container slot="title">{{ "noItemsMatchSearch" | i18n }}</ng-container>
<ng-container slot="description">{{ "clearFiltersOrTryAnother" | i18n }}</ng-container>
</bit-no-items>
</bit-status-layout>
</div>
}

<!-- For better consistency with screen readers, the role/aria needs to be on an element that isn't dynamic by @if -->
<div role="status" aria-live="polite">
@if (vaultState === VaultStateEnum.DeactivatedOrg) {
<div class="tw-flex tw-flex-col tw-justify-center tw-h-auto tw-pt-12">
<bit-no-items [icon]="deactivatedIcon">
<bit-status-layout>
<bit-svg slot="graphic" [content]="deactivatedIcon"></bit-svg>
<ng-container slot="title">
{{ "organizationIsDeactivated" | i18n }}
</ng-container>
<ng-container slot="description">{{ "contactYourOrgAdmin" | i18n }}</ng-container>
</bit-no-items>
</bit-status-layout>
</div>
}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ import { skeletonLoadingDelay } from "@bitwarden/common/vault/utils/skeleton-loa
import {
ButtonModule,
DialogService,
NoItemsModule,
StatusLayoutComponent,
ScrollLayoutService,
SvgComponent,
ToastService,
TypographyModule,
CalloutModule,
Expand Down Expand Up @@ -102,7 +103,7 @@ type VaultState = UnionOfValues<typeof VaultState>;
PopupHeaderComponent,
PopOutComponent,
CurrentAccountComponent,
NoItemsModule,
StatusLayoutComponent,
JslibModule,
CommonModule,
AutofillVaultListItemsComponent,
Expand All @@ -114,6 +115,7 @@ type VaultState = UnionOfValues<typeof VaultState>;
AtRiskPasswordCalloutComponent,
CalloutModule,
RouterModule,
SvgComponent,
TypographyModule,
VaultLoadingSkeletonComponent,
VaultFadeInOutSkeletonComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,15 @@ <h2 bitTypography="h6">
</bit-item-group>
</bit-section>
} @else {
<bit-no-items class="tw-flex tw-h-full tw-items-center tw-justify-center">
<bit-status-layout class="tw-flex tw-h-full tw-items-center tw-justify-center">
<bit-svg slot="graphic" [content]="noItemsIcon"></bit-svg>
<ng-container slot="title">
{{ "noItemsInArchive" | i18n }}
</ng-container>
<ng-container slot="description">
{{ "noItemsInArchiveDesc" | i18n }}
</ng-container>
</bit-no-items>
</bit-status-layout>
}
}
</popup-page>
9 changes: 7 additions & 2 deletions apps/browser/src/vault/popup/settings/archive.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { combineLatest, firstValueFrom, map, Observable, startWith, switchMap }

import { CollectionService } from "@bitwarden/admin-console/common";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { NoResults } from "@bitwarden/assets/svg";
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
Expand All @@ -24,9 +25,10 @@ import {
IconButtonModule,
ItemModule,
MenuModule,
NoItemsModule,
StatusLayoutComponent,
SectionComponent,
SectionHeaderComponent,
SvgComponent,
ToastService,
TypographyModule,
CardComponent,
Expand Down Expand Up @@ -57,7 +59,7 @@ import { ROUTES_AFTER_EDIT_DELETION } from "../services/vault-popup-after-deleti
PopupPageComponent,
PopupHeaderComponent,
PopOutComponent,
NoItemsModule,
StatusLayoutComponent,
ItemModule,
MenuModule,
IconButtonModule,
Expand All @@ -70,6 +72,7 @@ import { ROUTES_AFTER_EDIT_DELETION } from "../services/vault-popup-after-deleti
ButtonComponent,
IconModule,
Vfo1I18nPipe,
SvgComponent,
],
})
export class ArchiveComponent {
Expand All @@ -87,6 +90,8 @@ export class ArchiveComponent {

private userId$: Observable<UserId> = this.accountService.activeAccount$.pipe(getUserId);

readonly noItemsIcon = NoResults;

private readonly orgMap = toSignal(
this.userId$.pipe(
switchMap((userId) =>
Expand Down
Loading
Loading