From c80786014cbd988ea1a5dd863cc3b290e5b85a94 Mon Sep 17 00:00:00 2001 From: f0x Date: Thu, 26 Jan 2023 18:37:11 +0100 Subject: [PATCH] CSV import/export, UI/UX improvements to import-export interface --- web/source/package.json | 1 + .../admin/federation/export-format-table.jsx | 64 +++++++++++++++++++ .../admin/federation/import-export.js | 63 +++++++++++------- .../settings/lib/query/admin/import-export.js | 21 ++++++ web/source/settings/style.css | 34 ++++++++++ web/source/yarn.lock | 5 ++ 6 files changed, 165 insertions(+), 23 deletions(-) create mode 100644 web/source/settings/admin/federation/export-format-table.jsx diff --git a/web/source/package.json b/web/source/package.json index f9520baba..f44495773 100644 --- a/web/source/package.json +++ b/web/source/package.json @@ -19,6 +19,7 @@ "langs": "^2.0.0", "match-sorter": "^6.3.1", "modern-normalize": "^1.1.0", + "papaparse": "^5.3.2", "photoswipe": "^5.3.3", "photoswipe-dynamic-caption-plugin": "^1.2.7", "photoswipe-video-plugin": "^1.0.2", diff --git a/web/source/settings/admin/federation/export-format-table.jsx b/web/source/settings/admin/federation/export-format-table.jsx new file mode 100644 index 000000000..72b2db04f --- /dev/null +++ b/web/source/settings/admin/federation/export-format-table.jsx @@ -0,0 +1,64 @@ +/* + GoToSocial + Copyright (C) 2021-2023 GoToSocial Authors admin@gotosocial.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + +"use strict"; + +const React = require("react"); + +module.exports = function ExportFormatTable() { + return ( + + + + + + + + + + + + + + + + + + +
+ IncludesImportable by
DomainPublic commentGoToSocialMastodon
+ ); +}; + +function Format({ name, info }) { + return ( + + {name} + {info.map((b, key) => {bool(b)})} + + ); +} + +function bool(val) { + return ( + <> + + {val ? "Yes" : "No"} + + ); +} \ No newline at end of file diff --git a/web/source/settings/admin/federation/import-export.js b/web/source/settings/admin/federation/import-export.js index a11174b1f..ceb0e32cc 100644 --- a/web/source/settings/admin/federation/import-export.js +++ b/web/source/settings/admin/federation/import-export.js @@ -45,6 +45,7 @@ const MutationButton = require("../../components/form/mutation-button"); const isValidDomain = require("is-valid-domain"); const FormWithData = require("../../lib/form/form-with-data"); const { Error } = require("../../components/error"); +const ExportFormatTable = require("./export-format-table"); const baseUrl = "/settings/admin/federation/import-export"; @@ -104,39 +105,55 @@ module.exports = function ImportExport() { {parseResult.isSuccess && }

Import / Export suspended domains

-
-
-