Skip to content

Commit

Permalink
fix(alerts): app level links to use specification colors (#1632)
Browse files Browse the repository at this point in the history
## PR Checklist

Please check if your PR fulfills the following requirements:

- [x] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
- [ ] If applicable, have a visual design approval

## PR Type

What kind of change does this PR introduce?

- [x] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] Other... Please describe:

## What is the current behavior?
Links in app level alerts have default link colors.

Issue Number: CDE-2467

## What is the new behavior?
Links in app level alerts follow the alert color specification.

## Does this PR introduce a breaking change?

- [ ] Yes
- [x] No

## Other information

---------

Co-authored-by: GitHub <[email protected]>
  • Loading branch information
valentin-mladenov and web-flow authored Dec 2, 2024
1 parent c3f558d commit 6107962
Show file tree
Hide file tree
Showing 30 changed files with 35 additions and 9 deletions.
32 changes: 29 additions & 3 deletions .storybook/stories/alert/app-level-alert.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ const template = `
(clrAlertClosedChange)="clrAlertClosedChange($event)"
>
<clr-alert-item *ngFor="let _ of createArray(itemCount); let i = index">
<span class="alert-text">{{ content }} {{ i + 1 }}</span>
<span class="alert-text">
{{ content }} {{ i + 1 }}
<a href="javascript://">
<cds-icon shape="user"></cds-icon>
Reset to green
</a>
</span>
<div *ngIf="showActions" class="alert-actions">
<button class="btn alert-action">Fix</button>
<button class="btn alert-action">Ignore</button>
Expand Down Expand Up @@ -122,7 +128,7 @@ const PaginatedTemplate: StoryFn = args => ({
template: `
<clr-alerts [clrCurrentAlertIndex]="clrCurrentAlertIndex">
<clr-alert
*ngFor="let alert of ALERT_TYPES"
*ngFor="let alert of ALERT_TYPES; let i = index"
[clrAlertAppLevel]="true"
[clrAlertClosable]="clrAlertClosable"
[clrAlertIcon]="clrAlertIcon"
Expand All @@ -131,7 +137,17 @@ const PaginatedTemplate: StoryFn = args => ({
(clrAlertClosedChange)="clrAlertClosedChange($event)"
>
<clr-alert-item>
<span class="alert-text">{{ content }} {{ alert }}</span>
<span class="alert-text">
{{ content }} {{ i + 1 }}
<a href="javascript://">
<cds-icon shape="user"></cds-icon>
Reset to green
</a>
</span>
<div *ngIf="showActions" class="alert-actions">
<button class="btn alert-action">Fix</button>
<button class="btn alert-action">Ignore</button>
</div>
</clr-alert-item>
</clr-alert>
</clr-alerts>
Expand Down Expand Up @@ -160,6 +176,16 @@ export const Paginated: StoryObj = {
},
};

export const PaginatedWithActions: StoryObj = {
render: PaginatedTemplate,
argTypes: paginatedArgTypes,
args: {
...paginatedArgs,
clrAlertClosable: false,
showActions: true,
},
};

export const PaginatedClosable: StoryObj = {
render: PaginatedTemplate,
argTypes: paginatedArgTypes,
Expand Down
12 changes: 6 additions & 6 deletions projects/angular/src/emphasis/alert/_alert.clarity.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@
background: alert-variables.getAlertColor($alertType, bg-color);
color: alert-variables.getAlertColor($alertType, color);

& a {
& .alert-items .alert-item a {
color: alert-variables.getAlertColor($alertType, color);

cds-icon,
clr-icon {
fill: alert-variables.getAlertColor($alertType, color);
}
}

$border-prop: alert-variables.getAlertColor($alertType, border-color);
Expand Down Expand Up @@ -362,11 +367,6 @@
.close {
margin: var(--cds-global-space-4) 0;
}

.alert-action,
.dropdown-toggle {
text-decoration: none;
}
}

.alert-sm {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6107962

Please sign in to comment.