Skip to content

Commit

Permalink
Merged branch feature/decisions-on-type-of-activity into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
horia141 committed Oct 18, 2024
1 parent 27d9c39 commit d5ec617
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 17 deletions.
5 changes: 4 additions & 1 deletion src/core/jupiter/core/use_cases/concept/big_plans/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
TimePlanActivityKind,
)
from jupiter.core.domain.core.adate import ADate
from jupiter.core.domain.core.recurring_task_period import RecurringTaskPeriod
from jupiter.core.domain.features import (
FeatureUnavailableError,
WorkspaceFeature,
Expand Down Expand Up @@ -120,7 +121,9 @@ async def _perform_transactional_mutation(
context.domain_context,
time_plan_ref_id=time_plan.ref_id,
big_plan_ref_id=new_big_plan.ref_id,
kind=TimePlanActivityKind.FINISH,
kind=TimePlanActivityKind.FINISH
if time_plan.period >= RecurringTaskPeriod.MONTHLY
else TimePlanActivityKind.MAKE_PROGRESS,
feasability=TimePlanActivityFeasability.MUST_DO,
)
new_time_plan_activity = await generic_creator(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from jupiter.core.domain.concept.time_plans.time_plan_activity_kind import (
TimePlanActivityKind,
)
from jupiter.core.domain.core.recurring_task_period import RecurringTaskPeriod
from jupiter.core.domain.features import WorkspaceFeature
from jupiter.core.domain.infra.generic_creator import generic_creator
from jupiter.core.domain.storage_engine import DomainUnitOfWork
Expand Down Expand Up @@ -85,7 +86,9 @@ async def _perform_transactional_mutation(
context.domain_context,
time_plan_ref_id=args.ref_id,
big_plan_ref_id=big_plan.ref_id,
kind=TimePlanActivityKind.FINISH,
kind=TimePlanActivityKind.FINISH
if time_plan.period >= RecurringTaskPeriod.MONTHLY
else TimePlanActivityKind.MAKE_PROGRESS,
feasability=TimePlanActivityFeasability.MUST_DO,
)
new_time_plan_activity = await generic_creator(
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/components/entity-name.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { EntityName } from "@jupiter/webapi-client";
import type { SxProps, Theme} from "@mui/material";
import type { SxProps, Theme } from "@mui/material";
import { Typography } from "@mui/material";

interface EntityNameProps {
Expand Down
14 changes: 9 additions & 5 deletions src/webui/app/components/infra/entity-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const SWIPE_COMPLETE_THRESHOLD = 150;
interface EntityCardProps {
entityId?: string;
showAsArchived?: boolean;
backgroundHint?: "neutral" | "success" | "failure"
backgroundHint?: "neutral" | "success" | "failure";
extraControls?: JSX.Element;
allowSwipe?: boolean;
allowSelect?: boolean;
Expand Down Expand Up @@ -106,9 +106,13 @@ export function EntityCard(props: PropsWithChildren<EntityCardProps>) {
touchAction: "pan-y",
position: "relative",
backgroundColor:
backgroundHint == "neutral" ? ((props.allowSelect && props.selected) || props.showAsArchived
? theme.palette.action.hover
: "transparent") : (backgroundHint === "success" ? `${theme.palette.success.light}22` : `${theme.palette.error.light}22`),
backgroundHint === "neutral"
? (props.allowSelect && props.selected) || props.showAsArchived
? theme.palette.action.hover
: "transparent"
: backgroundHint === "success"
? `${theme.palette.success.light}22`
: `${theme.palette.error.light}22`,
}}
onClick={props.onClick}
>
Expand Down Expand Up @@ -181,7 +185,7 @@ const StyledLink = styled(Link)<StyledLinkProps>(({ theme, light }) => ({
display: "flex",
gap: "0.5rem",
flexWrap: "wrap",
alignItems: "center"
alignItems: "center",
}));

interface EntityFakeLinkProps {
Expand Down
16 changes: 12 additions & 4 deletions src/webui/app/components/time-plan-activity-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ export function TimePlanActivityCard(props: TimePlanActivityCardProps) {
: undefined
}
backgroundHint={
props.activityDoneness[props.activity.ref_id] ?
(inboxTask?.status === InboxTaskStatus.NOT_DONE ? "failure" : "success") : "neutral"}
props.activityDoneness[props.activity.ref_id]
? inboxTask?.status === InboxTaskStatus.NOT_DONE
? "failure"
: "success"
: "neutral"
}
>
<EntityLink
to={`/workspace/time-plans/${props.timePlan.ref_id}/${props.activity.ref_id}`}
Expand Down Expand Up @@ -96,8 +100,12 @@ export function TimePlanActivityCard(props: TimePlanActivityCardProps) {
: undefined
}
backgroundHint={
props.activityDoneness[props.activity.ref_id] ?
(bigPlan?.status === BigPlanStatus.NOT_DONE ? "failure" : "success") : "neutral"}
props.activityDoneness[props.activity.ref_id]
? bigPlan?.status === BigPlanStatus.NOT_DONE
? "failure"
: "success"
: "neutral"
}
>
<EntityLink
to={`/workspace/time-plans/${props.timePlan.ref_id}/${props.activity.ref_id}`}
Expand Down
5 changes: 3 additions & 2 deletions src/webui/app/routes/workspace/calendar/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ export default function CalendarSettings() {
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
<AccordionHeader>
Run from <EventSourceTag source={entry.source} />
on {entry.today} from {entry.start_of_window} to {entry.end_of_window}
{" "}{entry.sync_even_if_not_modified ? "and sync forced " : " "}
on {entry.today} from {entry.start_of_window} to{" "}
{entry.end_of_window}{" "}
{entry.sync_even_if_not_modified ? "and sync forced " : " "}
with {entry.entity_records.length}
{entry.even_more_entity_records ? "+" : ""} entities synced
<TimeDiffTag
Expand Down
9 changes: 6 additions & 3 deletions src/webui/app/routes/workspace/tools/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@ export async function loader({ request }: LoaderArgs) {
),
filter_created_time_after: query.filterCreatedTimeAfter || undefined,
filter_created_time_before: query.filterCreatedTimeBefore || undefined,
filter_last_modified_time_after: query.filterLastModifiedTimeAfter || undefined,
filter_last_modified_time_before: query.filterLastModifiedTimeBefore || undefined,
filter_last_modified_time_after:
query.filterLastModifiedTimeAfter || undefined,
filter_last_modified_time_before:
query.filterLastModifiedTimeBefore || undefined,
filter_archived_time_after: query.filterArchivedTimeAfter || undefined,
filter_archived_time_before: query.filterArchivedTimeBefore || undefined,
filter_archived_time_before:
query.filterArchivedTimeBefore || undefined,
});
}

Expand Down

0 comments on commit d5ec617

Please sign in to comment.