ui: Update empty-state copy throughout app (#14721)

* Update empty-state copy throughout app

Update empty-states throughout the app to only include mentions of ACLs if the user has ACLs enabled.

* Update peers empty state copy
Flip the empty state copy logic for peers. Small typo fixes on other empty states.

* Update Node empty state with docs

* Update intentions empty state
Make ACL copy dependent on if acls are enabled.

* Update Nodes empty state learn copy

* Fix binding rule copy key
pull/14906/head
Tyler Wendlandt 2022-10-06 11:01:49 -06:00 committed by GitHub
parent 62a66a32d7
commit f0be55df86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 244 additions and 47 deletions

View File

@ -79,6 +79,7 @@ as |route|>
</BlockSlot>
<BlockSlot @name="body">
{{t 'routes.dc.nodes.show.sessions.empty.body'
canUseACLs=(can "use acls")
htmlSafe=true
}}
</BlockSlot>

View File

@ -105,20 +105,15 @@ as |route|>
>
<BlockSlot @name="header">
<h2>
{{#if (gt items.length 0)}}
No namespaces found
{{else}}
Welcome to Namespaces
{{/if}}
{{t 'routes.dc.namespaces.index.empty.header'
items=items.length}}
</h2>
</BlockSlot>
<BlockSlot @name="body">
<p>
{{#if (gt items.length 0)}}
No namespaces where found matching that search, or you may not have access to view the namespaces you are searching for.
{{else}}
There don't seem to be any namespaces, or you may not have access to view namespaces yet.
{{/if}}
{{t 'routes.dc.namespaces.index.empty.body'
items=items.length
canUseACLs=(can 'use acls')}}
</p>
</BlockSlot>
<BlockSlot @name="actions">

View File

@ -111,20 +111,15 @@ as |route|>
>
<BlockSlot @name="header">
<h2>
{{#if (gt items.length 0)}}
No partitions found
{{else}}
Welcome to Partitions
{{/if}}
{{t 'routes.dc.partitions.index.empty.header'
items=items.length}}
</h2>
</BlockSlot>
<BlockSlot @name="body">
<p>
{{#if (gt items.length 0)}}
No partitions where found matching that search, or you may not have access to view the namespaces you are searching for.
{{else}}
There don't seem to be any partitions, or you may not have access to view partitions yet.
{{/if}}
{{t 'routes.dc.partitions.index.empty.body'
items=items.length
canUseACLs=(can 'use acls')}}
</p>
</BlockSlot>
<BlockSlot @name="actions">

View File

@ -194,21 +194,20 @@ as |sort filters items|}}
>
<BlockSlot @name="header">
<h2>
{{#if (gt items.length 0)}}
No peers found
{{else}}
Welcome to Peers
{{/if}}
{{t 'routes.dc.peers.index.empty.header'
items=items.length
}}
</h2>
</BlockSlot>
<BlockSlot @name="body">
{{#if (gt items.length 0)}}
<p>No peers where found matching that search, or you may not have access to view the peers you are searching for.</p>
{{else}}
<p>
Cluster peering is the recommended way to connect services across or within Consul datacenters. Peering is a one-to-one relationship in which each peer is either a open-source Consul datacenter or a Consul enterprise admin partition. There don't seem to be any peers for this {{if (can "use partitions") "admin partition" "datacenter"}}, or you may not have the <code>peering:read</code> permissions to access this view.
</p>
{{/if}}
<p>
{{t 'routes.dc.peers.index.empty.body'
items=items.length
canUsePartitions=(can "use partitions")
canUseACLs=(can "use acls")
htmlSafe=true
}}
</p>
</BlockSlot>
<BlockSlot @name="actions">
<li class="docs-link">

View File

@ -114,6 +114,7 @@ as |route|>
<BlockSlot @name="body">
{{t 'routes.dc.intentions.index.empty.body'
items=items.length
canUseACLs=(can "use acls")
htmlSafe=true
}}
</BlockSlot>

View File

@ -186,6 +186,7 @@ as |sort filters parent items|}}
<BlockSlot @name="body">
{{t 'routes.dc.kv.index.empty.body'
items=items.length
canUseACLs=(can "use acls")
htmlSafe=true
}}
</BlockSlot>

View File

@ -103,9 +103,22 @@ as |route|>
<BlockSlot @name="body">
{{t 'routes.dc.nodes.index.empty.body'
items=items.length
canUseACLs=(can 'use acls')
htmlSafe=true
}}
</BlockSlot>
<BlockSlot @name="actions">
<li class="docs-link">
<a href="{{env 'CONSUL_DOCS_DEVELOPER_URL'}}/agent" rel="noopener noreferrer" target="_blank">
{{t 'routes.dc.nodes.index.empty.documentation'}}
</a>
</li>
<li class="learn-link">
<a href="{{env "CONSUL_DOCS_LEARN_URL"}}/tutorials/consul/deployment-guide?in=consul/production-deploy#configure-consul-agents" rel="noopener noreferrer" target="_blank">
{{t 'routes.dc.nodes.index.empty.learn'}}
</a>
</li>
</BlockSlot>
</EmptyState>
</collection.Empty>
</DataCollection>

View File

@ -113,6 +113,7 @@ as |sort filters items partition nspace|}}
<BlockSlot @name="body">
{{t 'routes.dc.services.index.empty.body'
items=items.length
canUseACLs=(can "use acls")
htmlSafe=true
}}
</BlockSlot>

View File

@ -102,6 +102,7 @@ as |route|>
<BlockSlot @name="body">
{{t 'routes.dc.services.show.intentions.index.empty.body'
items=items.length
canUseACLs=(can 'use acls')
htmlSafe=true
}}
</BlockSlot>

View File

@ -96,6 +96,7 @@ module.exports = function (environment, $ = process.env) {
CONSUL_DOCS_URL: 'https://www.consul.io/docs',
CONSUL_DOCS_LEARN_URL: 'https://learn.hashicorp.com',
CONSUL_DOCS_API_URL: 'https://www.consul.io/api',
CONSUL_DOCS_DEVELOPER_URL: 'https://developer.hashicorp.com/consul/docs',
CONSUL_COPYRIGHT_URL: 'https://www.hashicorp.com',
});
switch (true) {

View File

@ -71,3 +71,28 @@ Feature: dc / intentions / index
---
Then the url should be /dc-1/intentions
Then I don't see customResourceNotice on the intentionList
Scenario: Viewing an empty intentions page with acl enabled
Given 1 datacenter model with the value "dc-1"
And 0 intention models
When I visit the intentions page for yaml
---
dc: dc-1
---
Then the url should be /dc-1/intentions
And the title should be "Intentions - Consul"
Then I see 0 intention models on the intentionList component
And I see the text "There don't seem to be any Intentions in this Consul cluster, or you may not have intentions:read permissions access to this view." in ".empty-state p"
And I see the "[data-test-empty-state-login]" element
Scenario: Viewing an empty intentions page with acl disabled
Given ACLs are disabled
Given 1 datacenter model with the value "dc-1"
And 0 intention models
When I visit the intentions page for yaml
---
dc: dc-1
---
Then the url should be /dc-1/intentions
And the title should be "Intentions - Consul"
Then I see 0 intention models on the intentionList component
And I see the text "There don't seem to be any Intentions in this Consul cluster." in ".empty-state p"
And I don't see the "[data-test-empty-state-login]" element

View File

@ -95,3 +95,16 @@ Feature: dc / nodes / index
---
And I see 1 node model
And I see 1 node model with the name "node-02"
Scenario: Viewing an empty nodes page with acl enabled
Given 1 datacenter model with the value "dc-1"
And 0 nodes models
When I visit the nodes page for yaml
---
dc: dc-1
---
Then the url should be /dc-1/nodes
And the title should be "Nodes - Consul"
Then I see 0 node models
And I see the text "There don't seem to be any registered Nodes in this Consul cluster, or you may not have service:read and node:read permissions access to this view." in ".empty-state p"
And I see the "[data-test-empty-state-login]" element

View File

@ -51,3 +51,36 @@ Feature: dc / nodes / sessions / list: List Lock Sessions
- 18ms
- 15s
---
Scenario: Given 0 sessions with ACLs enabled
Given 1 datacenter model with the value "dc1"
And 1 node model from yaml
---
ID: node-0
---
And 0 session models
When I visit the node page for yaml
---
dc: dc1
node: node-0
---
And I click lockSessions on the tabs
Then I see lockSessionsIsSelected on the tabs
And I see the text "Consul provides a session mechanism which can be used to build distributed locks. Sessions act as a binding layer between Nodes, Health Checks, and Key/Value data. There are currently no Lock Sessions present, or you may not have key:read or session:read permissions." in ".empty-state p"
And I see the "[data-test-empty-state-login]" element
Scenario: Given 0 sessions with ACLs disabled
Given ACLs are disabled
Given 1 datacenter model with the value "dc1"
And 1 node model from yaml
---
ID: node-0
---
And 0 session models
When I visit the node page for yaml
---
dc: dc1
node: node-0
---
And I click lockSessions on the tabs
Then I see lockSessionsIsSelected on the tabs
And I see the text "Consul provides a session mechanism which can be used to build distributed locks. Sessions act as a binding layer between Nodes, Health Checks, and Key/Value data. There are currently no Lock Sessions present." in ".empty-state p"
And I don't see the "[data-test-empty-state-login]" element

View File

@ -34,4 +34,21 @@ Feature: dc / peers / index: Peers List
---
And I see 1 peer model
And I see 1 peer model with the name "a-peer"
Scenario: Empty state searching peers
Then I fill in with yaml
---
s: no-match
---
And I see 0 peer model
Then I see the text "No peers found" in ".empty-state h2"
Then I see the text "No peers were found matching that search, or you may not have the peering:read permissions to access this view." in ".empty-state p"
And I see the "[data-test-empty-state-login]" element
Scenario: Empty state searching peers with ACLs disabled
And ACLs are disabled
Then I fill in with yaml
---
s: no-match
---
And I see 0 peer model
Then I see the text "No peers found" in ".empty-state h2"
Then I see the text "No peers were found matching that search." in ".empty-state p"

View File

@ -165,3 +165,28 @@ Feature: dc / services / index: List Services
Then I see 2 service models
And I don't see associatedServiceCount on the services.0
And I see associatedServiceCount on the services.1
Scenario: Viewing the services index page with no services and ACLs enabled
Given 1 datacenter model with the value "dc-1"
And 0 service models
When I visit the services page for yaml
---
dc: dc-1
---
Then the url should be /dc-1/services
And the title should be "Services - Consul"
Then I see 0 service models
And I see the text "There don't seem to be any registered services in this Consul cluster, or you may not have service:read and node:read access to this view. Use Terraform, Kubernetes CRDs, Vault, or the Consul CLI to register Services." in ".empty-state p"
And I see the "[data-test-empty-state-login]" element
Scenario: Viewing the services index page with no services and ACLs disabled
Given ACLs are disabled
Given 1 datacenter model with the value "dc-1"
And 0 service models
When I visit the services page for yaml
---
dc: dc-1
---
Then the url should be /dc-1/services
And the title should be "Services - Consul"
Then I see 0 service models
And I see the text "There don't seem to be any registered services in this Consul cluster." in ".empty-state p"
And I don't see the "[data-test-empty-state-login]" element

View File

@ -66,8 +66,13 @@ dc:
{items, select,
0 {There don't seem to be any registered Nodes in this Consul cluster}
other {No Nodes were found matching your search}
}, or you may not have <code>service:read</code> and <code>node:read</code> permissions access to this view.
}{canUseACLs, select,
true {, or you may not have <code>service:read</code> and <code>node:read</code> permissions access to this view.}
other {.}
}
</p>
documentation: Documentation on Nodes
learn: Take the tutorial
show:
rtt:
title: Round Trip Time
@ -79,7 +84,10 @@ dc:
header: Welcome to Lock Sessions
body: |
<p>
Consul provides a session mechanism which can be used to build distributed locks. Sessions act as a binding layer between Nodes, Health Checks, and Key/Value data. There are currently no Lock Sessions present, or you may not have <code>key:read</code> or <code>session:read</code> permissions.
Consul provides a session mechanism which can be used to build distributed locks. Sessions act as a binding layer between Nodes, Health Checks, and Key/Value data. There are currently no Lock Sessions present{canUseACLs, select,
true {, or you may not have <code>key:read</code> or <code>session:read</code> permissions.}
other {.}
}
</p>
services:
title: Service Instances
@ -107,6 +115,23 @@ dc:
</p>
peers:
index:
empty:
header: |
{items, select,
0 {Welcome to Peers}
other {No peers found}
}
body: |
{items, select,
0 {Cluster peering is the recommended way to connect services across or within Consul datacenters. Peering is a one-to-one relationship in which each peer is either a open-source Consul datacenter or a Consul enterprise admin partition. There don't seem to be any peers for this {canUsePartitions, select,
true {admin partition}
other {datacenter}
}}
other {No peers were found matching that search}
}{canUseACLs, select,
true {, or you may not have the <code>peering:read</code> permissions to access this view.}
other {.}
}
detail:
imported:
count: |
@ -116,6 +141,44 @@ dc:
count: |
{count} exported services
tooltip: The number of services exported from {name}
partitions:
index:
empty:
header: |
{items, select,
0 {Welcome to Partitions}
other {No partitions found}
}
body: |
{items, select,
0 {There don't seem to be any partitions{canUseACLs, select,
true {, or you may not have access to view partitions yet.}
other {.}
}}
other {No partitions were found matching that search{canUseACLs, select,
true {, or you may not have access to view the namesapces you are searching}
other {.}
}}
}
namespaces:
index:
empty:
header: |
{items, select,
0 {Welcome to Namespaces}
other {No namespaces found}
}
body: |
{items, select,
0 {No namespaces were found matching that search{canUseACLs, select,
true {, or you may not have access to view the namespaces you are searching for.}
other {.}
}}
other {There don't seem to be any namespaces{canUseACLs, select,
true {, or you may not have access to view namespaces yet.}
other {.}
}}
}
services:
index:
empty:
@ -129,7 +192,10 @@ dc:
{items, select,
0 {There don't seem to be any registered services in this Consul cluster}
other {No Services were found matching your search}
}, or you may not have <code>service:read</code> and <code>node:read</code> access to this view. Use Terraform, Kubernetes CRDs, Vault, or the Consul CLI to register Services.
}{canUseACLs, select,
true {, or you may not have <code>service:read</code> and <code>node:read</code> access to this view. Use Terraform, Kubernetes CRDs, Vault, or the Consul CLI to register Services.}
other {.}
}
</p>
instance:
exposedpaths:
@ -239,7 +305,10 @@ dc:
{items, select,
0 {There don't seem to be any Intentions in this Consul cluster}
other {No Intentions were found matching your search}
}, or you may not have <code>intentions:read</code> permissions access to this view.
}{canUseACLs, select,
true {, or you may not have <code>intentions:read</code> permissions access to this view.}
other {.}
}
</p>
instances:
@ -297,7 +366,10 @@ dc:
{items, select,
0 {There don't seem to be any Intentions in this Consul cluster}
other {No Intentions were found matching your search}
}, or you may not have <code>intentions:read</code> permissions access to this view.
}{canUseACLs, select,
true {, or you may not have intentions:read permissions access to this view.}
other {.}
}
</p>
kv:
index:
@ -312,7 +384,10 @@ dc:
{items, select,
0 {There don't seem to be any K/V pairs in this Consul cluster yet}
other {No K/V pairs were found matching your search}
}, or you may not have <code>key:read</code> permissions access to this view.
}{canUseACLs, select,
true {, or you may not have <code>key:read</code> permissions access to this view.}
other {.}
}
</p>
acls:
tokens:
@ -363,15 +438,16 @@ dc:
auth-methods:
show:
binding-rules:
empty:
header: No Binding Rules
body: |
<p>
Binding rules allow an operator to express a systematic way of automatically linking roles and service identities to newly created tokens without operator intervention.
</p>
index:
empty:
header: No binding rules
body: |
<p>
Binding rules allow an operator to express a systematic way of automatically linking roles and service identities to newly created tokens without operator intervention.
</p>
nspace-rules:
empty:
header: No Namespace Rules
header: No namespace rules
body: |
<p>
A set of rules that can control which namespace tokens created via this auth method will be created within. Unlike binding rules, the first matching namespace rule wins.