Merge pull request #18371 from desktop/more-alertdialogs

Turn more dialogs into `alertdialog`
This commit is contained in:
Sergio Padrino 2024-04-02 15:20:44 +02:00 committed by GitHub
commit bfa8f0663e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 5 deletions

View file

@ -84,10 +84,12 @@ export class DiscardChanges extends React.Component<
loading={isDiscardingChanges}
disabled={isDiscardingChanges}
type="warning"
role="alertdialog"
ariaDescribedBy="discard-changes-confirmation-file-list discard-changes-confirmation-message"
>
<DialogContent>
{this.renderFileList()}
<p>
<p id="discard-changes-confirmation-message">
Changes can be restored by retrieving them from the {TrashNameLabel}
.
</p>
@ -130,14 +132,14 @@ export class DiscardChanges extends React.Component<
private renderFileList() {
if (this.props.files.length > MaxFilesToList) {
return (
<p>
<p id="discard-changes-confirmation-file-list">
Are you sure you want to discard all {this.props.files.length} changed
files?
</p>
)
} else {
return (
<div>
<div id="discard-changes-confirmation-file-list">
<p>Are you sure you want to discard all changes to:</p>
<div className="file-list">
<ul>

View file

@ -51,10 +51,14 @@ export class WarnForcePushDialog extends React.Component<
onSubmit={this.onBegin}
backdropDismissable={false}
type="warning"
role="alertdialog"
ariaDescribedBy="warn-force-push-confirmation-title warn-force-push-confirmation-message"
>
<DialogContent>
<p>Are you sure you want to {operation.toLowerCase()}?</p>
<p>
<p id="warn-force-push-confirmation-title">
Are you sure you want to {operation.toLowerCase()}?
</p>
<p id="warn-force-push-confirmation-message">
At the end of the {operation.toLowerCase()} flow, GitHub Desktop
will enable you to force push the branch to update the upstream
branch. Force pushing will alter the history on the remote and