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

ui: Allow font-awesome icon usage and optimise icon size inconsistency #9744

Open
wants to merge 3 commits into
base: 4.19
Choose a base branch
from

Conversation

rohityadavcloud
Copy link
Member

@rohityadavcloud rohityadavcloud commented Sep 28, 2024

This addresses that issue that plugins customisation in the UI (https://docs.cloudstack.apache.org/en/4.19.1.1/adminguide/ui.html#basic-ui-c
ustomization) isn't able to use all the ant-design-vue icons.

We already use and support fontawesome components such as for Kubernetes menu etc.
This extends the usage of fontawesome (free) solid icons for custom plugins
section in config.json. The plugin can be defined as array:

  "plugins": [
    {
        "name": "HomeLab",
        "icon": ["fa-solid", "fa-server"],
        "path": "https://dash.yadav.cloud/dash/"
    }
  ],

Here the icons is declared as a json array config, where the first
parameter is the pack/type name ("fa-solid") and the second parameter is
the icons name with the "fa-" prefix.

The solid icon can be searched and used from here:
https://fontawesome.com/search?q=server&o=r&s=solid

This also fixes icon size inconsistency when fa os-logo icons are used versus when resource icons are used. This also changes some of the infocard icons to use better icons from font awesome.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Testing

With the example json snipped defined above, would result in this which uses a font awesome solid icon:
Screenshot 2024-09-28 at 12 38 03 PM

This calls listProjects with details=min in the global header menu.

Signed-off-by: Rohit Yadav <[email protected]>
This enables usage of fontawesome (free) solid icons for custom plugins
section in config.json. The plugin can be defined as array:

```
  "plugins": [
    {
        "name": "HomeLab",
        "icon": ["fa-solid", "fa-server"],
        "path": "https://dash.yadav.cloud/dash/"
    }
  ],
```

Here the icons is declared as a json array config, where the first
parameter is the pack/type name ("fa-solid") and the second parameter is
the icons name with the "fa-" prefix.

The solid icon can be searched and used from here:
https://fontawesome.com/search?q=server&o=r&s=solid

Signed-off-by: Rohit Yadav <[email protected]>
This fixes icon size inconsistency when fa os-logo icons are used versus
when resource icons are used. This also changes some of the infocard
icons to use better icons from font awesome.

Signed-off-by: Rohit Yadav <[email protected]>
@rohityadavcloud
Copy link
Member Author

FYI - this is from Swen (proIO's) email from users ML who found a limitation in plugins/UI icons usage.

@blueorangutan ui

@blueorangutan
Copy link

@rohityadavcloud a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

Copy link

codecov bot commented Sep 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 15.08%. Comparing base (0fae0c0) to head (4e5150b).
Report is 25 commits behind head on 4.19.

Additional details and impacted files
@@             Coverage Diff              @@
##               4.19    #9744      +/-   ##
============================================
- Coverage     15.08%   15.08%   -0.01%     
+ Complexity    11194    11184      -10     
============================================
  Files          5406     5402       -4     
  Lines        473184   473137      -47     
  Branches      58549    61651    +3102     
============================================
- Hits          71398    71379      -19     
+ Misses       393836   393817      -19     
+ Partials       7950     7941       -9     
Flag Coverage Δ
uitests 4.30% <ø> (-0.01%) ⬇️
unittests 15.80% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/9744 (QA-JID-458)

@rohityadavcloud
Copy link
Member Author

QA'd manually this seems to be working okay: (notice the icons)
Screenshot 2024-09-30 at 1 13 43 PM

@DaanHoogland
Copy link
Contributor

FYI - this is from Swen (proIO's) email from users ML who found a limitation in plugins/UI icons usage.

https://lists.apache.org/thread/0062c2o0dl4vps562bdkpmw0ym8f5yq6

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm (not sure I can judge the long term policy, though)

@DaanHoogland DaanHoogland linked an issue Sep 30, 2024 that may be closed by this pull request
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.

UI: Missing icons when implementing custom menu points
3 participants