Skip to content

Commit 7ce44d0

Browse files
florinbiltArchaeopteryx
authored andcommitted
FXP-3970 and FXP-4371 (#9035)
* FXP-3970 - Automate linking the bug after filling a bug in Alerts View FXP-4371 - Disable the File bug button after clicking it until we get a response * add const bugzillaIssueTracker * remove bugzillaIssueTracker * lint fix
1 parent 1856081 commit 7ce44d0

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

ui/perfherder/alerts/FileBugModal.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default class FileBugModal extends React.Component {
2424
inputValue: '',
2525
invalidInput: false,
2626
validated: false,
27+
disableButton: false,
2728
};
2829
}
2930

@@ -52,9 +53,10 @@ export default class FileBugModal extends React.Component {
5253
};
5354

5455
handleSubmit = async (event, inputValue) => {
56+
this.setState({ disableButton: true });
5557
const { updateAndClose } = this.props;
5658
await updateAndClose(event, inputValue);
57-
this.setState({ inputValue: '' });
59+
this.setState({ inputValue: '', disableButton: false });
5860
};
5961

6062
render() {
@@ -68,7 +70,7 @@ export default class FileBugModal extends React.Component {
6870
errorMessage,
6971
} = this.props;
7072

71-
const { inputValue, invalidInput, validated } = this.state;
73+
const { inputValue, invalidInput, validated, disableButton } = this.state;
7274

7375
const infoText =
7476
'Leaving the input empty will open an enter bug screen prefilled with the default values.\n' +
@@ -122,7 +124,7 @@ export default class FileBugModal extends React.Component {
122124
<Button
123125
className="btn-outline-darker-info active"
124126
onClick={(event) => this.handleSubmit(event, inputValue)}
125-
disabled={invalidInput && !validated}
127+
disabled={(invalidInput && !validated) || disableButton}
126128
type="submit"
127129
>
128130
{(inputValue.length &&

ui/perfherder/alerts/StatusDropdown.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ export default class StatusDropdown extends React.Component {
181181
};
182182
}
183183
window.open(`${bzBaseUrl}show_bug.cgi?id=${createResult.data.id}`);
184+
185+
// Link to bug
186+
const params = {
187+
bug_number: parseInt(createResult.data.id, 10),
188+
};
189+
this.changeAlertSummary(params);
190+
184191
return {
185192
failureStatus: null,
186193
};

0 commit comments

Comments
 (0)