Skip to content

Conversation

@lslezak
Copy link
Contributor

@lslezak lslezak commented Mar 31, 2025

Problem

  • Extensions can be registered only from command line or in autoinstallation

Solution

  • Implement the web UI

Screenshots

The first proposal:

agama-extension-ui

After registering the registration code field and the button is replaced by "registered" status text:

image

Copy link
Contributor

@dgdavid dgdavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @lslezak!

To be honest, I'm not completely sure how this will look when we have a bunch of extensions, but it definitely seems like a very good starting point to me.

That said, I’ve left a few comments that I think could help refine it a bit more before releasing a first iteration.

Hope it helps.

Copy link
Contributor Author

@lslezak lslezak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DBus error

export default function ProductRegistrationPage() {
const { selectedProduct: product } = useProduct();
const { key } = useRegistration();
// FIXME: this needs to be fixed for RMT which allows registering with empty key
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙈

@mvidner
Copy link
Contributor

mvidner commented Apr 11, 2025

Just a note about the aa{sv} versus a{sv} confusion referenced earlier, I have tried to improve ruby-dbus to report a better error message for this, but it is a bit hard to fix because the weird "a Dictionary is actually an Array of Dictionary-Entries" concept is spread through the code base.

mvidner/ruby-dbus#148

@lslezak lslezak marked this pull request as ready for review April 14, 2025 13:57
@lslezak
Copy link
Contributor Author

lslezak commented Apr 15, 2025

I tried to simplify the code in b40dea6, but now it fails with error:

error[E0277]: the `?` operator can only be used in a closure that returns `Result` or `Option` (or another type that implements `std::ops::FromResidual`)
   --> agama-lib/src/product/client.rs:157:46
    |
156 |             .map(|hash| AddonProperties {
    |                  ------ this function should return `Result` or `Option` to accept `?`
157 |                 id: get_property(&hash, "id")?,
    |                                              ^ cannot use the `?` operator in a closure that returns `software::model::registration::AddonProperties`
    |
    = help: the trait `std::ops::FromResidual<std::result::Result<std::convert::Infallible, zbus::zvariant::Error>>` is not implemented for `software::model::registration::AddonProperties`

See the full log at https://github.com/agama-project/agama/actions/runs/14464157813/job/40562519285#step:8:619.

No idea how to fix that... 😟

@lslezak
Copy link
Contributor Author

lslezak commented Apr 15, 2025

OK, now it compiles fine.

Copy link
Contributor

@imobachgs imobachgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Rust part looks good.

.available_addons()
.await?
.into_iter()
.map(|hash| AddonProperties {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be a good idea to move this code to a separate function. But, for now, it is good enough. Thanks!

@lslezak lslezak merged commit 57fcdf0 into master Apr 15, 2025
12 checks passed
@lslezak lslezak deleted the extensions_ui branch April 15, 2025 10:49
@imobachgs imobachgs mentioned this pull request Apr 22, 2025
imobachgs added a commit that referenced this pull request Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants