Skip to content
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
6 changes: 6 additions & 0 deletions web/package/agama-web-ui.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jun 26 13:14:06 UTC 2024 - David Diaz <dgonzalez@suse.com>

- Bring back installer options when selecting a product
(gh#openSUSE/agama#1384).

-------------------------------------------------------------------
Wed Jun 26 08:31:31 UTC 2024 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
22 changes: 20 additions & 2 deletions web/src/SimpleLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,34 @@

import React from "react";
import { Outlet } from "react-router-dom";
import { Page } from "@patternfly/react-core";
import {
Masthead, MastheadContent,
Page,
Toolbar, ToolbarContent, ToolbarGroup, ToolbarItem
} from "@patternfly/react-core";
import { InstallerOptions } from "./components/core";
import { _ } from "~/i18n";

/**
* Simple layout for displaying content that comes before product configuration
* TODO: improve documentation
*/
export default function SimpleLayout({ showOutlet = true, children }) {
export default function SimpleLayout({ showOutlet = true, showInstallerOptions = false, children }) {
return (
<Page>
<Masthead backgroundColor="light200">
<MastheadContent>
<Toolbar>
<ToolbarContent>
<ToolbarGroup align={{ default: "alignRight" }}>
<ToolbarItem>
{showInstallerOptions && <InstallerOptions />}
</ToolbarItem>
</ToolbarGroup>
</ToolbarContent>
</Toolbar>
</MastheadContent>
</Masthead>
{showOutlet ? <Outlet /> : children}
</Page>
);
Expand Down
8 changes: 4 additions & 4 deletions web/src/components/core/InstallerOptions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function InstallerOptions() {
const [inProgress, setInProgress] = useState(false);

// FIXME: Installer options should be available in the login too.
if (location.pathname.includes("login")) return;
if (["/login", "/products/progress"].includes(location.pathname)) return;

const open = () => setIsOpen(true);
const close = () => setIsOpen(false);
Expand Down Expand Up @@ -109,7 +109,7 @@ export default function InstallerOptions() {
fieldId="keymap"
label={_("Keyboard layout")}
>
{ localConnection()
{localConnection()
? (
<FormSelect
id="keymap"
Expand All @@ -123,12 +123,12 @@ export default function InstallerOptions() {
)}
</FormSelect>
)
: _("Cannot be changed in remote installation") }
: _("Cannot be changed in remote installation")}
</FormGroup>
</Form>
</Flex>
<Popup.Actions>
<Popup.Confirm form="installer-l10n" type="submit" autoFocus isDisabled={inProgress}>{_("Accept")}</Popup.Confirm>
<Popup.Confirm form="installer-l10n" type="submit" autoFocus isDisabled={inProgress} isLoading={inProgress}>{_("Accept")}</Popup.Confirm>
<Popup.Cancel onClick={close} isDisabled={inProgress} />
</Popup.Actions>
</Popup>
Expand Down
2 changes: 1 addition & 1 deletion web/src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const protectedRoutes = [
]
},
{
element: <SimpleLayout />,
element: <SimpleLayout showInstallerOptions />,
children: [productsRoute]
}
]
Expand Down