Fix UI bug with publish dialog

This commit is contained in:
binwiederhier 2023-02-11 14:13:10 -05:00
parent 669d269fd9
commit 224c54b1a2
28 changed files with 75 additions and 69 deletions

View file

@ -93,6 +93,7 @@ type Tier struct {
StripePriceID string // Price ID for paid tiers (price_...)
}
// Context returns fields for the log
func (t *Tier) Context() log.Context {
return log.Context{
"tier_id": t.ID,

View file

@ -114,8 +114,8 @@
"prefs_users_table_user_header": "Потребител",
"prefs_users_dialog_title_edit": "Промяна на потребител",
"prefs_users_dialog_base_url_label": "Адрес на услугата, e.g. https://ntfy.sh",
"prefs_users_dialog_button_cancel": "Отказ",
"prefs_users_dialog_button_save": "Запазване",
"common_cancel": "Отказ",
"common_save": "Запазване",
"prefs_appearance_language_title": "Език",
"subscribe_dialog_login_password_label": "Парола",
"subscribe_dialog_login_button_login": "Вход",
@ -128,7 +128,7 @@
"prefs_users_dialog_title_add": "Добавяне на потребител",
"prefs_notifications_delete_after_one_month": "След един месец",
"prefs_users_dialog_username_label": "Потребител, напр. phil",
"prefs_users_dialog_button_add": "Добавяне",
"common_add": "Добавяне",
"error_boundary_title": "О, не, ntfy се срина",
"error_boundary_description": "Това очевидно не трябва да се случва. Много съжаляваме!<br/>Ако имате минута, <githubLink>докладвайте в GitHub</githubLink> или ни уведомете в <discordLink>Discord</discordLink> или <matrixLink>Matrix</matrixLink>.",
"error_boundary_stack_trace": "Следа от стека",

View file

@ -116,9 +116,9 @@
"prefs_users_add_button": "Přidat uživatele",
"prefs_users_table_user_header": "Uživatel",
"prefs_users_table_base_url_header": "URL služby",
"prefs_users_dialog_button_cancel": "Zrušit",
"prefs_users_dialog_button_add": "Přidat",
"prefs_users_dialog_button_save": "Uložit",
"common_cancel": "Zrušit",
"common_add": "Přidat",
"common_save": "Uložit",
"priority_min": "nejnižší",
"priority_low": "nízká",
"priority_default": "výchozí",

View file

@ -15,9 +15,9 @@
"prefs_notifications_min_priority_max_only": "Nur höchste Priorität",
"prefs_notifications_delete_after_never": "Nie",
"prefs_users_dialog_password_label": "Kennwort",
"prefs_users_dialog_button_cancel": "Abbrechen",
"prefs_users_dialog_button_add": "Hinzufügen",
"prefs_users_dialog_button_save": "Speichern",
"common_cancel": "Abbrechen",
"common_add": "Hinzufügen",
"common_save": "Speichern",
"prefs_appearance_language_title": "Sprache",
"notifications_none_for_any_description": "Um Benachrichtigungen an ein Thema zu senden, schicke einen PUT/POST-Request an die Themen-URL. Hier ist ein Beispiel mit einem Deiner Themen.",
"publish_dialog_message_placeholder": "Gib hier eine Nachricht ein",

View file

@ -1,6 +1,7 @@
{
"common_cancel": "Cancel",
"common_save": "Save",
"common_add": "Add",
"signup_title": "Create a ntfy account",
"signup_form_username": "Username",
"signup_form_password": "Password",
@ -299,9 +300,6 @@
"prefs_users_dialog_base_url_label": "Service URL, e.g. https://ntfy.sh",
"prefs_users_dialog_username_label": "Username, e.g. phil",
"prefs_users_dialog_password_label": "Password",
"prefs_users_dialog_button_cancel": "Cancel",
"prefs_users_dialog_button_add": "Add",
"prefs_users_dialog_button_save": "Save",
"prefs_appearance_title": "Appearance",
"prefs_appearance_language_title": "Language",
"prefs_reservations_title": "Reserved topics",

View file

@ -101,8 +101,8 @@
"prefs_users_add_button": "Añadir usuario",
"prefs_users_dialog_title_edit": "Editar usuario",
"prefs_users_dialog_base_url_label": "URL del servicio, ej. https://ntfy.sh",
"prefs_users_dialog_button_add": "Añadir",
"prefs_users_dialog_button_save": "Guardar",
"common_add": "Añadir",
"common_save": "Guardar",
"prefs_appearance_title": "Apariencia",
"prefs_appearance_language_title": "Idioma",
"error_boundary_title": "Oh no, ntfy tuvo un error",
@ -134,7 +134,7 @@
"prefs_users_dialog_password_label": "Contraseña",
"error_boundary_description": "Obviamente, esto no debería ocurrir. Lo sentimos mucho.<br/>Si tienes un minuto, por favor <githubLink>informa de esto en GitHub</githubLink>, o avísanos vía <discordLink>Discord</discordLink> o <matrixLink>Matrix</matrixLink>.",
"prefs_users_dialog_title_add": "Añadir usuario",
"prefs_users_dialog_button_cancel": "Cancelar",
"common_cancel": "Cancelar",
"prefs_users_dialog_username_label": "Nombre de usuario, ej. phil",
"priority_max": "máx",
"priority_high": "alta",

View file

@ -79,7 +79,7 @@
"subscribe_dialog_subscribe_title": "S'abonner au sujet",
"subscribe_dialog_login_title": "Connexion nécessaire",
"prefs_notifications_min_priority_low_and_higher": "Priorité basse et au-dessus",
"prefs_users_dialog_button_cancel": "Annuler",
"common_cancel": "Annuler",
"error_boundary_button_copy_stack_trace": "Copier la trace d'appels",
"publish_dialog_attached_file_title": "Fichier joint :",
"publish_dialog_checkbox_publish_another": "Publier un autre",
@ -128,7 +128,7 @@
"prefs_users_description": "Ajoutez/supprimez des utilisateurs pour vos sujets protégés ici. Notez que cet utilisateur et ce mot de passe sont stockés dans le stockage local du navigateur.",
"prefs_users_table_user_header": "Utilisateur",
"prefs_users_dialog_title_edit": "Éditer l'utilisateur",
"prefs_users_dialog_button_add": "Ajouter",
"common_add": "Ajouter",
"error_boundary_description": "Ceci ne devrait évidemment pas arriver. Désolé pour ça.<br/>Si vous avez une minute, merci de <githubLink>signaler ceci sur GitHub</githubLink>, ou faites-le nous savoir par <discordLink>Discord</discordLink> ou <matrixLink>Matrix</matrixLink>.",
"prefs_users_dialog_title_add": "Ajouter un utilisateur",
"error_boundary_stack_trace": "Trace de pile d'appels",
@ -152,7 +152,7 @@
"publish_dialog_chip_topic_label": "Changer de sujet",
"publish_dialog_details_examples_description": "Pour des exemples et une description détaillée des fonctionnalités d'envoi, voir la <docsLink>documentation</docsLink>.",
"publish_dialog_button_cancel_sending": "Annuler l'envoi",
"prefs_users_dialog_button_save": "Enregistrer",
"common_save": "Enregistrer",
"notifications_new_indicator": "Nouvelle notification",
"publish_dialog_delay_reset": "Retirer le délai de réception",
"notifications_list_item": "Notification",

View file

@ -108,7 +108,7 @@
"prefs_users_dialog_title_edit": "Felhasználó szerkesztése",
"prefs_users_dialog_username_label": "Felhasználónév, pl: jozsi",
"prefs_users_dialog_password_label": "Jelszó",
"prefs_users_dialog_button_add": "Hozzáadás",
"common_add": "Hozzáadás",
"prefs_users_dialog_base_url_label": "Szerver címe, pl: https://ntfy.sh",
"notifications_loading": "Értesítések betöltése …",
"publish_dialog_progress_uploading": "Feltöltés …",
@ -144,8 +144,8 @@
"error_boundary_gathering_info": "Több információ…",
"publish_dialog_attachment_limits_file_reached": "túllépi a fájlméret korlátot ({{fileSizeLimit}})",
"prefs_users_title": "Felhasználók kezelése",
"prefs_users_dialog_button_cancel": "Mégsem",
"prefs_users_dialog_button_save": "Mentés",
"common_cancel": "Mégsem",
"common_save": "Mentés",
"prefs_users_dialog_title_add": "Felhasználó hozzáadása",
"prefs_appearance_language_title": "Nyelv",
"priority_low": "alacsony",

View file

@ -19,7 +19,7 @@
"publish_dialog_message_label": "Pesan",
"nav_button_settings": "Pengaturan",
"nav_button_documentation": "Dokumentasi",
"prefs_users_dialog_button_add": "Tambahkan",
"common_add": "Tambahkan",
"nav_topics_title": "Topik yang dilanggani",
"nav_button_subscribe": "Berlangganan ke topik",
"alert_grant_title": "Notifikasi dinonaktifkan",
@ -113,7 +113,7 @@
"prefs_notifications_sound_no_sound": "Tidak ada suara",
"prefs_users_table_user_header": "Pengguna",
"prefs_users_dialog_base_url_label": "URL Layanan, mis. https://ntfy.sh",
"prefs_users_dialog_button_save": "Simpan",
"common_save": "Simpan",
"prefs_appearance_title": "Tampilan",
"subscribe_dialog_login_password_label": "Kata sandi",
"subscribe_dialog_login_button_back": "Kembali",
@ -131,7 +131,7 @@
"prefs_users_dialog_title_add": "Tambahkan pengguna",
"prefs_users_dialog_title_edit": "Edit pengguna",
"prefs_users_dialog_password_label": "Kata sandi",
"prefs_users_dialog_button_cancel": "Batal",
"common_cancel": "Batal",
"error_boundary_title": "Aduh, ntfy mogok",
"error_boundary_description": "Seharusnya ini tidak terjadi. Maaf sekali tentang hal ini.<br/>Jika Anda punya beberapa menit, silakan <githubLink>laporkan ini di GitHub</githubLink>, atau beritahu kami melalui <discordLink>Discord</discordLink> atau <matrixLink>Matrix</matrixLink>.",
"error_boundary_stack_trace": "Jejak tumpukan",

View file

@ -134,9 +134,9 @@
"prefs_users_dialog_base_url_label": "URL del servizio, ad es. https://ntfy.sh",
"prefs_users_dialog_username_label": "Nome utente, ad es. phil",
"prefs_users_dialog_password_label": "Password",
"prefs_users_dialog_button_cancel": "Annulla",
"prefs_users_dialog_button_add": "Aggiungere",
"prefs_users_dialog_button_save": "Salva",
"common_cancel": "Annulla",
"common_add": "Aggiungere",
"common_save": "Salva",
"prefs_appearance_title": "Aspetto",
"prefs_appearance_language_title": "Lingua",
"priority_min": "min",

View file

@ -99,7 +99,7 @@
"prefs_notifications_delete_after_three_hours": "3時間後",
"prefs_users_description": "保護トピックのユーザーを追加/削除できます。ユーザー名とパスワードはブラウザのローカルストレージに保存されることに留意してください。",
"prefs_users_add_button": "ユーザー追加",
"prefs_users_dialog_button_add": "追加",
"common_add": "追加",
"subscribe_dialog_subscribe_use_another_label": "他のサーバーを使用",
"subscribe_dialog_error_user_not_authorized": "ユーザー名 {{username}} は許可されていません",
"prefs_notifications_delete_after_one_week": "1週間後",
@ -118,8 +118,8 @@
"prefs_notifications_min_priority_title": "表示する優先度",
"prefs_notifications_min_priority_default_and_higher": "優先度通常 およびそれ以上",
"prefs_notifications_delete_after_title": "通知を削除",
"prefs_users_dialog_button_cancel": "キャンセル",
"prefs_users_dialog_button_save": "保存",
"common_cancel": "キャンセル",
"common_save": "保存",
"prefs_users_table_user_header": "ユーザー名",
"prefs_users_dialog_title_add": "ユーザー追加",
"prefs_users_dialog_title_edit": "ユーザー編集",

View file

@ -126,10 +126,10 @@
"prefs_users_dialog_title_add": "사용자 추가",
"prefs_users_dialog_title_edit": "사용자 편집",
"prefs_users_dialog_base_url_label": "서비스 URL, 예를 들면 https://ntfy.sh",
"prefs_users_dialog_button_cancel": "취소",
"prefs_users_dialog_button_save": "저장",
"common_cancel": "취소",
"common_save": "저장",
"prefs_appearance_title": "표시 설정",
"prefs_users_dialog_button_add": "추가",
"common_add": "추가",
"prefs_appearance_language_title": "언어",
"priority_min": "최하",
"priority_low": "낮음",

View file

@ -90,7 +90,7 @@
"prefs_users_dialog_title_edit": "Rediger bruker",
"prefs_users_dialog_base_url_label": "Tjeneste-nettadresse, f.eks. https://ntfy.sh",
"prefs_users_dialog_password_label": "Passord",
"prefs_users_dialog_button_save": "Lagre",
"common_save": "Lagre",
"prefs_appearance_title": "Utseende",
"prefs_appearance_language_title": "Språk",
"prefs_users_dialog_username_label": "Brukernavn, f.eks. phil",
@ -116,8 +116,8 @@
"subscribe_dialog_login_button_back": "Tilbake",
"prefs_notifications_delete_after_three_hours": "Etter tre timer",
"prefs_users_table_base_url_header": "Tjeneste-nettadresse",
"prefs_users_dialog_button_cancel": "Avbryt",
"prefs_users_dialog_button_add": "Legg til",
"common_cancel": "Avbryt",
"common_add": "Legg til",
"publish_dialog_chip_attach_url_label": "Legg til fil med nettadresse",
"publish_dialog_tags_placeholder": "Kommainndelt liste over etiketter, f.eks. advarsel, srv1-sikkerhetskopi",
"prefs_notifications_sound_description_none": "Merknader spiller ikke lyd når de mottas",

View file

@ -177,9 +177,9 @@
"prefs_users_table_base_url_header": "Service URL",
"prefs_users_dialog_base_url_label": "Service URL, bijv. https://ntfy.sh",
"prefs_users_dialog_username_label": "Gebruikersnaam, bijv. phil",
"prefs_users_dialog_button_cancel": "Annuleren",
"prefs_users_dialog_button_add": "Toevoegen",
"prefs_users_dialog_button_save": "Bewaren",
"common_cancel": "Annuleren",
"common_add": "Toevoegen",
"common_save": "Bewaren",
"prefs_appearance_title": "Weergave",
"prefs_appearance_language_title": "Taal",
"priority_min": "min",

View file

@ -141,9 +141,9 @@
"prefs_users_delete_button": "Usuń użytkownika",
"prefs_users_table_base_url_header": "Adres URL usługi",
"prefs_users_dialog_title_add": "Dodaj użytkownika",
"prefs_users_dialog_button_cancel": "Anuluj",
"prefs_users_dialog_button_add": "Dodaj",
"prefs_users_dialog_button_save": "Zapisz",
"common_cancel": "Anuluj",
"common_add": "Dodaj",
"common_save": "Zapisz",
"prefs_appearance_title": "Wygląd",
"prefs_appearance_language_title": "Język",
"error_boundary_title": "Oh nie, ntfy przestało działać",

View file

@ -108,8 +108,8 @@
"prefs_notifications_delete_after_one_month_description": "As notificações serão eliminadas automaticamente após um mês",
"prefs_users_dialog_username_label": "Utilizador, por exemplo: \"filipe\"",
"prefs_users_dialog_password_label": "Palavra-passe",
"prefs_users_dialog_button_cancel": "Cancelar",
"prefs_users_dialog_button_add": "Adicionar",
"common_cancel": "Cancelar",
"common_add": "Adicionar",
"error_boundary_description": "Obviamente, isto não devia acontecer, lamentamos o sucedido.<br/>Se tiver um minuto, por favor <githubLink>relate isto no GitHub</githubLink>, ou informe-nos através de <discordLink>Discord</discordLink> ou <matrixLink>Matrix</matrixLink>.",
"error_boundary_stack_trace": "Erro (\"stack trace\")",
"error_boundary_gathering_info": "A recolher mais informações …",
@ -178,7 +178,7 @@
"prefs_users_dialog_title_add": "Adicionar utilizador",
"prefs_users_dialog_title_edit": "Editar utilizador",
"prefs_users_dialog_base_url_label": "URL de serviço, por exemplo: https://ntfy.sh",
"prefs_users_dialog_button_save": "Gravar",
"common_save": "Gravar",
"prefs_appearance_title": "Aparência",
"prefs_appearance_language_title": "Idioma",
"priority_min": "mínima",

View file

@ -108,9 +108,9 @@
"prefs_users_dialog_base_url_label": "URL de serviço, exemplo https://ntfy.sh",
"prefs_users_dialog_username_label": "Usuário, por exemplo phil",
"prefs_users_dialog_password_label": "Senha",
"prefs_users_dialog_button_cancel": "Cancelar",
"prefs_users_dialog_button_add": "Adicionar",
"prefs_users_dialog_button_save": "Salvar",
"common_cancel": "Cancelar",
"common_add": "Adicionar",
"common_save": "Salvar",
"prefs_appearance_title": "Aparência",
"prefs_appearance_language_title": "LInguagem",
"priority_min": "minima",

View file

@ -135,9 +135,9 @@
"prefs_users_dialog_base_url_label": "URL-адрес службы. Например, https://ntfy.sh",
"prefs_users_dialog_username_label": "Имя пользователя. Например, phil",
"prefs_users_dialog_password_label": "Пароль",
"prefs_users_dialog_button_cancel": "Отмена",
"prefs_users_dialog_button_add": "Добавить",
"prefs_users_dialog_button_save": "Сохранить",
"common_cancel": "Отмена",
"common_add": "Добавить",
"common_save": "Сохранить",
"prefs_appearance_title": "Внешний вид",
"prefs_appearance_language_title": "Язык",
"priority_min": "минимум",

View file

@ -126,9 +126,9 @@
"prefs_users_dialog_username_label": "Kullanıcı adı, örn. phil",
"prefs_users_table_user_header": "Kullanıcı",
"prefs_users_dialog_password_label": "Parola",
"prefs_users_dialog_button_add": "Ekle",
"prefs_users_dialog_button_cancel": "İptal",
"prefs_users_dialog_button_save": "Kaydet",
"common_add": "Ekle",
"common_cancel": "İptal",
"common_save": "Kaydet",
"prefs_appearance_title": "Görünüm",
"prefs_appearance_language_title": "Dil",
"error_boundary_title": "Olamaz, ntfy çöktü",

View file

@ -73,7 +73,7 @@
"prefs_users_title": "Керувати користувачами",
"prefs_users_table": "Таблиця користувачів",
"prefs_users_edit_button": "Редагувати користувача",
"prefs_users_dialog_button_save": "Зберегти",
"common_save": "Зберегти",
"prefs_appearance_title": "Зовнішній вигляд",
"priority_default": "за замовчуванням",
"priority_high": "високий",
@ -178,8 +178,8 @@
"prefs_users_table_user_header": "Користувач",
"prefs_users_dialog_title_add": "Додати користувача",
"prefs_users_dialog_username_label": "Ім'я користувача, наприклад phil",
"prefs_users_dialog_button_cancel": "Скасувати",
"prefs_users_dialog_button_add": "Додати",
"common_cancel": "Скасувати",
"common_add": "Додати",
"prefs_appearance_language_title": "Мова",
"error_boundary_gathering_info": "Зберіть більше інформації…",
"priority_min": "мін",

View file

@ -136,8 +136,8 @@
"prefs_users_dialog_title_edit": "编辑用户",
"prefs_users_dialog_username_label": "用户名,例如 phil",
"prefs_users_dialog_password_label": "密码",
"prefs_users_dialog_button_cancel": "取消",
"prefs_users_dialog_button_save": "保存",
"common_cancel": "取消",
"common_save": "保存",
"prefs_appearance_title": "外观",
"prefs_appearance_language_title": "语言",
"priority_min": "最低",
@ -179,7 +179,7 @@
"prefs_notifications_delete_after_three_hours": "三小时后",
"prefs_users_delete_button": "删除用户",
"prefs_users_table_user_header": "用户",
"prefs_users_dialog_button_add": "添加",
"common_add": "添加",
"prefs_notifications_delete_after_one_day": "一天后",
"error_boundary_description": "这显然不应该发生。对此非常抱歉。<br/>如果您有时间,请<githubLink>在GitHub</githubLink>上报告,或通过<discordLink>Discord</discordLink>或<matrixLink>Matrix</matrixLink>告诉我们。",
"prefs_users_table": "用户表",

View file

@ -76,8 +76,8 @@
"prefs_users_add_button": "新增使用者",
"prefs_users_dialog_password_label": "密碼",
"prefs_users_dialog_title_add": "新增使用者",
"prefs_users_dialog_button_save": "儲存",
"prefs_users_dialog_button_cancel": "取消",
"common_save": "儲存",
"common_cancel": "取消",
"error_boundary_title": "歐買尬ntfy 壞掉了",
"notifications_none_for_any_description": "要開始發送通知到一個主題,只需要對主題 URL 發送 HTTP PUT 或者 POST例如",
"notifications_no_subscriptions_description": "點選 「{{linktext}}」 連結以建立或訂閱主題。完成後,你就可以使用 HTTP PUT 或者 POST 發送通知到這裡了!",

View file

@ -8,7 +8,7 @@ import {
accountSubscriptionSingleUrl,
accountSubscriptionUrl,
accountTokenUrl,
accountUrl,
accountUrl, maybeWithBearerAuth,
tiersUrl,
withBasicAuth,
withBearerAuth
@ -78,7 +78,7 @@ class AccountApi {
const url = accountUrl(config.base_url);
console.log(`[AccountApi] Fetching user account ${url}`);
const response = await fetchOrThrow(url, {
headers: withBearerAuth({}, session.token())
headers: maybeWithBearerAuth({}, session.token()) // GET /v1/account endpoint can be called by anonymous
});
const account = await response.json(); // May throw SyntaxError
console.log(`[AccountApi] Account`, account);

View file

@ -113,6 +113,13 @@ export const maybeWithAuth = (headers, user) => {
return headers;
}
export const maybeWithBearerAuth = (headers, token) => {
if (token) {
return withBearerAuth(headers, token);
}
return headers;
}
export const withBasicAuth = (headers, username, password) => {
headers['Authorization'] = basicAuth(username, password);
return headers;

View file

@ -1,7 +1,7 @@
import * as React from 'react';
import {Avatar} from "@mui/material";
import Box from "@mui/material/Box";
import logo from "../img/ntfy2.svg";
import logo from "../img/ntfy-filled.svg";
const AvatarBox = (props) => {
return (

View file

@ -412,8 +412,8 @@ const UserDialog = (props) => {
/>
</DialogContent>
<DialogActions>
<Button onClick={props.onCancel}>{t("prefs_users_dialog_button_cancel")}</Button>
<Button onClick={handleSubmit} disabled={!addButtonEnabled}>{editMode ? t("prefs_users_dialog_button_save") : t("prefs_users_dialog_button_add")}</Button>
<Button onClick={props.onCancel}>{t("common_cancel")}</Button>
<Button onClick={handleSubmit} disabled={!addButtonEnabled}>{editMode ? t("common_save") : t("common_add")}</Button>
</DialogActions>
</Dialog>
);

View file

@ -76,8 +76,8 @@ export const ReserveAddDialog = (props) => {
/>
</DialogContent>
<DialogFooter status={error}>
<Button onClick={props.onClose}>{t("prefs_users_dialog_button_cancel")}</Button>
<Button onClick={handleSubmit} disabled={!submitButtonEnabled}>{t("prefs_users_dialog_button_add")}</Button>
<Button onClick={props.onClose}>{t("common_cancel")}</Button>
<Button onClick={handleSubmit} disabled={!submitButtonEnabled}>{t("common_add")}</Button>
</DialogFooter>
</Dialog>
);

View file

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB