-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3956 from hashicorp/b-ui-placement-failures-persist
Only show the placement failures section if there is a blocked eval
- Loading branch information
Showing
3 changed files
with
12 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { alias, bool, equal, or } from '@ember/object/computed'; | ||
import { alias, equal, or, and } from '@ember/object/computed'; | ||
import { computed } from '@ember/object'; | ||
import Model from 'ember-data/model'; | ||
import attr from 'ember-data/attr'; | ||
|
@@ -106,7 +106,13 @@ export default Model.extend({ | |
evaluations: hasMany('evaluations'), | ||
namespace: belongsTo('namespace'), | ||
|
||
hasPlacementFailures: bool('latestFailureEvaluation'), | ||
hasBlockedEvaluation: computed('[email protected]', function() { | ||
return this.get('evaluations') | ||
.toArray() | ||
.some(evaluation => evaluation.get('isBlocked')); | ||
}), | ||
|
||
hasPlacementFailures: and('latestFailureEvaluation', 'hasBlockedEvaluation'), | ||
|
||
latestEvaluation: computed('[email protected]', 'evaluations.isPending', function() { | ||
const evaluations = this.get('evaluations'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters