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

Improve Template Manager UI #382

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

marmarta
Copy link
Member

Changed Template Manager UI to be more friendly.
Added a lot of explanations. Functionally,
added checking for obsolete templates.

@marmarta
Copy link
Member Author

Should I base this on release4.2 or on main, @marmarek ?

@marmarek
Copy link
Member

main

@marmarta marmarta force-pushed the update_template_manager_looks branch from c5370f3 to 8e93566 Compare August 20, 2024 14:31
@marmarta marmarta changed the base branch from release4.2 to main August 20, 2024 14:32
@marmarta marmarta force-pushed the update_template_manager_looks branch from 8e93566 to f1fdb2a Compare August 20, 2024 14:45
Changed Template Manager UI to be more friendly.
Added a lot of explanations. Functionally,
added checking for obsolete templates.
@marmarta marmarta force-pushed the update_template_manager_looks branch from f1fdb2a to 23fa39f Compare August 20, 2024 15:11
@marmarta marmarta mentioned this pull request Sep 25, 2024
Copy link
Member

@marmarek marmarek left a comment

Choose a reason for hiding this comment

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

Besides specific comments below, here are few comments about the behavior:

  1. When clicking "upgrade template" on installed template, I get a warning it will get reinstalled and my changes will be lost. But then it says "Template ... of highest version already installed, skipping..." and it doesn't actually reinstall it. I tried this on fedora-40-xfce - installed version is "0:4.2.0-202404251306" and the one in repo "0:4.3.0-202405280043".
  2. Templates listed as "installed" have version that is currently installed. So far so good. But there is no information to what version"upgrade" action will upgrade it. This may be related to dropping version from tpls dict key (the comment about keeping just epoch).
  3. Templates that are both installed and available (possibly with a newer version) are not listed as "available" (that's probably okay, if a version you can update to is listed somewhere).
  4. Failed action shows an error text, but there is no icon/extra dialog about the error. Maybe at least "OK" button should change?
  5. Clicking "Repository settings" should go to "updates" tab, and ideally scroll to the templates section. Or at least say somewhere that user should go there.
  6. Repository data should refresh automatically after coming back from repository settings. Or there should be some info that user need to click that button themselves.

Besides the above, it's a huge improvement over the old template manager.

Comment on lines +74 to +84
# Todo:
# - tests
# - packaging

# tests:
# - run with data, see if there are things listed
# - check button visibility?

# later bullcrap
# - fix qvm-template
# - update eol table
Copy link
Member

Choose a reason for hiding this comment

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

Not applicable anymore, right? If some still is, create issues instead of comments here.

if not eol_string:
return False
eol = datetime.strptime(eol_string, '%Y-%m-%d')
return eol > datetime.now()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return eol > datetime.now()
return eol < datetime.now()

name = self.template_name
for suffix in SUFFIXES:
name = name.removesuffix(suffix)
eol_string = EOL_DATES.get(name, None)
Copy link
Member

Choose a reason for hiding this comment

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

It should also look at os-eol feature on the template itself (for installed templates). This may need to be collected elsewhere and put into entry dict to keep it clean.

If you prefer to change it later in a separate PR, I'm fine with that too, but open an issue about it then.

for key in tpls:
tpls[key] = {
(x['name'], x['epoch'], x['version'], x['release']): x
(x['name'], x['epoch']): x
Copy link
Member

Choose a reason for hiding this comment

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

Why just epoch? It's meaningless without full version. Maybe you need just name here then?

@@ -100,6 +100,7 @@ rm -rf $RPM_BUILD_ROOT

%{python3_sitelib}/qubesmanager/resources_rc.py

%{python3_sitelib}/qubesmanager/ui_templatemanger2.py
Copy link
Member

Choose a reason for hiding this comment

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

Should the old one be removed (not only from spec, but from repo completely)?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, good catch, no point keeping it

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.

2 participants