Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ScmAmendComponent

Hierarchy

Index

Constructors

Properties

lastCommitHeight: number = 0
toDisposeOnUnmount: DisposableCollection = ...
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

  • 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>

  • buildAmendingList(lastCommit: undefined | ScmCommit): Promise<{ avatar: string; commit: ScmCommit }[]>
  • clearAmending(): Promise<void>
  • clearAmendingCommits(): Promise<void>
  • 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(): Promise<void>
  • componentWillUnmount(): void
  • doClearAmending(): Promise<void>
  • doUnamendAll(): Promise<void>
  • fetchStatusAndSetState(): Promise<void>
  • getLastCommit(): Promise<undefined | { avatar: string; commit: ScmCommit }>
  • getStorageKey(): string
  • lastCommitScrollRef(instance: HTMLDivElement): void
  • onNextFrame(callback: FrameRequestCallback): void
  • render(): Element
  • renderAmendCommitListButtons(): ReactNode
  • renderAmendingCommits(): ReactNode
  • renderCommitAvatarAndDetail(commitData: { avatar: string; commit: ScmCommit }): ReactNode
  • renderCommitBeingAmended(commitData: { avatar: string; commit: ScmCommit }, isOldestAmendCommit: boolean): Element
  • renderCommitCount(commits: number): ReactNode
  • renderLastCommit(): ReactNode
  • renderLastCommitNoButton(lastCommit: { avatar: string; commit: ScmCommit }): ReactNode
  • resetAndSetMessage(commitToRestore: string, commitToUseForMessage: undefined | string): Promise<void>
  • styleAmendedCommits(): CSSProperties
  • styleLastCommit(transitionState: "start" | "transitioning", startingMarginTop: number, startingMarginBottom: number): CSSProperties
  • styleLastCommitMovingDown(transitionState: "start" | "transitioning"): CSSProperties
  • styleLastCommitMovingUp(transitionState: "start" | "transitioning"): CSSProperties
  • unamend(): Promise<void>
  • unamendAll(): Promise<void>