A few more fixes

This commit is contained in:
2024-04-26 10:33:46 -05:00
parent 3021b6e712
commit c087cdabf1
4 changed files with 38 additions and 25 deletions

View File

@@ -1,15 +1,20 @@
<!doctype html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overseas Auto Protection - Svelte</title> <title>Overseas Auto Protection - Svelte</title>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
<div id="4j2b7wf1fmjdd1g2twvxhpng4h" class="OapApplicationForm"></div> <main class="container mx-auto flex flex-col max-w-screen-md p-6">
<div
id="4j2b7wf1fmjdd1g2twvxhpng4h"
class="OapApplicationForm"
></div>
</main>
<script type="module" src="/src/main.ts"></script> <script type="module" src="/src/main.ts"></script>
</body> </body>
</html> </html>

View File

@@ -11,6 +11,7 @@
const query = graphql(/* GraphQL */ ` const query = graphql(/* GraphQL */ `
query OapApplicationForm($contentItemId: ID!) { query OapApplicationForm($contentItemId: ID!) {
oapApplicationForm(where: { contentItemId: $contentItemId }) { oapApplicationForm(where: { contentItemId: $contentItemId }) {
displayText
contentItemId contentItemId
list { list {
contentItems { contentItems {
@@ -31,15 +32,22 @@
}); });
</script> </script>
<div> {#if $content.fetching}
{#if $content.fetching} <p>Loading...</p>
<p>Loading...</p> {:else if $content.error}
{:else if $content.error} <p>Oh no... {$content.error.message}</p>
<p>Oh no... {$content.error.message}</p> {:else if !$content.data}
{:else if !$content.data} <p>No content data??</p>
<p>No content data??</p> {:else if $content.data?.oapApplicationForm}
{:else if $content.data?.oapApplicationForm} <div class="flex flex-col gap-x-4">
{#each $content.data?.oapApplicationForm as oapApplicationForm} {#each $content.data?.oapApplicationForm as oapApplicationForm}
{#if oapApplicationForm}
<h1
class="mb-6 border-b-2 border-solid border-black pb-1 text-center text-2xl font-bold"
>
{oapApplicationForm.displayText}
</h1>
{/if}
{#if oapApplicationForm?.list} {#if oapApplicationForm?.list}
{#each oapApplicationForm.list.contentItems ?? [] as contentItem} {#each oapApplicationForm.list.contentItems ?? [] as contentItem}
{#if contentItem?.__typename === "OapApplicationFormStep"} {#if contentItem?.__typename === "OapApplicationFormStep"}
@@ -48,5 +56,5 @@
{/each} {/each}
{/if} {/if}
{/each} {/each}
{/if} </div>
</div> {/if}

View File

@@ -13,7 +13,7 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-
* Therefore it is highly recommended to use the babel or swc plugin for production. * Therefore it is highly recommended to use the babel or swc plugin for production.
*/ */
const documents = { const documents = {
"\n\t\tquery OapApplicationForm($contentItemId: ID!) {\n\t\t\toapApplicationForm(where: { contentItemId: $contentItemId }) {\n\t\t\t\tcontentItemId\n\t\t\t\tlist {\n\t\t\t\t\tcontentItems {\n\t\t\t\t\t\t__typename\n\t\t\t\t\t\t...OapApplicationFormStep\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t": types.OapApplicationFormDocument, "\n\t\tquery OapApplicationForm($contentItemId: ID!) {\n\t\t\toapApplicationForm(where: { contentItemId: $contentItemId }) {\n\t\t\t\tdisplayText\n\t\t\t\tcontentItemId\n\t\t\t\tlist {\n\t\t\t\t\tcontentItems {\n\t\t\t\t\t\t__typename\n\t\t\t\t\t\t...OapApplicationFormStep\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t": types.OapApplicationFormDocument,
"\n fragment ButtonPart on Button {\n button {\n type\n text\n }\n formInputElement {\n name\n }\n formElement {\n id\n }\n }\n ": types.ButtonPartFragmentDoc, "\n fragment ButtonPart on Button {\n button {\n type\n text\n }\n formInputElement {\n name\n }\n formElement {\n id\n }\n }\n ": types.ButtonPartFragmentDoc,
"\n fragment FlowPart on FlowPart {\n widgets {\n contentType\n }\n }\n ": types.FlowPartFragmentDoc, "\n fragment FlowPart on FlowPart {\n widgets {\n contentType\n }\n }\n ": types.FlowPartFragmentDoc,
"\n\t\tfragment Form on Form {\n\t\t\tdisplayText\n\t\t\tform {\n\t\t\t\taction\n\t\t\t\tmethod\n\t\t\t}\n\t\t\tformElement {\n\t\t\t\tid\n\t\t\t}\n\t\t\tflow {\n\t\t\t\t...FlowPart\n\t\t\t}\n\t\t}\n\t": types.FormFragmentDoc, "\n\t\tfragment Form on Form {\n\t\t\tdisplayText\n\t\t\tform {\n\t\t\t\taction\n\t\t\t\tmethod\n\t\t\t}\n\t\t\tformElement {\n\t\t\t\tid\n\t\t\t}\n\t\t\tflow {\n\t\t\t\t...FlowPart\n\t\t\t}\n\t\t}\n\t": types.FormFragmentDoc,
@@ -39,7 +39,7 @@ export function graphql(source: string): unknown;
/** /**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/ */
export function graphql(source: "\n\t\tquery OapApplicationForm($contentItemId: ID!) {\n\t\t\toapApplicationForm(where: { contentItemId: $contentItemId }) {\n\t\t\t\tcontentItemId\n\t\t\t\tlist {\n\t\t\t\t\tcontentItems {\n\t\t\t\t\t\t__typename\n\t\t\t\t\t\t...OapApplicationFormStep\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t"): (typeof documents)["\n\t\tquery OapApplicationForm($contentItemId: ID!) {\n\t\t\toapApplicationForm(where: { contentItemId: $contentItemId }) {\n\t\t\t\tcontentItemId\n\t\t\t\tlist {\n\t\t\t\t\tcontentItems {\n\t\t\t\t\t\t__typename\n\t\t\t\t\t\t...OapApplicationFormStep\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t"]; export function graphql(source: "\n\t\tquery OapApplicationForm($contentItemId: ID!) {\n\t\t\toapApplicationForm(where: { contentItemId: $contentItemId }) {\n\t\t\t\tdisplayText\n\t\t\t\tcontentItemId\n\t\t\t\tlist {\n\t\t\t\t\tcontentItems {\n\t\t\t\t\t\t__typename\n\t\t\t\t\t\t...OapApplicationFormStep\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t"): (typeof documents)["\n\t\tquery OapApplicationForm($contentItemId: ID!) {\n\t\t\toapApplicationForm(where: { contentItemId: $contentItemId }) {\n\t\t\t\tdisplayText\n\t\t\t\tcontentItemId\n\t\t\t\tlist {\n\t\t\t\t\tcontentItems {\n\t\t\t\t\t\t__typename\n\t\t\t\t\t\t...OapApplicationFormStep\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t"];
/** /**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/ */

View File

@@ -3390,7 +3390,7 @@ export type OapApplicationFormQueryVariables = Exact<{
}>; }>;
export type OapApplicationFormQuery = { __typename?: 'Query', oapApplicationForm?: Array<{ __typename?: 'OapApplicationForm', contentItemId: string, list?: { __typename?: 'ListPart', contentItems?: Array<{ __typename: 'Button' } | { __typename: 'ContentMenuItem' } | { __typename: 'Form' } | { __typename: 'HtmlMenuItem' } | { __typename: 'Input' } | { __typename: 'Label' } | { __typename: 'LinkMenuItem' } | { __typename: 'Menu' } | { __typename: 'OapApplication' } | { __typename: 'OapApplicationForm' } | ( export type OapApplicationFormQuery = { __typename?: 'Query', oapApplicationForm?: Array<{ __typename?: 'OapApplicationForm', displayText?: string | null, contentItemId: string, list?: { __typename?: 'ListPart', contentItems?: Array<{ __typename: 'Button' } | { __typename: 'ContentMenuItem' } | { __typename: 'Form' } | { __typename: 'HtmlMenuItem' } | { __typename: 'Input' } | { __typename: 'Label' } | { __typename: 'LinkMenuItem' } | { __typename: 'Menu' } | { __typename: 'OapApplication' } | { __typename: 'OapApplicationForm' } | (
{ __typename: 'OapApplicationFormStep' } { __typename: 'OapApplicationFormStep' }
& { ' $fragmentRefs'?: { 'OapApplicationFormStepFragment': OapApplicationFormStepFragment } } & { ' $fragmentRefs'?: { 'OapApplicationFormStepFragment': OapApplicationFormStepFragment } }
) | { __typename: 'OapExplanation' } | { __typename: 'Select' } | { __typename: 'TextArea' } | { __typename: 'Validation' } | { __typename: 'ValidationSummary' } | null> | null } | null } | null> | null }; ) | { __typename: 'OapExplanation' } | { __typename: 'Select' } | { __typename: 'TextArea' } | { __typename: 'Validation' } | { __typename: 'ValidationSummary' } | null> | null } | null } | null> | null };
@@ -3422,4 +3422,4 @@ export const FormFragmentDoc = {"kind":"Document","definitions":[{"kind":"Fragme
export const LabelPartFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"LabelPart"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Label"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"displayText"}},{"kind":"Field","name":{"kind":"Name","value":"formElement"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"label"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"for"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"contentType"}}]}}]} as unknown as DocumentNode<LabelPartFragment, unknown>; export const LabelPartFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"LabelPart"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Label"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"displayText"}},{"kind":"Field","name":{"kind":"Name","value":"formElement"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"label"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"for"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"contentType"}}]}}]} as unknown as DocumentNode<LabelPartFragment, unknown>;
export const RichTextFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RichText"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"HtmlBodyPart"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"html"}}]}}]} as unknown as DocumentNode<RichTextFragment, unknown>; export const RichTextFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RichText"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"HtmlBodyPart"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"html"}}]}}]} as unknown as DocumentNode<RichTextFragment, unknown>;
export const OapApplicationFormStepFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"OapApplicationFormStep"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"OapApplicationFormStep"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contentItemId"}},{"kind":"Field","name":{"kind":"Name","value":"htmlBody"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RichText"}}]}},{"kind":"Field","name":{"kind":"Name","value":"flow"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FlowPart"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RichText"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"HtmlBodyPart"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"html"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FlowPart"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FlowPart"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contentType"}}]}}]}}]} as unknown as DocumentNode<OapApplicationFormStepFragment, unknown>; export const OapApplicationFormStepFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"OapApplicationFormStep"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"OapApplicationFormStep"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contentItemId"}},{"kind":"Field","name":{"kind":"Name","value":"htmlBody"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RichText"}}]}},{"kind":"Field","name":{"kind":"Name","value":"flow"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FlowPart"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RichText"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"HtmlBodyPart"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"html"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FlowPart"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FlowPart"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contentType"}}]}}]}}]} as unknown as DocumentNode<OapApplicationFormStepFragment, unknown>;
export const OapApplicationFormDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"OapApplicationForm"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"contentItemId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"oapApplicationForm"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"contentItemId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"contentItemId"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contentItemId"}},{"kind":"Field","name":{"kind":"Name","value":"list"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contentItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"OapApplicationFormStep"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RichText"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"HtmlBodyPart"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"html"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FlowPart"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FlowPart"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contentType"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"OapApplicationFormStep"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"OapApplicationFormStep"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contentItemId"}},{"kind":"Field","name":{"kind":"Name","value":"htmlBody"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RichText"}}]}},{"kind":"Field","name":{"kind":"Name","value":"flow"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FlowPart"}}]}}]}}]} as unknown as DocumentNode<OapApplicationFormQuery, OapApplicationFormQueryVariables>; export const OapApplicationFormDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"OapApplicationForm"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"contentItemId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"oapApplicationForm"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"contentItemId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"contentItemId"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"displayText"}},{"kind":"Field","name":{"kind":"Name","value":"contentItemId"}},{"kind":"Field","name":{"kind":"Name","value":"list"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contentItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"OapApplicationFormStep"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RichText"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"HtmlBodyPart"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"html"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FlowPart"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FlowPart"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contentType"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"OapApplicationFormStep"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"OapApplicationFormStep"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contentItemId"}},{"kind":"Field","name":{"kind":"Name","value":"htmlBody"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RichText"}}]}},{"kind":"Field","name":{"kind":"Name","value":"flow"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FlowPart"}}]}}]}}]} as unknown as DocumentNode<OapApplicationFormQuery, OapApplicationFormQueryVariables>;