MOBILE-3936 reminders: Add toasts when setting and deleting reminders

main
Pau Ferrer Ocaña 2022-10-14 14:35:22 +02:00
parent 69d2530bb8
commit 43cec87112
3 changed files with 20 additions and 6 deletions

View File

@ -2151,12 +2151,15 @@
"core.reminders.atthetime": "local_moodlemobileapp",
"core.reminders.custom": "local_moodlemobileapp",
"core.reminders.customreminder": "local_moodlemobileapp",
"core.reminders.daybefore": "local_moodlemobileapp",
"core.reminders.daysbefore": "local_moodlemobileapp",
"core.reminders.delete": "moodle",
"core.reminders.reminderset": "local_moodlemobileapp",
"core.reminders.reminderunset": "local_moodlemobileapp",
"core.reminders.setareminder": "local_moodlemobileapp",
"core.reminders.setareminderfor": "local_moodlemobileapp",
"core.reminders.setreminder": "local_moodlemobileapp",
"core.reminders.timebefore": "local_moodlemobileapp",
"core.reminders.units": "qtype_numerical",
"core.reminders.value": "local_moodlemobileapp",
"core.remove": "moodle",
"core.removefiles": "local_moodlemobileapp",
"core.required": "moodle",

View File

@ -16,6 +16,8 @@ import { CoreReminderData, CoreReminders, CoreRemindersService } from '@features
import { Component, Input, OnInit } from '@angular/core';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreRemindersSetReminderMenuComponent } from '../set-reminder-menu/set-reminder-menu';
import { Translate } from '@singletons';
import { CoreTimeUtils } from '@services/utils/time';
/**
* Component that displays a button to set a reminder.
@ -104,6 +106,8 @@ export class CoreRemindersSetButtonComponent implements OnInit {
});
this.timebefore = undefined;
CoreDomUtils.showToast('core.reminders.reminderunset', true);
return;
}
@ -121,6 +125,10 @@ export class CoreRemindersSetButtonComponent implements OnInit {
// Save before.
await CoreReminders.addReminder(reminder);
const time = this.time - timebefore;
const text = Translate.instant('core.reminders.reminderset', { $a: CoreTimeUtils.userDate(time * 1000) });
CoreDomUtils.showToast(text);
}
}

View File

@ -2,10 +2,13 @@
"atthetime": "At the time of the event",
"custom": "Custom...",
"customreminder": "Custom reminder",
"setareminder": "Set a reminder",
"daybefore": "{{time}} day before",
"daysbefore": "{{time}} days before",
"delete": "Delete reminder",
"reminderset": "Reminder set for {{$a}}",
"reminderunset": "Reminder deleted",
"setareminder": "Set a reminder",
"setareminderfor": "Set a reminder for \"{{title}}\" ({{label}})",
"setreminder": "Set reminder",
"timebefore": "{{value}} {{units}} before",
"units": "units"
"units": "Units",
"value": "Value"
}