Skip to content

Commit c6361bf

Browse files
authored
fix: [M3-9796] - Notice icon, padding, and dark mode (#12065)
## Changes 🔄 - Fix icon not changing in dark mode - Fix left padding - All notices/banners have icons associated now without the need for important - Removed important references from the codebase and stories No need for changeset since this isn't released yet. I did a quick pass-through and haven't noticed any regressions ## How to test 🧪 ### Verification steps (How to verify changes) - [ ] Check notices/banners for regressions across the codebase in dark mode, various sizes, and storybook
1 parent 6b5f8a8 commit c6361bf

File tree

63 files changed

+172
-323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+172
-323
lines changed

packages/manager/cypress/e2e/core/objectStorageGen2/bucket-object-gen2.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ describe('Object Storage Gen2 bucket object tests', () => {
413413
cy.findByText(mockRegions[0].label).should('be.visible');
414414
});
415415
// warning message
416-
cy.findByTestId('notice-warning-important').within(() => {
416+
cy.findByTestId('notice-warning').within(() => {
417417
cy.contains(
418418
`There was an error loading buckets in ${mockRegions[1].label}`
419419
);
@@ -463,7 +463,7 @@ describe('Object Storage Gen2 bucket object tests', () => {
463463
// table with retrieved bucket
464464
cy.get('table tbody tr').should('have.length', 1);
465465
// warning message
466-
cy.findByTestId('notice-warning-important').within(() => {
466+
cy.findByTestId('notice-warning').within(() => {
467467
cy.contains(
468468
'There was an error loading buckets in the following regions:'
469469
);

packages/manager/src/components/AbuseTicketBanner/AbuseTicketBanner.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const AbuseTicketBanner = () => {
3333

3434
const href = multiple
3535
? '/support/tickets'
36-
: abuseTickets[0].entity?.url ?? '';
36+
: (abuseTickets[0].entity?.url ?? '');
3737
const isViewingTicket = location.pathname.match(href);
3838

3939
return (
@@ -43,7 +43,6 @@ export const AbuseTicketBanner = () => {
4343
expiry: DateTime.utc().plus({ days: 7 }).toISO(),
4444
label: preferenceKey,
4545
}}
46-
important
4746
preferenceKey={preferenceKey}
4847
variant="warning"
4948
>

packages/manager/src/components/DismissibleBanner/DismissibleBanner.stories.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type Story = StoryObj<typeof DismissibleBanner>;
1111

1212
export const Default: Story = {
1313
render: (args) => (
14-
<DismissibleBanner {...args} important variant="info">
14+
<DismissibleBanner {...args} variant="info">
1515
<Typography>This is an example of a dismissible banner.</Typography>
1616
</DismissibleBanner>
1717
),
@@ -29,7 +29,6 @@ export const CallToActionBanner: Story = {
2929
</Button>
3030
}
3131
forceImportantIconVerticalCenter
32-
important
3332
preferenceKey="cluster-v1"
3433
variant="info"
3534
>
@@ -60,12 +59,11 @@ export const BetaBanner: Story = {
6059
export const InfoWithLongTextAndMarkup: StoryObj = {
6160
render: () => (
6261
<DismissibleBanner
63-
important
6462
preferenceKey="lenghty-dismissible-banner"
6563
variant="info"
6664
>
6765
<Typography variant="h2">
68-
This is an important, dismissible informational notice with a title.
66+
This is a dismissible informational notice with a title.
6967
</Typography>
7068
<Typography>This notice contains long text that should wrap.</Typography>
7169
</DismissibleBanner>

packages/manager/src/components/DismissibleBanner/DismissibleBanner.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ export const DismissibleBanner = (props: Props) => {
6363
'& svg': {
6464
width: 16,
6565
height: 16,
66+
'& path': {
67+
fill: theme.tokens.component.NotificationBanner.Icon,
68+
},
6669
},
6770
})}
6871
>

packages/manager/src/components/MaintenanceBanner/MaintenanceBanner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const MaintenanceBanner = React.memo((props: Props) => {
6868
}
6969

7070
return (
71-
<Notice important variant="warning">
71+
<Notice variant="warning">
7272
<Typography lineHeight="20px">
7373
{generateIntroText(type, maintenanceStart, maintenanceEnd)}
7474
</Typography>

packages/manager/src/components/ProductInformationBanner/ProductInformationBanner.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ export const ProductInformationBanner = React.memo(
2929
return null;
3030
}
3131

32-
const isImportantBanner =
33-
thisBanner.decoration.important === 'true'
34-
? true
35-
: thisBanner.decoration.important === 'false'
36-
? false
37-
: true;
38-
3932
let hasBannerExpired = true;
4033
try {
4134
hasBannerExpired = isAfter(
@@ -52,7 +45,6 @@ export const ProductInformationBanner = React.memo(
5245

5346
return (
5447
<DismissibleBanner
55-
important={isImportantBanner}
5648
preferenceKey={`${bannerLocation}-${thisBanner.expirationDate}`}
5749
variant={thisBanner.decoration.variant ?? 'warning'}
5850
{...rest}

packages/manager/src/components/ProductNotification/ProductNotification.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,5 @@ export const ProductNotification = ({
2222
const level = (severityLevelMap[severity] as NoticeVariant) ?? 'warning';
2323
const props = { variant: level };
2424

25-
return (
26-
<Notice {...props} important>
27-
{text}
28-
</Notice>
29-
);
25+
return <Notice {...props}>{text}</Notice>;
3026
};

packages/manager/src/features/Account/AccountLogins.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ const AccountLogins = () => {
165165
isChildUser,
166166
resourceType: 'Account',
167167
})}
168-
important
169168
variant="warning"
170169
/>
171170
);

packages/manager/src/features/Account/CloseAccountDialog.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ interface Props {
1919
}
2020

2121
const CloseAccountDialog = ({ closeDialog, open }: Props) => {
22-
const [isClosingAccount, setIsClosingAccount] = React.useState<boolean>(
23-
false
24-
);
22+
const [isClosingAccount, setIsClosingAccount] =
23+
React.useState<boolean>(false);
2524
const [errors, setErrors] = React.useState<APIError[] | undefined>(undefined);
2625
const [comments, setComments] = React.useState<string>('');
2726
const history = useHistory();
@@ -103,11 +102,10 @@ const CloseAccountDialog = ({ closeDialog, open }: Props) => {
103102
) : null}
104103
<StyledNoticeWrapper>
105104
<Notice
105+
spacingBottom={12}
106106
sx={(theme) => ({
107107
border: `1px solid ${theme.tokens.alias.Action.Negative.Default}`,
108108
})}
109-
important
110-
spacingBottom={12}
111109
variant="error"
112110
>
113111
<Typography sx={{ fontSize: '0.875rem' }}>

packages/manager/src/features/Backups/BackupsCTA.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ export const BackupsCTA = () => {
6666
<IconButton
6767
aria-label="Dismiss notice enabling Linode backups"
6868
onClick={handleDismiss}
69-
sx={{ padding: 0.25 }}
69+
sx={(theme) => ({
70+
padding: 0.25,
71+
'& path': {
72+
fill: theme.tokens.component.NotificationBanner.Icon,
73+
},
74+
})}
7075
>
7176
<CloseIcon />
7277
</IconButton>

0 commit comments

Comments
 (0)