@fayz-ai/plugin-crm 0.28.0 → 0.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5122,7 +5122,7 @@ function LeadListView({ onNew, onEdit }) {
5122
5122
  const [archiveTarget, setArchiveTarget] = useState(null);
5123
5123
  const [bulkBusy, setBulkBusy] = useState(false);
5124
5124
  const [page, setPage] = usePersistedState("crm.leads.page", 1);
5125
- const PAGE_SIZE2 = 50;
5125
+ const PAGE_SIZE3 = 50;
5126
5126
  const [scores, setScores] = useState(/* @__PURE__ */ new Map());
5127
5127
  useEffect(() => {
5128
5128
  if (leads2.length === 0) {
@@ -5155,7 +5155,7 @@ function LeadListView({ onNew, onEdit }) {
5155
5155
  hasEmail: reachFilter === "email" ? true : void 0,
5156
5156
  city: cityFilter,
5157
5157
  page,
5158
- pageSize: PAGE_SIZE2
5158
+ pageSize: PAGE_SIZE3
5159
5159
  });
5160
5160
  }, [statusFilter, search, sourceFilter, tagFilter, effectiveOwner, companyFilter, reachFilter, cityFilter, page]);
5161
5161
  const runBulk = useCallback(async (rows, write, labels) => {
@@ -5626,7 +5626,7 @@ function LeadListView({ onNew, onEdit }) {
5626
5626
  loading: leadsLoading,
5627
5627
  total: leadsTotal,
5628
5628
  page,
5629
- pageSize: PAGE_SIZE2,
5629
+ pageSize: PAGE_SIZE3,
5630
5630
  onPageChange: setPage,
5631
5631
  rangeOfLabel: t2("crm.leads.pageRangeOf"),
5632
5632
  firstPageLabel: t2("crm.leads.firstPage"),
@@ -7308,15 +7308,18 @@ var buildColumns2 = (t2) => [
7308
7308
  }
7309
7309
  }
7310
7310
  ];
7311
+ var PAGE_SIZE2 = 50;
7311
7312
  function CompanyListView({ onNew, onEdit }) {
7312
7313
  const t2 = useTranslation();
7313
7314
  const can = usePermissionOptional();
7314
7315
  const companies = useCrmStore((s) => s.companies);
7316
+ const companiesTotal = useCrmStore((s) => s.companiesTotal);
7315
7317
  const companiesLoading = useCrmStore((s) => s.companiesLoading);
7316
7318
  const fetchCompanies = useCrmStore((s) => s.fetchCompanies);
7317
7319
  const archiveCompany = useCrmStore((s) => s.archiveCompany);
7318
7320
  const provider = useCrmProvider();
7319
7321
  const [search, setSearch] = usePersistedState("crm.companies.search", "");
7322
+ const [page, setPage] = usePersistedState("crm.companies.page", 1);
7320
7323
  const [archiveTarget, setArchiveTarget] = useState(null);
7321
7324
  const [bulkBusy, setBulkBusy] = useState(false);
7322
7325
  const columns = useMemo(() => buildColumns2(t2), [t2]);
@@ -7339,14 +7342,19 @@ function CompanyListView({ onNew, onEdit }) {
7339
7342
  for (const tg of tagFilter) set.add(tg);
7340
7343
  return [...set].sort();
7341
7344
  }, [companies, tagFilter]);
7345
+ useEffect(() => {
7346
+ setPage(1);
7347
+ }, [search, cityFilter, tagFilter]);
7342
7348
  useEffect(() => {
7343
7349
  void fetchCompanies({
7344
7350
  search: search || void 0,
7345
7351
  city: cityFilter,
7346
7352
  tags: tagFilter.length ? tagFilter : void 0,
7347
- isActive: true
7353
+ isActive: true,
7354
+ page,
7355
+ pageSize: PAGE_SIZE2
7348
7356
  });
7349
- }, [search, cityFilter, tagFilter]);
7357
+ }, [search, cityFilter, tagFilter, page]);
7350
7358
  const activeFilterCount = (cityFilter ? 1 : 0) + (tagFilter.length ? 1 : 0);
7351
7359
  const clearFilters = () => {
7352
7360
  setCityFilter(void 0);
@@ -7455,6 +7463,16 @@ function CompanyListView({ onNew, onEdit }) {
7455
7463
  columns,
7456
7464
  data: companies,
7457
7465
  loading: companiesLoading,
7466
+ total: companiesTotal,
7467
+ page,
7468
+ pageSize: PAGE_SIZE2,
7469
+ onPageChange: setPage,
7470
+ rangeOfLabel: t2("crm.leads.pageRangeOf"),
7471
+ firstPageLabel: t2("crm.leads.firstPage"),
7472
+ pageLabel: t2("crm.leads.page"),
7473
+ prevPageLabel: t2("crm.leads.prevPage"),
7474
+ nextPageLabel: t2("crm.leads.nextPage"),
7475
+ lastPageLabel: t2("crm.leads.lastPage"),
7458
7476
  searchPlaceholder: t2("crm.companies.searchPlaceholder"),
7459
7477
  search,
7460
7478
  onSearchChange: setSearch,