Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/policy-editor/ActionRowScript.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import Row from "react-bootstrap/Row";
import { OptionalFieldNoLabel } from "../../forms/OptionalFieldNoLabel";
import { LabelColumn } from "./LabelColumn";
import { WideValueColumn } from "./WideValueColumn";
import { EffectiveValue } from "./EffectiveValue";
import { EffectiveActionValue } from "./EffectiveActionValue";

export function ActionRowScript(component, action, name, help) {
return (
<Row>
<LabelColumn name={name} help={help} />
<WideValueColumn>{OptionalFieldNoLabel(component, "", "policy." + action, {})}</WideValueColumn>
{EffectiveValue(component, action)}
{EffectiveActionValue(component, action)}
</Row>
);
}
24 changes: 24 additions & 0 deletions src/components/policy-editor/EffectiveActionValue.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from "react";
import Form from "react-bootstrap/Form";
import { getDeepStateProperty } from "../../utils/deepstate";
import { EffectiveValueColumn } from "./EffectiveValueColumn";

export function EffectiveActionValue(component, policyField) {
const dsp = getDeepStateProperty(component, "resolved.definition." + policyField, undefined);

return (
<EffectiveValueColumn>
<Form.Group>
<Form.Control
data-testid={"effective-" + policyField}
size="sm"
value={getDeepStateProperty(component, "resolved.effective." + policyField, undefined)}
readOnly={true}
as="textarea"
rows="5"
/>
<Form.Text data-testid={"definition-" + policyField}>{component.PolicyDefinitionPoint(dsp)}</Form.Text>
</Form.Group>
</EffectiveValueColumn>
);
}
2 changes: 2 additions & 0 deletions src/forms/OptionalFieldNoLabel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export function OptionalFieldNoLabel(component, label, name, props = {}, helpTex
value={stateProperty(component, name)}
data-testid={"control-" + name}
onChange={component.handleChange}
as="textarea"
rows="5"
{...props}
/>
{helpText && <Form.Text className="text-muted">{helpText}</Form.Text>}
Expand Down