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

Fix sidebar navigation - Fedora 39 version #5101

Merged
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
11 changes: 6 additions & 5 deletions ui/webui/src/components/AnacondaWizard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,12 @@ export const AnacondaWizard = ({ dispatch, isBootIso, osRelease, storageData, lo
};
const steps = createSteps(stepsOrder);

const goToStep = (newStep) => {
// first reset validation state to default
setIsFormValid(false);

cockpit.location.go([newStep.id]);
const goToStep = (newStep, prevStep) => {
if (prevStep.prevId !== newStep.id) {
// first reset validation state to default
setIsFormValid(false);
cockpit.location.go([newStep.id]);
}
};

return (
Expand Down
29 changes: 29 additions & 0 deletions ui/webui/test/check-basic
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,35 @@ class TestBasic(anacondalib.VirtInstallMachineCase):
# Ensure that the 'actual' UI process is running/
self.assertIn("/usr/libexec/webui-desktop", m.execute("ps aux"))

def testSidebarNavigation(self):
b = self.browser
m = self.machine
i = Installer(b, m)

i.open()

i.check_prerelease_info()

# Test that clicking on current step does not break navigation
i.click_step_on_sidebar()

i.reach(i.steps.REVIEW)

# Test going back
steps = [
i.steps.DISK_CONFIGURATION,
i.steps.DISK_ENCRYPTION,
i.steps.DISK_CONFIGURATION,
i.steps.INSTALLATION_METHOD,
i.steps.WELCOME,
i.steps.WELCOME,
]

for step in steps:
i.click_step_on_sidebar(step)

i.reach(i.steps.REVIEW)

def testLanguageScreenHiddenLive(self):
b = self.browser
m = self.machine
Expand Down
5 changes: 5 additions & 0 deletions ui/webui/test/helpers/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class InstallerSteps(UserDict):
WELCOME = "installation-language"
INSTALLATION_METHOD = "installation-method"
CUSTOM_MOUNT_POINT = "mount-point-mapping"
DISK_CONFIGURATION = "disk-configuration"
DISK_ENCRYPTION = "disk-encryption"
REVIEW = "installation-review"
PROGRESS = "installation-progress"
Expand Down Expand Up @@ -120,6 +121,10 @@ def open(self, step="installation-language"):
self.browser.open(f"/cockpit/@localhost/anaconda-webui/index.html#/{step}")
self.wait_current_page(step)

def click_step_on_sidebar(self, step=None):
step = step or self.get_current_page()
self.browser.click(f"#{step}")

def get_current_page(self):
return self.browser.eval_js('window.location.hash;').replace('#/', '') or self.steps[0]

Expand Down