Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: Fix Health Checks in K/V form Lock Sessions Info section #10767

Merged
merged 4 commits into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/10767.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: Fix Health Checks in K/V form Lock Sessions Info section
```
Original file line number Diff line number Diff line change
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|}}
This conversation was marked as resolved.
Show resolved Hide resolved
<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
Original file line number Diff line number Diff line change
@@ -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/_
Original file line number Diff line number Diff line change
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