Skip to content

feat(editor): fix bug in save & apply logic #3597

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

blazethunderstorm
Copy link

Summary

This PR proicdes the option to add yaml file from local or from url also

Related Issue

Fixes #3488

Changes

  • Added two buttons:

    1. Upload YAML – lets you choose a .yaml file from your system and loads it into the editor.

    2. Load from URL – lets you paste a link to a YAML file, fetches it, and shows it in the editor.

Steps to Test

  1. Open the YAML editor in the app

  2. click on create button

  3. Click on load or uplaod yaml

  4. file is openend like yaml is loaded save and apply

Screenshots (if applicable)

Screencast.from.2025-07-08.20-24-29.mp4

Notes for the Reviewer

  • [e.g., This touches the i18n layer, so please check language consistency.]

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 8, 2025
@k8s-ci-robot k8s-ci-robot requested review from ashu8912 and illume July 8, 2025 14:59
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: blazethunderstorm
Once this PR has been reviewed and has the lgtm label, please assign sniok for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 8, 2025
@blazethunderstorm
Copy link
Author

@sniok @illume @ashu8912 i have made req changes

Copy link
Contributor

@skoeva skoeva left a comment

Choose a reason for hiding this comment

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

I believe this issue is waiting on input from the design team, will set to draft for now

@skoeva skoeva marked this pull request as draft July 9, 2025 13:59
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 9, 2025
@blazethunderstorm blazethunderstorm marked this pull request as ready for review July 9, 2025 14:00
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 9, 2025
@k8s-ci-robot k8s-ci-robot requested a review from joaquimrocha July 9, 2025 14:00
Copy link
Contributor

@skoeva skoeva left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this, be sure to keep the branch up to date with main, squash all merge commits, and use the commit/PR title format described in our commit guidelines

@@ -480,6 +480,42 @@ export default function EditorDialog(props: EditorDialogProps) {
</FormGroup>
</Grid>
</Grid>
<Box display="flex" gap={2} pb={2}>
<Button variant="outlined" component="label">
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be nice if the button matched the styling of the rest of the app, it stands out a bit too much currently

@@ -480,6 +480,42 @@ export default function EditorDialog(props: EditorDialogProps) {
</FormGroup>
</Grid>
</Grid>
<Box display="flex" gap={2} pb={2}>
<Button variant="outlined" component="label">
Upload YAML
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use translation for text like this: t('translation|Upload YAML')

}
}}
>
Load from URL
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here: t('translation|Load from URL')

<Button
variant="outlined"
onClick={async () => {
const url = prompt('Enter URL to load YAML from:');
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here with the translation, this isn't accessible atm

setCode({ code: text, format: 'yaml' });
setError('');
} catch (err) {
setError(`Failed to fetch YAML: ${(err as Error).message}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here with the translation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to load YAML from local file or a URL
3 participants