-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web: Add plugin status types (okta) and add error
kind to ToolTIp.tsx
#44788
Conversation
The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with |
718c4d1
to
fcbd5b9
Compare
The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with |
error
kind to ToolTIp.tsx
fcbd5b9
to
1dd8cf2
Compare
I feel like this option being hidden under "Options" would mean no one would know its there - can the row be clickable, or can we display "View Status" as a button and have a delete icon button too? cc @roraback |
Also a UX question: should we put error messages in tooltips? When there are sync errors (screesnohst), there are three warning icons. To see the actual problem, I have to click/hover them one by one (it feels inconvenient). |
I agree. A few thoughts on this:
|
I hear you here, but trying to show errors inline can make the page look quite messy if we don't know what length we need to plan for. That said, I think it might be good to show some error text along the lines of "Failed 3m ago" alongside the warning icon, and make the whole thing a tooltip target so you have a bigger area to hover than just a little square icon. What do you think about that @gzdunek @kimlisa ? It still requires hovering for the details, but it gives you a bit more insight on the recency and provides a bigger hover target. |
If we are concerned about the errors length, we can always try the good old text ellipsis: collapse-expand.movThe thing I don't like in tooltips is that often they have poor accessibility, especially on touch devices. For example, when it shows on hover, copying its content is impossible: tooltip.copy.movBut I'm not insisting on this change, I just wanted to add something to consider. |
I thought about this as well. The problem I see is that it still is problematic for the layout of a dashboard, particularly where you have two tiles side-by-side. If you expand the one tile, you're either also expanding the tile next to it with a lot of empty space or you're leaving a bunch of empty space below that tile. If we did this kind of behavior, I'd want it to be like the Resources tiles when you overflow the labels—it expands but overlaps the next tile below it until you stop hovering, at which point it snaps back. I hear you on the accessibility concern though... If copying the error message would be useful, we could make it open on hover, but stay open on click so that if they click on it, it isn't dismissed until they click away. |
I see this, thanks for explanation.
Sounds good to me. |
I made the following changes:
|
ab982eb
to
f59c19c
Compare
@@ -200,6 +200,7 @@ export default class Modal extends React.Component { | |||
data-testid="Modal" | |||
ref={this.handleModalRef} | |||
className={className} | |||
onClick={e => e.stopPropagation()} |
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 couldn't see an issue with this, but the reason why i had to was because of this
the whole row had a click handler, and there is another click handler with options
, if i didn't stop the modal propagation, once a user clicks on options
and click away from it, it still triggered the rows click handler.
7054b88
to
f80473a
Compare
rows.push( | ||
<tr | ||
key={rowIdx} | ||
onClick={row?.onClick ? () => row.onClick(item) : undefined} |
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.
onClick={row?.onClick ? () => row.onClick(item) : undefined} | |
onClick={() => row.onClick?.(item)} |
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 did as you suggested, but it doesn't matter right that it's still technically calling a function (but nothings happening b/c it's undefined)
<tr | ||
key={rowIdx} | ||
onClick={row?.onClick ? () => row.onClick(item) : undefined} | ||
style={row?.onStyle ? row.onStyle(item) : undefined} |
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 think getStyle
would make more sense here :)
// OktaPluginSyncStatusCode indicates the possible states of an Okta | ||
// synchronization service. |
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.
Can we convert these comments to JSDoc?
// OktaPluginSyncStatusCode indicates the possible states of an Okta | ||
// synchronization service. | ||
export enum PluginOktaSyncStatusCode { | ||
// is the status code zero value, |
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'd explicitly assign numbers to enum values.
/** | ||
* Error contains a textual description of the reason the last synchronization | ||
* failed. Only valid when StatusCode is OKTA_PLUGIN_SYNC_STATUS_CODE_ERROR. | ||
*/ |
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.
We could enforce this via types:
export type OktaUserSyncDetails = {
lastSuccess: Date;
lastFailed: Date;
enabled: boolean;
numUsers: number;
} & (
| {
statusCode:
| PluginOktaSyncStatusCode.Success
| PluginOktaSyncStatusCode.Unspecified;
}
| {
statusCode: PluginOktaSyncStatusCode.Error;
/**
* Contains a textual description of the reason the last synchronization
* failed.
*/
error: string;
}
);
But I will leave it up to you, it may be a slight overkill for this case.
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.
left it as is
appFilters: string[]; | ||
groupFilters: string[]; | ||
defaultOwners: string[]; | ||
error: string; |
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 error is also available only if status code is OKTA_PLUGIN_SYNC_STATUS_CODE_ERROR
?
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.
oktastatustypes.ts
I see the Go convention, but TBH I'm not sure if it should be applied to JS code. I'd stick with camelCase.
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.
Does the 👍 mean that you wanted to address it? :)
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.
renamed. that was so strange, i thought i renamed it
- Allow on row click handler - Allow custom row styler (func to conditionally apply styles)
f80473a
to
0d72bfe
Compare
history.push(cfg.getIntegrationStatusRoute(row.kind, row.name)); | ||
} | ||
|
||
function handleOnRowStyle(row: IntegrationLike): React.CSSProperties { |
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.
function handleOnRowStyle(row: IntegrationLike): React.CSSProperties { | |
function getRowStyle(row: IntegrationLike): React.CSSProperties { |
@@ -65,11 +66,27 @@ type Props<IntegrationLike> = { | |||
type IntegrationLike = Integration | Plugin | ExternalAuditStorageIntegration; | |||
|
|||
export function IntegrationList(props: Props<IntegrationLike>) { | |||
const history = useHistory(); | |||
|
|||
function handleOnRowClick(row: IntegrationLike) { |
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.
function handleOnRowClick(row: IntegrationLike) { | |
function handleRowClick(row: IntegrationLike) { |
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.
Does the 👍 mean that you wanted to address it? :)
fa5b8b2
to
376ef7d
Compare
376ef7d
to
510bc9e
Compare
related: #44431
🛑 do not merge: backend work is required that is TBD, it may change some fields in this PR
this PR contains just the necessary changes to implement the okta status page located in enterprise
in the
integrations
list, only okta will have aview status
linkadded a
error
kind to tool tip