ui: Ensure we show a special readonly page for intentions (#11767)
This commit is contained in:
parent
4734d0989c
commit
470fce1e07
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
ui: Ensure we show a readonly designed page for readonly intentions
|
||||
```
|
|
@ -56,7 +56,10 @@ as |api|>
|
|||
</BlockSlot>
|
||||
|
||||
<BlockSlot @name="form">
|
||||
{{#let api.data as |item|}}
|
||||
{{#let
|
||||
api.data
|
||||
(not (can 'write intention' item=api.data))
|
||||
as |item readonly|}}
|
||||
{{#if (not readonly)}}
|
||||
|
||||
{{#let (changeset-get item 'Action') as |newAction|}}
|
||||
|
@ -193,6 +196,7 @@ as |api|>
|
|||
</div>
|
||||
</form>
|
||||
{{else}}
|
||||
|
||||
{{#if item.IsManagedByCRD}}
|
||||
<Notice
|
||||
class="crd"
|
||||
|
@ -215,8 +219,10 @@ as |api|>
|
|||
</notice.Footer>
|
||||
</Notice>
|
||||
{{/if}}
|
||||
|
||||
<Consul::Intention::View
|
||||
@item={{item}}
|
||||
data-test-readonly
|
||||
/>
|
||||
{{/if}}
|
||||
{{/let}}
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<div class="consul-intention-view">
|
||||
<div
|
||||
class="consul-intention-view"
|
||||
...attributes
|
||||
>
|
||||
|
||||
<div class="definition-table">
|
||||
<dl>
|
||||
|
|
|
@ -81,7 +81,7 @@ ${fake.helpers.randomize([
|
|||
],
|
||||
`:``}
|
||||
"Precedence": ${fake.random.number({min: 1, max: 100})},
|
||||
${ !legacy && fake.random.number({min: 1, max: 10}) > 2 ? `
|
||||
${ (!legacy || source[1] === "external-source") && fake.random.number({min: 1, max: 10}) > 2 ? `
|
||||
"Meta": {
|
||||
"external-source": "${fake.helpers.randomize(['kubernetes', 'consul-api-gateway'])}"
|
||||
},
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
@setupApplicationTest
|
||||
Feature: dc / intentions / read-only
|
||||
Scenario: Viewing a readonly intention
|
||||
Given 1 datacenter model with the value "dc1"
|
||||
And 1 intention model from yaml:
|
||||
---
|
||||
Meta:
|
||||
external-source: kubernetes
|
||||
---
|
||||
When I visit the intention page for yaml
|
||||
---
|
||||
dc: dc1
|
||||
intention: default:external-source:web:default:external-source:db
|
||||
---
|
||||
Then I see the "[data-test-readonly]" element
|
|
@ -0,0 +1,10 @@
|
|||
import steps from '../../steps';
|
||||
|
||||
// step definitions that are shared between features should be moved to the
|
||||
// tests/acceptance/steps/steps.js file
|
||||
|
||||
export default function(assert) {
|
||||
return steps(assert).then('I should find a file', function() {
|
||||
assert.ok(true, this.step);
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue