Remove unused commitMessage and commitSHA props

We believe these weren't needed due to a redesign

Co-Authored-By: Sergio Padrino <1083228+sergiou87@users.noreply.github.com>
This commit is contained in:
Markus Olsson 2023-12-05 15:34:55 +01:00
parent 4897f2fc49
commit eb0f39cfe7
7 changed files with 3 additions and 38 deletions

View file

@ -7437,8 +7437,6 @@ export class AppStore extends TypedBaseStore<IAppState> {
public onChecksFailedNotification = async ( public onChecksFailedNotification = async (
repository: RepositoryWithGitHubRepository, repository: RepositoryWithGitHubRepository,
pullRequest: PullRequest, pullRequest: PullRequest,
commitMessage: string,
commitSha: string,
checks: ReadonlyArray<IRefCheck> checks: ReadonlyArray<IRefCheck>
) => { ) => {
const selectedRepository = const selectedRepository =
@ -7449,8 +7447,6 @@ export class AppStore extends TypedBaseStore<IAppState> {
pullRequest, pullRequest,
repository, repository,
shouldChangeRepository: true, shouldChangeRepository: true,
commitMessage,
commitSha,
checks, checks,
} }

View file

@ -4,7 +4,6 @@ import { PullRequest, getPullRequestCommitRef } from '../../models/pull-request'
import { RepositoryWithGitHubRepository } from '../../models/repository' import { RepositoryWithGitHubRepository } from '../../models/repository'
import { Dispatcher, defaultErrorHandler } from '../../ui/dispatcher' import { Dispatcher, defaultErrorHandler } from '../../ui/dispatcher'
import { API, APICheckConclusion, IAPIComment } from '../api' import { API, APICheckConclusion, IAPIComment } from '../api'
import { getCommit } from '../git'
import { showNotification } from '../notifications/show-notification' import { showNotification } from '../notifications/show-notification'
import { import {
isValidNotificationPullRequestReview, isValidNotificationPullRequestReview,
@ -226,8 +225,6 @@ export class NotificationsDebugStore {
commit_sha: commitSha, commit_sha: commitSha,
} }
const commit = await getCommit(repository, commitSha)
const numberOfFailedChecks = checks.filter( const numberOfFailedChecks = checks.filter(
check => check.conclusion === APICheckConclusion.Failure check => check.conclusion === APICheckConclusion.Failure
).length ).length
@ -239,13 +236,7 @@ export class NotificationsDebugStore {
const title = 'Pull Request checks failed' const title = 'Pull Request checks failed'
const body = `${pullRequest.title} #${pullRequest.pullRequestNumber} (${shortSHA})\n${numberOfFailedChecks} ${pluralChecks} not successful.` const body = `${pullRequest.title} #${pullRequest.pullRequestNumber} (${shortSHA})\n${numberOfFailedChecks} ${pluralChecks} not successful.`
const onClick = () => { const onClick = () => {
dispatcher.onChecksFailedNotification( dispatcher.onChecksFailedNotification(repository, pullRequest, checks)
repository,
pullRequest,
commit?.summary ?? 'Could not load commit summary',
commitSha,
checks
)
} }
showNotification({ showNotification({

View file

@ -41,8 +41,6 @@ import { NotificationCallback } from 'desktop-notifications/dist/notification-ca
export type OnChecksFailedCallback = ( export type OnChecksFailedCallback = (
repository: RepositoryWithGitHubRepository, repository: RepositoryWithGitHubRepository,
pullRequest: PullRequest, pullRequest: PullRequest,
commitMessage: string,
commitSha: string,
checkRuns: ReadonlyArray<IRefCheck> checkRuns: ReadonlyArray<IRefCheck>
) => void ) => void
@ -403,13 +401,7 @@ export class NotificationsStore {
const onClick = () => { const onClick = () => {
this.statsStore.increment('checksFailedNotificationClicked') this.statsStore.increment('checksFailedNotificationClicked')
this.onChecksFailedCallback?.( this.onChecksFailedCallback?.(repository, pullRequest, checks)
repository,
pullRequest,
commit.summary,
commitSHA,
checks
)
} }
if (skipNotification) { if (skipNotification) {

View file

@ -351,8 +351,6 @@ export type PopupDetail =
repository: RepositoryWithGitHubRepository repository: RepositoryWithGitHubRepository
pullRequest: PullRequest pullRequest: PullRequest
shouldChangeRepository: boolean shouldChangeRepository: boolean
commitMessage: string
commitSha: string
checks: ReadonlyArray<IRefCheck> checks: ReadonlyArray<IRefCheck>
} }
| { | {

View file

@ -2344,8 +2344,6 @@ export class App extends React.Component<IAppProps, IAppState> {
shouldChangeRepository={popup.shouldChangeRepository} shouldChangeRepository={popup.shouldChangeRepository}
repository={popup.repository} repository={popup.repository}
pullRequest={popup.pullRequest} pullRequest={popup.pullRequest}
commitMessage={popup.commitMessage}
commitSha={popup.commitSha}
checks={popup.checks} checks={popup.checks}
accounts={this.state.accounts} accounts={this.state.accounts}
onSubmit={onPopupDismissedFn} onSubmit={onPopupDismissedFn}

View file

@ -3923,16 +3923,8 @@ export class Dispatcher {
public onChecksFailedNotification( public onChecksFailedNotification(
repository: RepositoryWithGitHubRepository, repository: RepositoryWithGitHubRepository,
pullRequest: PullRequest, pullRequest: PullRequest,
commitMessage: string,
commitSha: string,
checks: ReadonlyArray<IRefCheck> checks: ReadonlyArray<IRefCheck>
) { ) {
this.appStore.onChecksFailedNotification( this.appStore.onChecksFailedNotification(repository, pullRequest, checks)
repository,
pullRequest,
commitMessage,
commitSha,
checks
)
} }
} }

View file

@ -36,8 +36,6 @@ interface IPullRequestChecksFailedProps {
readonly accounts: ReadonlyArray<Account> readonly accounts: ReadonlyArray<Account>
readonly repository: RepositoryWithGitHubRepository readonly repository: RepositoryWithGitHubRepository
readonly pullRequest: PullRequest readonly pullRequest: PullRequest
readonly commitMessage: string
readonly commitSha: string
readonly checks: ReadonlyArray<IRefCheck> readonly checks: ReadonlyArray<IRefCheck>
readonly onSubmit: () => void readonly onSubmit: () => void
readonly onDismissed: () => void readonly onDismissed: () => void