Skip to content

Commit df6c2a6

Browse files
committed
increase readability given multipel tooltip messages
1 parent e411dd9 commit df6c2a6

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

packages/compass-collection/src/components/collection-header-actions/collection-header-actions.tsx

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ const collectionHeaderActionsStyles = css({
3636
gap: spacing[200],
3737
});
3838

39+
const tooltipMessageStyles = css({
40+
display: 'block',
41+
marginBottom: spacing[100],
42+
'&:last-child': {
43+
marginBottom: 0,
44+
},
45+
});
46+
3947
function buildChartsUrl(
4048
groupId: string,
4149
clusterName: string,
@@ -150,13 +158,28 @@ const CollectionHeaderActions: React.FunctionComponent<
150158
>
151159
{/* TODO(CLOUDP-333853): update disabled open-modal button
152160
tooltip to communicate if schema analysis is incomplete */}
153-
{exceedsMaxNestingDepth &&
154-
'At this time we are unable to generate mock data for collections that have deeply nested documents'}
155-
{isCollectionEmpty &&
156-
'Please add data to your collection to generate similar mock documents'}
157-
{schemaAnalysisError &&
158-
schemaAnalysisError.errorType === 'unsupportedState' &&
159-
'This collection has a field with a name that contains a ".", which mock data generation does not support at this time.'}
161+
<>
162+
{exceedsMaxNestingDepth && (
163+
<span className={tooltipMessageStyles}>
164+
At this time we are unable to generate mock data for collections
165+
that have deeply nested documents.
166+
</span>
167+
)}
168+
{isCollectionEmpty && (
169+
<span className={tooltipMessageStyles}>
170+
Please add data to your collection to generate similar mock
171+
documents.
172+
</span>
173+
)}
174+
{schemaAnalysisError &&
175+
schemaAnalysisError.errorType === 'unsupportedState' && (
176+
<span className={tooltipMessageStyles}>
177+
This collection has a field with a name that contains a
178+
&quot.&quot, which mock data generation does not support at
179+
this time.
180+
</span>
181+
)}
182+
</>
160183
</Tooltip>
161184
)}
162185
{atlasMetadata && (

0 commit comments

Comments
 (0)