Skip to content
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

Merged
merged 7 commits into from
Aug 8, 2024

Conversation

kimlisa
Copy link
Contributor

@kimlisa kimlisa commented Jul 30, 2024

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 a view status link
image

added a error kind to tool tip
image

@github-actions github-actions bot requested a review from gzdunek July 30, 2024 00:27
@github-actions github-actions bot added the ui label Jul 30, 2024
@github-actions github-actions bot requested a review from ryanclark July 30, 2024 00:27
Copy link

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 changelog: followed by the changelog entries for the PR.

@kimlisa kimlisa force-pushed the lisa/okta-status-page branch from 718c4d1 to fcbd5b9 Compare July 30, 2024 00:28
Copy link

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 changelog: followed by the changelog entries for the PR.

@kimlisa kimlisa changed the title Web: Add plugin status endpoint and its boilerplates (okta) Web: Add plugin status types (okta) and add error kind to ToolTIp.tsx Jul 30, 2024
@kimlisa kimlisa added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v16 labels Jul 30, 2024
@kimlisa kimlisa force-pushed the lisa/okta-status-page branch from fcbd5b9 to 1dd8cf2 Compare July 30, 2024 00:54
@ryanclark
Copy link
Contributor

ryanclark commented Jul 30, 2024

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

@gzdunek
Copy link
Contributor

gzdunek commented Jul 30, 2024

Also a UX question: should we put error messages in tooltips?
Maybe we should just always show them on the page?

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).

@roraback
Copy link
Contributor

roraback commented Jul 31, 2024

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?

I agree. A few thoughts on this:

  1. As we start to build out detail pages, I'd love for the entire row (or card) to become clickable so that users can navigate more easily.
  2. I think we should also leave the option in the dropdown, especially since other integrations (and other tables) won't be clickable, so users may go to the dropdown before realizing that the entire row is clickable.
  3. I think the View Status option should be above the delete option in the drop-down menu. Destructive actions should typically be the last option in a menu.
  4. No ellipsis after the "View Status" text in the menu. Ellipses in a menu typically indicate that a follow-up action or input is required to complete the action, but there is no required follow-up to view the status. You just go to the status page.

@roraback
Copy link
Contributor

Also a UX question: should we put error messages in tooltips?
Maybe we should just always show them on the page?

When there are sync errors, there are three warning icons. To see the actual problem, I have to click/hover them one by one (it feels inconvenient).

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.

@gzdunek
Copy link
Contributor

gzdunek commented Jul 31, 2024

If we are concerned about the errors length, we can always try the good old text ellipsis:

collapse-expand.mov

The 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.mov

But I'm not insisting on this change, I just wanted to add something to consider.

@roraback
Copy link
Contributor

roraback commented Jul 31, 2024

If we are concerned about the errors length, we can always try the good old text ellipsis:

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.

@gzdunek
Copy link
Contributor

gzdunek commented Aug 1, 2024

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 see this, thanks for explanation.

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.

Sounds good to me.

@kimlisa
Copy link
Contributor Author

kimlisa commented Aug 2, 2024

@ryanclark @gzdunek

I made the following changes:

@kimlisa kimlisa force-pushed the lisa/okta-status-page branch from ab982eb to f59c19c Compare August 2, 2024 06:34
@@ -200,6 +200,7 @@ export default class Modal extends React.Component {
data-testid="Modal"
ref={this.handleModalRef}
className={className}
onClick={e => e.stopPropagation()}
Copy link
Contributor Author

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

image

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.

@kimlisa kimlisa force-pushed the lisa/okta-status-page branch 2 times, most recently from 7054b88 to f80473a Compare August 2, 2024 06:50
rows.push(
<tr
key={rowIdx}
onClick={row?.onClick ? () => row.onClick(item) : undefined}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
onClick={row?.onClick ? () => row.onClick(item) : undefined}
onClick={() => row.onClick?.(item)}

Copy link
Contributor Author

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}
Copy link
Contributor

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 :)

Comment on lines 19 to 20
// OktaPluginSyncStatusCode indicates the possible states of an Okta
// synchronization service.
Copy link
Contributor

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,
Copy link
Contributor

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.

Comment on lines 71 to 82
/**
* Error contains a textual description of the reason the last synchronization
* failed. Only valid when StatusCode is OKTA_PLUGIN_SYNC_STATUS_CODE_ERROR.
*/
Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

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? :)

Copy link
Contributor Author

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

@kimlisa kimlisa force-pushed the lisa/okta-status-page branch from f80473a to 0d72bfe Compare August 7, 2024 04:12
@kimlisa kimlisa requested a review from gzdunek August 7, 2024 04:14
history.push(cfg.getIntegrationStatusRoute(row.kind, row.name));
}

function handleOnRowStyle(row: IntegrationLike): React.CSSProperties {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function handleOnRowClick(row: IntegrationLike) {
function handleRowClick(row: IntegrationLike) {

Copy link
Contributor

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? :)

@kimlisa kimlisa force-pushed the lisa/okta-status-page branch from fa5b8b2 to 376ef7d Compare August 7, 2024 16:27
@kimlisa kimlisa force-pushed the lisa/okta-status-page branch from 376ef7d to 510bc9e Compare August 7, 2024 16:27
@kimlisa kimlisa added this pull request to the merge queue Aug 8, 2024
Merged via the queue into master with commit fff3913 Aug 8, 2024
35 checks passed
@kimlisa kimlisa deleted the lisa/okta-status-page branch August 8, 2024 22:55
@public-teleport-github-review-bot

@kimlisa See the table below for backport results.

Branch Result
branch/v16 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/branch/v16 no-changelog Indicates that a PR does not require a changelog entry size/md ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants