Skip to content

Commit

Permalink
fix(web-components-wrapper): don't generate default props for empty s…
Browse files Browse the repository at this point in the history
…trings (#469)
  • Loading branch information
MarcusNotheis authored May 4, 2020
1 parent b21b1f0 commit 48505d9
Show file tree
Hide file tree
Showing 94 changed files with 193 additions and 1,212 deletions.
6 changes: 4 additions & 2 deletions packages/main/scripts/create-web-components-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,9 @@ resolvedWebComponents.forEach((componentSpec) => {

propTypes.push(dedent`
/**
* ${property.description}
* ${property.description
.replace(/\n\n<br><br> /g, '<br/><br/>\n *\n * ')
.replace(/\n\n/g, '<br/><br/>\n *\n * ')}
*/
${property.name}?: ${tsType.tsType};
`);
Expand All @@ -603,7 +605,7 @@ resolvedWebComponents.forEach((componentSpec) => {
defaultProps.push(`${property.name}: ${property.defaultValue === 'true'}`);
} else if (tsType.isEnum === true) {
defaultProps.push(`${property.name}: ${tsType.tsType}.${property.defaultValue.replace(/['"]/g, '')}`);
} else {
} else if (tsType.tsType !== 'string' || (tsType.tsType === 'string' && property.defaultValue !== '""')) {
defaultProps.push(`${property.name}: ${property.defaultValue}`);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
exports[`ActionSheet Render without Crashing 1`] = `
<ui5-responsive-popover
class="ActionSheet-actionSheet-0 myCustomClass"
header-text=""
horizontal-align="Center"
initial-focus=""
placement-type="Right"
vertical-align="Center"
>
Expand All @@ -19,14 +17,12 @@ exports[`ActionSheet Render without Crashing 1`] = `
<ui5-button
data-is-action-sheet-button=""
design="Transparent"
icon=""
>
Reject
</ui5-button>
<ui5-button
data-is-action-sheet-button=""
design="Transparent"
icon=""
>
This is my super long text!
</ui5-button>
Expand All @@ -36,16 +32,13 @@ exports[`ActionSheet Render without Crashing 1`] = `
exports[`ActionSheet does not crash with other component 1`] = `
<ui5-responsive-popover
class="ActionSheet-actionSheet-0"
header-text=""
horizontal-align="Center"
initial-focus=""
placement-type="Right"
vertical-align="Center"
>
<ui5-label
data-is-action-sheet-button=""
design="Transparent"
for=""
>
I should not crash
</ui5-label>
Expand Down
Loading

0 comments on commit 48505d9

Please sign in to comment.