Skip to content

Add missing validations for Policy create page#1478

Open
cnotv wants to merge 4 commits into
rancher:mainfrom
cnotv:feature/1477-add-validation-new-repo-inputs
Open

Add missing validations for Policy create page#1478
cnotv wants to merge 4 commits into
rancher:mainfrom
cnotv:feature/1477-add-validation-new-repo-inputs

Conversation

@cnotv

@cnotv cnotv commented Apr 14, 2026

Copy link
Copy Markdown
Member

Fixes #1477

Logic insight:

  • Receiving the URL it is split with Regex logic
  • Editing the input fields does not trigger any validation logic, and the fields are just composed
Kapture.2026-04-15.at.23.07.03.mp4
Kapture.2026-04-24.at.10.10.54.mp4

@cnotv
cnotv requested a review from rak-phillip April 14, 2026 11:55
@cnotv cnotv self-assigned this Apr 14, 2026
@cnotv cnotv changed the title Add validation for the input field Add missing validations for Policy create page Apr 14, 2026

@kravciak kravciak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Inputs don't reflect right value when switching to YAML Editor and back

Screencast.From.2026-04-14.14-45-51.mp4

@kravciak kravciak moved this from Pending review to In Progress in Kubewarden Admission Controller Apr 14, 2026
@cnotv

cnotv commented Apr 14, 2026

Copy link
Copy Markdown
Member Author

Inputs don't reflect right value when switching to YAML Editor and back

Screencast.From.2026-04-14.14-45-51.mp4

Could you write a YAML of the generated code you expect instead?
How would you validate that in such a case?
I am open to suggestions.

I personally preferred to reset it rather than assume it's broken, as the value is composed.

@kravciak

Copy link
Copy Markdown
Collaborator

Could you write a YAML of the generated code you expect instead?

I expect UI inputs to show real state of what is sent when I click Finish button.
Currently I see input values in the UI, but I can't press Finish button because displayed values are not "real".

@cnotv

cnotv commented Apr 14, 2026

Copy link
Copy Markdown
Member Author

Could you write a YAML of the generated code you expect instead?

I expect UI inputs to show real state of what is sent when I click Finish button. Currently I see input values in the UI, but I can't press Finish button because displayed values are not "real".

Let's do it like this, I set it back to the previous one and then you tell me how do you expect to be validated in case is not fine.
If we do not find a clear statement, I am forced to send it back to design to define one.

@cnotv

cnotv commented Apr 14, 2026

Copy link
Copy Markdown
Member Author

So @kravciak this is how it worked before and how it reflects by validating the data instead of the inputs.

Kapture.2026-04-14.at.17.12.28.mp4

@cnotv
cnotv requested a review from kravciak April 14, 2026 15:29
@cnotv

cnotv commented Apr 15, 2026

Copy link
Copy Markdown
Member Author

@kravciak I have discussed about the whole logic with Ovi and we agreed about keeping a seamless experience with the modified data, as we do in other projects.
I have also created an issue with the remaining logic: #1480

@cnotv
cnotv marked this pull request as draft April 15, 2026 18:22
@cnotv
cnotv marked this pull request as ready for review April 15, 2026 21:07
@cnotv

cnotv commented Apr 15, 2026

Copy link
Copy Markdown
Member Author

Fixes #1477

Kapture.2026-04-15.at.23.07.03.mp4

I have updated the logic as agreed with Ovi.
Do you think it would be ok like this @kravciak ?

@kravciak

Copy link
Copy Markdown
Collaborator

I will look into it later today or tomorrow, I am jumping between things - sorry for delay

@cnotv

cnotv commented Apr 16, 2026

Copy link
Copy Markdown
Member Author

I will look into it later today or tomorrow, I am jumping between things - sorry for delay

No problem, actually thanks for the patience :D

@kravciak

kravciak commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

I see new #1482 with the same name which "fixes" this PR.
Is this one (1478) still relevant? Or what is current state? It would be better to fix this PR directly, but maybe I missed something..

@kravciak

kravciak commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

About this PR, it looks good, but I see one issue:

When I switch to Edit Yaml and back:

  • Registry is filled with default value (which is OK)
  • All the required values are now provided
  • I can't click Finish button until I edit Registry/Repository/Tag (can we fix this?)

Would it be possible to refresh Finish button state so it would be enabled (bacause all required inputs are filled) when I switch back?

Screencast.From.2026-04-17.13-11-20.mp4

@cnotv

cnotv commented Apr 17, 2026

Copy link
Copy Markdown
Member Author

About this PR, it looks good, but I see one issue:

When I switch to Edit Yaml and back:

  • Registry is filled with default value (which is OK)
  • All the required values are now provided
  • I can't click Finish button until I edit Registry/Repository/Tag (can we fix this?)

Would it be possible to refresh Finish button state so it would be enabled (bacause all required inputs are filled) when I switch back?

Screencast.From.2026-04-17.13-11-20.mp4

This is strange, I tested exactly that and is in my video. I take a look at it again to see if anything is wrong.

@cnotv

cnotv commented Apr 17, 2026

Copy link
Copy Markdown
Member Author

I see new #1482 with the same name which "fixes" this PR. Is this one (1478) still relevant? Or what is current state? It would be better to fix this PR directly, but maybe I missed something..

It's just me messing with the links :D
Sorry about it.

@cnotv

cnotv commented Apr 23, 2026

Copy link
Copy Markdown
Member Author

Would it be possible to refresh Finish button state so it would be enabled (bacause all required inputs are filled) when I switch back?

Taking a look into it. It occurs only on first edit and just that input 🤯

@cnotv

cnotv commented Apr 24, 2026

Copy link
Copy Markdown
Member Author

@kravciak now the logic seems to work fine

Kapture.2026-04-24.at.10.10.54.mp4

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 missing validations for Policy create page

4 participants