From 5a96f23ff7269a999c8bded42a97754e2f29992c Mon Sep 17 00:00:00 2001 From: f0x Date: Fri, 13 Jan 2023 23:18:27 +0000 Subject: [PATCH] refactor federation import-export interface --- web/source/css/_colors.css | 2 + .../settings/admin/emoji/local/detail.js | 5 +- .../settings/admin/emoji/local/index.js | 14 +- .../admin/emoji/remote/parse-from-toot.js | 38 +-- .../settings/admin/federation/detail.js | 4 +- .../admin/federation/import-export.js | 303 ++++++++++++++---- web/source/settings/admin/federation/index.js | 2 +- .../settings/admin/federation/overview.js | 15 +- web/source/settings/components/check-list.jsx | 4 +- .../settings/components/form/inputs.jsx | 24 +- .../settings/lib/form/form-with-data.jsx | 6 +- web/source/settings/lib/form/index.js | 1 + .../federation-bulk.js => form/radio.jsx} | 35 +- web/source/settings/lib/form/submit.js | 5 + web/source/settings/lib/form/text.jsx | 6 +- web/source/settings/lib/get-views.js | 2 +- web/source/settings/lib/import-export.js | 65 ---- .../settings/lib/query/admin/import-export.js | 212 ++++++++++++ web/source/settings/lib/query/admin/index.js | 14 +- web/source/settings/lib/query/lib.js | 21 +- web/source/settings/style.css | 46 ++- 21 files changed, 610 insertions(+), 214 deletions(-) rename web/source/settings/lib/{query/admin/federation-bulk.js => form/radio.jsx} (56%) delete mode 100644 web/source/settings/lib/import-export.js create mode 100644 web/source/settings/lib/query/admin/import-export.js diff --git a/web/source/css/_colors.css b/web/source/css/_colors.css index 86ef80c20..13a75c9f5 100644 --- a/web/source/css/_colors.css +++ b/web/source/css/_colors.css @@ -49,6 +49,8 @@ $error2: #ff9796; /* Error background text, can be used with $error1 (5.0), $gra $error3: #dd2c2c; /* Error button background text, can be used with $white1 (4.51) */ $error-link: #01318C; /* Error link text, can be used with $error2 (5.56) */ +$green1: #94E749; /* Green for positive/confirmation, similar contrast (luminance) as $blue2 */ + $info-fg: $gray1; $info-bg: #b3ddff; $info-link: $error-link; diff --git a/web/source/settings/admin/emoji/local/detail.js b/web/source/settings/admin/emoji/local/detail.js index 4fb59e9e0..65c5ec76e 100644 --- a/web/source/settings/admin/emoji/local/detail.js +++ b/web/source/settings/admin/emoji/local/detail.js @@ -45,7 +45,7 @@ module.exports = function EmojiDetailRoute() { return (
< go back - +
); } @@ -91,7 +91,7 @@ function EmojiDetailForm({ data: emoji }) { label="Delete" type="button" onClick={() => deleteEmoji(emoji.id)} - className="danger button-inline" + className="danger" showError={false} result={deleteResult} /> @@ -126,7 +126,6 @@ function EmojiDetailForm({ data: emoji }) { name="image" label="Replace image" showError={false} - className="button-inline" result={result} /> diff --git a/web/source/settings/admin/emoji/local/index.js b/web/source/settings/admin/emoji/local/index.js index 0cf4254f7..68cbbc47f 100644 --- a/web/source/settings/admin/emoji/local/index.js +++ b/web/source/settings/admin/emoji/local/index.js @@ -28,13 +28,11 @@ const base = "/settings/custom-emoji/local"; module.exports = function CustomEmoji() { return ( - <> - - - - - - - + + + + + + ); }; diff --git a/web/source/settings/admin/emoji/remote/parse-from-toot.js b/web/source/settings/admin/emoji/remote/parse-from-toot.js index e860512e4..309619ea4 100644 --- a/web/source/settings/admin/emoji/remote/parse-from-toot.js +++ b/web/source/settings/admin/emoji/remote/parse-from-toot.js @@ -65,7 +65,7 @@ module.exports = function ParseFromToot({ emojiCodes }) { onChange={onURLChange} value={url} /> -