Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: make Ansible role the first tab #19422

Merged
merged 1 commit into from
Oct 4, 2023
Merged
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
8 changes: 4 additions & 4 deletions pkg/lib/cockpit-components-modifications.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const _ = cockpit.gettext;
*
*/
const ModificationsExportDialog = ({ show, onClose, shell, ansible }) => {
const [active_tab, setActiveTab] = React.useState("shell");
const [active_tab, setActiveTab] = React.useState("ansible");
const [copied, setCopied] = React.useState(false);
const [timeoutId, setTimeoutId] = React.useState(null);

Expand Down Expand Up @@ -85,9 +85,6 @@ const ModificationsExportDialog = ({ show, onClose, shell, ansible }) => {
footer={footer}
title={_("Automation script") }>
<Tabs activeKey={active_tab} onSelect={handleSelect}>
<Tab eventKey="shell" title={_("Shell script")}>
<TextArea resizeOrientation='vertical' readOnlyVariant="default" defaultValue={shell.trim()} />
</Tab>
<Tab eventKey="ansible" title={_("Ansible")}>
<TextArea resizeOrientation='vertical' readOnlyVariant="default" defaultValue={ansible.trim()} />
<div className="ansible-docs-link">
Expand All @@ -100,6 +97,9 @@ const ModificationsExportDialog = ({ show, onClose, shell, ansible }) => {
</Button>
</div>
</Tab>
<Tab eventKey="shell" title={_("Shell script")}>
<TextArea resizeOrientation='vertical' readOnlyVariant="default" defaultValue={shell.trim()} />
</Tab>
</Tabs>
</Modal>
);
Expand Down
6 changes: 3 additions & 3 deletions test/verify/check-selinux
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,9 @@ class TestSelinux(testlib.MachineCase):
b.wait_visible(".pf-v5-c-data-list__cell:contains(Allow zebra)")
b.wait_visible(".pf-v5-c-data-list__cell:contains(fcontext -a -f a -t samba_share_t -r 's0' '/var/tmp/')")
b.click("button:contains('View automation script')")
shell_script_sel = ".automation-script-modal .pf-v5-c-modal-box__body section:nth-child(2) textarea"
ansible_script_sel = ".automation-script-modal .pf-v5-c-modal-box__body section:nth-child(3) textarea"
ansible_script_sel = ".automation-script-modal .pf-v5-c-modal-box__body section:nth-child(2) textarea"
shell_script_sel = ".automation-script-modal .pf-v5-c-modal-box__body section:nth-child(3) textarea"
b.click("button:contains('Shell')")
b.wait_in_text(shell_script_sel, "boolean -D")
b.wait_in_text(shell_script_sel, "fcontext -D")
b.wait_in_text(shell_script_sel, "boolean -m -1 zebra_write_config")
Expand Down Expand Up @@ -264,7 +265,6 @@ class TestSelinux(testlib.MachineCase):
with b.wait_timeout(30):
b.wait_visible(".pf-v5-c-data-list__cell:contains(Disallow zebra)")
b.click("button:contains('View automation script')")
b.click("button:contains('Ansible')")
ansible_m.write("roles/selinux/tasks/main.yml", b.text(ansible_script_sel))
se_before = se_after
ansible_m.execute("ansible -m include_role -a name=selinux localhost")
Expand Down