-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No blank backend role before adding a new one in Create User page (#1384
) * Add last backend role empty check Signed-off-by: nursaadat <SNursultan@dar.kz> Signed-off-by: Saadat Nursultan <nursultan.saadat@gmail.com> * Add backend role empty check Signed-off-by: nursaadat <SNursultan@dar.kz> Signed-off-by: Saadat Nursultan <nursultan.saadat@gmail.com> * Add strict comparison Signed-off-by: nursaadat <SNursultan@dar.kz> Signed-off-by: Saadat Nursultan <nursultan.saadat@gmail.com> * Fix lint errors Signed-off-by: nursaadat <SNursultan@dar.kz> Signed-off-by: Saadat Nursultan <nursultan.saadat@gmail.com> * Add tests for backend role panel Signed-off-by: Saadat Nursultan <nursultan.saadat@gmail.com> * Fix lint errors Signed-off-by: Saadat Nursultan <nursultan.saadat@gmail.com> --------- Signed-off-by: nursaadat <SNursultan@dar.kz> Signed-off-by: Saadat Nursultan <nursultan.saadat@gmail.com> Co-authored-by: nursaadat <SNursultan@dar.kz> Co-authored-by: Saadat Nursultan <nursultan.saadat@gmail.com>
- Loading branch information
1 parent
b3b3120
commit 5e99582
Showing
3 changed files
with
176 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 125 additions & 0 deletions
125
...nfiguration/panels/internal-user-edit/test/__snapshots__/backend-role-panel.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`User editing - backend role panel BackendRolePanel add backend role when one of the previous roles is blank 1`] = ` | ||
<PanelWithHeader | ||
headerSubText="Backend roles are used to map users from external authentication systems, such as LDAP or SAML to OpenSearch security roles." | ||
headerText="Backend roles" | ||
helpLink="https://opensearch.org/docs/latest/security-plugin/access-control/index/" | ||
optional={true} | ||
> | ||
<EuiFlexGroup> | ||
<EuiFlexItem | ||
className="limit-width-input" | ||
> | ||
<EuiFormRow | ||
describedByIds={Array []} | ||
display="row" | ||
error="" | ||
fullWidth={false} | ||
hasChildLabel={true} | ||
hasEmptyLabelSpace={false} | ||
isInvalid={false} | ||
label="Backend role" | ||
labelType="label" | ||
> | ||
<EuiFieldText | ||
id="backend-role-0" | ||
isInvalid={false} | ||
onChange={[Function]} | ||
placeholder="Type in backend role" | ||
value="admin" | ||
/> | ||
</EuiFormRow> | ||
</EuiFlexItem> | ||
<EuiFlexItem | ||
grow={false} | ||
> | ||
<EuiFormRow | ||
describedByIds={Array []} | ||
display="row" | ||
fullWidth={false} | ||
hasChildLabel={true} | ||
hasEmptyLabelSpace={true} | ||
labelType="label" | ||
> | ||
<EuiButton | ||
color="danger" | ||
id="backend-role-delete-0" | ||
onClick={[Function]} | ||
> | ||
Remove | ||
</EuiButton> | ||
</EuiFormRow> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
<EuiFlexGroup> | ||
<EuiFlexItem | ||
className="limit-width-input" | ||
> | ||
<EuiFormRow | ||
describedByIds={Array []} | ||
display="row" | ||
error="" | ||
fullWidth={false} | ||
hasChildLabel={true} | ||
hasEmptyLabelSpace={false} | ||
isInvalid={false} | ||
label="" | ||
labelType="label" | ||
> | ||
<EuiFieldText | ||
id="backend-role-1" | ||
isInvalid={false} | ||
onChange={[Function]} | ||
placeholder="Type in backend role" | ||
value="HR" | ||
/> | ||
</EuiFormRow> | ||
</EuiFlexItem> | ||
<EuiFlexItem | ||
grow={false} | ||
> | ||
<EuiFormRow | ||
describedByIds={Array []} | ||
display="row" | ||
fullWidth={false} | ||
hasChildLabel={true} | ||
hasEmptyLabelSpace={false} | ||
labelType="label" | ||
> | ||
<EuiButton | ||
color="danger" | ||
id="backend-role-delete-1" | ||
onClick={[Function]} | ||
> | ||
Remove | ||
</EuiButton> | ||
</EuiFormRow> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
<EuiSpacer /> | ||
<EuiButton | ||
id="backend-role-add-row" | ||
onClick={[Function]} | ||
> | ||
Add another backend role | ||
</EuiButton> | ||
</PanelWithHeader> | ||
`; | ||
|
||
exports[`User editing - backend role panel BackendRolePanel add backend role when the previous role is blank 1`] = ` | ||
<PanelWithHeader | ||
headerSubText="Backend roles are used to map users from external authentication systems, such as LDAP or SAML to OpenSearch security roles." | ||
headerText="Backend roles" | ||
helpLink="https://opensearch.org/docs/latest/security-plugin/access-control/index/" | ||
optional={true} | ||
> | ||
<EuiSpacer /> | ||
<EuiButton | ||
id="backend-role-add-row" | ||
onClick={[Function]} | ||
> | ||
Add another backend role | ||
</EuiButton> | ||
</PanelWithHeader> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters