зеркало из https://github.com/mozilla/treeherder.git
Bug 1720447 - Alerts View - Refresh in place starred alerts (#7212)
This commit is contained in:
Родитель
f0f1776f40
Коммит
0a3f6d1aeb
|
@ -376,6 +376,7 @@ export default class AlertTable extends React.Component {
|
|||
selectedAlerts={selectedAlerts}
|
||||
updateViewState={updateViewState}
|
||||
modifyAlert={modifyAlert}
|
||||
fetchAlertSummaries={fetchAlertSummaries}
|
||||
/>
|
||||
))}
|
||||
{downstreamIdsLength > 0 && (
|
||||
|
|
|
@ -81,7 +81,7 @@ export default class AlertTableRow extends React.Component {
|
|||
|
||||
toggleStar = async () => {
|
||||
const { starred } = this.state;
|
||||
const { alert } = this.props;
|
||||
const { alert, fetchAlertSummaries, alertSummary } = this.props;
|
||||
const updatedStar = {
|
||||
starred: !starred,
|
||||
};
|
||||
|
@ -91,7 +91,10 @@ export default class AlertTableRow extends React.Component {
|
|||
updatedStar,
|
||||
);
|
||||
|
||||
if (failureStatus) {
|
||||
if (!failureStatus) {
|
||||
// now refresh UI, by syncing with backend
|
||||
fetchAlertSummaries(alertSummary.id);
|
||||
} else {
|
||||
return this.props.updateViewState({
|
||||
errorMessages: [`Failed to update alert ${alert.id}: ${data}`],
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче