Skip to content

Conversation

jmthibault79
Copy link
Collaborator

We'll need this for the new apps panel. Splitting into its own PR for ease of review.


PR checklist

  • This PR meets the Acceptance Criteria in the JIRA story
  • The JIRA story has been moved to Dev Review
  • This PR includes appropriate unit tests
  • I have added explanatory comments where the logic is not obvious
  • I have run and tested this change locally, and my testing process is described here
  • If this includes a new feature flag, I have created and linked new JIRA tickets to (a) turn on the feature flag and (b) remove it later
  • If this includes an API change, I have run the E2E tests on this change against my local server with yarn test-local because this PR won't be covered by the CircleCI tests
  • If this includes a UI change, I have taken screen recordings or screenshots of the new behavior and notified the PO and UX designer in Slack
  • If this change impacts deployment safety (e.g. removing/altering APIs which are in use) I have documented these in the description
  • If this includes an API change, I have updated the appropriate Swagger definitions and updated the appropriate API consumers

hasContent: boolean;
}

export const proIcons = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

IMO this indirection was more confusing than helpful

workspaceNamespace: string,
store: RuntimeStore
) => {
let status = store?.runtime?.status;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this logic is now inside the new RuntimeStatusIcon

import { getCdrVersion } from 'app/utils/cdr-versions';
import { ComputeSecuritySuspendedError } from 'app/utils/runtime-utils';
import {
CompoundRuntimeOpStore,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

only used by the runtime status icon

icon: IconConfig,
workspace: WorkspaceData,
store: RuntimeStore,
compoundRuntimeOps: CompoundRuntimeOpStore
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the RuntimeStatusIcon can access this store directly - no need to pass it in

<img
data-test-id={'help-sidebar-icon-' + icon.id}
src={proIcons[icon.id]}
src={thunderstorm}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's always runtime here, so this is equivalent

<img
data-test-id={'help-sidebar-icon-' + icon.id}
src={proIcons[icon.id]}
src={icon.id === 'runtime' && thunderstorm}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

equivalent logic because there's no other proIcons entry which matched a SidebarIconId

} from 'generated/fetch';

import { SelectionList } from 'app/cohort-search/selection-list/selection-list.component';
import { Clickable, StyledExternalLink } from 'app/components/buttons';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

re-sorted after linting

<h3
style={{
...styles.sectionTitle,
marginTop: 0,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

all uses of sectionTitle had this override, so it's now included

},
sectionTitle: {
marginTop: '0.5rem',
marginTop: 0,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

all uses of sectionTitle overrode marginTop with 0, so it's now included here

Copy link
Contributor

@dmohs dmohs left a comment

Choose a reason for hiding this comment

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

Fantastic inline comments.

asyncOperationStatusIcon: {
width: '.5rem',
height: '.5rem',
zIndex: 2,
Copy link
Contributor

Choose a reason for hiding this comment

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

Most uses of zIndex need a comment as to why one needs to override the browser's default layout model. Maybe the usage will make this obvious.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, it's not obvious to me why it is needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't know much about how zIndex works (and this retains the existing style's value) but perhaps this is how the circle icon gets superimposed on the thunderstorm icon?

@jmthibault79 jmthibault79 merged commit 5ddcfae into main Nov 3, 2022
@jmthibault79 jmthibault79 deleted the joel/runtime-icon branch November 3, 2022 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants