PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.17
Yatra – Travel Booking & Tour Operator Software v3.0.17
3.0.17 3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 All 85 releases
← All changes | resources/js/pages/Customers.tsx +13 -13 3.0.4 → 3.0.17 View file →
@@ -163,9 +163,9 @@
163 163 });
164 164
165 165 return await apiService.getCustomers(paramsObj);
166 166 },
167 - enabled: can("yatra_view_bookings"),
167 + enabled: can("yatra_view_customers"),
168 168 });
169 169
170 170 // Fetch customer stats (counts)
171 171 const { data: statsRaw } = useQuery({
@@ -172,9 +172,9 @@
172 172 queryKey: ["customers-stats"],
173 173 queryFn: async () => {
174 174 return await apiService.getCustomerStats();
175 175 },
176 - enabled: can("yatra_view_bookings"),
176 + enabled: can("yatra_view_customers"),
177 177 });
178 178 const statsData: any = statsRaw ?? {};
179 179
180 180 // Delete mutation
@@ -591,9 +591,9 @@
591 591 key: "edit",
592 592 label: __("Edit"),
593 593 icon: <Edit className="w-4 h-4" />,
594 594 onClick: (customer: Customer) => handleEdit(customer),
595 - condition: () => can("yatra_edit_bookings"),
595 + condition: () => can("yatra_edit_customers"),
596 596 },
597 597 {
598 598 key: "mark_active",
599 599 label: __("Mark as Active"),
@@ -602,9 +602,9 @@
602 602 await updateStatusForIds([customer.id], "active");
603 603 queryClient.invalidateQueries({ queryKey: ["customers"] });
604 604 },
605 605 condition: (customer: Customer) =>
606 - can("yatra_edit_bookings") && customer.status !== "active",
606 + can("yatra_edit_customers") && customer.status !== "active",
607 607 },
608 608 {
609 609 key: "mark_inactive",
610 610 label: __("Mark as Inactive"),
@@ -613,9 +613,9 @@
613 613 await updateStatusForIds([customer.id], "inactive");
614 614 queryClient.invalidateQueries({ queryKey: ["customers"] });
615 615 },
616 616 condition: (customer: Customer) =>
617 - can("yatra_edit_bookings") && customer.status !== "inactive",
617 + can("yatra_edit_customers") && customer.status !== "inactive",
618 618 },
619 619 {
620 620 key: "mark_blocked",
621 621 label: __("Mark as Blocked"),
@@ -624,9 +624,9 @@
624 624 await updateStatusForIds([customer.id], "blocked");
625 625 queryClient.invalidateQueries({ queryKey: ["customers"] });
626 626 },
627 627 condition: (customer: Customer) =>
628 - can("yatra_edit_bookings") && customer.status !== "blocked",
628 + can("yatra_edit_customers") && customer.status !== "blocked",
629 629 },
630 630 {
631 631 key: "delete",
632 632 label: __("Delete"),
@@ -632,9 +632,9 @@
632 632 label: __("Delete"),
633 633 icon: <Trash2 className="w-4 h-4" />,
634 634 onClick: (customer: Customer) => handleDelete(customer),
635 635 variant: "destructive" as const,
636 - condition: () => can("yatra_delete_bookings"),
636 + condition: () => can("yatra_delete_customers"),
637 637 },
638 638 ];
639 639
640 640 // Skeleton loader
@@ -702,9 +702,9 @@
702 702 <div className="space-y-3">
703 703 <PageHeader
704 704 title={__("Customers")}
705 705 description={__("Manage your customer database")}
706 - actionCapability="yatra_edit_bookings"
706 + actionCapability="yatra_edit_customers"
707 707 actions={
708 708 <Button
709 709 onClick={handleCreateCustomer}
710 710 className="flex items-center gap-2"
@@ -716,9 +716,9 @@
716 716 />
717 717
718 718 <div className="space-y-3">
719 719 {/* Search and Filters Card */}
720 - <ConditionalRender capability="yatra_view_bookings">
720 + <ConditionalRender capability="yatra_view_customers">
721 721 <Card>
722 722 <CardContent className="p-4">
723 723 <div className="grid grid-cols-1 lg:grid-cols-12 gap-4 items-center">
724 724 {/* Search & status/sort (handled by toolbar) */}
@@ -773,9 +773,9 @@
773 773 </Card>
774 774 </ConditionalRender>
775 775
776 776 {/* Bulk Actions Toolbar */}
777 - <ConditionalRender capability="yatra_view_bookings">
777 + <ConditionalRender capability="yatra_view_customers">
778 778 <BulkActionToolbar
779 779 selectedIds={selectedIds}
780 780 bulkAction={bulkAction}
781 781 setBulkAction={setBulkAction}
@@ -814,9 +814,9 @@
814 814 />
815 815 </ConditionalRender>
816 816
817 817 {/* Customers Table Card */}
818 - <ConditionalRender capability="yatra_view_bookings">
818 + <ConditionalRender capability="yatra_view_customers">
819 819 <Card>
820 820 <CardContent className="p-0">
821 821 {isLoading ? (
822 822 renderSkeleton()
@@ -842,9 +842,9 @@
842 842 ? __("Try adjusting your filters to see more results.")
843 843 : __("Customers will appear here when bookings are made")
844 844 }
845 845 onCreateClick={
846 - can("yatra_edit_bookings")
846 + can("yatra_edit_customers")
847 847 ? handleCreateCustomer
848 848 : undefined
849 849 }
850 850 onSort={handleSort}
@@ -854,9 +854,9 @@
854 854 onSelectAll={handleSelectAll}
855 855 isAllSelected={isAllSelected}
856 856 getItemId={(customer: Customer) => customer.id}
857 857 skeletonRows={5}
858 - capability="yatra_view_bookings"
858 + capability="yatra_view_customers"
859 859 />
860 860 )}
861 861 </CardContent>
862 862 </Card>