Skip to content

Commit

Permalink
Standardize dialogs to use type over TTL icon
Browse files Browse the repository at this point in the history
  • Loading branch information
tupaschoal committed Feb 6, 2025
1 parent 0c88d1e commit 9675f0c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
8 changes: 1 addition & 7 deletions js/menus.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ function getEditMenuTemplate(mainWindow)
WindowAux.showDialog({
message: i18NextConfig.getCurrentTranslation('$Menu.database-export'),
type: 'info',
icon: appConfig.iconpath,
detail: i18NextConfig.getCurrentTranslation('$Menu.database-was-exported')
});
}
Expand Down Expand Up @@ -249,7 +248,6 @@ function getEditMenuTemplate(mainWindow)
WindowAux.showDialog({
message: i18NextConfig.getCurrentTranslation('$Menu.database-imported'),
type: 'info',
icon: appConfig.iconpath,
detail: i18NextConfig.getCurrentTranslation('$Menu.import-successful')
});
}
Expand All @@ -259,7 +257,6 @@ function getEditMenuTemplate(mainWindow)
importResult['total']
} ${i18NextConfig.getCurrentTranslation('$Menu.could-not-be-loaded')}`;
WindowAux.showDialogSync({
icon: appConfig.iconpath,
type: 'warning',
message: i18NextConfig.getCurrentTranslation('$Menu.failed-entries'),
detail: message
Expand All @@ -268,8 +265,7 @@ function getEditMenuTemplate(mainWindow)
else
{
WindowAux.showDialogSync({
icon: appConfig.iconpath,
type: 'warning',
type: 'error',
message: i18NextConfig.getCurrentTranslation('$Menu.failed-entries'),
detail: i18NextConfig.getCurrentTranslation('$Menu.something-went-wrong')
});
Expand Down Expand Up @@ -310,7 +306,6 @@ function getEditMenuTemplate(mainWindow)
WindowAux.showDialog({
message: i18NextConfig.getCurrentTranslation('$Menu.clear-database'),
type: 'info',
icon: appConfig.iconpath,
detail: `\n${i18NextConfig.getCurrentTranslation('$Menu.all-clear')}`
});
}
Expand Down Expand Up @@ -378,7 +373,6 @@ function getHelpMenuTemplate()
WindowAux.showDialog({
message: 'Time to Leave',
type: 'info',
icon: appConfig.iconpath,
detail: `\n${detail}`,
buttons: [
i18NextConfig.getCurrentTranslation('$Menu.copy'),
Expand Down
2 changes: 1 addition & 1 deletion renderer/classes/DayCalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class DayCalendar extends BaseCalendar
const removeEntriesDialogOptions = {
message: calendar._getTranslation('$DayCalendar.remove-entry'),
detail: calendar._getTranslation('$DayCalendar.entry-removal-confirmation'),
type: 'info',
type: 'question',
buttons: [calendar._getTranslation('$DayCalendar.yes'), calendar._getTranslation('$DayCalendar.no')],
defaultId: 1,
cancelId: 1
Expand Down
2 changes: 1 addition & 1 deletion renderer/classes/MonthCalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ class MonthCalendar extends BaseCalendar
const removeEntriesDialogOptions = {
message: `${calendar._getTranslation('$MonthCalendar.remove-entry')}`,
detail: `${calendar._getTranslation('$MonthCalendar.entry-removal-confirmation')} ${date}?`,
type: 'info',
type: 'question',
buttons: [calendar._getTranslation('$MonthCalendar.yes'), calendar._getTranslation('$MonthCalendar.no')],
defaultId: 1,
cancelId: 1
Expand Down
6 changes: 5 additions & 1 deletion src/workday-waiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ async function addWaiver()
if (diff < 0)
{
const options = {
type: 'warning',
message: getTranslation('$WorkdayWaiver.add-waiver'),
detail: getTranslation('$WorkdayWaiver.end-date-cannot-be-less')
};
Expand All @@ -134,6 +135,7 @@ async function addWaiver()
if (hasWaiver)
{
const options = {
type: 'warning',
message: getTranslation('$WorkdayWaiver.add-waiver'),
detail: `${alreadyHaveWaiverStr} ${tempDateStr}. ${removeWaiverStr}`
};
Expand All @@ -147,6 +149,7 @@ async function addWaiver()
if (noWorkingDaysOnRange)
{
const options = {
type: 'warning',
message: getTranslation('$WorkdayWaiver.add-waiver'),
detail: getTranslation('$WorkdayWaiver.no-working-days-on-range')
};
Expand Down Expand Up @@ -184,7 +187,7 @@ async function deleteEntryOnClick(event)
const options = {
message: getTranslation('$WorkdayWaiver.add-waiver'),
detail: `${deleteWaiverMessageStr} ${day}?`,
type: 'info',
type: 'question',
buttons: [getTranslation('$WorkdayWaiver.yes'), getTranslation('$WorkdayWaiver.no')],
defaultId: 1,
cancelId: 1
Expand Down Expand Up @@ -412,6 +415,7 @@ async function addHolidaysAsWaiver()
//clear data from table and return the configurations to default
await initializeHolidayInfo();
const options = {
type: 'info',
message: getTranslation('$WorkdayWaiver.add-waiver'),
detail: getTranslation('$WorkdayWaiver.loaded-waivers-holidays')
};
Expand Down

0 comments on commit 9675f0c

Please sign in to comment.