-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from hashicorp/CC-6223
CC-6223: Update how statuses are displayed on Cut::ListItem::Service
- Loading branch information
Showing
10 changed files
with
100 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@hashicorp/consul-ui-toolkit': minor | ||
--- | ||
|
||
Service list item now displays an overall service health status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
toolkit/src/components/cut/metadata/service-health-badge/index.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{{! | ||
Copyright (c) HashiCorp, Inc. | ||
}} | ||
|
||
<Hds::TooltipButton | ||
@text={{if | ||
this.statusIsCritical '1 or more instances is critical' | ||
(if this.statusIsWarning '1 or more instances has a warning' | ||
'All instances are healthy') | ||
}} | ||
@placement="bottom-start"> | ||
{{#if this.statusIsCritical}} | ||
<Hds::Badge | ||
@color='critical' | ||
@icon='x' | ||
@text="Critical" | ||
@size="small" | ||
data-test-service-health-check-critical | ||
/> | ||
{{else if this.statusIsWarning}} | ||
<Hds::Badge | ||
@color='warning' | ||
@icon='alert-triangle' | ||
@text="Warning" | ||
@size="small" | ||
data-test-service-health-check-warning | ||
/> | ||
{{else}} | ||
<Hds::Badge | ||
@color='success' | ||
@icon='check' | ||
@text="Healthy" | ||
@size="small" | ||
data-test-service-health-check-healthy | ||
/> | ||
{{/if}} | ||
</Hds::TooltipButton> |
18 changes: 18 additions & 0 deletions
18
toolkit/src/components/cut/metadata/service-health-badge/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
*/ | ||
|
||
import Component from '@glimmer/component'; | ||
import { MetadataServiceHealthBadgeSignature } from '../types'; | ||
|
||
export default class MetadataServiceHealthBadgeComponent extends Component<MetadataServiceHealthBadgeSignature> { | ||
get statusIsCritical() { | ||
const { criticalCount } = this.args; | ||
return criticalCount && criticalCount > 0; | ||
} | ||
|
||
get statusIsWarning() { | ||
const { warningCount } = this.args; | ||
return warningCount && warningCount > 0 && !this.statusIsCritical; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d4369d4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
consul-ui-toolkit-documentation – ./
consul-ui-toolkit-documentation-hashicorp.vercel.app
consul-ui-toolkit-documentation-git-main-hashicorp.vercel.app
consul-ui-toolkit-documentation.vercel.app