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

Add ability to specify domains, lists, clients and group names as arrays #1629

Merged
merged 17 commits into from
Oct 26, 2023

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Sep 6, 2023

What does this implement/fix?

Add ability to specify domains, lists, clients and group names as arrays

Screenshot from 2023-09-06 18-47-17
Screenshot from 2023-09-06 18-47-23
Screenshot from 2023-09-06 18-47-27

Related issue or feature (if applicable): N/A

Pull request in docs with documentation (if applicable): N/A


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

  • The code change is tested and works locally.
  • I based my code and PRs against the repositories developmental branch.
  • I signed off all commits. Pi-hole enforces the DCO for all contributions
  • I signed all my commits. Pi-hole requires signatures to verify authorship
  • I have read the above and my PR is ready for review.

@DL6ER
Copy link
Member Author

DL6ER commented Sep 7, 2023

Changing this to "ready for review" and kindly asking for the same

@DL6ER
Copy link
Member Author

DL6ER commented Sep 7, 2023

This branch continues to work with the current development-v6 web branch. However, if you specifically want to review the core of this PR (being able to add multiple at once), you'll need the web interface branch new/antigravity tweak/domain_array which contains the necessary changes for this PR (sending multiple domains as an array of strings).

edit See also the related PR pi-hole/web#2707.

…ays for creating multiple with the same properties (comment, groups, ...) at the same time

Signed-off-by: Dominik Derigs <[email protected]>
…ted it (not if we are merely using a copy)

Signed-off-by: DL6ER <[email protected]>
@DL6ER
Copy link
Member Author

DL6ER commented Sep 15, 2023

Rebased on latest development-v6

@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link

Conflicts have been resolved.

@DL6ER
Copy link
Member Author

DL6ER commented Oct 7, 2023

The spellcheck issue will be fixed in #1649 by 28358d4

@github-actions
Copy link

github-actions bot commented Oct 8, 2023

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link

github-actions bot commented Oct 8, 2023

Conflicts have been resolved.

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/adding-batch-adlists/65446/3

@DL6ER
Copy link
Member Author

DL6ER commented Oct 12, 2023

This PR has recently been affected by a bug solved in #1659 and should be reviewed thereafter.

@DL6ER
Copy link
Member Author

DL6ER commented Oct 13, 2023

This PR is now ready.

@yubiuser
Copy link
Member

What's the reason to accept string and [string] and not just [string] for the relevant value? It could simply be an array of 1.

@DL6ER
Copy link
Member Author

DL6ER commented Oct 16, 2023

Following the REST principles, you should add/manipulate one entry per call so sending a string feels natural here. We simply extend this natural feeling by also allowing arrays. You are right, an array of size 1 is exactly identical to a naked string, however, to my understanding, rejecting plain strings and demanding them to be encapsulated in an otherwise empty array shell feels odd to me.

@DL6ER DL6ER enabled auto-merge October 18, 2023 17:05
src/api/docs/content/specs/common.yaml Outdated Show resolved Hide resolved
src/api/list.c Show resolved Hide resolved
src/api/list.c Outdated Show resolved Hide resolved
@DL6ER DL6ER requested a review from yubiuser October 26, 2023 15:07
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/add-client-or-group-in-management-doesnt-work/65855/5

@DL6ER DL6ER merged commit c7f50a3 into development-v6 Oct 26, 2023
18 checks passed
@DL6ER DL6ER deleted the tweak/domain_array branch October 26, 2023 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression: input multiple domains in domain input field adds them as a single domain
4 participants