Skip to content

Commit

Permalink
[Backport 4.4-7.16] Added data-test-subj create policy (#4875)
Browse files Browse the repository at this point in the history
Added data-test-subj create policy (#4873)

* Added data-test-subj create policy

* Updated CHANGELOG

(cherry picked from commit b9c4645)
  • Loading branch information
Machi3mfl authored Nov 16, 2022
1 parent c80c46b commit ba26920
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ All notable changes to the Wazuh app project will be documented in this file.
- Added validation to the plugin settings in the form of `Settings/Configuration` and the endpoint to update the plugin configuration [#4503](https://github.com/wazuh/wazuh-kibana-app/pull/4503)[#4785](https://github.com/wazuh/wazuh-kibana-app/pull/4785)
- Added new plugin settings to customize the header and footer on the PDF reports [#4505](https://github.com/wazuh/wazuh-kibana-app/pull/4505)[#4798](https://github.com/wazuh/wazuh-kibana-app/pull/4798)[#4805](https://github.com/wazuh/wazuh-kibana-app/pull/4805)
- Add a new plugin setting to enable or disable the customization [#4507](https://github.com/wazuh/wazuh-kibana-app/pull/4507)
- Added a centralized service to handle the requests [#4831](https://github.com/wazuh/wazuh-kibana-app/pull/4831)
- Added data-test-subj create policy [#4873](https://github.com/wazuh/wazuh-kibana-app/pull/4873)

### Changed

Expand Down
9 changes: 8 additions & 1 deletion public/components/security/policies/create-policy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ export const CreatePolicyFlyout = ({ closeFlyout }) => {
<EuiForm component="form" style={{ padding: 24 }}>
<EuiFormRow label="Policy name" helpText="Introduce a name for this new policy.">
<EuiFieldText
data-test-subj="createPolicyName"
placeholder=""
value={policyName}
onChange={(e) => onChangePolicyName(e)}
Expand All @@ -326,6 +327,7 @@ export const CreatePolicyFlyout = ({ closeFlyout }) => {
<EuiFlexGroup>
<EuiFlexItem>
<EuiFormRow
data-test-subj="createPolicyActionRow"
label="Action"
helpText="Set an action where the policy will be carried out."
>
Expand All @@ -342,6 +344,7 @@ export const CreatePolicyFlyout = ({ closeFlyout }) => {
<EuiFlexItem grow={false}>
<EuiFormRow hasEmptyLabelSpace>
<EuiButton
data-test-subj="createPolicyAddAction"
onClick={() => addAction()}
iconType="plusInCircle"
disabled={!actionValue}
Expand All @@ -367,6 +370,7 @@ export const CreatePolicyFlyout = ({ closeFlyout }) => {
<EuiFormRow
label="Resource"
helpText="Select the resource to which this policy is directed."
data-test-subj="createPolicyResourceRow"
>
<EuiSuperSelect
options={resources}
Expand All @@ -384,6 +388,7 @@ export const CreatePolicyFlyout = ({ closeFlyout }) => {
helpText="Introduce the resource identifier. Type * for all."
>
<EuiFieldText
data-test-subj="createPolicyResourceIdentifier"
placeholder={getIdentifier()}
value={resourceIdentifierValue}
onChange={(e) => onChangeResourceIdentifierValue(e)}
Expand All @@ -394,6 +399,7 @@ export const CreatePolicyFlyout = ({ closeFlyout }) => {
<EuiFlexItem grow={false}>
<EuiFormRow hasEmptyLabelSpace>
<EuiButton
data-test-subj="createPolicyAddResource"
onClick={() => addResource()}
iconType="plusInCircle"
disabled={!resourceIdentifierValue}
Expand All @@ -414,7 +420,7 @@ export const CreatePolicyFlyout = ({ closeFlyout }) => {
</>
)}
<EuiSpacer></EuiSpacer>
<EuiFormRow label="Select an effect" helpText="Select an effect.">
<EuiFormRow label="Select an effect" helpText="Select an effect." data-test-subj="createPolicyEffectRow">
<EuiSuperSelect
options={effectOptions}
valueOfSelected={effectValue}
Expand All @@ -423,6 +429,7 @@ export const CreatePolicyFlyout = ({ closeFlyout }) => {
</EuiFormRow>
<EuiSpacer />
<EuiButton
data-test-subj="createPolicyButton"
disabled={
!policyName || !addedActions.length || !addedResources.length || !effectValue
}
Expand Down

0 comments on commit ba26920

Please sign in to comment.