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

Added feature to indicate the user if the content JSON is exploitable… #366

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

Conversation

tusharkc
Copy link

Feature : #279

Under this PR, I have created a function that will check if the JSON is exploitable or not, and if it is not exploitable, a new indication has been added to the bottom bar component, that will indicate that JSON is 100% safe.

@tusharkc
Copy link
Author

@TallTed I have added changes as per your suggestions.

@tusharkc tusharkc closed this Nov 15, 2023
@tusharkc tusharkc reopened this Nov 15, 2023
@tusharkc
Copy link
Author

@TallTed The improvements have been added, I had accidentally clicked on the close button, but now the pr is open again.

@TallTed
Copy link
Contributor

TallTed commented Nov 16, 2023

@tusharkc — I'm just a contributing community member. My coding language is English, and I mostly poke at human-facing things. I have no other involvement in this project.

@@ -114,11 +115,16 @@ export const BottomBar = () => {
const getFormat = useFile(state => state.getFormat);
const [isPrivate, setIsPrivate] = React.useState(false);
const [isUpdating, setIsUpdating] = React.useState(false);
const contents = useFile(state => state.contents);
Copy link
Owner

Choose a reason for hiding this comment

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

Each time the contents in updated it will cause a rerender which is a performance concern for us. Instead we could make our calculations with in useFile(state => ...) to prevent rerender and only when the value is changed, referred as exploitable.

Comment on lines 283 to 288
{isNotExploitableJson(contents) && (
<StyledBottomBarItem>
<AiOutlineSafetyCertificate />
JSON is not exploitable
</StyledBottomBarItem>
)}
Copy link
Owner

Choose a reason for hiding this comment

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

It's better to show the warning when it's exploitable instead of not exploitable.

Copy link
Owner

Choose a reason for hiding this comment

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

Also we could use "Exploitable" instead of "JSON is exploitable" so it will consume less space.

@AykutSarac
Copy link
Owner

Good job, I've added a few comments!

@tusharkc
Copy link
Author

@AykutSarac I will work on these issues now.

@tusharkc
Copy link
Author

tusharkc commented Dec 18, 2023

@AykutSarac c41836a

here is the pr with the changes

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.

None yet

3 participants