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

SUGCON24 EU: Fix Agenda and Sessions addition error bug #451

Merged
merged 5 commits into from
Jul 22, 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
10 changes: 6 additions & 4 deletions src/Project/Sugcon2024/Sugcon/src/components/Events/Agenda.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react';
import InnerHTML from 'dangerously-set-html-content';
import { Field } from '@sitecore-jss/sitecore-jss-nextjs';
import { Field, withDatasourceCheck } from '@sitecore-jss/sitecore-jss-nextjs';
import useSWR from 'swr';
import { ComponentProps } from 'lib/component-props';

interface Fields {
SessionizeUrl: Field<string>;
}

type AgendaProps = {
params: { [key: string]: string };
type AgendaProps = ComponentProps & {
gkLeo marked this conversation as resolved.
Show resolved Hide resolved
fields: Fields;
};

Expand All @@ -20,7 +20,7 @@ const AgendaDefaultComponent = (props: AgendaProps): JSX.Element => (
</div>
);

export const Default = (props: AgendaProps): JSX.Element => {
const AgendaComponent = (props: AgendaProps): JSX.Element => {
const id = props.params.RenderingIdentifier;

const fetcher = (url: string) => fetch(url).then((res) => res.text());
Expand Down Expand Up @@ -51,3 +51,5 @@ export const Default = (props: AgendaProps): JSX.Element => {
</div>
);
};

export const Default = withDatasourceCheck()<AgendaProps>(AgendaComponent);
10 changes: 6 additions & 4 deletions src/Project/Sugcon2024/Sugcon/src/components/Events/Sessions.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react';
import { Field } from '@sitecore-jss/sitecore-jss-nextjs';
import { Field, withDatasourceCheck } from '@sitecore-jss/sitecore-jss-nextjs';
import useSWR from 'swr';
import clsx from 'clsx';
import { Flex } from '@chakra-ui/react';
import { ComponentProps } from 'lib/component-props';

interface Fields {
SessionizeUrl: Field<string>;
}

type SessionsProps = {
params: { [key: string]: string };
type SessionsProps = ComponentProps & {
robearlam marked this conversation as resolved.
Show resolved Hide resolved
fields: Fields;
};

Expand All @@ -21,7 +21,7 @@ const SessionsDefaultComponent = (props: SessionsProps): JSX.Element => (
</div>
);

export const Default = (props: SessionsProps): JSX.Element => {
const SessionsComponent = (props: SessionsProps): JSX.Element => {
const id = props.params.RenderingIdentifier || undefined;

const fetcher = (url: string) => fetch(url).then((res) => res.text());
Expand Down Expand Up @@ -54,3 +54,5 @@ export const Default = (props: SessionsProps): JSX.Element => {
</Flex>
);
};

export const Default = withDatasourceCheck()<SessionsProps>(SessionsComponent);
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ type Story = StoryObj<typeof meta>;
export const AgendaStory: Story = {
name: 'Agenda',
args: {
rendering: {
componentName: 'Agenda',
},
params: {
styles: '',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ type Story = StoryObj<typeof meta>;
export const SessionsStory: Story = {
name: 'Sessions',
args: {
rendering: {
componentName: 'Sessions',
},
params: {
styles: '',
},
Expand Down
Loading