Skip to content

Commit

Permalink
Merge branch 'storage-config-ui' into storage-add-partition-select-wr…
Browse files Browse the repository at this point in the history
…apper-test
  • Loading branch information
dgdavid committed Feb 4, 2025
2 parents cb28ed6 + c4826d5 commit c213d68
Show file tree
Hide file tree
Showing 62 changed files with 440 additions and 794 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Install DocBook tooling
run: |
sudo apt-get update
sudo apt-get --assume-yes --no-install-recommends install xmlto docbook-xsl xmlstarlet
sudo apt-get --assume-yes --no-install-recommends install xmlto docbook-xsl xmlstarlet libglib2.0-dev
- name: Build HTML via DocBook
run: make -C doc
Expand All @@ -55,14 +55,14 @@ jobs:
run: cd web && npm run typedoc && mv typedoc.out/ ../doc/dist/web-ui

- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
# upload the built docs
path: 'doc/dist'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
24 changes: 21 additions & 3 deletions service/lib/agama/software/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,25 @@ def import_gpg_keys
end

def add_base_repos
return if add_repos_by_label
return if add_repos_by_dir

# local repositories not found, use the online repositories
product.repositories.each { |url| repositories.add(url) }
end

def add_repos_by_dir
# path to cdrom which can contain installation repositories
dir_path = "/run/initramfs/live/install"

return false unless File.exist?(dir_path)

logger.info "/install found on source cd"
repositories.add("dir://" + dir_path)
true
end

def add_repos_by_label
# NOTE: support multiple labels/installation media?
label = product.labels.first

Expand All @@ -481,12 +500,11 @@ def add_base_repos
if device
logger.info "Installation device: #{device}"
repositories.add("hd:/?device=" + device)
return
return true
end
end

# disk label not found or not configured, use the online repositories
product.repositories.each { |url| repositories.add(url) }
false
end

# find all devices with the required disk label
Expand Down
6 changes: 6 additions & 0 deletions service/package/rubygem-agama-yast.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jan 29 16:28:32 UTC 2025 - Josef Reidinger <jreidinger@suse.com>

- Allow reading repository in /install directory on iso
(jsc#PED-10405)

-------------------------------------------------------------------
Fri Jan 24 09:33:27 UTC 2025 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion web/.svgrrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"icon": 28,
"icon": "1.2em",
"plugins": ["@svgr/plugin-jsx"]
}
40 changes: 40 additions & 0 deletions web/src/assets/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

:root {
--agm-t--color--pine: #0c322c;
--agm-t--color--pine--shade--100: #025937;
--agm-t--color--jungle: #30ba78;
--agm-t--color--jungle--hover: #c0efde;
--agm-t--color--fog: #efefef;
Expand All @@ -37,8 +38,11 @@
--pf-t--global--background--color--action--plain--alt--clicked: var(--agm-t--color--jungle);

--agm-t--install--button--background: var(--agm-t--color--pine);
--agm-t--install--button--background--hover: var(--agm-t--color--pine--shade--100);
--agm-t--install--button--color: var(--pf-t--color--white);

--pf-t--global--color--brand--default: var(--agm-t--color--pine);
--pf-t--global--color--brand--hover: var(--agm-t--color--pine--shade--100);
--pf-t--global--font--family--100: "SUSE Text";
--pf-t--global--font--family--200: "SUSE Display";
--pf-t--global--font--family--300: "Roboto mono", monospace;
Expand All @@ -61,6 +65,7 @@
--pf-t--global--icon--color--status--info--default: var(--agm-t--color--waterhole);
--pf-t--global--breakpoint--lg: 64rem;
--pf-t--global--font--size--body--sm: var(--pf-t--global--font--size--sm);
--pf-t--global--background--color--disabled--default: #dcdbdc;
}

// Temporary CSS rules written during migration to PFv6
Expand Down Expand Up @@ -96,6 +101,10 @@
svg {
fill: var(--agm-t--install--button--color);
}

&:hover {
background: var(--agm-t--install--button--background--hover);
}
}

.agm-inline-menu-toggle {
Expand Down Expand Up @@ -139,10 +148,37 @@
inline-size: 50dvw;
}

.pf-v6-c-masthead__toggle button {
--pf-v6-c-button--LineHeight: 0;

svg {
font-size: var(--pf-t--global--font--size--xl);
}
}

.pf-v6-c-masthead {
--pf-v6-c-masthead__logo--Width: fit-content;
--pf-v6-c-masthead--PaddingBlock: var(--pf-t--global--spacer--sm);
}

.pf-v6-c-page__main-section {
--pf-v6-c-page__main-section--PaddingInlineStart: var(--pf-t--global--spacer--md);
--pf-v6-c-page__main-section--PaddingInlineEnd: var(--pf-t--global--spacer--md);
}

.pf-v6-c-page__main-section.pf-m-sticky-top {
--pf-v6-c-page__main-section--PaddingBlockStart: var(--pf-t--global--spacer--sm);
--pf-v6-c-page__main-section--PaddingBlockEnd: var(--pf-t--global--spacer--sm);
}

.pf-v6-c-page__main-group.pf-m-sticky-bottom {
--pf-v6-c-page--section--m-sticky-bottom--BoxShadow: var(--pf-t--global--box-shadow--md--top);
}

// .pf-v6-c-page__sidebar-body .pf-v6-c-nav:first-child {
// --pf-v6-c-nav--PaddingBlockStart: 0;
// }

.pf-v6-c-alert {
--pf-v6-c-alert--m-info__title--Color: var(--agm-t--color--waterhole);
--pf-v6-c-alert__icon--FontSize: var(--pf-t--global--font--size--lg);
Expand Down Expand Up @@ -173,6 +209,10 @@

.pf-v6-c-nav__link {
--pf-v6-c-nav__link--AlignItems: center;

svg {
font-size: var(--pf-t--global--font--size--lg);
}
}

.pf-v6-c-nav__link.pf-m-current {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { screen } from "@testing-library/react";
import { installerRender } from "~/test-utils";
import { PRODUCT as PATHS } from "~/routes/paths";
import { Product, RegistrationInfo } from "~/types/software";
import ChangeProductLink from "./ChangeProductLink";
import ChangeProductOption from "./ChangeProductOption";
import { useRegistration } from "~/queries/software";

const tumbleweed: Product = {
Expand All @@ -51,15 +51,15 @@ jest.mock("~/queries/software", () => ({
useRegistration: (): ReturnType<typeof useRegistration> => registrationInfoMock,
}));

describe("ChangeProductLink", () => {
describe("ChangeProductOption", () => {
describe("when there is more than one product available", () => {
beforeEach(() => {
mockUseProduct = { products: [tumbleweed, microos] };
});

it("renders a link for navigating to product selection page", () => {
installerRender(<ChangeProductLink />);
const link = screen.getByRole("link", { name: "Change product" });
it("renders a menu item for navigating to product selection page", () => {
installerRender(<ChangeProductOption />);
const link = screen.getByRole("menuitem", { name: "Change product" });
expect(link).toHaveAttribute("href", PATHS.changeProduct);
});

Expand All @@ -69,7 +69,7 @@ describe("ChangeProductLink", () => {
});

it("renders nothing", () => {
const { container } = installerRender(<ChangeProductLink />);
const { container } = installerRender(<ChangeProductOption />);
expect(container).toBeEmptyDOMElement();
});
});
Expand All @@ -81,7 +81,7 @@ describe("ChangeProductLink", () => {
});

it("renders nothing", () => {
const { container } = installerRender(<ChangeProductLink />);
const { container } = installerRender(<ChangeProductOption />);
expect(container).toBeEmptyDOMElement();
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) [2024] SUSE LLC
* Copyright (c) [2024-2025] SUSE LLC
*
* All Rights Reserved.
*
Expand All @@ -21,25 +21,29 @@
*/

import React from "react";
import { Link, LinkProps } from "react-router-dom";
import { DropdownItem, DropdownItemProps } from "@patternfly/react-core";
import { useHref, useLocation } from "react-router-dom";
import { useProduct, useRegistration } from "~/queries/software";
import { PRODUCT as PATHS } from "~/routes/paths";
import { PRODUCT as PATHS, SIDE_PATHS } from "~/routes/paths";
import { _ } from "~/i18n";
import { isEmpty } from "~/utils";

/**
* Link for navigating to the selection product.
* DropdownItem Option for navigating to the selection product.
*/
export default function ChangeProductLink({ children, ...props }: Omit<LinkProps, "to">) {
export default function ChangeProductOption({ children, ...props }: Omit<DropdownItemProps, "to">) {
const { products } = useProduct();
const registration = useRegistration();
const currentLocation = useLocation();
const to = useHref(PATHS.changeProduct);

if (products.length <= 1) return null;
if (!isEmpty(registration?.key)) return null;
if (SIDE_PATHS.includes(currentLocation.pathname)) return null;

return (
<Link to={PATHS.changeProduct} {...props}>
<DropdownItem to={to} {...props}>
{children || _("Change product")}
</Link>
</DropdownItem>
);
}
42 changes: 0 additions & 42 deletions web/src/components/core/Em.jsx

This file was deleted.

35 changes: 0 additions & 35 deletions web/src/components/core/Em.test.jsx

This file was deleted.

2 changes: 1 addition & 1 deletion web/src/components/core/EmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function EmptyStateWrapper({
// @ts-ignore
if (noPadding) rest.className = [rest.className, "no-padding"].join(" ").trim();

const EmptyStateIcon = () => <Icon name={icon} size="xxl" color={color} />;
const EmptyStateIcon = () => <Icon name={icon} />;

return (
<EmptyState
Expand Down
Loading

0 comments on commit c213d68

Please sign in to comment.