-
-
Notifications
You must be signed in to change notification settings - Fork 562
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
Add suggested domains in group domains page #2209
Conversation
0425572
to
99c2ad4
Compare
You can ignore these 2 errors related to IE11:
Please, verify the other errors. |
Thanks for your contribution. I really like the idea. |
I've based it on my most common use case. That is when browsing on a mobile phone encountering a page that is blocked that shouldn't or isn't that should. I copied the whole URL and pasted it into pi-hole's new_domain field. And then I would've needed to re-copy and paste the domain part while struggling with the imprecise selection markers or trying removing the path without holding the backspace key for to long otherwise it would've deleted the whole text. One to many frustrated moments later I just decided to implement it for myself a couple of weeks ago. And this week I had some free time decided to polish it and make a PR. So that's the backstory how it got created and the reason I designed it this way ;)
The thought crossed my mind as well, but I decided against it because it would be silly to type
Do you mean to extend the functionality that allows you to add multiple domain in a single action by separating them with a space? So to first split the Or do you mean that in case of It's totally possible that you're talking about a scenario I'm not seeing. Could you explain the scenario a bit more or give some example values that I'm not thinking of? As a side node, listening for a paste event can give instant user feedback in comparison to a debounce of 500ms - 1sec when listening on the input event. |
I totally see where you came from ;-) What I meant is a lighter version of
Silly or not, I've seen people typing
I didn't thought about this so far, but think it is not needed. How do you want to present a large number of domains in a suitable way if users mass input URLs? They will be rejected anyway (contained invalid characters), so users should think about what they input.
This would also be a nice feature. Make them selectable? From a UI perspective - how do we need to deal with "Add domain as wildcard" then? |
Fair point. I'll take a look at it next week when I've some spare time. Should be an easy modification.
Thinking about it some more you could support showing suggested domains when the pasted value is separated with a space from the existing text in
I was thinking about only removing the selected suggestion and change the I think that the current version (with typing support) is a great first step. And if there is a need to extend the functionally I'll be happy to work on it some more |
Let's see the simpler version first. |
I agree. Happy to see your updated version. |
8ebd5d2
to
7ff9a6d
Compare
f4d91de
to
1783d26
Compare
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.
The code suggested above can be found here: |
Signed-off-by: Anthony de Jong <11158888+anthony-de-jong@users.noreply.github.com>
1783d26
to
eaef6f8
Compare
Ah, small oversight. I've fixed it and squashed it into 1 commit.
Do I need to do anything with this? |
Yes, please. Makes it easier to find relevant PRs if needed in the future. |
Thanks for your PR. Please don't be demotivated by the changes we requested, we really appreciated your PR and effort. We hope you'll continue contributing to the project. |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/pi-hole-ftl-v5-16-web-v5-13-and-core-v5-11-1-released/56384/1 |
By submitting this pull request, I confirm the following:
git rebase
)git commit --signoff
)What does this PR aim to accomplish?:
Make adding domains easier by suggesting (sub-)domains when typing or pasting an URL into the group domains page:
How does this PR accomplish the above?:
Adding a
input
event listener on the#new_domain
input element with a debounce of 1000ms. When executed it checks for a valid URL by passing the#new_domain
value intonew URL(...)
. If the value is a valid URL it creates a table with the suggested (sub-)domains. Clicking on a suggested (sub-)domain sets the value of#new_domain
to the selected (sub-)domain and hides the table.What documentation changes (if any) are needed to support this PR?:
None that I'm aware of.