Skip to content

Commit

Permalink
Improve naming in experiment row context menu component
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon committed Feb 24, 2023
1 parent 2a87d1f commit 5b2de94
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions webview/src/experiments/components/table/RowContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const getSingleSelectMenuOptions = (

const notExperiment = depth !== 1

const withId = (
const notRunningWithId = (
label: string,
type: MessageFromWebviewType,
hidden?: boolean,
Expand All @@ -190,35 +190,34 @@ const getSingleSelectMenuOptions = (
)

return [
withId(
notRunningWithId(
'Apply to Workspace',
MessageFromWebviewType.APPLY_EXPERIMENT_TO_WORKSPACE,
isNotExperimentOrCheckpoint
),
withId(
notRunningWithId(
'Create new Branch',
MessageFromWebviewType.CREATE_BRANCH_FROM_EXPERIMENT,
isNotExperimentOrCheckpoint
),
experimentMenuOption(
id,
notRunningWithId(
'Share to Studio',
MessageFromWebviewType.SHARE_EXPERIMENT_TO_STUDIO,
notExperiment || hasRunningExperiment,
notExperiment,
!hasRunningExperiment
),
withId(
notRunningWithId(
'Commit and Share',
MessageFromWebviewType.SHARE_EXPERIMENT_AS_COMMIT,
isNotExperimentOrCheckpoint
),
withId(
notRunningWithId(
'Share as Branch',
MessageFromWebviewType.SHARE_EXPERIMENT_AS_BRANCH,
isNotExperimentOrCheckpoint
),
...getRunResumeOptions(
withId,
notRunningWithId,
projectHasCheckpoints,
isNotExperimentOrCheckpoint,
depth
Expand All @@ -237,7 +236,7 @@ const getSingleSelectMenuOptions = (
!isRunning(status),
id !== EXPERIMENT_WORKSPACE_ID
),
withId(
notRunningWithId(
'Remove',
MessageFromWebviewType.REMOVE_EXPERIMENT,
depth !== 1,
Expand Down

0 comments on commit 5b2de94

Please sign in to comment.