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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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