Skip to content

Commit

Permalink
Merge pull request #151 from pantheon-systems/PCC-840-smart-component…
Browse files Browse the repository at this point in the history
…-fields-need-an-optional-default-value

PCC 840 Add defaultValue type to smart component map.
  • Loading branch information
kevinstubbs authored Dec 27, 2023
2 parents 843ac36 + 2934b62 commit ae7af27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/core/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const baseFieldSchema = z.object({
type: fieldTypes,
displayName: z.string(),
required: z.boolean(),
defaultValue: z.union([z.string(), z.number(), z.boolean()]).optional(),
});

const optionsSchema = z.array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ const PantheonTreeRenderer = ({
) ?? [];

if (element.tag === "component") {
const componentType =
(element.attrs?.type as string | undefined)?.toUpperCase() ??
// Backwards compatibility
element.type?.toUpperCase();
const componentType = element.type?.toUpperCase();

if (!componentType) {
return null;
Expand Down

0 comments on commit ae7af27

Please sign in to comment.