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

feat(policy-summary): add formats universal and kubernetes #3581

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

schogges
Copy link
Contributor

@schogges schogges commented Feb 21, 2025

Requires

Splits the format YAML into Kubernetes and Universal. The selected format is stored as preference k8s or universal in local storage.

Kubernetes

image

Universal

image

Closes #3489

Signed-off-by: schogges <moritz.fleck@konghq.com>
Signed-off-by: schogges <moritz.fleck@konghq.com>
Signed-off-by: schogges <moritz.fleck@konghq.com>
Copy link

netlify bot commented Feb 21, 2025

Deploy Preview for kuma-gui ready!

Name Link
🔨 Latest commit 30cee64
🔍 Latest deploy log https://app.netlify.com/sites/kuma-gui/deploys/67bee34258d28400083f63e0
😎 Deploy Preview https://deploy-preview-3581--kuma-gui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@schogges schogges marked this pull request as ready for review February 24, 2025 13:29
@schogges schogges requested a review from a team as a code owner February 24, 2025 13:29
@schogges schogges requested review from johncowen and removed request for a team February 24, 2025 13:29
@johncowen
Copy link
Contributor

johncowen commented Feb 24, 2025

I think we are going to have to decide what to do about our "Global Format" values. Previous to this PR we had 2 possible values structured and yaml. Now, at least in some places we have 3 structured, yaml-universal and yaml-k8s.

Off the back of that I have a question, with some potential follow up questions/suggestions.

  • I think the plan will be to have 3 options everywhere? Is that right do you think?

Separately, I think we will have to build the data interaction so if you don't have Kubernetes selected when landing on the page we don't make the ?format=kubernetes request, we only actually make it when you switch to kubernetes. If you do already have kubernetes selected when landing on a page, then of course its fine to make the ?format=kubernetes request when we land on the page.

@schogges
Copy link
Contributor Author

schogges commented Feb 24, 2025

I think we are going to have to decide what to do about our "Global Format" values. Previous to this PR we had 2 possible values structured and yaml. Now, at least in some places we have 3 structured, yaml-universal and yaml-k8s.

Of the back of that I have a question, with some potential follow up questions/suggestions.

  • I think the plan will be to have 3 options everywhere? Is that right do you think?

Hmmm, good point 🤔 I think we will have more options everywhere. I think that would be beneficial for the UX, because as a kubernetes user I'm mainly/only interested in the k8s format. But during the time where we have to support yaml, yaml-universal and yaml-kubernetes (we don't know how long that'll be), it's probably better to have yaml and yaml-kubernetes only where yaml is both the format for yaml and yaml-universal. Wdyt?

Separately, I think we will have to build the data interaction so if you don't have Kubernetes selected when landing on the page we don't make the ?format=kubernetes request, we only actually make it when you switch to kubernetes. If you do already have kubernetes selected when landing on a page, then of course its fine to make the ?format=kubernetes request when we land on the page.

I was thinking about this and thought it'd be better to load this initially than loading it after selecting k8s 🤔 but I can move the DataLoader to wrap the k8s CodeBlock only.

@johncowen
Copy link
Contributor

I think we will have more options everywhere.

👍 cool

I think that would be beneficial for the UX, because as a kubernetes user I'm mainly/only interested in the k8s format.

Yeah this is where things can get weird. global could be on k8s, but a zone on that install could be universal or vice-versa. Or maybe I just want to see what universal looks like even though I'm totally on k8s.

Given the above maybe we should change the values to structured, universal, k8s? And we just implicitly know (because the default format for universal and k8s is YAML) that universal and k8s formats mean we are showing it in YAML for the specific software environment?

@schogges
Copy link
Contributor Author

I think that would be beneficial for the UX, because as a kubernetes user I'm mainly/only interested in the k8s format.

Yeah this is where things can get weird. global could be on k8s, but a zone on that install could be universal or vice-versa. Or maybe I just want to see what universal looks like even though I'm totally on k8s.

Yeah, totally agree 👍

Given the above maybe we should change the values to structured, universal, k8s? And we just implicitly know (because the default format for universal and k8s is YAML) that universal and k8s formats mean we are showing it in YAML for the specific software environment?

Sounds good 👍 I'll change it, but would also like to ask wdyt we should do once we add JSON to the group? 🙂

@schogges
Copy link
Contributor Author

The good thing is that in all the other places we currently have the flow of either show structured or the codeblock. So regardless if the user selects kubernetes or universal, in the other places the user will see the codeblock.

Signed-off-by: schogges <moritz.fleck@konghq.com>
Signed-off-by: schogges <moritz.fleck@konghq.com>
@johncowen
Copy link
Contributor

Sounds good 👍 I'll change it, but would also like to ask wdyt we should do once we add JSON to the group? 🙂

Hmm, depends, what will the content of the JSON be? I would guess we aren't doing "JSON Universal" and "JSON Kubernetes", but maybe we are?

Signed-off-by: schogges <moritz.fleck@konghq.com>
@schogges
Copy link
Contributor Author

schogges commented Feb 25, 2025

Sounds good 👍 I'll change it, but would also like to ask wdyt we should do once we add JSON to the group? 🙂

Hmm, depends, what will the content of the JSON be? I would guess we aren't doing "JSON Universal" and "JSON Kubernetes", but maybe we are?

Not sure either, I guess we'll find out then 😄 I could imagine that we'd show everything yaml as json additionally, but not too sure.

@schogges
Copy link
Contributor Author

I just realized another thing: we currently only show the select in case there is a spec. I think this should be changed now to only include the structured in case there is a spec, but in any case show the select with options Kubernetes and Universal.

…y-view

Signed-off-by: schogges <moritz.fleck@konghq.com>
Signed-off-by: schogges <moritz.fleck@konghq.com>
Signed-off-by: schogges <moritz.fleck@konghq.com>
@schogges schogges force-pushed the feat/policy-summary/formats/k8s_universal branch from 7e90e2c to 207257e Compare February 25, 2025 10:42
schogges and others added 4 commits February 25, 2025 11:56
Signed-off-by: schogges <moritz.fleck@konghq.com>
Signed-off-by: schogges <moritz.fleck@konghq.com>
Signed-off-by: schogges <moritz.fleck@konghq.com>
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.

Add more Info to Structured Format of Policy Summary View
2 participants