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

Policy Playground Layout Updates #87

Merged
merged 14 commits into from
May 25, 2021
Merged

Policy Playground Layout Updates #87

merged 14 commits into from
May 25, 2021

Conversation

pickjasmine
Copy link
Contributor

Changes the playground to match the updated prototypes/the OPA Rego playground.

Copy link
Contributor

@alexashley alexashley left a comment

Choose a reason for hiding this comment

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

Not sure the best way to describe this (or what the right behavior is), but the resize corner in the policy editor causes the parent widget to expand or contract. But on the playground, the resize doesn't affect the parent container at all:

Screen Shot 2021-05-24 at 5 32 16 PM

Also I probably missed it, but is there a way to do trigger another evaluation? The only thing I could see to do was re-select a policy or resource.

components/playground/SelectedPolicy.js Outdated Show resolved Hide resolved
components/playground/SelectedResource.js Show resolved Hide resolved
@pickjasmine
Copy link
Contributor Author

pickjasmine commented May 25, 2021

Not sure the best way to describe this (or what the right behavior is), but the resize corner in the policy editor causes the parent widget to expand or contract. But on the playground, the resize doesn't affect the parent container at all:

I believe this is because the playground is using flex for the layout but the policy creation page is using flexbox. I think it would be better to be constrained to the parent container, do you agree? I will make an issue to update them to match.

Also I probably missed it, but is there a way to do trigger another evaluation? The only thing I could see to do was re-select a policy or resource.

Yeah, searching for a new policy or resource is the only way right now. I can add back the button to reset the playground or clear the policy/resource, but I figured once the user is able to edit the policy or resource fields then having the current screen would be the cleanest UI. I do have some ideas around adding a copy button to the blocks of code, so it could be a good place to add another button to remove the selected policy/resource

@alexashley
Copy link
Contributor

@pickjasmine I agree it makes sense to limit them to the parent container, and also maybe to set resize: none to remove the ability to change the textarea size (since it's already as big as it can get and can only be made smaller).

@pickjasmine
Copy link
Contributor Author

@pickjasmine I agree it makes sense to limit them to the parent container, and also maybe to set resize: none to remove the ability to change the textarea size (since it's already as big as it can get and can only be made smaller).

I will add the resize: none for now. I tried to copy the overflow/scrolling behavior that the playground has, but because the way the syntax highlighting is done I will have to spend some time figuring out if that behavior is possible.

Copy link
Contributor

@alexashley alexashley left a comment

Choose a reason for hiding this comment

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

:shipit:

@pickjasmine pickjasmine merged commit 9290032 into main May 25, 2021
@pickjasmine pickjasmine deleted the new-playground-layout branch May 25, 2021 15:35
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.

2 participants