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

Create Test button for function nodes #2188

Merged
merged 2 commits into from
Sep 24, 2024
Merged

Conversation

AbdulWahab3181
Copy link
Contributor

@tomsmith8
Copy link
Contributor

I see the image on the 'Topic' node.

As per the ticket, this button should only appear for 'node_type = Function'

@tomsmith8
Copy link
Contributor

It seems the check does filter only by 'Function'

@AbdulWahab3181
Copy link
Contributor Author

@tomsmith8 Yeah, I know. Basically, for testing purposes, I used Topic because I didn't see the Function node type. However, I have placed a check for Function as you can see here in the code: https://github.com/stakwork/sphinx-nav-fiber/pull/2188/files#diff-3ab7b92393d6490c005dfa71060f6262c76b1406b196b332ff12f43d2bc8ddeeR167.

@@ -163,6 +164,8 @@ export const NodeControls = memo(() => {

const id = open ? 'simple-popover' : undefined

const isShowCreateTestButton = !!(selectedNode && selectedNode.node_type === 'function')
Copy link
Contributor

Choose a reason for hiding this comment

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

@AbdulWahab3181 is this case sensitive. Will it work for node_type = Function and function

Copy link
Collaborator

Choose a reason for hiding this comment

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

++, it will not work for Function

display: flex;
justify-content: center;
align-items: center;
background: ${(p: ButtonProps) => (p.backgroundColor ? p.backgroundColor : '#000000bb')};
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can use ??, and try to not use hardcoded colors

justify-content: center;
align-items: center;
background: ${(p: ButtonProps) => (p.backgroundColor ? p.backgroundColor : '#000000bb')};
color: ${(p: ButtonProps) => (p.fontColor ? p.fontColor : '#ffffff')};
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can use ??, and try to not use hardcoded colors

}
}

export const postBountyData = async (payload: BountyPayload) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's move it to separate file, network/postBounty/index.ts

Copy link
Collaborator

@Rassl Rassl left a comment

Choose a reason for hiding this comment

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

Please take a look to my comments

Copy link
Collaborator

Choose a reason for hiding this comment

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

It is part for createBountyModal, lets put this file with folder inside createBountyModal


return (
<BaseModal id="createBounty" kind={modalKind} onClose={handleClose} preventOutsideClose>
<FormProvider {...form}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's move it to Body similar to this: src/components/ModalsContainer/EditNodeNameModal/Body/index.tsx

We need it so lazyloading makes sense

@@ -163,6 +164,8 @@ export const NodeControls = memo(() => {

const id = open ? 'simple-popover' : undefined

const isShowCreateTestButton = !!(selectedNode && selectedNode.node_type === 'function')
Copy link
Collaborator

Choose a reason for hiding this comment

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

++, it will not work for Function

@AbdulWahab3181
Copy link
Contributor Author

@tomsmith8 @Rassl Addressed all the issues and changes. @Rassl Could you please review and merge the PR?

@Rassl Rassl merged commit 9536826 into stakwork:master Sep 24, 2024
22 checks passed
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.

Create Test button for function nodes
3 participants