Better naming for step enum

This commit is contained in:
tidy-dev 2021-02-19 10:22:44 -05:00
parent 752510f671
commit 671f9bc6df
3 changed files with 12 additions and 6 deletions

View file

@ -13,7 +13,7 @@ export interface ICherryPickSnapshot {
/** Union type representing the possible states of the cherry pick flow */
export type CherryPickFlowStep = ChooseTargetBranchesStep
export const enum CherryPickStep {
export const enum CherryPickStepKind {
/**
* The initial state of a cherry pick.
*
@ -26,7 +26,7 @@ export const enum CherryPickStep {
/** Shape of data needed to choose the base branch for a cherry pick */
export type ChooseTargetBranchesStep = {
readonly kind: CherryPickStep.ChooseTargetBranch
readonly kind: CherryPickStepKind.ChooseTargetBranch
readonly defaultBranch: Branch | null
readonly currentBranch: Branch
readonly allBranches: ReadonlyArray<Branch>

View file

@ -122,7 +122,10 @@ import { LocalChangesOverwrittenDialog } from './local-changes-overwritten/local
import memoizeOne from 'memoize-one'
import { AheadBehindStore } from '../lib/stores/ahead-behind-store'
import { CherryPickFlow } from './cherry-pick/cherry-pick-flow'
import { CherryPickStep, ChooseTargetBranchesStep } from '../models/cherry-pick'
import {
CherryPickStepKind,
ChooseTargetBranchesStep,
} from '../models/cherry-pick'
import { getAccountForRepository } from '../lib/get-account-for-repository'
const MinuteInMilliseconds = 1000 * 60
@ -2737,7 +2740,7 @@ export class App extends React.Component<IAppProps, IAppState> {
}
const initialStep: ChooseTargetBranchesStep = {
kind: CherryPickStep.ChooseTargetBranch,
kind: CherryPickStepKind.ChooseTargetBranch,
defaultBranch,
currentBranch,
allBranches,

View file

@ -2,7 +2,10 @@ import * as React from 'react'
import { assertNever } from '../../lib/fatal-error'
import { Branch } from '../../models/branch'
import { CherryPickFlowStep, CherryPickStep } from '../../models/cherry-pick'
import {
CherryPickFlowStep,
CherryPickStepKind,
} from '../../models/cherry-pick'
import { Repository } from '../../models/repository'
import { Dispatcher } from '../dispatcher'
@ -31,7 +34,7 @@ export class CherryPickFlow extends React.Component<ICherryPickFlowProps> {
const { step } = this.props
switch (step.kind) {
case CherryPickStep.ChooseTargetBranch: {
case CherryPickStepKind.ChooseTargetBranch: {
const {
allBranches,
defaultBranch,