Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Reflect Updated Service Notes Immediately in Asset Details without page reload #9226

Merged
merged 4 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/components/Assets/AssetManage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ const AssetManage = (props: AssetManageProps) => {
>();
const [transactionFilter, setTransactionFilter] = useState<any>({});

const { data: asset, loading } = useQuery(routes.getAsset, {
const {
data: asset,
loading,
refetch,
} = useQuery(routes.getAsset, {
pathParams: {
external_id: assetId,
},
Expand Down Expand Up @@ -594,7 +598,10 @@ const AssetManage = (props: AssetManageProps) => {
handleClose={() =>
setServiceEditData({ ...serviceEditData, open: false })
}
handleUpdate={() => serviceRefetch()}
handleUpdate={() => {
serviceRefetch();
refetch();
}}
show={serviceEditData.open}
viewOnly={serviceEditData.viewOnly}
/>
Expand Down
13 changes: 10 additions & 3 deletions src/components/Shifting/ShiftDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,20 @@ export default function ShiftDetails(props: { id: string }) {
: ""
}
tooltipClassName="tooltip-top -translate-x-28 -translate-y-1 text-xs"
disabled={data?.status === "COMPLETED" || data?.status === "CANCELLED"}
onClick={() => navigate(`/shifting/${data?.external_id}/update`)}
disabled={
data?.status === "COMPLETED" || data?.status === "CANCELLED"
}
onClick={() =>
navigate(`/shifting/${data?.external_id}/update`)
}
>
{t("update_status_details")}
</ButtonV2>

<ButtonV2 className="w-full sm:w-auto" onClick={() => setIsPrintMode(true)}>
<ButtonV2
className="w-full sm:w-auto"
onClick={() => setIsPrintMode(true)}
>
<CareIcon icon="l-file-alt" className="mr-2 text-base" />{" "}
{t("referral_letter")}
</ButtonV2>
Expand Down
Loading