Skip to content

Commit

Permalink
Added data-test-subj create policy (#4873)
Browse files Browse the repository at this point in the history
* Added data-test-subj create policy

* Updated CHANGELOG

(cherry picked from commit b9c4645)
  • Loading branch information
Machi3mfl committed Nov 16, 2022
1 parent 2b4ce14 commit b47fd70
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion 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 All @@ -28,7 +30,6 @@ commands of Start the agent in the deploy new agent section [#4458](https://gith

- Improves Agents Overview performance [#4363](https://github.com/wazuh/wazuh-kibana-app/pull/4363)
- Improved alerts summary performance [#4376](https://github.com/wazuh/wazuh-kibana-app/pull/4376)
- The endpoint `/agents/summary/status` response was adapted. [#3874](https://github.com/wazuh/wazuh-kibana-app/pull/3874)
- Made Agents Overview icons load independently [#4363](https://github.com/wazuh/wazuh-kibana-app/pull/4363)
- Improved the message displayed when there is a versions mismatch between the Wazuh API and the Wazuh APP [#4529](https://github.com/wazuh/wazuh-kibana-app/pull/4529)
- Allowed to upload an image for the `customization.logo.*` settings in `Settings/Configuration` [#4504](https://github.com/wazuh/wazuh-kibana-app/pull/4504)
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 @@ -312,6 +312,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 @@ -322,6 +323,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 @@ -338,6 +340,7 @@ export const CreatePolicyFlyout = ({ closeFlyout }) => {
<EuiFlexItem grow={false}>
<EuiFormRow hasEmptyLabelSpace>
<EuiButton
data-test-subj="createPolicyAddAction"
onClick={() => addAction()}
iconType="plusInCircle"
disabled={!actionValue}
Expand All @@ -363,6 +366,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 @@ -380,6 +384,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 @@ -390,6 +395,7 @@ export const CreatePolicyFlyout = ({ closeFlyout }) => {
<EuiFlexItem grow={false}>
<EuiFormRow hasEmptyLabelSpace>
<EuiButton
data-test-subj="createPolicyAddResource"
onClick={() => addResource()}
iconType="plusInCircle"
disabled={!resourceIdentifierValue}
Expand All @@ -410,7 +416,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 @@ -419,6 +425,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 b47fd70

Please sign in to comment.