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 packages webui #111

Merged
merged 8 commits into from
Feb 24, 2024
Merged

Improve packages webui #111

merged 8 commits into from
Feb 24, 2024

Conversation

hgy59
Copy link
Contributor

@hgy59 hgy59 commented Jan 1, 2024

Some web ui improvements

fix beta label and use different labels for active and inactive packages

  • apply "beta" to package versions instead of packages
  • use green labels for active packages
  • use default (gray) label for inactive packages and add tooltip telling the package is inactive
  • update version date (cut microseconds)
  • fix unclosed span tag in package.html

show packages without active versions (leftover of #106)

fix webpage footer (fixes #116)

  • correct link for SynoCommunity members

@hgy59
Copy link
Contributor Author

hgy59 commented Jan 1, 2024

@mreid-tt this includes a proposal to distinguish active an inactive packages.

It is still a static solution and does not add a user filter to include/exclude inactive packages.

hgy59 added 3 commits January 1, 2024 03:55
- apply "beta" to package versions instead of packages
- use green labels for active packages
- use default (gray) label for inactive packages and add tooltip telling the package is inactive
- update version date (cut microseconds)
- fix unclosed span tag in package.html
- do not hide package in packages when there is no active version (SynoCommunity/spksrc#5803)
- remove obsolete TODOs
@hgy59 hgy59 force-pushed the improve_packages_webui branch from 0a42006 to fed32c9 Compare January 1, 2024 02:56
@mreid-tt
Copy link
Contributor

mreid-tt commented Jan 1, 2024

@hgy59, great work! Pulled into my test environment and all the improvements seem to be there as described. 🚀

I've not interrogated the modifications you did to the tests but I will be guided by your validation.

@hgy59
Copy link
Contributor Author

hgy59 commented Jan 1, 2024

I've not interrogated the modifications you did to the tests but I will be guided by your validation.

packages frontend test changes:

  • beta labels are not shown anymore
  • packages with only inactive versions are shown now

package (singular) frontend test changes:

  • beta label tests added (according to former packages tests)

@hgy59
Copy link
Contributor Author

hgy59 commented Jan 1, 2024

This are the updated views:

beta on verstion instead of package (revisions 10 and 11 are beta, rev 9 not):
spkrepo_beta

inactive package with tooltip (ppc824x and ppc854x of rev 3 are inactive), active packages have green label now (screen shot without mouse cursor):
spkrepo_inactive_tooltip

@mreid-tt
Copy link
Contributor

mreid-tt commented Jan 1, 2024

This are the updated views:

I was thinking more about the tests. Is there a way for it to test that the builds that are shown in the package webpage have the active/inactive colours you added? I don't recall seeing that in your new tests.

@hgy59 hgy59 force-pushed the improve_packages_webui branch 2 times, most recently from 29c6fb9 to b2368a7 Compare January 1, 2024 12:52
@hgy59 hgy59 force-pushed the improve_packages_webui branch from b2368a7 to 0ce2d02 Compare January 1, 2024 12:53
@mreid-tt mreid-tt mentioned this pull request Jan 1, 2024
@mreid-tt
Copy link
Contributor

mreid-tt commented Jan 3, 2024

Hello @hgy59, I encountered a situation while working on the admin side that I believe you can address on the frontend and incorporate into this pull request. The issue arises when a package is created without any versions, and upon manually navigating to the package URL, the server returns an internal server error. I propose the following code modification to handle this scenario:

if package is None:

Change to:

    if package is None or not package.versions:

@mreid-tt
Copy link
Contributor

mreid-tt commented Jan 5, 2024

Hi @hgy59, as another suggestion I would remove the duplicate password reset link on the login page by deleting this line:

<p><a href="{{ url_for('security.forgot_password') }}">I forgot my password</a></p>

@mreid-tt
Copy link
Contributor

mreid-tt commented Jan 8, 2024

@hgy59, I'd love to hear your thoughts on my suggestions. Alternatively, if you prefer, I can make the amendments directly through a commit for you.

hgy59 and others added 3 commits January 8, 2024 19:01
- remove duplicate link to recover email
- handle invalid navigation to package without versions
- TODOs in `spkrepo/views/admin.py` addressed in #112
@mreid-tt
Copy link
Contributor

mreid-tt commented Jan 9, 2024

@hgy59, I hope you don't mind but I reverted a change to spkrepo/views/admin.py as this was addressed in my PR #112. This will prevent a merge conflict between the two.

@mreid-tt
Copy link
Contributor

@Diaoul, @publicarray, do either of you have time to give this a review and approval? Eager to get these into production.

@mreid-tt
Copy link
Contributor

I was looking at issue #116 that was raised regarding the webpage footer. In looking at the code and the website they do not seem to be in sync. For example the footer in the source code is:

<footer class="footer" role="contentinfo">
<div class="container">
<p>Powered by <a href="https://github.com/Diaoul/spkrepo">spkrepo</a>.</p>
<p>Developed by <a href="https://github.com/Diaoul">Antoine Bertin</a>.</p>
<p>Code licensed under <a href="https://github.com/Diaoul/spkrepo/blob/master/LICENSE" target="_blank">MIT</a>.</p>
</div>
</footer>

However on the website the footer has this code:

    <footer class="footer" role="contentinfo">
      <div class="container">
        <p>Designed by Antoine Bertin.</p>
        <p>Maintained by <a href="https://github.com/SynoCommunity?tab=members">SynoCommunity</a> with the help of <a href="https://github.com/SynoCommunity/spksrc/graphs/contributors">contributors</a>.</p>
        <p>Code licensed under <a href="https://github.com/SynoCommunity/spkrepo/blob/master/LICENSE" target="_blank">MIT</a>.</p>
      </div>
    </footer>

I would have normally proposed a fix to include in this PR but the codebase and the website don't seem to align. Any thoughts on this? @publicarray @Diaoul ?

@Diaoul
Copy link
Member

Diaoul commented Jan 27, 2024

Yes some templates are overridden locally on the server. The only way to change them is to SSH to it.

@mreid-tt
Copy link
Contributor

Yes some templates are overridden locally on the server. The only way to change them is to SSH to it.

Hmm, any particular reason for this manual editing? Should I move the server-side HTML into the codebase so they can be in sync?

@mreid-tt
Copy link
Contributor

@hgy59 given the comment above from @Diaoul, I've brought the code in from the live website into the codebase so they would be in sync and resolved the broken members link raised in #116.

@ymartin59
Copy link
Collaborator

I wonder if @Diaoul expects to include synocommunity.com specific templates into code base, as spkrepo may be deployed by other users.

@mreid-tt
Copy link
Contributor

I wonder if @Diaoul expects to include synocommunity.com specific templates into code base, as spkrepo may be deployed by other users.

As far as I can observe the code is very explicit to SynoCommunity in the templates. My suspicion is that there was a minor HTML change in the footer that was needed sometime ago and the change was made as a direct edit on the server and never brought back into the codebase (I've seen a similar thing in the database schema). This last commit was meant to bring them back in sync so that we don't have this to worry about it moving forward.

To check for any others (that we can't see without server access), according to this blog we can run these commands on the server:

To display file names that are NOT under version control:

git clean -fdxn

To display all changes in the GIT files just use:

git diff .

So if there are any other files which are different we can sync them up. This makes the server easier to maintain and if we ever had to move to another server there would be less non-standard variables to worry about.

@publicarray
Copy link
Member

publicarray commented Feb 24, 2024

@mreid-tt looks good to me, with this the spkrepo is going to be more specific for our use case and no longer as generic.

The reason for removing the password reset I assume is because we can't send emails? I would have thought it's best to leave it in regardless so that at least a reset code can be generated, even if it isn't sent.

@publicarray
Copy link
Member

Hi @hgy59, as another suggestion I would remove the duplicate password reset link on the login page by deleting this line:

<p><a href="{{ url_for('security.forgot_password') }}">I forgot my password</a></p>

Oh duplicate I see

@publicarray publicarray merged commit 2db02f3 into main Feb 24, 2024
2 checks passed
@mreid-tt mreid-tt deleted the improve_packages_webui branch February 25, 2024 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Members Link in SynoCommunity Website Footer Is Bad
5 participants