-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Filter Bounties By Paid and Unpaid #1629
Conversation
api/resolvers/item.js
Outdated
// if (subType === 'paid') { | ||
// return ['"Item".bounty IS NOT NULL', '"Item".bountyPaidTo IS NOT NULL', '"Item"."parentId" IS NULL'] | ||
// } else if (subType === 'unpaid') { | ||
// return ['"Item".bounty IS NOT NULL', '"Item".bountyPaidTo IS NULL', '"Item"."parentId" IS NULL'] | ||
// } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@huumn Is bountyPaidTo
a field because I tried the above but it returns an error. Is this "the way" to know whether a bounty has been paid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to use quotation marks for case-sensitive SQL fields (see surrounding code) or #1589
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
14568109 | Triggered | Generic Private Key | b5851ae | docker/cln/client-key.pem | View secret |
14568110 | Triggered | Generic Private Key | b5851ae | docker/cln/server-key.pem | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
This filter has already been added in #1589 |
Oh bugger. No one had assigned it. Mine does work slightly differently however as it makes a new request to fetch unpaid and paid rather than filtering the ones on screen already. Maybe some of it is usable. |
@tsmith123 Just to clarify, my PR updates the data by updating the query filter returned by typeClause, therefore it does not just filter elements present in the screen. |
Ok, only looked very quickly. If you refresh the page does it preserve the filter? |
I admit I have not tried, but should it? You are actually refreshing the "bounties" page so it may make sense to reset the filter on every hard refresh. |
I am sorry for your unnecessary work. Next time please check if there was a PR linked. The link also mentioned it will close the issue: I have already reviewed #1589 and it contains 99% of what we need. |
The only other thing is you can't show just paid and just unpaid with a checkbox as well as all but that isn't a big deal. Anyway, my bad as I was bit late to this ticket. 😂 good luck |
Description
This PR adds a sub filter to the recent/bounties page so that paid and unpaid bounties can be shown.
When the user selects the sub filter, it appends a query string value to the url and passes this value to the item resolver. If the user selects "all" from the filter then the query string value will be removed.
DRAFT
This is a draft PR because the SQL queries don't yet work. I'm not sure how to know whether a bounty has been paid which is why the code is commented out in the PR. I've tried to use
Item.bountyPaidTo
but it results in an error.Screenshots
Additional Context
My test environment doesn't have any posts with bounties and therefore my local testing has been limited. I don't know how to add sats to my test account so I can't create bounty posts.
Is it possible to preload my test account with sats to help with testing?