Skip to content

Commit a002e38

Browse files
committed
Merged branch bugfix/more-fixes into develop
1 parent 6290a91 commit a002e38

67 files changed

Lines changed: 1076 additions & 999 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/webui/app/components/domain/application/calendar/time-event-full-days-block-stack.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { CombinedTimeEventFullDaysEntry } from "~/logic/domain/time-event";
22
import type { TopLevelInfo } from "~/top-level-context";
3-
import { SectionCardNew } from "~/components/infra/section-card-new";
3+
import { SectionCard } from "~/components/infra/section-card";
44
import { TimeEventFullDaysBlockCard } from "~/components/domain/application/calendar/time-event-full-days-block-card";
55

66
interface TimeEventFullDaysBlockStackProps {
@@ -16,7 +16,7 @@ export function TimeEventFullDaysBlockStack(
1616
const actions = undefined;
1717

1818
return (
19-
<SectionCardNew
19+
<SectionCard
2020
id="time-event-full-days-block-stack"
2121
title={props.title}
2222
actions={actions}
@@ -27,6 +27,6 @@ export function TimeEventFullDaysBlockStack(
2727
entry={entry}
2828
/>
2929
))}
30-
</SectionCardNew>
30+
</SectionCard>
3131
);
3232
}

src/webui/app/components/domain/application/calendar/time-event-in-day-block-stack.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { CombinedTimeEventInDayEntry } from "~/logic/domain/time-event";
22
import type { TopLevelInfo } from "~/top-level-context";
33
import { NavSingle, SectionActions } from "~/components/infra/section-actions";
4-
import { SectionCardNew } from "~/components/infra/section-card-new";
4+
import { SectionCard } from "~/components/infra/section-card";
55
import { TimeEventInDayBlockCard } from "~/components/domain/application/calendar/time-event-in-day-block-card";
66

77
interface TimeEventInDayBlockStackProps {
@@ -32,7 +32,7 @@ export function TimeEventInDayBlockStack(props: TimeEventInDayBlockStackProps) {
3232
}
3333

3434
return (
35-
<SectionCardNew
35+
<SectionCard
3636
id="time-event-in-day-block-stack"
3737
title={props.title}
3838
actions={actions}
@@ -44,6 +44,6 @@ export function TimeEventInDayBlockStack(props: TimeEventInDayBlockStackProps) {
4444
userTimezone={props.topLevelInfo.user.timezone}
4545
/>
4646
))}
47-
</SectionCardNew>
47+
</SectionCard>
4848
);
4949
}

src/webui/app/components/domain/concept/inbox-task/inbox-task-properties-editor.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import {
3939
NavSingle,
4040
SectionActions,
4141
} from "~/components/infra/section-actions";
42-
import { SectionCardNew } from "~/components/infra/section-card-new";
42+
import { SectionCard } from "~/components/infra/section-card";
4343
import { ProjectSelect } from "~/components/domain/concept/project/project-select";
4444
import { IsKeySelect } from "~/components/domain/core/is-key-select";
4545
import {
@@ -172,7 +172,7 @@ export function InboxTaskPropertiesEditor(
172172
}, [props.inboxTaskInfo]);
173173

174174
return (
175-
<SectionCardNew
175+
<SectionCard
176176
title={props.title}
177177
actions={
178178
<SectionActions
@@ -551,7 +551,7 @@ export function InboxTaskPropertiesEditor(
551551
)}
552552
</Stack>
553553
</CardActions>
554-
</SectionCardNew>
554+
</SectionCard>
555555
);
556556
}
557557

src/webui/app/components/infra/entity-card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,14 @@ export function EntityLink(props: PropsWithChildren<EntityLinkProps>) {
170170
to={props.to}
171171
inline={props.inline === true ? "true" : "false"}
172172
light={props.light === true ? "true" : "false"}
173-
singleline={props.singleLine === true ? "true" : "false"}
173+
singleline={props.singleLine ? "true" : "false"}
174174
>
175175
{props.children}
176176
</StandardLink>
177177
);
178178
} else {
179179
return (
180-
<EntityFakeLink inline={props.inline} light={props.light}>
180+
<EntityFakeLink inline={props.inline} light={props.light} singleLine={props.singleLine}>
181181
{props.children}
182182
</EntityFakeLink>
183183
);

src/webui/app/components/infra/section-actions.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,18 +195,27 @@ export function FilterManyOptions<K>(
195195
};
196196
}
197197

198+
export enum ActionsExpansion {
199+
ALWAYS_SHOW,
200+
ALWAYS_COMPACT,
201+
ADAPT
202+
}
203+
198204
interface SectionActionsProps {
199205
id: string;
200206
topLevelInfo: TopLevelInfo;
201207
inputsEnabled: boolean;
208+
expansion?: ActionsExpansion;
202209
actions: Array<ActionDesc>;
203210
extraActions?: Array<ActionDesc>;
204211
}
205212

206213
export function SectionActions(props: SectionActionsProps) {
207214
const isBigScreen = useBigScreen();
215+
const expansion = props.expansion ?? ActionsExpansion.ADAPT;
208216

209-
if (!isBigScreen) {
217+
if ((expansion === ActionsExpansion.ADAPT && !isBigScreen)
218+
|| expansion === ActionsExpansion.ALWAYS_COMPACT) {
210219
const allActions = props.actions.concat(props.extraActions ?? []);
211220
return (
212221
<SectionActionsWithDialog

src/webui/app/components/infra/section-card-new.tsx renamed to src/webui/app/components/infra/section-card.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
1-
import { Card, CardContent, Chip, styled } from "@mui/material";
1+
import { Card, CardActions, CardContent, Chip, styled } from "@mui/material";
22
import { Form } from "@remix-run/react";
33
import type { PropsWithChildren } from "react";
44

5-
interface SectionCardNewProps {
5+
export enum ActionsPosition {
6+
ABOVE,
7+
BELOW
8+
}
9+
10+
interface SectionCardProps {
611
id?: string;
712
title: string;
813
actions?: JSX.Element;
14+
actionsPosition?: ActionsPosition;
915
}
1016

11-
export function SectionCardNew(props: PropsWithChildren<SectionCardNewProps>) {
17+
export function SectionCard(props: PropsWithChildren<SectionCardProps>) {
18+
const actionsPosition = props.actionsPosition ?? ActionsPosition.ABOVE;
19+
1220
return (
1321
<StyledCard id={props.id}>
1422
<Form method="post">
1523
<SectionHeader>
1624
<SectionTitle label={props.title} />
17-
{props.actions}
25+
{actionsPosition === ActionsPosition.ABOVE && props.actions}
1826
</SectionHeader>
1927
<CardContent>{props.children}</CardContent>
28+
{actionsPosition === ActionsPosition.BELOW && (
29+
<CardActions>
30+
{props.actions}
31+
</CardActions>
32+
)}
2033
</Form>
2134
</StyledCard>
2235
);

src/webui/app/logic/domain/entity-tag.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export function entityTagName(entityTag: NamedEntityTag): string {
3030
return "Chore";
3131
case NamedEntityTag.BIG_PLAN:
3232
return "Big Plan";
33+
case NamedEntityTag.BIG_PLAN_MILESTONE:
34+
return "Big Plan Milestone";
3335
case NamedEntityTag.JOURNAL:
3436
return "Journal";
3537
case NamedEntityTag.DOC:

src/webui/app/routes/app/init.tsx

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ import { GlobalPropertiesContext } from "~/global-properties-client";
5656
import { validationErrorToUIErrorInfo } from "~/logic/action-result";
5757
import { AUTH_TOKEN_NAME } from "~/names";
5858
import { commitSession, getSession } from "~/sessions";
59+
import { ActionsExpansion, ActionSingle, SectionActions } from "~/components/infra/section-actions";
60+
import { ActionsPosition, SectionCard } from "~/components/infra/section-card";
61+
import { EMPTY_CONTEXT } from "~/top-level-context";
5962

6063
const WorkspaceInitFormSchema = z.object({
6164
userEmailAddress: z.string(),
@@ -157,11 +160,24 @@ export default function WorkspaceInit() {
157160
</SmartAppBar>
158161

159162
<LifecyclePanel>
160-
<Form method="post">
161-
<Card>
162-
<GlobalError actionResult={actionData} />
163-
<CardHeader title="New Account & Workspace" />
164-
<CardContent>
163+
<GlobalError actionResult={actionData} />
164+
<SectionCard title="New Account & Workspace" actionsPosition={ActionsPosition.BELOW}
165+
actions={
166+
<SectionActions
167+
id="init"
168+
topLevelInfo={EMPTY_CONTEXT}
169+
inputsEnabled={inputsEnabled}
170+
expansion={ActionsExpansion.ALWAYS_SHOW}
171+
actions={[
172+
ActionSingle({
173+
text: "Create",
174+
value: "create",
175+
highlight: true,
176+
}),
177+
]}
178+
/>
179+
}
180+
>
165181
<Stack spacing={2} useFlexGap>
166182
<FormControl fullWidth>
167183
<InputLabel id="userEmailAddress">
@@ -329,21 +345,7 @@ export default function WorkspaceInit() {
329345
</AccordionDetails>
330346
</Accordion>
331347
</Stack>
332-
</CardContent>
333-
334-
<CardActions>
335-
<ButtonGroup>
336-
<Button
337-
variant="contained"
338-
disabled={!inputsEnabled}
339-
type="submit"
340-
>
341-
Create
342-
</Button>
343-
</ButtonGroup>
344-
</CardActions>
345-
</Card>
346-
</Form>
348+
</SectionCard>
347349

348350
<EntityActionHeader>
349351
<ButtonGroup>

src/webui/app/routes/app/workspace/big-plans/$id.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import { InboxTaskStack } from "~/components/domain/concept/inbox-task/inbox-tas
4848
import { makeLeafErrorBoundary } from "~/components/infra/error-boundary";
4949
import { FieldError, GlobalError } from "~/components/infra/errors";
5050
import { LeafPanel } from "~/components/infra/layout/leaf-panel";
51-
import { SectionCardNew } from "~/components/infra/section-card-new";
51+
import { SectionCard } from "~/components/infra/section-card";
5252
import { ProjectSelect } from "~/components/domain/concept/project/project-select";
5353
import { TimePlanActivityList } from "~/components/domain/concept/time-plan/time-plan-activity-list";
5454
import { validationErrorToUIErrorInfo } from "~/logic/action-result";
@@ -408,7 +408,8 @@ export default function BigPlan() {
408408
shouldShowALeaflet={shouldShowALeaflet}
409409
>
410410
<NestingAwareBlock shouldHide={shouldShowALeaflet}>
411-
<SectionCardNew
411+
<GlobalError actionResult={actionData} />
412+
<SectionCard
412413
id="big-plan-properties"
413414
title="Properties"
414415
actions={
@@ -430,7 +431,6 @@ export default function BigPlan() {
430431
/>
431432
}
432433
>
433-
<GlobalError actionResult={actionData} />
434434
<Stack spacing={2} useFlexGap>
435435
<Box sx={{ display: "flex", flexDirection: "row", gap: "0.25rem" }}>
436436
<FormControl sx={{ flexGrow: 3 }}>
@@ -688,7 +688,7 @@ export default function BigPlan() {
688688
)}
689689
</Stack>
690690
</CardActions>
691-
</SectionCardNew>
691+
</SectionCard>
692692

693693
<Card>
694694
{!loaderData.note && (
@@ -717,7 +717,7 @@ export default function BigPlan() {
717717
)}
718718
</Card>
719719

720-
<SectionCardNew
720+
<SectionCard
721721
id="big-plan-milestones"
722722
title="Milestones"
723723
actions={
@@ -735,9 +735,9 @@ export default function BigPlan() {
735735
}
736736
>
737737
<BigPlanMilestoneStack milestones={loaderData.milestones} />
738-
</SectionCardNew>
738+
</SectionCard>
739739

740-
<SectionCardNew
740+
<SectionCard
741741
id="big-plan-inbox-tasks"
742742
title="Inbox Tasks"
743743
actions={
@@ -771,14 +771,14 @@ export default function BigPlan() {
771771
onCardMarkNotDone={handleCardMarkNotDone}
772772
/>
773773
)}
774-
</SectionCardNew>
774+
</SectionCard>
775775

776776
{isWorkspaceFeatureAvailable(
777777
topLevelInfo.workspace,
778778
WorkspaceFeature.TIME_PLANS,
779779
) &&
780780
timePlanActivities && (
781-
<SectionCardNew
781+
<SectionCard
782782
id="big-plan-time-plan-activities"
783783
title="Time Plan Activities"
784784
>
@@ -792,7 +792,7 @@ export default function BigPlan() {
792792
timeEventsByRefId={timeEventsByRefId}
793793
fullInfo={false}
794794
/>
795-
</SectionCardNew>
795+
</SectionCard>
796796
)}
797797
</NestingAwareBlock>
798798

src/webui/app/routes/app/workspace/big-plans/$id/milestones/$milestoneId.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { getLoggedInApiClient } from "~/api-clients.server";
1313
import { makeLeafErrorBoundary } from "~/components/infra/error-boundary";
1414
import { FieldError, GlobalError } from "~/components/infra/errors";
1515
import { LeafPanel } from "~/components/infra/layout/leaf-panel";
16-
import { SectionCardNew } from "~/components/infra/section-card-new";
16+
import { SectionCard } from "~/components/infra/section-card";
1717
import {
1818
ActionSingle,
1919
SectionActions,
@@ -153,7 +153,8 @@ export default function BigPlanMilestoneView() {
153153
entityArchived={milestone.archived}
154154
returnLocation={`/app/workspace/big-plans/${milestone.big_plan_ref_id}`}
155155
>
156-
<SectionCardNew
156+
<GlobalError actionResult={actionData} />
157+
<SectionCard
157158
id="milestone-properties"
158159
title="Properties"
159160
actions={
@@ -171,7 +172,6 @@ export default function BigPlanMilestoneView() {
171172
/>
172173
}
173174
>
174-
<GlobalError actionResult={actionData} />
175175
<Stack spacing={2} useFlexGap>
176176
<Stack direction="row" spacing={2}>
177177
<FormControl sx={{ flexGrow: 3 }}>
@@ -203,7 +203,7 @@ export default function BigPlanMilestoneView() {
203203
<FieldError actionResult={actionData} fieldName="/date" />
204204
</FormControl>
205205
</Stack>
206-
</SectionCardNew>
206+
</SectionCard>
207207
</LeafPanel>
208208
);
209209
}

0 commit comments

Comments
 (0)