Skip to content

Commit

Permalink
ui: Fancier delete confirmation using window.prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
Veikkosuhonen committed Nov 29, 2023
1 parent bfc2cf8 commit 3eeadd8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
"publishingInfo": "The answers to this questions are not shown to students. You can publish the answers to enrolled students from the button on the left titled \"Not public\".",
"unpublishingInfo": "The answers to this questions are shown to students.",
"hidingFeatureInfo": "If some answer contains personal information such as student number, or the answer is otherwise inappropriate, you can hide it with the eye-icon on the right. This has effect only when the answers are published.",
"confirmDeleteFeedback": "You are about to PERMANTENTLY delete a student's answer using admin rights. Are you sure you want to delete this answer?",
"confirmDeleteFeedback": "You are about to PERMANTENTLY delete a student's answer using admin rights. Are you sure you want to delete this answer? Type \"delete\" to confirm.",
"deleteSuccess": "Answer deleted."
},
"groups": {
Expand Down
2 changes: 1 addition & 1 deletion public/locales/fi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
"publishingInfo": "Tämän kysymyksen vastaukset eivät näy kurssin opiskelijoille. Halutessasi voit julkistaa ne kurssin opiskelijoiden nähtäväksi klikkaamalla vasemmanpuolista nappia \"Ei julkinen\".",
"unpublishingInfo": "Tämän kysymyksen näkyvät kurssin opiskelijoille.",
"hidingFeatureInfo": "Jos johonkin vastaukseen on päätynyt luottamuksellista tietoa kuten opiskelijanumero tai vastaus on muuten asiaton, voit piilottaa sen oikeanpuoleisesta silmäkuvakkeesta. Tällä on vaikutusta vain jos vastaukset on julkistettu.",
"confirmDeleteFeedback": "Olet poistamassa opiskelijan vastausta PYSYVÄSTI admin-oikeuksilla. Haluatko varmasti poistaa vastauksen?",
"confirmDeleteFeedback": "Olet poistamassa opiskelijan vastausta PYSYVÄSTI admin-oikeuksilla. Haluatko varmasti poistaa vastauksen? Kirjoita \"delete\" vahvistaaksesi.",
"deleteSuccess": "Vastaus poistettu"
},
"groups": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const useDeleteContinuousFeedback = () => {

const deleteAnswer = async continuousFeedbackId => {
// eslint-disable-next-line no-alert
if (!canDelete || !window.confirm(t('feedbackTargetResults:confirmDeleteFeedback'))) return
if (!canDelete || !(window.prompt(t('feedbackTargetResults:confirmDeleteFeedback')) === 'delete')) return

try {
await mutation.mutateAsync({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const useDeleteOpenFeedback = () => {

const deleteAnswer = async feedback => {
// eslint-disable-next-line no-alert
if (!canDelete || !window.confirm(t('feedbackTargetResults:confirmDeleteFeedback'))) return
if (!canDelete || !(window.prompt(t('feedbackTargetResults:confirmDeleteFeedback')) === 'delete')) return

try {
await mutation.mutateAsync({
Expand Down

0 comments on commit 3eeadd8

Please sign in to comment.