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

chore(ui): add validation messages for custom dashboard crud actions #7367

Merged
merged 4 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/src/components/dashboard/components/DashboardCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ charts:
async save(input) {
const dashboard = await this.$store.dispatch("dashboard/create", input);

this.$toast().saved(dashboard.title);
this.$toast().success(this.$t("custom_dashboard_validate_creation", {title: dashboard.title}));

this.$store.dispatch("core/isUnsaved", false);
this.$router.push({name: "home", params: {id: dashboard.id}});
Expand Down
6 changes: 3 additions & 3 deletions ui/src/components/filter/segments/Dashboards.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@
const toast = getCurrentInstance().appContext.config.globalProperties.$toast();

const remove = (dashboard: any) => {
toast.confirm(t("delete confirm", {name: dashboard.title}), () => {
store.dispatch("dashboard/delete", dashboard.id).then((item) => {
toast.confirm(t("custom_dashboard_confirm_deletion", {title: dashboard.title}), () => {
store.dispatch("dashboard/delete", dashboard.id).then(() => {
dashboards.value = dashboards.value.filter((d) => d.id !== dashboard.id);
toast.deleted(item.title);
toast.deleted(dashboard.title);
router.push({name: "home"});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
source: input,
});

this.$toast().saved(response.title);
this.$toast().success(this.$t("custom_dashboard_validate_editing", {title: response.title}));

this.$store.dispatch("core/isUnsaved", false);
},
Expand Down
5 changes: 4 additions & 1 deletion ui/src/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,9 @@
"label": "Eigenschaften"
},
"debug": "Debuggen",
"default": "Standard"
"default": "Standard",
"custom_dashboard_confirm_deletion": "Möchten Sie das Dashboard <code>{title}</code> wirklich löschen?",
"custom_dashboard_validate_editing": "Änderungen im Dashboard <code>{title}</code> sind gespeichert.",
"custom_dashboard_validate_creation": "Dashboard <code>{title}</code> wurde erstellt."
}
}
3 changes: 3 additions & 0 deletions ui/src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1055,8 +1055,11 @@
"default_dashboard": "Default Dashboard",
"custom_dashboard": "Custom Dashboards",
"create_custom_dashboard": "Create new dashboard",
"custom_dashboard_validate_creation": "Dashboard <code>{title}</code> is created.",
"create_dashboard": "Create Dashboard",
"edit_custom_dashboard": "Edit Dashboard",
"custom_dashboard_validate_editing": "Changes in dashboard <code>{title}</code> are saved.",
"custom_dashboard_confirm_deletion": "Are you sure you want to delete <code>{title}</code> dashboard?",
"custom_dashboard_empty": "There are no results to be shown.",
"filters": {
"label": "Choose filters",
Expand Down
5 changes: 4 additions & 1 deletion ui/src/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,9 @@
"label": "Propiedades"
},
"debug": "Depuración",
"default": "Predeterminado"
"default": "Predeterminado",
"custom_dashboard_confirm_deletion": "¿Está seguro de que desea eliminar el dashboard <code>{title}</code>?",
"custom_dashboard_validate_editing": "Los cambios en el dashboard <code>{title}</code> se han guardado.",
"custom_dashboard_validate_creation": "El Dashboard <code>{title}</code> ha sido creado."
}
}
5 changes: 4 additions & 1 deletion ui/src/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,9 @@
"label": "Propriétés"
},
"debug": "Déboguer",
"default": "Par défaut"
"default": "Par défaut",
"custom_dashboard_confirm_deletion": "Êtes-vous sûr de vouloir supprimer le tableau de bord <code>{title}</code> ?",
"custom_dashboard_validate_editing": "Les modifications dans le tableau de bord <code>{title}</code> sont enregistrées.",
"custom_dashboard_validate_creation": "Tableau de bord <code>{title}</code> est créé."
}
}
5 changes: 4 additions & 1 deletion ui/src/translations/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,9 @@
"label": "गुणधर्म"
},
"debug": "डिबग",
"default": "डिफ़ॉल्ट"
"default": "डिफ़ॉल्ट",
"custom_dashboard_confirm_deletion": "क्या आप वाकई <code>{title}</code> डैशबोर्ड को हटाना चाहते हैं?",
"custom_dashboard_validate_editing": "डैशबोर्ड <code>{title}</code> में परिवर्तन सहेजे गए हैं।",
"custom_dashboard_validate_creation": "डैशबोर्ड <code>{title}</code> बनाया गया है।"
}
}
5 changes: 4 additions & 1 deletion ui/src/translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,9 @@
"label": "Proprietà"
},
"debug": "Debug",
"default": "Predefinito"
"default": "Predefinito",
"custom_dashboard_confirm_deletion": "Sei sicuro di voler eliminare la dashboard <code>{title}</code>?",
"custom_dashboard_validate_editing": "Le modifiche nel dashboard <code>{title}</code> sono state salvate.",
"custom_dashboard_validate_creation": "Dashboard <code>{title}</code> è stato creato."
}
}
5 changes: 4 additions & 1 deletion ui/src/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,9 @@
"label": "プロパティ"
},
"debug": "デバッグ",
"default": "デフォルト"
"default": "デフォルト",
"custom_dashboard_confirm_deletion": "<code>{title}</code> ダッシュボードを削除してもよろしいですか?",
"custom_dashboard_validate_editing": "ダッシュボード<code>{title}</code>の変更が保存されました。",
"custom_dashboard_validate_creation": "ダッシュボード <code>{title}</code> が作成されました。"
}
}
5 changes: 4 additions & 1 deletion ui/src/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,9 @@
"label": "속성"
},
"debug": "디버그",
"default": "기본값"
"default": "기본값",
"custom_dashboard_confirm_deletion": "<code>{title}</code> 대시보드를 삭제하시겠습니까?",
"custom_dashboard_validate_editing": "대시보드 <code>{title}</code>의 변경 사항이 저장되었습니다.",
"custom_dashboard_validate_creation": "대시보드 <code>{title}</code>가 생성되었습니다."
}
}
5 changes: 4 additions & 1 deletion ui/src/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,9 @@
"label": "Właściwości"
},
"debug": "Debugowanie",
"default": "Domyślny"
"default": "Domyślny",
"custom_dashboard_confirm_deletion": "Czy na pewno chcesz usunąć dashboard <code>{title}</code>?",
"custom_dashboard_validate_editing": "Zmiany w dashboardzie <code>{title}</code> zostały zapisane.",
"custom_dashboard_validate_creation": "Dashboard <code>{title}</code> został utworzony."
}
}
5 changes: 4 additions & 1 deletion ui/src/translations/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,9 @@
"label": "Propriedades"
},
"debug": "Depurar",
"default": "Padrão"
"default": "Padrão",
"custom_dashboard_confirm_deletion": "Tem certeza de que deseja excluir o dashboard <code>{title}</code>?",
"custom_dashboard_validate_editing": "Alterações no dashboard <code>{title}</code> foram salvas.",
"custom_dashboard_validate_creation": "Painel <code>{title}</code> foi criado."
}
}
5 changes: 4 additions & 1 deletion ui/src/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,9 @@
"label": "Свойства"
},
"debug": "Отладка",
"default": "По умолчанию"
"default": "По умолчанию",
"custom_dashboard_confirm_deletion": "Вы уверены, что хотите удалить панель <code>{title}</code>?",
"custom_dashboard_validate_editing": "Изменения в панели <code>{title}</code> сохранены.",
"custom_dashboard_validate_creation": "Панель управления <code>{title}</code> создана."
}
}
5 changes: 4 additions & 1 deletion ui/src/translations/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,9 @@
"label": "属性"
},
"debug": "调试",
"default": "默认值"
"default": "默认值",
"custom_dashboard_confirm_deletion": "您确定要删除<code>{title}</code>仪表板吗?",
"custom_dashboard_validate_editing": "仪表板<code>{title}</code>中的更改已保存。",
"custom_dashboard_validate_creation": "仪表板 <code>{title}</code> 已创建。"
}
}