Skip to content

Commit

Permalink
Merge pull request #415 from ericsanner/feature/78-error-message
Browse files Browse the repository at this point in the history
Feature/78 error message
  • Loading branch information
robearlam authored Mar 21, 2024
2 parents 4afa73e + 6e4b2a1 commit 34a496b
Show file tree
Hide file tree
Showing 16 changed files with 1,222 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Project/Sugcon2024/Sugcon/public/red-speech-bubble.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React from 'react';
import { Box, Heading, Text, Flex } from '@chakra-ui/react';
import {
TextField,
Text as JssText,
RichTextField,
RichText as JssRichText,
} from '@sitecore-jss/sitecore-jss-nextjs';

// Define the type of props that ErrorMessage will accept
interface Fields {
/** Headline of the ErrorMessage */
Headline: TextField;

/** Richtext of the ErrorMessage */
Text: RichTextField;

/** StatusCode of the ErrorMessage */
StatusCode: TextField;
}

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

export const Default = (props: ErrorMessageProps): JSX.Element => {
return (
<Flex
direction={{ base: 'column', md: 'row' }}
my="20"
mx={{ base: '20px', md: 'auto' }}
columnGap={20}
>
<Box
fontSize="80px"
fontWeight="bold"
textColor="red"
textAlign={'center'}
p="20px"
mb={{ base: '20px', md: '0' }}
backgroundImage="url('/red-speech-bubble.svg')"
backgroundRepeat="no-repeat"
backgroundPosition="center"
minW={'216px'}
minH={'217px'}
>
<Text as={JssText} field={props.fields.StatusCode} />
</Box>
<Box flex="1" maxW={{ md: '400px' }} alignSelf="center">
<Heading as="h2" fontSize="30px" fontWeight="bold" mb="10px" textColor="red">
<JssText field={props.fields.Headline} />
</Heading>
<Text as={JssRichText} mb={6} fontSize="18px" field={props.fields.Text} />
</Box>
</Flex>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Meta, StoryObj } from '@storybook/react';
import { Default as ErrorMessage } from '../../../components/Basic Components/ErrorMessage';
const meta = {
title: 'Basic Components/Error Message',
component: ErrorMessage,
parameters: {},
tags: ['autodocs'],
argTypes: {},
} satisfies Meta<typeof ErrorMessage>;
export default meta;
type Story = StoryObj<typeof meta>;
export const ErrorMsg: Story = {
name: 'Error Message',
args: {
params: {},
fields: {
Text: {
value: "The page you've requested could not be found, please check the URL and try again.",
},
Headline: {
value: 'Page Not Found',
},
StatusCode: {
value: '404',
},
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
ID: "5b8c8c41-f345-4d22-bf4d-d89722e74708"
Parent: "6f3393fc-0bcf-43fa-9ee2-47dcff255efc"
Template: "3aea335c-d06d-45b1-841a-cbc8d2d1ce40"
Path: /sitecore/system/Settings/Project/Sugcon2024/Basic Components/Basic Components Headless Site Setup/Add Error Messages Data Item
SharedFields:
- ID: "52c91c75-6698-4701-a8a2-242ace59a8d6"
Hint: Location
Value: "{BA2F959D-A614-4C92-8B57-F1FC1A323ABE}"
- ID: "7868e6bc-525c-4fce-ab8a-77da3e09b171"
Hint: Name
Value: Error Message
- ID: "e62c28f0-9d3b-46e2-8bec-a5e120542499"
Hint: Template
Value: "{04480AE3-AED6-485F-B887-1D63B184B636}"
Languages:
- Language: en
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20240319T164301Z
- ID: "52807595-0f8f-4b20-8d2a-cb71d28c6103"
Hint: __Owner
Value: |
sitecore\UOUBIWQRx7
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
sitecore\UOUBIWQRx7
- ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
Hint: __Revision
Value: "ad701a5b-02f7-4d9a-9b36-df3428447ee5"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\UOUBIWQRx7
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240319T164301Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
---
ID: "0704f498-1ff6-43a1-8b6a-cdd2bea7a7cf"
Parent: "ddc6ed3d-2e47-4945-a316-9a5304a0db3b"
Template: "04646a89-996f-4ee7-878a-ffdbf1f0ef0d"
Path: /sitecore/layout/Renderings/Project/Sugcon2024/Basic Components/Error Message
SharedFields:
- ID: "037fe404-dd19-4bf7-8e30-4dadf68b27b0"
Hint: componentName
Value: ErrorMessage
- ID: "06d5295c-ed2f-4a54-9bf2-26228d113318"
Hint: __Icon
Value: Office/32x32/window_close.png
- ID: "1a7c85e5-dc0b-490d-9187-bb1dbcb4c72f"
Hint: Datasource Template
Value: /sitecore/templates/Project/Sugcon2024/Basic Components/Error Message
- ID: "7d8ae35f-9ed1-43b5-96a2-0a5f040d4e4e"
Hint: Open Properties after Add
Value: 0
- ID: "9c6106ea-7a5a-48e2-8cad-f0f693b1e2d4"
Hint: __Read Only
Value:
- ID: "a77e8568-1ab3-44f1-a664-b7c37ec7810d"
Hint: Parameters Template
Value: "{F220EB4B-7C0B-4C8B-8EF9-552684625BA1}"
- ID: "b5b27af1-25ef-405c-87ce-369b3a004016"
Hint: Datasource Location
Value: "query:$site/*[@@name='Data']/*[@@templatename='Error Message Folder']|query:$sharedSites/*[@@name='Data']/*[@@templatename='Error Message Folder']"
- 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: "76f20ec2-3d34-4a17-841c-0f9e6f59de65"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\UOUBIWQRx7
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240319T165032Z
- 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
31 changes: 31 additions & 0 deletions src/Project/Sugcon2024/items/SiteEU/EU/Data/Error Messages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
ID: "9be2e328-702e-4a32-918f-640bb30e62d2"
Parent: "968dab46-6eda-4775-8a0f-85037e2d92f2"
Template: "04480ae3-aed6-485f-b887-1d63b184b636"
Path: /sitecore/content/Sugcon2024/EU/Data/Error Messages
Languages:
- Language: en
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20240319T165246Z
- ID: "52807595-0f8f-4b20-8d2a-cb71d28c6103"
Hint: __Owner
Value: |
sitecore\UOUBIWQRx7
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
sitecore\UOUBIWQRx7
- ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
Hint: __Revision
Value: "1050ca40-f1b8-42c0-ae3e-15fa3a81bdad"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\UOUBIWQRx7
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240319T165246Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
ID: "9fa8e061-a6f0-4f16-8a14-3044074b5835"
Parent: "0c5c8db1-5dc6-4a54-a232-750f004bfb84"
Template: "04480ae3-aed6-485f-b887-1d63b184b636"
Path: /sitecore/content/Sugcon2024/Shared/Data/Error Messages
Languages:
- Language: en
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20240319T165311Z
- ID: "52807595-0f8f-4b20-8d2a-cb71d28c6103"
Hint: __Owner
Value: |
sitecore\UOUBIWQRx7
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
sitecore\UOUBIWQRx7
- ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
Hint: __Revision
Value: "3ae54e27-792e-4495-b840-1a19af8f0e48"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\UOUBIWQRx7
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240319T165311Z
Loading

0 comments on commit 34a496b

Please sign in to comment.