Skip to content

Commit

Permalink
Adjust some typings
Browse files Browse the repository at this point in the history
Most notably the series title (in Tobira context)
was made optional, so we don't have to pass an empty
string to Tobira when it's not specified.
  • Loading branch information
owi92 committed Aug 13, 2024
1 parent 62994d0 commit ccdd703
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const NewTobiraPage = <T extends RequiredTobiraFormProps>({
goto(formik.values.breadcrumbs.splice(index)[0]);
};

const select = (page: TobiraPage | undefined) => {
const select = (page?: TobiraPage) => {
if (!page || !page.new) {
stopEditing();
}
Expand Down Expand Up @@ -161,7 +161,6 @@ const NewTobiraPage = <T extends RequiredTobiraFormProps>({
new: true,
children: [],
ancestors: [],
title: "",
path: "",
subpages: "",
blocks: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { TobiraPage } from "../../../../slices/seriesSlice";
interface RequiredFormProps {
theme: string,
acls: TransformedAcl[],
selectedPage: TobiraPage | undefined,
selectedPage?: TobiraPage,
}

const NewSeriesSummary = <T extends RequiredFormProps>({
Expand Down
4 changes: 2 additions & 2 deletions src/components/events/partials/wizards/NewSeriesWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const NewSeriesWizard: React.FC<{
acls: TransformedAcl[];
theme: string;
breadcrumbs: TobiraPage[];
selectedPage: TobiraPage | undefined;
selectedPage?: TobiraPage;
}
) => {
setSnapshot(values);
Expand All @@ -110,7 +110,7 @@ const NewSeriesWizard: React.FC<{
acls: TransformedAcl[];
theme: string;
breadcrumbs: TobiraPage[];
selectedPage: TobiraPage | undefined;
selectedPage?: TobiraPage;
},
twoPagesBack?: boolean
) => {
Expand Down
2 changes: 1 addition & 1 deletion src/configs/modalConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const initialFormValuesNewSeries: {
theme: string,

breadcrumbs: TobiraPage[],
selectedPage: TobiraPage | undefined,
selectedPage?: TobiraPage,
[key: string]: any, // Metadata fields that are getting added later
} = {
acls: [
Expand Down
2 changes: 1 addition & 1 deletion src/slices/seriesSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type Theme = {
}

export interface TobiraPage {
title: string | undefined,
title?: string,
path: string,
segment: string,
children: TobiraPage[],
Expand Down

0 comments on commit ccdd703

Please sign in to comment.