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

Reset preferences feature with button and reset functionality and cor… #1055

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
35 changes: 35 additions & 0 deletions __tests__/__renderer__/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@
if (fs.existsSync(preferencesFilePath)) fs.unlinkSync(preferencesFilePath);
}

function clickItem(item)
{
$(`#${item}`)
.trigger('click')

Check failure on line 90 in __tests__/__renderer__/preferences.js

View workflow job for this annotation

GitHub Actions / Checking (ubuntu-20.04)

Missing semicolon
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below there are some linting issues

}

function checkItemText(item, text)
{
expect($(`#${item}`).text().replace(/\s/g, "")).toBe(text);

Check failure on line 95 in __tests__/__renderer__/preferences.js

View workflow job for this annotation

GitHub Actions / Checking (ubuntu-20.04)

Strings must use singlequote
}

const testPreferences = Object.assign({}, defaultPreferences);

describe('Test Preferences Window', () =>
Expand Down Expand Up @@ -216,3 +227,27 @@
});
});


describe('Test Preferences Window Reset', () =>
{
process.env.NODE_ENV = 'test';

describe('Checking if reset button is responsive', () =>
{
beforeEach((async(done) =>
{
prepareMockup();
await refreshContent();
renderPreferencesWindow();
populateLanguages();
listenerLanguage();
done();
}));
test('Click reset and check button text change', () =>
{
checkItemText('reset-button', 'Reset')

Check failure on line 248 in __tests__/__renderer__/preferences.js

View workflow job for this annotation

GitHub Actions / Checking (ubuntu-20.04)

Missing semicolon
clickItem('reset-button');
});
});
});

12 changes: 12 additions & 0 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ html[data-theme="light"] {
--table-header-label-bground: var(--table-bground);
--table-header-label-shadow: var(--table-border);
--error: red;
--reset-color: rgb(242, 93, 77);
--punch-bground: var(--table-total-border);
--punch-color: black;
--punch-disable-bground: rgb(134, 134, 134);
Expand Down Expand Up @@ -62,6 +63,7 @@ html[data-theme="dark"] {
--table-header-label-bground: var(--table-bground);
--table-header-label-shadow: var(--table-border);
--error: red;
--reset-color: rgb(242, 93, 77);
--punch-bground: rgb(164, 158, 207);
--punch-color: white;
--punch-disable-bground: rgb(134, 134, 134);
Expand Down Expand Up @@ -99,6 +101,7 @@ html[data-theme="cadent-star"] {
--table-header-label-bground: rgba(255, 238, 227, 0.9);
--table-header-label-shadow: var(--table-border);
--error: red;
--reset-color: rgb(242, 93, 77);
--punch-bground: var(--table-total-border);
--punch-color: rgb(228, 228, 228);
--punch-disable-bground: rgb(134, 134, 134);
Expand Down Expand Up @@ -709,6 +712,15 @@ input:disabled + .slider {
text-align: center;
}

#preferences-window .reset-button {
opacity: 0.9;
width: 25%;
height: 24px;
border: none;
color: var(--punch-color);
background-color: var(--reset-color);
}

/* Waiver page styles */

#workday-waiver-window .section-title {
Expand Down
7 changes: 6 additions & 1 deletion locales/bn/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
"appBehavior": "অ্যাপ বিহেভিয়ার",
"cadentStar": "ক্যাডেন্ট স্টার",
"closeMinimizeToTray": "বন্ধ বোতামটি ট্রেতে ছোট করা উচিত",
"confirm-reset-preferences": "Are you sure you want to reset all preferences?",
"countTodayOnTotals": "কাউন্ট টুডে টোটাল",
"dark": "অন্ধকার",
"day": "দিন",
Expand All @@ -143,8 +144,11 @@
"mon": "সোম",
"month": "মাস",
"notification": "বিজ্ঞপ্তি",
"no-thanks": "না, ধন্যবাদ",
"numberOfEntries": "এন্ট্রির সংখ্যা",
"overallBalanceStart": "সামগ্রিক ব্যালেন্স শুরুর তারিখ",
"reset": "Reset",
"reset-preferences": "Reset to default preferences",
"sat": "শনি",
"startOnLogin": "লগইন শুরু করুন",
"sun": "রবিবার",
Expand All @@ -156,7 +160,8 @@
"userPreferences": "ব্যবহারকারীর পছন্দ",
"view": "দেখুন",
"wed": "বুধ",
"workingDays": "কাজের দিন"
"workingDays": "কাজের দিন",
"yes-please": "হ্যাঁ, দয়া করে"
},
"$UpdateManager": {
"dismissBtn": "খারিজ",
Expand Down
7 changes: 6 additions & 1 deletion locales/ca/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"appBehavior": "Funcionament de l'aplicació",
"cadentStar": "Estrella Fugaç",
"closeMinimizeToTray": "El botó de tancament hauria de minimitzar a la safata",
"confirm-reset-preferences": "Are you sure you want to reset all preferences?",
"countTodayOnTotals": "Contar els totals avui",
"dark": "Fosc",
"day": "Dia",
Expand All @@ -142,8 +143,11 @@
"mon": "Dil",
"month": "Mes",
"notification": "Notificació",
"no-thanks": "No, gracies",
"numberOfEntries": "Nombre de entrades",
"overallBalanceStart": "Balanç general Data D'inici",
"reset": "Reset",
"reset-preferences": "Reset to default preferences",
"sat": "Dis",
"startOnLogin": "Començar al inici de sessió",
"sun": "Diu",
Expand All @@ -155,7 +159,8 @@
"userPreferences": "Preferéncias d' usuari",
"view": "Vista",
"wed": "Dim",
"workingDays": "Dies de treball"
"workingDays": "Dies de treball",
"yes-please": "Sí, si us plau"
},
"$UpdateManager": {
"dismissBtn": "Ara no",
Expand Down
7 changes: 6 additions & 1 deletion locales/de-DE/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"appBehavior": "App Verhalten",
"cadentStar": "Regenbogenfarben",
"closeMinimizeToTray": "Schließen Button minimiert Fenster in den Tray",
"confirm-reset-preferences": "Are you sure you want to reset all preferences?",
"countTodayOnTotals": "Zähle heute in Summe",
"dark": "Dunkel",
"day": "Tag",
Expand All @@ -142,8 +143,11 @@
"mon": "Mo",
"month": "Monat",
"notification": "Benachrichtigungen",
"no-thanks": "Nein, danke",
"numberOfEntries": "Anzahl an Einträgen",
"overallBalanceStart": "Gesamtbilanz Startdatum",
"reset": "Reset",
"reset-preferences": "Reset to default preferences",
"sat": "Sa",
"startOnLogin": "Starten beim Login",
"sun": "So",
Expand All @@ -155,7 +159,8 @@
"userPreferences": "Benutzereinstellungen",
"view": "Ansicht",
"wed": "Mi",
"workingDays": "Arbeitstage"
"workingDays": "Arbeitstage",
"yes-please": "Ja, bitte"
},
"$UpdateManager": {
"dismissBtn": "Ablehnen",
Expand Down
7 changes: 6 additions & 1 deletion locales/el/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"appBehavior": "Συμπεριφορά εφαρμογής",
"cadentStar": "Cadent Star",
"closeMinimizeToTray": "Το κουμπί Κλείσιμο θα ελαχιστοποιεί στη γραμμή εργασιών",
"confirm-reset-preferences": "Are you sure you want to reset all preferences?",
"countTodayOnTotals": "Μετρήστε τη σημερινή ημέρα στα συνολικά",
"dark": "Σκοτεινό",
"day": "Ημέρα",
Expand All @@ -142,8 +143,11 @@
"mon": "Δευ",
"month": "Μήνας",
"notification": "Ειδοποίηση",
"no-thanks": "Όχι, ευχαριστώ",
"numberOfEntries": "Αριθμός εγγραφών",
"overallBalanceStart": "Ημερομηνία Έναρξης Συνολικού Ισοζυγίου",
"reset": "Reset",
"reset-preferences": "Reset to default preferences",
"sat": "Σαβ",
"startOnLogin": "Εκκίνηση κατά την είσοδο στο σύστημα",
"sun": "Κυρ",
Expand All @@ -155,7 +159,8 @@
"userPreferences": "Προτιμήσεις χρήστη",
"view": "Προβολή",
"wed": "Τετ",
"workingDays": "Εργάσιμες ημέρες"
"workingDays": "Εργάσιμες ημέρες",
"yes-please": "Ναι, παρακαλώ"
},
"$UpdateManager": {
"dismissBtn": "Απόρριψη",
Expand Down
7 changes: 6 additions & 1 deletion locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"appBehavior": "App Behavior",
"cadentStar": "Cadent Star",
"closeMinimizeToTray": "Close button should minimize to tray",
"confirm-reset-preferences": "Are you sure you want to reset all preferences?",
"countTodayOnTotals": "Count Today in Totals",
"dark": "Dark",
"day": "Day",
Expand All @@ -142,8 +143,11 @@
"mon": "Mon",
"month": "Month",
"notification": "Notification",
"no-thanks": "No, thanks",
"numberOfEntries": "Number of Entries",
"overallBalanceStart": "Overall Balance Start Date",
"reset": "Reset",
"reset-preferences": "Reset to default preferences",
"sat": "Sat",
"startOnLogin": "Start on Login",
"sun": "Sun",
Expand All @@ -155,7 +159,8 @@
"userPreferences": "User preferences",
"view": "View",
"wed": "Wed",
"workingDays": "Working days"
"workingDays": "Working days",
"yes-please": "Yes, please"
},
"$UpdateManager": {
"dismissBtn": "Dismiss",
Expand Down
7 changes: 6 additions & 1 deletion locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"appBehavior": "Comportamiento de la aplicación",
"cadentStar": "Estrella Fugaz",
"closeMinimizeToTray": "El botón de cierre debería minimizar a la bandeja",
"confirm-reset-preferences": "Are you sure you want to reset all preferences?",
"countTodayOnTotals": "Contar hoy en los totales",
"dark": "Oscuro",
"day": "Día",
Expand All @@ -142,8 +143,11 @@
"mon": "Lun",
"month": "Mes",
"notification": "Notificación",
"no-thanks": "No, gracias",
"numberOfEntries": "Número de entradas",
"overallBalanceStart": "Balance general Fecha de inicio",
"reset": "Reset",
"reset-preferences": "Reset to default preferences",
"sat": "Sáb",
"startOnLogin": "Comienza en Login",
"sun": "Dom",
Expand All @@ -155,7 +159,8 @@
"userPreferences": "Preferencias de usuario",
"view": "Vista",
"wed": "Mié",
"workingDays": "Días de trabajo"
"workingDays": "Días de trabajo",
"yes-please": "Sí, por favor"
},
"$UpdateManager": {
"dismissBtn": "Ahora no",
Expand Down
7 changes: 6 additions & 1 deletion locales/fa-IR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"appBehavior": "تنظیمات برنامه",
"cadentStar": "ستاره دنباله دار",
"closeMinimizeToTray": "هنگام کلیک روی دکمه خروج در قسمت آیکن ها قرار بگیرد",
"confirm-reset-preferences": "Are you sure you want to reset all preferences?",
"countTodayOnTotals": "شمارش امروز در قسمت مجموع",
"dark": "تاریک",
"day": "روزانه",
Expand All @@ -142,8 +143,11 @@
"mon": "دوشنبه",
"month": "ماهانه",
"notification": "اعلان ها",
"no-thanks": "خیر",
"numberOfEntries": "تعداد موارد",
"overallBalanceStart": "تاریخ شروع محاسبه اختلاف ساعت های کاری",
"reset": "Reset",
"reset-preferences": "Reset to default preferences",
"sat": "شنبه",
"startOnLogin": "بازکردن هنگام ورود به سیستم",
"sun": "یکشنبه",
Expand All @@ -155,7 +159,8 @@
"userPreferences": "تنظیمات کاربری",
"view": "شیوه نمایش",
"wed": "چهارشنبه",
"workingDays": "روزهای کاری"
"workingDays": "روزهای کاری",
"yes-please": "بله"
},
"$UpdateManager": {
"dismissBtn": "رد کردن",
Expand Down
7 changes: 6 additions & 1 deletion locales/fr-FR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"appBehavior": "Comportement de l'application",
"cadentStar": "Étoile filante",
"closeMinimizeToTray": "Le bouton de fermeture doit être réduit au bac",
"confirm-reset-preferences": "Are you sure you want to reset all preferences?",
"countTodayOnTotals": "Compter aujourd'hui dans les totaux",
"dark": "Sombre",
"day": "Jour",
Expand All @@ -142,8 +143,11 @@
"mon": "Lun",
"month": "Mois",
"notification": "Notification",
"no-thanks": "Non merci",
"numberOfEntries": "Nombre d'entrées",
"overallBalanceStart": "Date de début du solde global",
"reset": "Reset",
"reset-preferences": "Reset to default preferences",
"sat": "Sam",
"startOnLogin": "Commencer à la connexion",
"sun": "Dim",
Expand All @@ -155,7 +159,8 @@
"userPreferences": "Préférences de l'utilisateur",
"view": "Vue",
"wed": "Mer",
"workingDays": "Jours de travail"
"workingDays": "Jours de travail",
"yes-please": "Oui s'il vous plaît"
},
"$UpdateManager": {
"dismissBtn": "Rejeter",
Expand Down
7 changes: 6 additions & 1 deletion locales/gu/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"appBehavior": "એપ્લિકેશન વર્તણૂક",
"cadentStar": "કેડેન્ટ સ્ટાર",
"closeMinimizeToTray": "ટ્રેમાં બટન બંધ કરવું જોઈએ",
"confirm-reset-preferences": "Are you sure you want to reset all preferences?",
"countTodayOnTotals": "ટોટલ્સમાં આજે ગણતરી કરો",
"dark": "શ્યામ",
"day": "દિવસ",
Expand All @@ -142,8 +143,11 @@
"mon": "સોમ",
"month": "માસ",
"notification": "સૂચના",
"no-thanks": "ના, આભાર",
"numberOfEntries": "પ્રવેશોની સંખ્યા",
"overallBalanceStart": "એકંદરે બેલેન્સ પ્રારંભ તારીખ",
"reset": "Reset",
"reset-preferences": "Reset to default preferences",
"sat": "શનિ",
"startOnLogin": "લોગિન પર પ્રારંભ કરો",
"sun": "રવિવાર",
Expand All @@ -155,7 +159,8 @@
"userPreferences": "વપરાશકર્તા પસંદગીઓ",
"view": "જુઓ",
"wed": "બુધ",
"workingDays": "કાર્યકારી દિવસો"
"workingDays": "કાર્યકારી દિવસો",
"yes-please": "હા, કૃપા કરીને"
},
"$UpdateManager": {
"dismissBtn": "કાઢી નાખવું",
Expand Down
7 changes: 6 additions & 1 deletion locales/he/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"appBehavior": "התנהגות ישומון",
"cadentStar": "כוכב קדנט",
"closeMinimizeToTray": "כפתור סגירה ימזער למגש",
"confirm-reset-preferences": "Are you sure you want to reset all preferences?",
"countTodayOnTotals": "להחשיב את היום למאזן",
"dark": "חשוך",
"day": "יום",
Expand All @@ -142,8 +143,11 @@
"mon": "יום שני",
"month": "חודש",
"notification": "התראה",
"no-thanks": "לא, תודה",
"numberOfEntries": "כמות רשומות",
"overallBalanceStart": "זמן התחלה של מאזן כללי",
"reset": "Reset",
"reset-preferences": "Reset to default preferences",
"sat": "יום שבת",
"startOnLogin": "התחל בעת חיבור",
"sun": "יום ראשון",
Expand All @@ -155,7 +159,8 @@
"userPreferences": "העדפות משתמש",
"view": "תצוגה",
"wed": "יום רביעי",
"workingDays": "ימי עבודה"
"workingDays": "ימי עבודה",
"yes-please": "כן, בבקשה"
},
"$UpdateManager": {
"dismissBtn": "לפטור",
Expand Down
Loading
Loading