Bug 1577532 - Reflect new job classified status after using BugFiler (#5518)

This commit is contained in:
Cameron Dawson 2019-10-16 08:13:18 -07:00 коммит произвёл GitHub
Родитель 56bb1827ed
Коммит 48c5941a75
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -476,8 +476,8 @@ export class BugFilerClass extends React.Component {
);
if (!failureStatus) {
successCallback(data);
toggle();
successCallback(data);
} else {
this.submitFailure('Treeherder Bug Filer API', failureStatus, data);
}

Просмотреть файл

@ -114,9 +114,13 @@ class PinBoard extends React.Component {
});
};
saveClassification = async job => {
const { recalculateUnclassifiedCounts, notify } = this.props;
saveClassification = async pinnedJob => {
const { recalculateUnclassifiedCounts, notify, jobMap } = this.props;
const classification = this.createNewClassification();
// Ensure the version of the job we have is the one that is displayed in
// the main job field. Not the "full" selected job instance only shown in
// the job details panel.
const job = jobMap[pinnedJob.id];
// classification can be left unset making this a no-op
if (classification.failure_classification_id > 0) {
@ -131,6 +135,8 @@ class PinBoard extends React.Component {
// update the job to show that it's now classified
const jobInstance = findJobInstance(job.id);
// Filter in case we are hiding unclassified. Also causes a repaint on the job
// to show it if has been newly classified or not.
if (jobInstance) {
jobInstance.refilter();
}
@ -637,6 +643,7 @@ class PinBoard extends React.Component {
PinBoard.propTypes = {
recalculateUnclassifiedCounts: PropTypes.func.isRequired,
decisionTaskMap: PropTypes.object.isRequired,
jobMap: PropTypes.object.isRequired,
classificationTypes: PropTypes.array.isRequired,
isLoggedIn: PropTypes.bool.isRequired,
isPinBoardVisible: PropTypes.bool.isRequired,
@ -665,7 +672,7 @@ PinBoard.defaultProps = {
};
const mapStateToProps = ({
pushes: { revisionTips, decisionTaskMap },
pushes: { revisionTips, decisionTaskMap, jobMap },
pinnedJobs: {
isPinBoardVisible,
pinnedJobs,
@ -676,6 +683,7 @@ const mapStateToProps = ({
}) => ({
revisionTips,
decisionTaskMap,
jobMap,
isPinBoardVisible,
pinnedJobs,
pinnedJobBugs,