1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

[SM-660] move sm-no-items to CL (#5059)

* refactor: move sm-no-items to CL

* update and run prettier

* apply code review
This commit is contained in:
Will Martin
2023-04-07 11:05:14 -04:00
committed by GitHub
parent 2ad739b5a8
commit 36de1c8e32
12 changed files with 83 additions and 26 deletions

View File

@@ -2,7 +2,7 @@
<i class="bwi bwi-spinner bwi-spin bwi-3x"></i>
</div>
<sm-no-items *ngIf="tokens?.length == 0">
<bit-no-items *ngIf="tokens?.length == 0">
<ng-container slot="title">{{ "accessTokensNoItemsTitle" | i18n }}</ng-container>
<ng-container slot="description">{{ "accessTokensNoItemsDesc" | i18n }}</ng-container>
<button
@@ -15,7 +15,7 @@
<i class="bwi bwi-plus" aria-hidden="true"></i>
{{ "newAccessToken" | i18n }}
</button>
</sm-no-items>
</bit-no-items>
<bit-table *ngIf="tokens?.length >= 1">
<ng-container header>

View File

@@ -2,7 +2,7 @@
<i class="bwi bwi-spinner bwi-spin bwi-3x"></i>
</div>
<sm-no-items *ngIf="serviceAccounts?.length == 0">
<bit-no-items *ngIf="serviceAccounts?.length == 0">
<ng-container slot="title">{{ "serviceAccountsNoItemsTitle" | i18n }}</ng-container>
<ng-container slot="description">{{ "serviceAccountsNoItemsMessage" | i18n }}</ng-container>
<button
@@ -15,7 +15,7 @@
<i class="bwi bwi-plus" aria-hidden="true"></i>
{{ "newServiceAccount" | i18n }}
</button>
</sm-no-items>
</bit-no-items>
<bit-table *ngIf="serviceAccounts?.length >= 1" [dataSource]="dataSource">
<ng-container header>

View File

@@ -1,16 +0,0 @@
<div
class="tw-mx-auto tw-flex tw-flex-col tw-items-center tw-justify-center tw-pt-6 tw-text-center"
>
<div class="tw-max-w-sm">
<bit-icon [icon]="icon" aria-hidden="true"></bit-icon>
<h3 class="tw-font-semibold">
<ng-content select="[slot=title]"></ng-content>
</h3>
<p>
<ng-content select="[slot=description]"></ng-content>
</p>
</div>
<div class="tw-space-x-2">
<ng-content select="[slot=button]"></ng-content>
</div>
</div>

View File

@@ -1,11 +0,0 @@
import { Component } from "@angular/core";
import { Icons } from "@bitwarden/components";
@Component({
selector: "sm-no-items",
templateUrl: "./no-items.component.html",
})
export class NoItemsComponent {
protected icon = Icons.Search;
}

View File

@@ -2,7 +2,7 @@
<i class="bwi bwi-spinner bwi-spin bwi-3x"></i>
</div>
<sm-no-items *ngIf="projects?.length == 0">
<bit-no-items *ngIf="projects?.length == 0">
<ng-container slot="title">{{ "projectsNoItemsTitle" | i18n }}</ng-container>
<ng-container slot="description">{{ "projectsNoItemsMessage" | i18n }}</ng-container>
<button
@@ -15,7 +15,7 @@
<i class="bwi bwi-plus" aria-hidden="true"></i>
{{ "newProject" | i18n }}
</button>
</sm-no-items>
</bit-no-items>
<bit-table *ngIf="projects?.length >= 1" [dataSource]="dataSource">
<ng-container header>

View File

@@ -3,11 +3,11 @@
</div>
<ng-container *ngIf="secrets?.length == 0">
<sm-no-items *ngIf="trash">
<bit-no-items *ngIf="trash">
<ng-container slot="title">{{ "secretsNoItemsTitle" | i18n }}</ng-container>
<ng-container slot="description">{{ "secretsTrashNoItemsMessage" | i18n }}</ng-container>
</sm-no-items>
<sm-no-items *ngIf="!trash">
</bit-no-items>
<bit-no-items *ngIf="!trash">
<ng-container slot="title">{{ "secretsNoItemsTitle" | i18n }}</ng-container>
<ng-container slot="description">{{ "secretsNoItemsMessage" | i18n }}</ng-container>
<button
@@ -20,7 +20,7 @@
<i class="bwi bwi-plus" aria-hidden="true"></i>
{{ "newSecret" | i18n }}
</button>
</sm-no-items>
</bit-no-items>
</ng-container>
<bit-table *ngIf="secrets?.length >= 1" [dataSource]="dataSource">

View File

@@ -1,6 +1,6 @@
import { NgModule } from "@angular/core";
import { MultiSelectModule } from "@bitwarden/components";
import { MultiSelectModule, NoItemsModule } from "@bitwarden/components";
import { CoreOrganizationModule } from "@bitwarden/web-vault/app/admin-console/organizations/core";
import { ProductSwitcherModule } from "@bitwarden/web-vault/app/layouts/product-switcher/product-switcher.module";
import { SharedModule } from "@bitwarden/web-vault/app/shared";
@@ -10,19 +10,24 @@ import { AccessRemovalDialogComponent } from "./access-policies/dialogs/access-r
import { BulkStatusDialogComponent } from "./dialogs/bulk-status-dialog.component";
import { HeaderComponent } from "./header.component";
import { NewMenuComponent } from "./new-menu.component";
import { NoItemsComponent } from "./no-items.component";
import { ProjectsListComponent } from "./projects-list.component";
import { SecretsListComponent } from "./secrets-list.component";
@NgModule({
imports: [SharedModule, ProductSwitcherModule, MultiSelectModule, CoreOrganizationModule],
imports: [
SharedModule,
ProductSwitcherModule,
MultiSelectModule,
CoreOrganizationModule,
NoItemsModule,
],
exports: [
SharedModule,
NoItemsModule,
AccessRemovalDialogComponent,
BulkStatusDialogComponent,
HeaderComponent,
NewMenuComponent,
NoItemsComponent,
ProjectsListComponent,
SecretsListComponent,
AccessSelectorComponent,
@@ -32,7 +37,6 @@ import { SecretsListComponent } from "./secrets-list.component";
BulkStatusDialogComponent,
HeaderComponent,
NewMenuComponent,
NoItemsComponent,
ProjectsListComponent,
SecretsListComponent,
AccessSelectorComponent,