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

[frogend] (Mastodon) domain block CSV import #1390

Merged
merged 13 commits into from
Feb 3, 2023
Merged

Conversation

f0x52
Copy link
Contributor

@f0x52 f0x52 commented Jan 26, 2023

Description

Adds CSV import and export to the bulk import/export interface, tested to be compatible with Mastodon too (glitch-soc).
Generally cleans up the code structure around it a bit too, both on the page itself and the exportType based branching in query.

Also added some information text about the page, and a table comparing the different export formats. Still not sure how well it fits there, might just have to move that to the docs, or a separate page?

Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: [ ] -> [x]

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

  • I/we have read the GoToSocial contribution guidelines.
  • I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
  • I/we have performed a self-review of added code.
  • I/we have written code that is legible and maintainable by others.
  • I/we have commented the added code, particularly in hard-to-understand areas.
  • I/we have made any necessary changes to documentation.
  • I/we have added tests that cover new code.
  • I/we have run tests and they pass locally with the changes.
  • I/we have run go fmt ./... and golangci-lint run.

@f0x52 f0x52 added enhancement New feature or request frontend Frontend-related stuff labels Jan 26, 2023
@f0x52 f0x52 requested a review from tsmethurst January 26, 2023 18:13
@tsmethurst
Copy link
Contributor

This looks really good to me :) Just wondering about what we discussed briefly in matrix: domains that are wildcarded by starting with *.. Should we trim that off before it gets sent to gts, or should the server do it?

@f0x52
Copy link
Contributor Author

f0x52 commented Jan 27, 2023

hmm I feel like the server should reject them if it doesn't handle it for you, because as a literal * it's never a valid domain. If we don't want to handle them in the backend I can update the client validation to match, and possibly add the trimming there

I'm actually not sure if Mastodon even handles those wildcards either..

@tsmethurst
Copy link
Contributor

I can add something to trim it in the server side, then it'll work via the API too and not just the settings panel: I needed a small thing to work on this afternoon anyway :)

f0x52 added 8 commits January 31, 2023 15:33
commit e3655ba
Author: f0x <f0x@cthu.lu>
Date:   Tue Jan 31 15:19:10 2023 +0100

    let debug depend on env (prod/debug) again

commit 79c792b
Author: f0x <f0x@cthu.lu>
Date:   Tue Jan 31 00:34:01 2023 +0100

    update checklist components

commit 4367960
Author: f0x <f0x@cthu.lu>
Date:   Mon Jan 30 23:46:20 2023 +0100

    checklist performance improvements

commit 204a4c0
Author: f0x <f0x@cthu.lu>
Date:   Mon Jan 30 20:05:34 2023 +0100

    checklist field: use reducer for state
Copy link
Contributor

@tsmethurst tsmethurst left a comment

Choose a reason for hiding this comment

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

This looks good to me so far :)

web/source/settings/admin/federation/import-export.js Outdated Show resolved Hide resolved
web/source/settings/lib/domain-block.js Show resolved Hide resolved
@tsmethurst tsmethurst merged commit a59dc85 into main Feb 3, 2023
@tsmethurst tsmethurst deleted the mastodon-csv-import branch February 3, 2023 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend Frontend-related stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants