Skip to content

Commit

Permalink
Merge pull request #414 from carloslancha/SoyFixes
Browse files Browse the repository at this point in the history
Empty string for contentRenderers are mandatory to make it work in java
  • Loading branch information
jbalsas authored Jan 16, 2018
2 parents d0f2148 + 999584f commit cc82deb
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 18 deletions.
10 changes: 6 additions & 4 deletions packages/clay-card/src/ClayCard.soy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
href: string,
label: string,
separator: bool
]> | ?}
]>}
{@param? contentRenderer: string}
{@param? disabled: bool}
{@param? elementClasses: string}
Expand Down Expand Up @@ -49,8 +49,10 @@
{/if}
{/let}

{let $variant: $contentRenderer ?: '' /}

{let $descriptiveArea kind="html"}
{delcall ClayCard.DescriptiveArea variant="$contentRenderer"}
{delcall ClayCard.DescriptiveArea variant="$variant"}
{param actionItems: $actionItems /}
{param href: $href /}
{param labels: $labels /}
Expand All @@ -62,7 +64,7 @@
{/let}

{let $visualArea kind="html"}
{delcall ClayCard.VisualArea variant="$contentRenderer"}
{delcall ClayCard.VisualArea variant="$variant"}
{param fileType: $fileType /}
{param fileTypeStyle: $fileTypeStyle /}
{param icon: $icon /}
Expand Down Expand Up @@ -111,7 +113,7 @@
href: string,
label: string,
separator: bool
]> | ?}
]>}
{@param? href: string}
{@param? labels: list<?>}
{@param? labelStylesMap: ?}
Expand Down
2 changes: 1 addition & 1 deletion packages/clay-card/src/ClayFileCard.soy
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
href: string,
label: string,
separator: bool
]> | ?}
]>}
{@param? disabled: bool}
{@param? elementClasses: string}
{@param? fileType: string}
Expand Down
4 changes: 2 additions & 2 deletions packages/clay-card/src/ClayHorizontalCard.soy
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
href: string,
label: string,
separator: bool
]> | ?}
]>}
{@param? disabled: bool}
{@param? elementClasses: string}
{@param? groupName: string}
Expand Down Expand Up @@ -83,7 +83,7 @@
href: string,
label: string,
separator: bool
]> | ?}
]>}
{@param? href: string}
{@param? icon: string}

Expand Down
2 changes: 1 addition & 1 deletion packages/clay-card/src/ClayImageCard.soy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
href: string,
label: string,
separator: bool
]> | ?}
]>}
{@param? disabled: bool}
{@param? elementClasses: string}
{@param? fileType: string}
Expand Down
4 changes: 2 additions & 2 deletions packages/clay-card/src/ClayUserCard.soy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
href: string,
label: string,
separator: bool
]> | ?}
]>}
{@param? disabled: bool}
{@param? elementClasses: string}
{@param? groupName: string}
Expand Down Expand Up @@ -67,7 +67,7 @@
href: string,
label: string,
separator: bool
]> | ?}
]>}
{@param? href: string}
{@param? labels: list<?>}
{@param? labelStylesMap: ?}
Expand Down
5 changes: 1 addition & 4 deletions packages/clay-card/src/action_items_validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ let actionItemShape = {
type: Config.oneOf(['group', 'item']).value('item'),
};

const actionItemsValidator = Config.oneOfType([
Config.arrayOf(Config.shapeOf(actionItemShape)),
Config.object(),
]);
const actionItemsValidator = Config.arrayOf(Config.shapeOf(actionItemShape));

actionItemShape.items = actionItemsValidator;

Expand Down
4 changes: 2 additions & 2 deletions packages/clay-dataset-display/src/ClayDatasetDisplay.soy
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
quickAction: bool,
separator: bool,
type: string
]> | ?}
]>}
{@param? creationMenu: [
button: ?,
caption: string,
Expand Down Expand Up @@ -112,7 +112,7 @@
{/call}

{if $views and isNonnull($selectedView)}
{let $variant: $views[$selectedView].contentRenderer /}
{let $variant: $views[$selectedView].contentRenderer ?: '' /}

{delcall ClayDatasetDisplay.List variant="$variant"}
{param handleItemToggled_: $handleItemToggled_ /}
Expand Down
2 changes: 1 addition & 1 deletion packages/clay-dropdown/src/ClayDropdownBase.soy
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
{call .sections}
{param button: $button /}
{param caption: $caption /}
{param contentRenderer: $contentRenderer /}
{param contentRenderer: $contentRenderer ?: '' /}
{param expanded: $expanded /}
{param handleButtonClick_: $handleButtonClick_ /}
{param handleItemClick_: $handleItemClick_ /}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
{/call}
{else}
{call .default}
{param contentRenderer: $contentRenderer /}
{param contentRenderer: $contentRenderer ?: '' /}
{param creationMenu: $creationMenu /}
{param elementClasses: $elementClasses /}
{param filterItems: $filterItems /}
Expand Down

0 comments on commit cc82deb

Please sign in to comment.