-
Notifications
You must be signed in to change notification settings - Fork 10
[risk=low][RW-9006] Extract a runtime-status-icon component #7118
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
Conversation
hasContent: boolean; | ||
} | ||
|
||
export const proIcons = { |
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.
IMO this indirection was more confusing than helpful
workspaceNamespace: string, | ||
store: RuntimeStore | ||
) => { | ||
let status = store?.runtime?.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.
this logic is now inside the new RuntimeStatusIcon
import { getCdrVersion } from 'app/utils/cdr-versions'; | ||
import { ComputeSecuritySuspendedError } from 'app/utils/runtime-utils'; | ||
import { | ||
CompoundRuntimeOpStore, |
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.
only used by the runtime status icon
icon: IconConfig, | ||
workspace: WorkspaceData, | ||
store: RuntimeStore, | ||
compoundRuntimeOps: CompoundRuntimeOpStore |
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.
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} |
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.
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} |
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.
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'; |
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.
re-sorted after linting
<h3 | ||
style={{ | ||
...styles.sectionTitle, | ||
marginTop: 0, |
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.
all uses of sectionTitle had this override, so it's now included
c490920
to
f524c23
Compare
}, | ||
sectionTitle: { | ||
marginTop: '0.5rem', | ||
marginTop: 0, |
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.
all uses of sectionTitle overrode marginTop
with 0, so it's now included here
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.
Fantastic inline comments.
asyncOperationStatusIcon: { | ||
width: '.5rem', | ||
height: '.5rem', | ||
zIndex: 2, |
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.
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.
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.
Okay, it's not obvious to me why it is needed.
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 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?
We'll need this for the new apps panel. Splitting into its own PR for ease of review.
PR checklist