-
-
Notifications
You must be signed in to change notification settings - Fork 146
Add new setting for grouping CRD in UI menu #815
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
base: main
Are you sure you want to change the base?
Add new setting for grouping CRD in UI menu #815
Conversation
|
I won't lie: it seems to me overcomplicated. I really don't want to create any JSON file (btw, why JSON if all ecosystem is YAML-based) for grouping of menus, then catching all edge cases (too long strings, broken schemas, weird characters, 10 more edge cases) then editing it for all my CRDs (now 77, will be more probably). I mean: it looks like some hack rather than friendly solution. What I would really need is maybe some automating grouping it by predefined set of labels/annotations? I see we eventually could have some heuristic and use first found label/annotation like, ie.:
Some UI when I can build the menu also would be welcomed but still: like is too short to spend it on building menu for 77 resources, IMO. |
|
Another possibility maybe: just a simple YAML with Regexp/substring/suffix? Why I need to list all CRDs one-by-one if simple rule could catch them all and 1st is winning. Ie: AWS:
- amazonaws.com
- aws
KEDA:
- keda.sh
External Secrets:
- external-secrets.io
FluxCD:
- fluxcd.controlplane.io
- fluxcd.io
Karpenter:
- karpenter.sh
Kyverno:
- kyverno.io
- wgpolicyk8s.io
Kubernetes:
- k8s.io
Prometheus:
- monitoring.coreos.comSimple, effective, we can provide default configuration for 1000 of them in our main repo or provide a canonical list to download/refresh and it can be a default with option to add or override by user for some unknown CDRs. |
|
I can convert it to yaml that not a problem for me and accept regex that ok for me i thought about it but didn't think if we need it or not. {
"Kyverno": [
{
"Core": [
"kyverno.io"
]
},
{
"Policies": [
"policies.kyverno.io"
]
},
{
"Reports": [
"reports.kyverno.io"
]
}
],
"FluxCD": [
{
"Core": [
"kustomize.toolkit.fluxcd.io"
]
},
{
"Image Policies": [
"image.toolkit.fluxcd.io"
]
},
{
"Source Control": [
"helm.toolkit.fluxcd.io",
"source.toolkit.fluxcd.io"
]
},
{
"Notifications": [
"notification.toolkit.fluxcd.io"
]
}
],
"Cast AI": [
{
"Autoscaling": [
"autoscaling.cast.ai"
]
},
{
"Gate Keeper": [
"config.gatekeeper.sh",
"expansion.gatekeeper.sh",
"externaldata.gatekeeper.sh",
"mutations.gatekeeper.sh",
"status.gatekeeper.sh",
"syncset.gatekeeper.sh",
"templates.gatekeeper.sh"
]
},
{
"Policies": [
"wgpolicyk8s.io"
]
}
],
"KEDA": [
{
"Core": [
"keda.sh"
]
},
{
"Events": [
"eventing.keda.sh"
]
}
],
"CSI": [
{
"Secrets": [
"secrets-store.csi.x-k8s.io"
]
},
{
"Volume Snaphost": [
"snapshot.storage.k8s.io"
]
}
],
"Cert Manager": [
{
"Core": [
"cert-manager.io"
]
},
{
"ACME": [
"acme.cert-manager.io"
]
}
],
"Cluster API": [
{
"Addons": [
"addons.cluster.x-k8s.io"
]
},
{
"Cluster": [
"clusterctl.cluster.x-k8s.io",
"cluster.x-k8s.io"
]
},
{
"IPAM": [
"ipam.cluster.x-k8s.io"
]
},
{
"Runtime": [
"runtime.cluster.x-k8s.io"
]
}
],
"Victoria Metrics": [
{
"Core": [
"operator.victoriametrics.com"
]
},
{
"Monitoring": [
"monitoring.coreos.com"
]
}
],
"Other": [
{
"APISIX": [
"apisix.apache.org"
]
},
{
"CollectorD": [
"collectord.io"
]
},
{
"Kubecost": [
"kubecost.com"
]
},
{
"LinkerD": [
"linkerd.io",
"policy.linkerd.io"
]
},
{
"Microsoft Defender": [
"defender.microsoft.com"
]
},
{
"Redis": [
"redis.redis.opstreelabs.in"
]
},
{
"Service Mesh Interface": [
"split.smi-spec.io"
]
},
{
"Trivy": [
"aquasecurity.github.io"
]
}
]
} |
|
1 -2- i agree to create a default configuration it's always cool to have it. We just need to create a good grouping. I don't necessary have enought exemple/list of crd for creating everything myself. For the catch-all rule what do you want ?
The other thing is what do we want for the order, alphabeticaly ? same as the yaml ? I will work on it during this week. maybe some collegue will help in their free time |
a5942a4 to
08514b4
Compare
ba3a2bb to
cd16e6a
Compare
ae51b98 to
0908bfa
Compare
|
Hello Hello after a lot of try and test on my way i have some new work : This pull request introduces enhancements to the extension registration process, updates custom resource sidebar handling, and adds a new "CRDs" tab in preferences. The changes focus on improving state management, updating test snapshots, and enhancing the user interface. Extension Registration Enhancements:
Custom Resource Sidebar Updates:
Preferences UI Enhancements:
i still need to test that everything work well and there is no case i forgot to test . but it's seem to work well on my side for the moment
If you have a list for the default configuration :) could be good . |
|
@dex4er any suggestion ? comment about it |
|
@dex4er hello hello what can do to merge it ? Thanks |
|
Very cool feature, looking forward to trying it out 🙂 thanks for your effort @snaquekiller 👍 |
thanks but there no reply from dexer how to merge it and what he want more :'( |
|
Hey @dex4er, not to be impatient, but do you have some time again to review this PR once again or at least give any feedback about the status, by any chance? 🙂 Sorry if this counts as being annoying. Just some short feedback would be very cool. much appreciated 👍 |
…mise à jour de la logique de stockage des préférences utilisateur. Signed-off-by: Guitton Nicolas <[email protected]>
…tat des préférences utilisateur dans le calcul des éléments de la barre latérale. Signed-off-by: Guitton Nicolas <[email protected]>
…fication de l'état du groupe Signed-off-by: Guitton Nicolas <[email protected]>
…ion JSON améliorée et un message d'indice contextuel. Signed-off-by: Guitton Nicolas <[email protected]>
…ge d'indice plus informatif et une validation JSON améliorée. Signed-off-by: Guitton Nicolas <[email protected]>
…t ainsi l'expérience utilisateur. Signed-off-by: Guitton Nicolas <[email protected]>
…SON et gestion des erreurs lors de l'obtention des éléments de la barre latérale. Signed-off-by: Guitton Nicolas <[email protected]>
… d'erreur et formatage du code pour une meilleure lisibilité. Signed-off-by: Guitton Nicolas <[email protected]>
… : mise à jour des titres de page et d'onglet. Signed-off-by: Guitton Nicolas <[email protected]>
…on des préférences utilisateur. Signed-off-by: Guitton Nicolas <[email protected]>
…groupes CRD : implémentation de la validation, ajout de la configuration par défaut et mise à jour de la gestion des erreurs. Signed-off-by: Guitton Nicolas <[email protected]>
…chier YAML Signed-off-by: Guitton Nicolas <[email protected]>
…e la validation YAML dans la gestion des groupes CRD. Signed-off-by: Guitton Nicolas <[email protected]>
Signed-off-by: Guitton Nicolas <[email protected]>
…sonnalisées dans la barre latérale Signed-off-by: Guitton Nicolas <[email protected]>
…nération des éléments de la barre latérale : filtrage des groupes et sous-niveaux vides, mise à jour de l'exemple de format YAML. Signed-off-by: Guitton Nicolas <[email protected]>
…s d'injectables dans les extensions et la création automatique des API CRD Signed-off-by: Guitton Nicolas <[email protected]>
…uration YAML dans le composant CrdGroup, avec amélioration de l'interface utilisateur et des fonctionnalités de fusion. Signed-off-by: Guitton Nicolas <[email protected]>
…mise à jour des styles pour les titres et les sections d'aide, ajout de classes utilitaires pour une meilleure hiérarchie visuelle, et ajustement des tests pour refléter les nouvelles modifications. Signed-off-by: Guitton Nicolas <[email protected]>
…t CrdGroup, avec validation améliorée et gestion des erreurs. Mise à jour des tests pour refléter les changements. Signed-off-by: Guitton Nicolas <[email protected]>
…ichier crd-preference-page.injectable.tsx. Signed-off-by: Guitton Nicolas <[email protected]>
fa77f2e to
ecf0365
Compare
|
Hi @snaquekiller! I personally just saw this PR now and wanted to thank you so much for your work regardless. |
|
This looks great! How can I try it out to give feedback? |
Hi @juv and thank you about your interest in Freelens! |




This pull request introduces a new feature for managing Custom Resource Definitions (CRDs) in the preferences UI and sidebar. It includes changes to add support for grouping CRDs, validate JSON configurations, and improve error handling in sidebar item registration. The most important changes are grouped into themes: CRD Preferences, Sidebar Enhancements, and Error Handling.
CRD Preferences:
navigateToCrdPreferencesInjectableto enable navigation to CRD preferences. (packages/core/src/features/preferences/common/navigate-to-crd-preferences.injectable.ts)crdGroupPreferenceBlockInjectableandCrdGroupcomponent to allow users to define custom CRD groups in JSON format, with validation and formatting functionality. (packages/core/src/features/preferences/renderer/preference-items/crd/crd-group/crd-group-preference-block.injectable.ts,packages/core/src/features/preferences/renderer/preference-items/crd/crd-group/crd-group.tsx) [1] [2]packages/core/src/features/preferences/renderer/preference-items/crd/crd-preference-page.injectable.tsx,packages/core/src/features/preferences/renderer/preference-items/crd/crd-preference-tab.injectable.ts) [1] [2]userPreferenceDescriptorsInjectableanduserPreferencesPersistentStorageInjectableto store and retrieve CRD group preferences. (packages/core/src/features/user-preferences/common/preference-descriptors.injectable.ts,packages/core/src/features/user-preferences/common/storage.injectable.ts) [1] [2] [3]Examples
Sidebar Enhancements:
groups-sidebar-items-computed.injectable.tsto support hierarchical grouping of CRDs based on user-defined JSON configurations, including top-level and sub-level groups. (packages/core/src/renderer/components/custom-resource-definitions/groups-sidebar-items-computed.injectable.ts) [1] [2] [3]packages/core/src/renderer/components/custom-resource-definitions/groups-sidebar-items-computed.injectable.ts)Error Handling:
groups-sidebar-items-registrator.injectable.tsto wrap reactions in try/catch blocks, ensuring errors in sidebar item computation or registration do not propagate. (packages/core/src/renderer/components/custom-resource-definitions/groups-sidebar-items-registrator.injectable.ts)