Skip to content

Commit

Permalink
Improve naming in experiment row context menu component (#3346)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon authored Feb 24, 2023
1 parent cab0207 commit 79a3cd9
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 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,
!hasRunningExperiment
notExperiment,
true
),
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 79a3cd9

Please sign in to comment.