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

SUGCON 2024 EU - Created Sessions Rendering and related Content Items #401

Merged
merged 1 commit into from
Mar 13, 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
50 changes: 50 additions & 0 deletions src/Project/Sugcon2024/Sugcon/src/components/Events/Sessions.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React from 'react';
import { Field } from '@sitecore-jss/sitecore-jss-nextjs';
import useSWR from 'swr';

interface Fields {
SessionizeUrl: Field<string>;
}

type SessionsProps = {
params: { [key: string]: string };
fields: Fields;
};

const SessionsDefaultComponent = (props: SessionsProps): JSX.Element => (
<div className={`component promo ${props.params.styles}`}>
<div className="component-content">
<span className="is-empty-hint">Sessions</span>
</div>
</div>
);

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

if (!props?.fields?.SessionizeUrl?.value) {
return <SessionsDefaultComponent {...props} />;
}

//Question: linter is saying the hook shouldn't be called conditionally, but that's correct in this case?
//eslint-disable-next-line
const { data, error } = useSWR(props.fields.SessionizeUrl.value, () => fetch(props.fields.SessionizeUrl.value).then((response) => response.text()));

//TODO: design error
if (error) {
return <div>Failed to load...</div>;
}

//TODO: design loading
if (!data) {
return <div>Loading</div>;
}

return (
<div className={`component sessions ${props.params.styles}`} id={id ? id : undefined}>
<div className="component-content">
<div dangerouslySetInnerHTML={{ __html: data as string }} />
</div>
</div>
);
};
142 changes: 142 additions & 0 deletions src/Project/Sugcon2024/items/Renderings/Sugcon2024/Events/Sessions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
---
ID: "a24bd223-2c84-4ecc-9f2e-40147bea7df7"
Parent: "07aea86f-b4bd-4110-a007-d2d3e8be1697"
Template: "04646a89-996f-4ee7-878a-ffdbf1f0ef0d"
Path: /sitecore/layout/Renderings/Project/Sugcon2024/Events/Sessions
SharedFields:
- ID: "037fe404-dd19-4bf7-8e30-4dadf68b27b0"
Hint: componentName
Value: Sessions
- ID: "06d5295c-ed2f-4a54-9bf2-26228d113318"
Hint: __Icon
Value: office/32x32/list_style_bullets.png
- ID: "1a7c85e5-dc0b-490d-9187-bb1dbcb4c72f"
Hint: Datasource Template
Value: /sitecore/templates/Project/Sugcon2024/Events/Sessions
- ID: "7d8ae35f-9ed1-43b5-96a2-0a5f040d4e4e"
Hint: Open Properties after Add
Value: 0
- ID: "9c6106ea-7a5a-48e2-8cad-f0f693b1e2d4"
Hint: __Read Only
Value: 0
- ID: "a77e8568-1ab3-44f1-a664-b7c37ec7810d"
Hint: Parameters Template
Value: "{C8DF4EA0-57FE-4D1C-B3A0-3E908FC6B34F}"
- ID: "b5b27af1-25ef-405c-87ce-369b3a004016"
Hint: Datasource Location
Value: "query:./Data"
- ID: "c39a90ce-0035-41bb-90f6-3c8a6ea87797"
Hint: AddFieldEditorButton
Value:
- ID: "e829c217-5e94-4306-9c48-2634b094fdc2"
Hint: OtherProperties
Value: IsRenderingsWithDynamicPlaceholders=true
Languages:
- Language: "de-DE"
Fields:
- ID: "b5e02ad9-d56f-4c41-a065-a133db87bdeb"
Hint: __Display name
Value: Promo
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20240125T152634Z
- ID: "52807595-0f8f-4b20-8d2a-cb71d28c6103"
Hint: __Owner
Value: |
sitecore\Admin
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
sitecore\Admin
- ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
Hint: __Revision
Value: "c5100b7f-97cb-4d5a-9601-9d07dafe7323"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\Admin
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240125T152634Z
- Language: en
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20211012T120931Z
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
sitecore\JssImport
- ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
Hint: __Revision
Value: "2ff18311-634a-431c-b425-c5cb7fb4ac34"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\1ISa5gYrpM
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240313T020900Z
- Language: "ja-JP"
Fields:
- ID: "b5e02ad9-d56f-4c41-a065-a133db87bdeb"
Hint: __Display name
Value: プロモ
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20240125T152634Z
- ID: "52807595-0f8f-4b20-8d2a-cb71d28c6103"
Hint: __Owner
Value: |
sitecore\Admin
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
sitecore\Admin
- ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
Hint: __Revision
Value: "c5100b7f-97cb-4d5a-9601-9d07dafe7323"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\Admin
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240125T152634Z
- Language: "zh-CN"
Fields:
- ID: "b5e02ad9-d56f-4c41-a065-a133db87bdeb"
Hint: __Display name
Value: 促销
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20240125T152634Z
- ID: "52807595-0f8f-4b20-8d2a-cb71d28c6103"
Hint: __Owner
Value: |
sitecore\Admin
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
sitecore\Admin
- ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
Hint: __Revision
Value: "c5100b7f-97cb-4d5a-9601-9d07dafe7323"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\Admin
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240125T152634Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
ID: "2f81cd63-6e5d-4fc5-9e44-a8bec1f0f953"
Parent: "27731bab-41d9-4b88-b2d3-bd904a627573"
Template: "76da0a8d-fc7e-42b2-af1e-205b49e43f98"
Path: /sitecore/content/Sugcon2024/EU/Presentation/Available Renderings/Events
SharedFields:
- ID: "715ae6c0-71c8-4744-ab4f-65362d20ad65"
Hint: Renderings
Value: |
{3B8EB38B-326E-48F8-AB21-8AE0215D2A23}
{A24BD223-2C84-4ECC-9F2E-40147BEA7DF7}
Languages:
- Language: en
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20240308T145338Z
- ID: "52807595-0f8f-4b20-8d2a-cb71d28c6103"
Hint: __Owner
Value: |
sitecore\[email protected]
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
sitecore\[email protected]
- ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
Hint: __Revision
Value: "7370edfa-1d1f-44cb-907f-6122108db687"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\1ISa5gYrpM
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240313T023826Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
ID: "c8df4ea0-57fe-4d1c-b3a0-3e908fc6b34f"
Parent: "814fe657-4521-40e5-8cfa-6e469481cc76"
Template: "ab86861a-6030-46c5-b394-e8f99e8b87db"
Path: /sitecore/templates/Project/Sugcon2024/Events/Rendering Parameters/Sessions
SharedFields:
- ID: "06d5295c-ed2f-4a54-9bf2-26228d113318"
Hint: __Icon
Value: office/32x32/list_style_bullets.png
- ID: "12c33f3f-86c5-43a5-aeb4-5598cec45116"
Hint: __Base template
Value: |
{4247AAD4-EBDE-4994-998F-E067A51B1FE4}
{5C74E985-E055-43FF-B28C-DB6C6A6450A2}
{44A022DB-56D3-419A-B43B-E27E4D8E9C41}
{3DB3EB10-F8D0-4CC9-BE26-18CE7B139EC8}
- ID: "9c6106ea-7a5a-48e2-8cad-f0f693b1e2d4"
Hint: __Read Only
Value: 0
- ID: "f7d48a55-2158-4f02-9356-756654404f73"
Hint: __Standard values
Value: "{E8E24D73-8249-47EA-B1F4-B32EC79C0E80}"
Languages:
- Language: "de-DE"
Fields:
- ID: "b5e02ad9-d56f-4c41-a065-a133db87bdeb"
Hint: __Display name
Value: Promo
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20240125T152634Z
- ID: "52807595-0f8f-4b20-8d2a-cb71d28c6103"
Hint: __Owner
Value: |
sitecore\Admin
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
sitecore\Admin
- ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
Hint: __Revision
Value: "c5100b7f-97cb-4d5a-9601-9d07dafe7323"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\Admin
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240125T152634Z
- Language: en
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20211012T120926Z
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
sitecore\JssImport
- ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
Hint: __Revision
Value: "0091f589-a5f7-4d55-90af-296ca08f0420"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\1ISa5gYrpM
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240313T020743Z
- Language: "ja-JP"
Fields:
- ID: "b5e02ad9-d56f-4c41-a065-a133db87bdeb"
Hint: __Display name
Value: プロモ
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20240125T152634Z
- ID: "52807595-0f8f-4b20-8d2a-cb71d28c6103"
Hint: __Owner
Value: |
sitecore\Admin
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
sitecore\Admin
- ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
Hint: __Revision
Value: "c5100b7f-97cb-4d5a-9601-9d07dafe7323"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\Admin
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240125T152634Z
- Language: "zh-CN"
Fields:
- ID: "b5e02ad9-d56f-4c41-a065-a133db87bdeb"
Hint: __Display name
Value: 促销
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20240125T152634Z
- ID: "52807595-0f8f-4b20-8d2a-cb71d28c6103"
Hint: __Owner
Value: |
sitecore\Admin
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
sitecore\Admin
- ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
Hint: __Revision
Value: "c5100b7f-97cb-4d5a-9601-9d07dafe7323"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\Admin
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240125T152634Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
ID: "e8e24d73-8249-47ea-b1f4-b32ec79c0e80"
Parent: "c8df4ea0-57fe-4d1c-b3a0-3e908fc6b34f"
Template: "c8df4ea0-57fe-4d1c-b3a0-3e908fc6b34f"
Path: /sitecore/templates/Project/Sugcon2024/Events/Rendering Parameters/Sessions/__Standard Values
Languages:
- Language: en
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20211012T120926Z
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
sitecore\JssImport
- ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
Hint: __Revision
Value: "63b9acf1-f094-43f7-883f-d9db919f7035"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\1ISa5gYrpM
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240313T020730Z
Loading
Loading