PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.16
Yatra – Travel Booking & Tour Operator Software v3.0.16
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 2.0.1 All 84 releases
← All changes | resources/js/pages/RecurringRulesPage.tsx +25 -11 3.0.6 → 3.0.16 View file →
@@ -17,8 +17,9 @@
17 17 CheckCircle,
18 18 XCircle,
19 19 } from "lucide-react";
20 20 import { __ } from "../lib/i18n";
21 +import { toDateValue } from "../lib/dateFormat";
21 22 import { Button } from "../components/ui/button";
22 23 import { Input } from "../components/ui/input";
23 24 import { Select } from "../components/ui/select";
24 25 import { PageHeader } from "../components/common/PageHeader";
@@ -64,8 +65,10 @@
64 65 ? parseInt(urlParams.get("trip_id")!)
65 66 : null;
66 67
67 68 // Filters and search
69 + const [bulkDeleteConfirm, setBulkDeleteConfirm] = useState(false);
70 +
68 71 const [searchTerm, setSearchTerm] = useState("");
69 72 const [statusFilter, setStatusFilter] = useState("all");
70 73 const [page, setPage] = useState(1);
71 74
@@ -197,18 +200,11 @@
197 200 if (!bulkAction || selectedIds.length === 0) return;
198 201
199 202 switch (bulkAction) {
200 203 case "delete":
201 - if (
202 - confirm(
203 - __(
204 - "Are you sure you want to delete {count} rule(s)?",
205 - "yatra",
206 - ).replace("{count}", selectedIds.length.toString()),
207 - )
208 - ) {
209 - bulkDeleteMutation.mutate(selectedIds);
210 - }
204 + // Confirmed through the shared dialog, matching the single-rule delete
205 + // already used on this page.
206 + setBulkDeleteConfirm(true);
211 207 break;
212 208 }
213 209
214 210 setBulkAction("");
@@ -230,9 +226,9 @@
230 226 // eslint-disable-next-line react-hooks/exhaustive-deps
231 227 const formatDate = (dateString: string | null | undefined): string => {
232 228 if (!dateString) return "--";
233 229 try {
234 - const date = new Date(dateString);
230 + const date = toDateValue(dateString);
235 231 return date.toLocaleDateString("en-US", {
236 232 year: "numeric",
237 233 month: "short",
238 234 day: "numeric",
@@ -642,8 +638,26 @@
642 638 </CardContent>
643 639 </Card>
644 640 </>
645 641 )}
642 +
643 + <ConfirmationDialog
644 + isOpen={bulkDeleteConfirm}
645 + onClose={() => setBulkDeleteConfirm(false)}
646 + onConfirm={() => {
647 + bulkDeleteMutation.mutate(selectedIds);
648 + setBulkDeleteConfirm(false);
649 + }}
650 + title={__("Delete Rules", "yatra")}
651 + message={__(
652 + "Are you sure you want to delete {count} rule(s)? This action cannot be undone.",
653 + "yatra",
654 + ).replace("{count}", selectedIds.length.toString())}
655 + confirmText={__("Delete", "yatra")}
656 + cancelText={__("Cancel", "yatra")}
657 + variant="danger"
658 + isLoading={bulkDeleteMutation.isPending}
659 + />
646 660 </div>
647 661 );
648 662 };
649 663