Skip to content

Commit

Permalink
ui: Fix Health Checks in K/V form Lock Sessions Info section (#10767)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaxcode committed Aug 4, 2021
1 parent 710bd90 commit 8ad1ab9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/10767.txt
@@ -0,0 +1,3 @@
```release-note:bug
ui: Fix Health Checks in K/V form Lock Sessions Info section
```
Expand Up @@ -32,7 +32,7 @@
<dd>{{or api.data.TTL '-'}}</dd>
<dt>Behavior</dt>
<dd>{{api.data.Behavior}}</dd>
{{#let (union api.data.NodeChecks api.data.ServiceChecks) as |checks|}}
{{#let api.data.checks as |checks|}}
<dt>Health Checks</dt>
<dd>
{{#if (gt checks.length 0)}}
Expand Down
6 changes: 6 additions & 0 deletions ui/packages/consul-ui/app/models/session.js
@@ -1,4 +1,5 @@
import Model, { attr } from '@ember-data/model';
import { computed } from '@ember/object';
import { nullValue } from 'consul-ui/decorators/replace';

export const PRIMARY_KEY = 'uid';
Expand All @@ -23,4 +24,9 @@ export default class Session extends Model {
@nullValue([]) @attr({ defaultValue: () => [] }) ServiceChecks;

@attr({ defaultValue: () => [] }) Resources; // []

@computed('NodeChecks', 'ServiceChecks')
get checks() {
return [...this.NodeChecks, ...this.ServiceChecks.map(({ ID }) => ID)];
}
}
10 changes: 9 additions & 1 deletion ui/packages/consul-ui/mock-api/v1/session/info/_
Expand Up @@ -8,7 +8,15 @@
}",
"Node":"node-1",
"NodeChecks":["serfHealth"],
"ServiceChecks": ["${fake.hacker.noun()}Health"],
"ServiceChecks": [
{
"ID": "${fake.hacker.noun()}Health",
"Namespace": "${
typeof location.search.ns !== 'undefined' ? location.search.ns :
typeof http.body.Namespace !== 'undefined' ? http.body.Namespace : 'default'
}"
}
],
"LockDelay":15000000000,
"Behavior":"${fake.helpers.randomize(['release', 'delete'])}",
"TTL":"",
Expand Down

0 comments on commit 8ad1ab9

Please sign in to comment.