Skip to content

Commit

Permalink
fix: fully disable profile status watcher
Browse files Browse the repository at this point in the history
We removed the UI for this a while back, but forgot to remove the underlying status watcher process.
  • Loading branch information
starpit committed Oct 7, 2022
1 parent 53a8863 commit adcaa3a
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions plugins/plugin-codeflare/src/components/ProfileExplorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import {
DropdownItem,
DropdownSeparator,
KebabToggle,
Select,
SelectOption,
// Select,
// SelectOption,
Title,
TreeView,
TreeViewDataItem,
Expand All @@ -40,8 +40,8 @@ import {
import ProfileSelect from "./ProfileSelect"
// import DashboardSelect from "./DashboardSelect"
import ProfileWatcher from "../tray/watchers/profile/list"
import ProfileStatusWatcher from "../tray/watchers/profile/status"
import UpdateFunction from "../tray/update"
// import ProfileStatusWatcher from "../tray/watchers/profile/status"
// import UpdateFunction from "../tray/update"
import { handleNew, handleDelete, handleReset } from "../controller/profile/actions"

import "../../web/scss/components/ProfileExplorer/_index.scss"
Expand All @@ -60,7 +60,7 @@ type Diff = {

type State = Partial<Diff> & {
watcher: ProfileWatcher
statusWatcher: ProfileStatusWatcher
// statusWatcher: ProfileStatusWatcher
selectedProfile?: string
profiles?: Profile
catastrophicError?: unknown
Expand All @@ -84,11 +84,11 @@ export default class ProfileExplorer extends React.PureComponent<Props, State> {
this.init()
}

private readonly statusWatcherUpdateFn: UpdateFunction = () => {
/* private readonly statusWatcherUpdateFn: UpdateFunction = () => {
this.setState((curState) => ({
updateCount: (curState?.updateCount || 0) + 1,
}))
}
} */

/** If given `null`, then we will attempt to use the lastUsed profile */
private readonly _handleProfileSelection = (selectedProfile: string | null) => {
Expand Down Expand Up @@ -212,8 +212,8 @@ export default class ProfileExplorer extends React.PureComponent<Props, State> {
public componentDidUpdate(prevProps: Props, prevState: State) {
if (prevState?.selectedProfile !== this.state?.selectedProfile) {
if (!this.state?.selectedProfile) return
const statusWatcher = new ProfileStatusWatcher(this.state.selectedProfile, this.statusWatcherUpdateFn)
this.setState({ statusWatcher })
// const statusWatcher = new ProfileStatusWatcher(this.state.selectedProfile, this.statusWatcherUpdateFn)
// this.setState({ statusWatcher })
}
}

Expand All @@ -224,15 +224,15 @@ export default class ProfileExplorer extends React.PureComponent<Props, State> {
return <Loading />
} else {
return (
// profileReadiness={this.state.statusWatcher?.readiness}
// profileStatus={this.state.statusWatcher}
<div className="codeflare--profile-explorer flex-fill">
<ProfileCard
profile={this.state.selectedProfile}
profiles={this.state.profiles}
profilesDiff={this.state.profilesDiff}
onSelectProfile={this._handleProfileSelection}
onSelectGuidebook={this.props.onSelectGuidebook}
profileReadiness={this.state.statusWatcher?.readiness}
profileStatus={this.state.statusWatcher}
/>
</div>
)
Expand All @@ -246,8 +246,8 @@ type ProfileCardProps = Partial<Diff> &
profiles: Profile
onSelectProfile: (profile: string | null) => void

profileReadiness: string
profileStatus: ProfileStatusWatcher
// profileReadiness: string
// profileStatus: ProfileStatusWatcher
}

type ProfileCardState = {
Expand Down Expand Up @@ -316,7 +316,7 @@ class ProfileCard extends React.PureComponent<ProfileCardProps, ProfileCardState
)
}

private actionsStatus() {
/* private actionsStatus() {
const StatusTitle = ({ readiness }: { readiness: string | undefined }) => (
<React.Fragment>
<span>Status</span>
Expand All @@ -339,7 +339,7 @@ class ProfileCard extends React.PureComponent<ProfileCardProps, ProfileCardState
<SelectOption isPlaceholder>{this.props.profileStatus?.workers.label}</SelectOption>
</Select>
)
}
} */

private readonly groups: Record<string, Group> = {
Application: {
Expand Down

0 comments on commit adcaa3a

Please sign in to comment.