Skip to content

Commit

Permalink
Merged branch feature/show-just-the-list-of-all-time-plans into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
horia141 committed Jun 18, 2024
1 parent f47e48f commit c58d19e
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { LeafPanel } from "~/components/infra/layout/leaf-panel";
import { SectionCard } from "~/components/infra/section-card";
import { TimePlanActivityCard } from "~/components/time-plan-activity-card";
import { TimePlanCard } from "~/components/time-plan-card";
import { TimePlanStack } from "~/components/time-plan-stack";
import { validationErrorToUIErrorInfo } from "~/logic/action-result";
import {
filterActivitiesByTargetStatus,
Expand Down Expand Up @@ -69,6 +70,16 @@ export async function loader({ request, params }: LoaderArgs) {
include_other_time_plans: true,
});

const otherHigherTimePlanResult = await getLoggedInApiClient(
session
).timePlans.timePlanLoad({
ref_id: otherResult.higher_time_plan!.ref_id,
allow_archived: true,
include_targets: false,
include_completed_nontarget: false,
include_other_time_plans: true,
});

return json({
mainTimePlan: mainResult.time_plan,
mainActivities: mainResult.activities,
Expand All @@ -82,6 +93,7 @@ export async function loader({ request, params }: LoaderArgs) {
>,
otherHigherTimePlan: otherResult.higher_time_plan as TimePlan,
otherPreviousTimePlan: otherResult.previous_time_plan as TimePlan,
otherHigherTimePlanSubTimePlans: otherHigherTimePlanResult.sub_period_time_plans
});
} catch (error) {
if (error instanceof ApiError && error.status === StatusCodes.NOT_FOUND) {
Expand Down Expand Up @@ -284,6 +296,14 @@ export default function TimePlanAddFromCurrentTimePlans() {
/>
</SectionCard>
)}

{loaderData.otherHigherTimePlanSubTimePlans && (
<SectionCard title="Sub Time Plans">
<TimePlanStack
topLevelInfo={topLevelInfo}
timePlans={loaderData.otherHigherTimePlanSubTimePlans}
/>
</SectionCard>)}
</LeafPanel>
);
}
Expand Down

0 comments on commit c58d19e

Please sign in to comment.