Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ScmAmendComponent

Hierarchy

Index

Constructors

constructor

Properties

Protected lastCommitHeight

lastCommitHeight: number = 0

Protected Readonly toDisposeOnUnmount

toDisposeOnUnmount: DisposableCollection = ...

Protected transitionHint

transitionHint: "none" | "amend" | "unamend" = 'none'

a hint on how to animate an update, set by certain user action handlers and used when updating the view based on a repository change

Methods

Protected amend

  • amend(): Promise<void>
  • This function will update the 'model' (lastCommit, amendingCommits) only when the repository sees the last commit change. 'render' can be called at any time, so be sure we don't update any 'model' fields until we actually start the transition.

    Returns Promise<void>

Private buildAmendingList

  • buildAmendingList(lastCommit: undefined | ScmCommit): Promise<{ avatar: string; commit: ScmCommit }[]>

Readonly clearAmending

  • clearAmending(): Promise<void>

Private clearAmendingCommits

  • clearAmendingCommits(): Promise<void>

Private commitsAreEqual

  • commitsAreEqual(lastCommit: undefined | ScmCommit, savedLastCommitId: undefined | string): boolean
  • Commits are equal if the ids are equal or if both are undefined. (If a commit is undefined, it represents the initial empty state of a repository, before the initial commit).

    Parameters

    • lastCommit: undefined | ScmCommit
    • savedLastCommitId: undefined | string

    Returns boolean

componentDidMount

  • componentDidMount(): Promise<void>

componentWillUnmount

  • componentWillUnmount(): void

Protected doClearAmending

  • doClearAmending(): Promise<void>

Protected doUnamendAll

  • doUnamendAll(): Promise<void>

fetchStatusAndSetState

  • fetchStatusAndSetState(): Promise<void>

Protected getLastCommit

  • getLastCommit(): Promise<undefined | { avatar: string; commit: ScmCommit }>

Private getStorageKey

  • getStorageKey(): string

lastCommitScrollRef

  • lastCommitScrollRef(instance: HTMLDivElement): void

Protected onNextFrame

  • onNextFrame(callback: FrameRequestCallback): void

render

  • render(): Element

Protected renderAmendCommitListButtons

  • renderAmendCommitListButtons(): ReactNode

Protected renderAmendingCommits

  • renderAmendingCommits(): ReactNode

Protected renderCommitAvatarAndDetail

  • renderCommitAvatarAndDetail(commitData: { avatar: string; commit: ScmCommit }): ReactNode

Protected renderCommitBeingAmended

  • renderCommitBeingAmended(commitData: { avatar: string; commit: ScmCommit }, isOldestAmendCommit: boolean): Element

Protected renderCommitCount

  • renderCommitCount(commits: number): ReactNode

Protected renderLastCommit

  • renderLastCommit(): ReactNode

Protected renderLastCommitNoButton

  • renderLastCommitNoButton(lastCommit: { avatar: string; commit: ScmCommit }): ReactNode

Private resetAndSetMessage

  • resetAndSetMessage(commitToRestore: string, commitToUseForMessage: undefined | string): Promise<void>

Protected styleAmendedCommits

  • styleAmendedCommits(): CSSProperties

Protected styleLastCommit

  • styleLastCommit(transitionState: "start" | "transitioning", startingMarginTop: number, startingMarginBottom: number): CSSProperties

Protected styleLastCommitMovingDown

  • styleLastCommitMovingDown(transitionState: "start" | "transitioning"): CSSProperties

Protected styleLastCommitMovingUp

  • styleLastCommitMovingUp(transitionState: "start" | "transitioning"): CSSProperties

Protected unamend

  • unamend(): Promise<void>

Readonly unamendAll

  • unamendAll(): Promise<void>