From c087cdabf10b7a078e4c1285a624d0963ab52dde Mon Sep 17 00:00:00 2001 From: Ben Ramey Date: Fri, 26 Apr 2024 10:33:46 -0500 Subject: [PATCH] A few more fixes --- src/OAP/Oap.Theme.Svelte/index.html | 27 ++++++++++-------- .../src/OapApplicationForm.svelte | 28 ++++++++++++------- src/OAP/Oap.Theme.Svelte/src/gql/gql.ts | 4 +-- src/OAP/Oap.Theme.Svelte/src/gql/graphql.ts | 4 +-- 4 files changed, 38 insertions(+), 25 deletions(-) diff --git a/src/OAP/Oap.Theme.Svelte/index.html b/src/OAP/Oap.Theme.Svelte/index.html index 42d98dd..8c4957b 100644 --- a/src/OAP/Oap.Theme.Svelte/index.html +++ b/src/OAP/Oap.Theme.Svelte/index.html @@ -1,15 +1,20 @@ - + - - - - Overseas Auto Protection - Svelte - - -
+ + + + Overseas Auto Protection - Svelte + + +
-
+
+
+
- - + + diff --git a/src/OAP/Oap.Theme.Svelte/src/OapApplicationForm.svelte b/src/OAP/Oap.Theme.Svelte/src/OapApplicationForm.svelte index 89f5cc6..c4f36da 100644 --- a/src/OAP/Oap.Theme.Svelte/src/OapApplicationForm.svelte +++ b/src/OAP/Oap.Theme.Svelte/src/OapApplicationForm.svelte @@ -11,6 +11,7 @@ const query = graphql(/* GraphQL */ ` query OapApplicationForm($contentItemId: ID!) { oapApplicationForm(where: { contentItemId: $contentItemId }) { + displayText contentItemId list { contentItems { @@ -31,15 +32,22 @@ }); -
- {#if $content.fetching} -

Loading...

- {:else if $content.error} -

Oh no... {$content.error.message}

- {:else if !$content.data} -

No content data??

- {:else if $content.data?.oapApplicationForm} +{#if $content.fetching} +

Loading...

+{:else if $content.error} +

Oh no... {$content.error.message}

+{:else if !$content.data} +

No content data??

+{:else if $content.data?.oapApplicationForm} +
{#each $content.data?.oapApplicationForm as oapApplicationForm} + {#if oapApplicationForm} +

+ {oapApplicationForm.displayText} +

+ {/if} {#if oapApplicationForm?.list} {#each oapApplicationForm.list.contentItems ?? [] as contentItem} {#if contentItem?.__typename === "OapApplicationFormStep"} @@ -48,5 +56,5 @@ {/each} {/if} {/each} - {/if} -
+
+{/if} diff --git a/src/OAP/Oap.Theme.Svelte/src/gql/gql.ts b/src/OAP/Oap.Theme.Svelte/src/gql/gql.ts index 7ad0506..dff15a2 100644 --- a/src/OAP/Oap.Theme.Svelte/src/gql/gql.ts +++ b/src/OAP/Oap.Theme.Svelte/src/gql/gql.ts @@ -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. */ 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 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, @@ -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. */ -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. */ diff --git a/src/OAP/Oap.Theme.Svelte/src/gql/graphql.ts b/src/OAP/Oap.Theme.Svelte/src/gql/graphql.ts index 49a5bda..d57dc6f 100644 --- a/src/OAP/Oap.Theme.Svelte/src/gql/graphql.ts +++ b/src/OAP/Oap.Theme.Svelte/src/gql/graphql.ts @@ -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' } & { ' $fragmentRefs'?: { 'OapApplicationFormStepFragment': OapApplicationFormStepFragment } } ) | { __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; 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; 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; -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; \ No newline at end of file +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; \ No newline at end of file