Skip to content

Commit f583e5f

Browse files
authored
feat(mesh-trusts-listing): add zone column (#5004)
Adds a zone column to the mesh-trusts listing in the overview of a mesh. Closes #5000 --------- Signed-off-by: schogges <moritz.fleck@konghq.com>
1 parent 39f7bde commit f583e5f

3 files changed

Lines changed: 31 additions & 30 deletions

File tree

packages/kuma-gui/features/mesh/MeshTrust.feature

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ Feature: mesh / mesh-trust
77
| item | $meshtrusts-listing tbody tr |
88
| summary | [data-testid="slideout-container"] |
99
| summary-title | $summary [data-testid='slideout-title'] |
10-
11-
Scenario: MeshTrusts are listed in mesh overview
12-
Given the URL "/meshes/default/meshtrusts" responds with
10+
And the URL "/meshes/default/meshtrusts" responds with
1311
"""
1412
body:
1513
items:
@@ -18,29 +16,27 @@ Feature: mesh / mesh-trust
1816
kri: kri_mtrust_default___trust-1_
1917
labels:
2018
kuma.io/display-name: trust-1
19+
kuma.io/origin: zone
20+
kuma.io/zone: zone-1
21+
spec:
22+
trustDomain: default.zone-1.mesh.local
2123
status:
2224
origin:
2325
kri: kri_mid_default_default_foo_bar_baz
2426
"""
27+
28+
Scenario: MeshTrusts are listed in mesh overview
2529
When I visit the "/meshes/default" URL
2630
Then the "$meshtrusts-listing" element exists
27-
And the "$item:nth-child(1)" element contains "trust-1"
28-
And the "$item:nth-child(1)" element contains "kri_mid_default_default_foo_bar_baz"
31+
And the "$meshtrusts-listing th" element exists 4 times
32+
And the "$item:nth-child(1)" element contains
33+
| Value |
34+
| trust-1 |
35+
| zone-1 |
36+
| default.zone-1.mesh.local |
37+
| kri_mid_default_default_foo_bar_baz |
2938

3039
Scenario: Clicking on mesh trust item opens summary view
31-
Given the URL "/meshes/default/meshtrusts" responds with
32-
"""
33-
body:
34-
items:
35-
- name: trust-1
36-
mesh: default
37-
kri: kri_mtrust_default___trust-1_
38-
labels:
39-
kuma.io/display-name: trust-1
40-
status:
41-
origin:
42-
kri: kri_mid_default_default_foo_bar_baz
43-
"""
4440
When I visit the "/meshes/default" URL
4541
Then I click the "$item:nth-child(1) td:first-child a" element
4642
Then the URL contains "/meshes/default/overview/meshtrust/kri_mtrust_default___trust-1_"
@@ -52,28 +48,18 @@ Feature: mesh / mesh-trust
5248
And the "$summary [data-testid='k-code-block']" element contains "name: trust-1"
5349

5450
Scenario: Clicking on an origin opens the summary tray of mesh identity
55-
Given the URL "/meshes/default/meshtrusts" responds with
56-
"""
57-
body:
58-
items:
59-
- name: trust-1
60-
status:
61-
origin:
62-
kri: kri_mid_default_default_foo_bar_baz
63-
"""
6451
And the URL "/meshes/default/meshidentities" responds with
6552
"""
6653
body:
6754
items:
6855
- name: bar
6956
"""
7057
When I visit the "/meshes/default" URL
71-
Then I click the "$item:nth-child(1) td:nth-child(3) a" element
58+
Then I click the "$item:nth-child(1) td:nth-child(4) a" element
7259
Then the URL contains "/meshes/default/overview/meshidentity/kri_mid_default_default_foo_bar_baz"
7360
And the "$summary" element exists
7461
And the "$summary-title" element contains "bar"
7562
And the "$summary [data-testid='k-code-block']" element exists
7663
And the "$summary [data-testid='k-code-block']" element contains "type: MeshIdentity"
7764
And the "$summary [data-testid='k-code-block']" element contains "mesh: default"
7865
And the "$summary [data-testid='k-code-block']" element contains "name: bar"
79-
Then pause

packages/kuma-gui/src/app/meshes/locales/en-us/index.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ meshes:
6969
name: Name
7070
trust-domain: TrustDomain
7171
origin: Origin
72+
zone: Zone
7273
items:
7374
title: Meshes
7475
breadcrumbs: Meshes

packages/kuma-gui/src/app/meshes/views/MeshDetailView.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
mesh: '',
66
environment: String,
77
}"
8-
v-slot="{ route, t, uri, me }"
8+
v-slot="{ route, t, uri, me, can }"
99
>
1010
<RouteTitle
1111
:title="t('meshes.routes.overview.title')"
@@ -72,6 +72,7 @@
7272
:items="items"
7373
:headers="[
7474
{ ...me.get('headers.identity'), label: t('meshes.routes.item.mesh-trusts.name'), key: 'name' },
75+
...(can('use zones') ? [{ label: t('meshes.routes.item.mesh-trusts.zone'), key: 'zone' }] : []),
7576
{ ...me.get('headers.type'), label: t('meshes.routes.item.mesh-trusts.trust-domain'), key: 'trustDomain' },
7677
{ ...me.get('headers.origin'), label: t('meshes.routes.item.mesh-trusts.origin'), key: 'origin' },
7778
]"
@@ -95,6 +96,19 @@
9596
<b>{{ item.name }}</b>
9697
</XAction>
9798
</template>
99+
<template #zone="{ row: item }">
100+
<XAction
101+
v-if="item.zone.length > 0"
102+
:to="{
103+
name: 'zone-cp-detail-view',
104+
params: {
105+
zone: item.zone,
106+
},
107+
}"
108+
>
109+
{{ item.zone }}
110+
</XAction>
111+
</template>
98112
<template #trustDomain="{ row: item }">
99113
<XBadge appearance="decorative">
100114
{{ item.spec.trustDomain }}

0 commit comments

Comments
 (0)