Merge pull request 'Highlight Separator Line Between Expense Details and History Section adding border-2 for the thikness of the line.' (#326) from Expense_Bugs into Expense_Manangement_Feature
Reviewed-on: #326 merged
This commit is contained in:
commit
199d7ab8ff
@ -30,7 +30,7 @@ import moment from "moment";
|
|||||||
import ExpenseStatusLogs from "./ExpenseStatusLogs";
|
import ExpenseStatusLogs from "./ExpenseStatusLogs";
|
||||||
|
|
||||||
const ViewExpense = ({ ExpenseId }) => {
|
const ViewExpense = ({ ExpenseId }) => {
|
||||||
const { data, isLoading, isError, error } = useExpense(ExpenseId);
|
const { data, isLoading, isError, error, isFetching } = useExpense(ExpenseId);
|
||||||
const [IsPaymentProcess, setIsPaymentProcess] = useState(false);
|
const [IsPaymentProcess, setIsPaymentProcess] = useState(false);
|
||||||
const [clickedStatusId, setClickedStatusId] = useState(null);
|
const [clickedStatusId, setClickedStatusId] = useState(null);
|
||||||
|
|
||||||
@ -363,7 +363,7 @@ const ViewExpense = ({ ExpenseId }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<hr className="divider my-1 divider-primary" />
|
<hr className="divider my-1 border-2 divider-primary my-2"/>
|
||||||
|
|
||||||
{Array.isArray(data?.nextStatus) && data.nextStatus.length > 0 && (
|
{Array.isArray(data?.nextStatus) && data.nextStatus.length > 0 && (
|
||||||
<>
|
<>
|
||||||
@ -435,7 +435,7 @@ const ViewExpense = ({ ExpenseId }) => {
|
|||||||
setValue("statusId", status.id);
|
setValue("statusId", status.id);
|
||||||
handleSubmit(onSubmit)();
|
handleSubmit(onSubmit)();
|
||||||
}}
|
}}
|
||||||
disabled={isPending}
|
disabled={isPending || isFetching}
|
||||||
className="btn btn-primary btn-sm cursor-pointer mx-2 border-0"
|
className="btn btn-primary btn-sm cursor-pointer mx-2 border-0"
|
||||||
>
|
>
|
||||||
{isPending && clickedStatusId === status.id
|
{isPending && clickedStatusId === status.id
|
||||||
|
|||||||
@ -67,7 +67,7 @@ const SelectMultiple = ({
|
|||||||
const dropdownElement = (
|
const dropdownElement = (
|
||||||
<div
|
<div
|
||||||
ref={dropdownRef}
|
ref={dropdownRef}
|
||||||
className="multi-select-dropdown-options"
|
className="multi-select-dropdown-options py-2"
|
||||||
style={{
|
style={{
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
top: dropdownStyles.top,
|
top: dropdownStyles.top,
|
||||||
|
|||||||
@ -168,27 +168,27 @@ export const useActionOnExpense = (onSuccessCallBack) => {
|
|||||||
onSuccess: (updatedExpense, variables) => {
|
onSuccess: (updatedExpense, variables) => {
|
||||||
showToast("Request processed successfully.", "success");
|
showToast("Request processed successfully.", "success");
|
||||||
|
|
||||||
queryClient.setQueriesData(
|
// queryClient.setQueriesData(
|
||||||
{
|
// {
|
||||||
queryKey: ["Expenses"],
|
// queryKey: ["Expenses"],
|
||||||
exact: false,
|
// exact: false,
|
||||||
},
|
// },
|
||||||
(oldData) => {
|
// (oldData) => {
|
||||||
if (!oldData) return oldData;
|
// if (!oldData) return oldData;
|
||||||
return {
|
// return {
|
||||||
...oldData,
|
// ...oldData,
|
||||||
data: oldData.data.map((item) =>
|
// data: oldData.data.map((item) =>
|
||||||
item.id === updatedExpense.id
|
// item.id === updatedExpense.id
|
||||||
? {
|
// ? {
|
||||||
...item,
|
// ...item,
|
||||||
nextStatus: updatedExpense.nextStatus,
|
// nextStatus: updatedExpense.nextStatus,
|
||||||
status: updatedExpense.status,
|
// status: updatedExpense.status,
|
||||||
}
|
// }
|
||||||
: item
|
// : item
|
||||||
),
|
// ),
|
||||||
};
|
// };
|
||||||
}
|
// }
|
||||||
);
|
// );
|
||||||
// queryClient.setQueriesData(
|
// queryClient.setQueriesData(
|
||||||
// { queryKey: ["Expense", updatedExpense.id] },
|
// { queryKey: ["Expense", updatedExpense.id] },
|
||||||
// (oldData) => {
|
// (oldData) => {
|
||||||
@ -200,6 +200,7 @@ export const useActionOnExpense = (onSuccessCallBack) => {
|
|||||||
// }
|
// }
|
||||||
// );
|
// );
|
||||||
queryClient.invalidateQueries({queryKey:["Expense",updatedExpense.id]})
|
queryClient.invalidateQueries({queryKey:["Expense",updatedExpense.id]})
|
||||||
|
queryClient.invalidateQueries({queryKey:["Expenses",updatedExpense.id]})
|
||||||
|
|
||||||
if (onSuccessCallBack) onSuccessCallBack();
|
if (onSuccessCallBack) onSuccessCallBack();
|
||||||
},
|
},
|
||||||
|
|||||||
@ -100,7 +100,7 @@ useEffect(() => {
|
|||||||
></Breadcrumb>
|
></Breadcrumb>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="card">
|
<div className="card">
|
||||||
<div className="card-datatable table-responsive pt-2">
|
<div className="card-datatable table-responsive py-4">
|
||||||
<div
|
<div
|
||||||
id="DataTables_Table_0_wrapper"
|
id="DataTables_Table_0_wrapper"
|
||||||
className="dataTables_wrapper dt-bootstrap5 no-footer"
|
className="dataTables_wrapper dt-bootstrap5 no-footer"
|
||||||
|
|||||||
@ -184,7 +184,7 @@ const MasterTable = ({ data, columns, loading, handleModalData }) => {
|
|||||||
{/* Pagination */}
|
{/* Pagination */}
|
||||||
{!loading && safeData.length > 20 && (
|
{!loading && safeData.length > 20 && (
|
||||||
<nav aria-label="Page ">
|
<nav aria-label="Page ">
|
||||||
<ul className="pagination pagination-sm justify-content-end py-1">
|
<ul className="pagination pagination-sm justify-content-end mt-3">
|
||||||
<li className={`page-item ${currentPage === 1 ? "disabled" : ""}`}>
|
<li className={`page-item ${currentPage === 1 ? "disabled" : ""}`}>
|
||||||
<button
|
<button
|
||||||
className="page-link btn-xs"
|
className="page-link btn-xs"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user