-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: updated status badge appearance and organisation #936
feat: updated status badge appearance and organisation #936
Conversation
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.
Self-review.
return ( | ||
<Stack> | ||
<Toggletip | ||
content={ | ||
<div> | ||
{description} | ||
{docsLink && ( | ||
<> | ||
{` `} | ||
<TextLink href={docsLink} external variant="bodySmall"> | ||
Read more | ||
</TextLink> | ||
</> | ||
)} | ||
</div> | ||
} | ||
> | ||
<button className={styles.badgeLink} type="button"> | ||
<Badge | ||
text={ | ||
<Stack gap={0.5} alignItems={`center`}> | ||
<div>{text}</div> | ||
<Icon name={`info-circle`} size="sm" /> | ||
</Stack> | ||
} | ||
color={color} | ||
/> | ||
</button> | ||
</Toggletip> | ||
</Stack> | ||
); |
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.
@@ -73,16 +72,12 @@ export const ChooseCheckType = ({ checkType, checkTypeGroup, disabled }: ChooseC | |||
{description} | |||
</Text> | |||
)} | |||
{status ? <CheckStatusBadge status={status} /> : <BadgePlaceholder />} |
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.
This became redundant now I've added the status to the section title of the form.
{checkType === CheckType.Browser && ( | ||
<Alert severity="info" title=""> | ||
<div> | ||
Browser checks are in private preview. During the preview they are free to use: test executions will | ||
not be billed.{' '} | ||
<TextLink | ||
href="https://grafana.com/docs/grafana-cloud/cost-management-and-billing/understand-your-invoice/synthetic-monitoring-invoice/" | ||
external={true} | ||
> | ||
Read more | ||
</TextLink> | ||
</div> | ||
</Alert> | ||
)} |
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.
I didn't like that this became decoupled from the status when using useCheckTypeOptions
. We had an incident a while back (which prompted me to create the aforementioned hook) where one part of the UI said the check was in one state and another part of the UI mentioned another state, so I've removed it from here and co-located this information with the check's status.
<FormLayout.Section | ||
label={checkTypeStep1Label[checkType]} | ||
fields={[`job`, ...defineCheckFields]} | ||
status={status} |
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.
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.
Love the improvement!
@@ -31,7 +31,7 @@ const getStyles = (theme: GrafanaTheme2) => ({ | |||
}), | |||
}); | |||
|
|||
const hideTelemetryForTypes = [CheckType.Scripted, CheckType.MULTI_HTTP]; | |||
const hideTelemetryForTypes = [CheckType.Scripted, CheckType.MULTI_HTTP, CheckType.Browser]; |
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.
I thought I'd add this whilst I was there (I was considering adding the alert about them being free to this component but decided against it in the end).
@@ -80,7 +79,6 @@ export const CHECK_TYPE_GROUP_OPTIONS: CheckTypeGroupOption[] = [ | |||
description: `Monitor the availability and performance of a website using a real browser.`, | |||
value: CheckTypeGroup.Browser, | |||
icon: `globe`, | |||
status: CheckStatus.PRIVATE_PREVIEW, |
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.
Similar problem to above where I wanted all of the associated information colocated so it is easier to reason with.
@@ -40,6 +41,10 @@ export const ChooseCheckGroup = () => { | |||
const CheckGroupCard = ({ group }: { group: CheckTypeGroupOption }) => { | |||
const styles = useStyles2(getStyles); | |||
const { isOverCheckLimit, isOverScriptedLimit } = useLimits(); | |||
const checkOptions = useCheckTypeOptions().filter((option) => option.group === group.value); | |||
const checksWithStatus = checkOptions.filter((option) => option.status); | |||
const shouldShowStatus = checksWithStatus.length === checkOptions.length; |
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.
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.
👏 👏 👏
18527a7
into
browser-checks-public-preview-badge
* feat: add private preview badge to browser checks * feat: add banner on free usage for browser tests private preview * feat: updated status badge appearance and organisation (#936) --------- Co-authored-by: Chris Bedwell <christopher.bedwell@grafana.com>
Because we are on a tight schedule I thought I'd make some of the change suggestions I had for the original branch (if we didn't have a hard deadline I'd have been more polite 😅)
I'll add the explanations for the changes in a self-review of the PR.