Skip to content

Commit

Permalink
Small fixes following #229 (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadorequest authored Dec 20, 2020
1 parent 30d83e9 commit 5a04c14
Show file tree
Hide file tree
Showing 11 changed files with 180 additions and 167 deletions.
1 change: 1 addition & 0 deletions public/static/images/LOGO_Powered_by_UNLY_BLACK_BLUE.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 0 additions & 54 deletions public/static/images/LOGO_Powered_by_UNLY_monochrome_WHITE.svg

This file was deleted.

13 changes: 9 additions & 4 deletions src/airtableSchema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AirtableSchema } from './types/airtableDataset/AirtableSchema';
import { GenericPostConsolidationTransformationValueInputProps } from './types/airtableDataset/FieldSchema';
import { Product } from './types/data/Product';

type Props = {}

Expand Down Expand Up @@ -53,7 +52,12 @@ export const getAirtableSchema = (props?: Props): AirtableSchema => {
},
},
serviceLabel: {},
privacyDescription: {},
termsDescription: {
isI18n: true,
},
privacyDescription: {
isI18n: true,
},
},
},
Product: {
Expand All @@ -71,7 +75,7 @@ export const getAirtableSchema = (props?: Props): AirtableSchema => {
const { sanitizedRecord: product } = props;
return product?.imagesTitle?.split(', ') || [];
},
}
},
},
description: {
isI18n: true,
Expand All @@ -95,10 +99,11 @@ export const getAirtableSchema = (props?: Props): AirtableSchema => {
onSurfaceColor: {},
errorColor: {},
onErrorColor: {},
fonts: {},
logo: {
transformations: {
asSingleRecord: true,
}
},
},
logoTitle: {},
},
Expand Down
17 changes: 16 additions & 1 deletion src/components/appBootstrap/MultiversalAppBootstrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { detectLightHouse } from '../../utils/quality/lighthouse';
import { detectCypress } from '../../utils/testing/cypress';
import Loader from '../animations/Loader';
import DefaultErrorLayout from '../errors/DefaultErrorLayout';
import ErrorDebug from '../errors/ErrorDebug';
import BrowserPageBootstrap, { BrowserPageBootstrapProps } from './BrowserPageBootstrap';
import MultiversalGlobalStyles from './MultiversalGlobalStyles';
import ServerPageBootstrap, { ServerPageBootstrapProps } from './ServerPageBootstrap';
Expand Down Expand Up @@ -95,12 +96,26 @@ const MultiversalAppBootstrap: React.FunctionComponent<Props> = (props): JSX.Ele
}: SSGPageProps | SSRPageProps = pageProps;
configureSentryI18n(lang, locale);

if (typeof serializedDataset !== 'string') {
return (
<ErrorDebug
error={new Error(`Fatal error - Unexpected "serializedDataset" passed as page props.\n
Expecting string, but got "${typeof serializedDataset}".\n
This error is often caused by returning an invalid "serializedDataset" from a getStaticProps/getServerSideProps.\n
Make sure you return a correct value, using "serializeSafe".`)}
context={{
pageProps,
}}
/>
);
}

if (process.env.NEXT_PUBLIC_APP_STAGE !== 'production') {
// XXX It's too cumbersome to do proper typings when type changes
// The "customer" was forwarded as a JSON-ish string (using Flatten) in order to avoid circular dependencies issues (SSG/SSR)
// It now being converted back into an object to be actually usable on all pages
// eslint-disable-next-line no-console
console.debug('pageProps.serializedDataset length (bytes)', (serializedDataset as unknown as string).length);
console.debug('pageProps.serializedDataset length (bytes)', (serializedDataset as unknown as string)?.length);
// console.debug('serializedDataset', serializedDataset);
}

Expand Down
Loading

1 comment on commit 5a04c14

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.