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

feature(web): make the product selection more appealing and accessible #1550

Merged
merged 22 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d43bcc2
Decorated product selection without radio btn
lkocman Aug 21, 2024
562fa73
Do not repeat product name on the first line
lkocman Aug 21, 2024
51b84d7
Add padding 20px from right as well as 20px from bottom to allow long…
lkocman Aug 21, 2024
632a652
Use border color that matches active button
lkocman Aug 21, 2024
243d344
get rid of problematic logger entry from test perspective
lkocman Aug 21, 2024
43604fa
add icon definition to ChangeProductLink test
lkocman Aug 21, 2024
e7e7b9d
Update web/src/components/product/ProductSelectionPage.jsx
lkocman Aug 22, 2024
e06eb2c
Update service/lib/agama/software/product.rb
lkocman Aug 22, 2024
ca59133
Update service/lib/agama/software/product_builder.rb
lkocman Aug 22, 2024
3c92e8d
Update service/lib/agama/software/product.rb
lkocman Aug 22, 2024
f8ae4e7
Revert "Update web/src/components/product/ProductSelectionPage.jsx"
lkocman Aug 22, 2024
8ad16c2
Merge branch 'master' into icons
dgdavid Sep 4, 2024
ce403e0
fix(web): restore radio inputs in product selection
dgdavid Sep 4, 2024
3cb7ebf
fix(web): do not lost focus when selecting a product
dgdavid Sep 4, 2024
e85aef0
feat(web): copy product logos to public dist directory
dgdavid Sep 4, 2024
ec57cc1
refactor(web): rework product selector
dgdavid Sep 4, 2024
f22d679
fix(web): improve a11y of product selector
dgdavid Sep 5, 2024
1d823e9
refactor(web): migrate product selector to TypeScript
dgdavid Sep 5, 2024
aefdd5f
fix(web): restore unit test for product selection
dgdavid Sep 5, 2024
ac7f797
Merge branch 'master' into icons
dgdavid Sep 5, 2024
ed0025a
fix(web): adapt entries in changelog files
dgdavid Sep 5, 2024
18b48cc
fix(web): fixes from code review
dgdavid Sep 5, 2024
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 products.d/agama-products.changes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Tue Sep 3 10:24:30 UTC 2024 - Lubos Kocman <[email protected]>
- Add kde to Leap 16.0, remove Xfce until it's fully submitted to 16.0
initial set of ~800 KIDE related packages were just merged to Leap 16.0

-------------------------------------------------------------------
Wed Aug 21 19:07:28 UTC 2024 - Lubos Kocman <[email protected]>

- Add product icons. Resolves Issue #1415
Not setting any icon will default to default.svg icon

-------------------------------------------------------------------
Fri Aug 2 09:12:25 UTC 2024 - Imobach Gonzalez Sosa <[email protected]>

Expand Down
3 changes: 2 additions & 1 deletion products.d/leap_160.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ name: Leap 16.0 Alpha
# at the at translations/description key below to avoid using obsolete
# translations!!
# ------------------------------------------------------------------------------
description: 'Leap 16.0 is the latest version of a community distribution based
description: 'The latest version of a community distribution based
on the latest SUSE Linux Enterprise Server.'
# Do not manually change any translations! See README.md for more details.
icon: Leap16.svg
translations:
description:
ca: El Leap 16.0 és la darrera versió d'una distribució comunitària basada en
Expand Down
1 change: 1 addition & 0 deletions products.d/microos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ description: 'A quick, small distribution designed to host container workloads
with automated administration & patching. openSUSE MicroOS provides
transactional (atomic) updates upon a read-only btrfs root file system. As
rolling release distribution the software is always up-to-date.'
icon: MicroOS.svg
# Do not manually change any translations! See README.md for more details.
translations:
description:
Expand Down
3 changes: 2 additions & 1 deletion products.d/sles_160.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ name: SUSE Linux Enteprise Server 16.0 Alpha
# at the at translations/description key below to avoid using obsolete
# translations!!
# ------------------------------------------------------------------------------
description: "SUSE Linux Enterprise Server is the open, reliable, compliant, and
description: "An open, reliable, compliant, and
future-proof Linux Server choice that ensures the enterprise's business
continuity. It is the secure and adaptable OS for long-term supported,
innovation-ready infrastructure running business-critical workloads
on-premises, in the cloud, and at the edge."
icon: SUSE.svg
# Do not manually change any translations! See README.md for more details.
translations:
description:
Expand Down
3 changes: 2 additions & 1 deletion products.d/tumbleweed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ name: openSUSE Tumbleweed
# at the at translations/description key below to avoid using obsolete
# translations!!
# ------------------------------------------------------------------------------
description: 'The Tumbleweed distribution is a pure rolling release version of
description: 'A pure rolling release version of
openSUSE containing the latest "stable" versions of all software instead of
relying on rigid periodic release cycles. The project does this for users that
want the newest stable software.'
icon: Tumbleweed.svg
# Do not manually change any translations! See README.md for more details.
translations:
description:
Expand Down
1 change: 1 addition & 0 deletions rust/agama-lib/share/profile.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"id": {
"title": "Product identifier",
"description": "The id field from a products.d/foo.yaml file",
"icon": "Product Icon path specified in products.d/foo.yaml file",
"type": "string"
},
"registrationCode": {
Expand Down
7 changes: 7 additions & 0 deletions rust/agama-lib/src/product/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ pub struct Product {
pub name: String,
/// Product description
pub description: String,
/// Product icon (e.g., "default.svg")
pub icon: String,
}

#[derive(Clone, Debug, Serialize, Deserialize, utoipa::ToSchema)]
Expand Down Expand Up @@ -74,10 +76,15 @@ impl<'a> ProductClient<'a> {
Some(value) => value.try_into().unwrap(),
None => "",
};
let icon = match data.get("icon") {
Some(value) => value.try_into().unwrap(),
None => "default.svg",
};
Product {
id,
name,
description: description.to_string(),
icon: icon.to_string(),
}
})
.collect();
Expand Down
6 changes: 6 additions & 0 deletions rust/package/agama.changes
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Mon Aug 26 11:19:27 UTC 2024 - Martin Vidner <[email protected]>
for Software (gh#openSUSE/agama#1548)
- added SoftwareHTTPClient

-------------------------------------------------------------------
Wed Aug 21 19:07:28 UTC 2024 - Lubos Kocman <[email protected]>

- Add product icons. Resolves Issue #1415
dgdavid marked this conversation as resolved.
Show resolved Hide resolved
Not setting any icon will default to default.svg icon

-------------------------------------------------------------------
Thu Aug 15 08:33:02 UTC 2024 - Josef Reidinger <[email protected]>

Expand Down
9 changes: 8 additions & 1 deletion service/lib/agama/dbus/software/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@ def issues

def available_products
backend.products.map do |product|
[product.id, product.display_name, { "description" => product.localized_description }]
[
product.id,
product.display_name,
{
"description" => product.localized_description,
"icon" => product.icon
}
]
end
end

Expand Down
8 changes: 8 additions & 0 deletions service/lib/agama/software/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ class Product
# @return [String, nil] E.g., "1.0".
attr_accessor :version

# Product icon. Please use specify filename with svg suffix and ensure referenced
# file exists inside agama/web/src/assests/product.
dgdavid marked this conversation as resolved.
Show resolved Hide resolved
dgdavid marked this conversation as resolved.
Show resolved Hide resolved
# `default.svg` will be used unless specified otherwise.
#
# @return [String] E.g. "leap.svg"
attr_accessor :icon

# List of repositories.
#
# @return [Array<String>] Empty if the product requires registration.
Expand Down Expand Up @@ -99,6 +106,7 @@ class Product
# @param id [string] Product id.
def initialize(id)
@id = id
@icon = "default.svg"
@repositories = []
@labels = []
@mandatory_packages = []
Expand Down
2 changes: 2 additions & 0 deletions service/lib/agama/software/product_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def initialize_product(id, data, attrs)
product.description = attrs["description"]
product.name = data[:name]
product.version = data[:version]
product.icon = attrs["icon"] if attrs["icon"]
end
end

Expand Down Expand Up @@ -98,6 +99,7 @@ def product_data_from_config(id)
{
name: config.products.dig(id, "software", "base_product"),
version: config.products.dig(id, "software", "version"),
icon: config.products.dig(id, "software", "icon"),
labels: config.arch_elements_from(
id, "software", "installation_labels", property: :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
Expand Up @@ -27,6 +27,12 @@ Mon Aug 26 10:01:27 UTC 2024 - Imobach Gonzalez Sosa <[email protected]>
- Do not depend on f2fs-tools and nilfs-utils
(jsc#PED-8669, gh#openSUSE/agama#1554).

-------------------------------------------------------------------
Wed Aug 21 19:07:28 UTC 2024 - Lubos Kocman <[email protected]>
dgdavid marked this conversation as resolved.
Show resolved Hide resolved

- Add product icons. Resolves Issue #1415
Not setting any icon will default to default.svg icon

-------------------------------------------------------------------
Mon Aug 19 15:13:46 UTC 2024 - Lubos Kocman <[email protected]>

Expand Down
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 Aug 21 19:07:28 UTC 2024 - Lubos Kocman <[email protected]>

- Add product icons. Resolves Issue #1415
Not setting any icon will default to default.svg icon

-------------------------------------------------------------------
Tue Aug 13 14:57:21 UTC 2024 - David Diaz <[email protected]>

Expand Down
79 changes: 79 additions & 0 deletions web/src/assets/products/Leap16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions web/src/assets/products/MicroOS.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading