Skip to content

Commit

Permalink
Apply most review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
tupaschoal committed Jan 3, 2025
1 parent 2149f30 commit d21554c
Show file tree
Hide file tree
Showing 33 changed files with 116 additions and 109 deletions.
11 changes: 3 additions & 8 deletions __tests__/__renderer__/preferences.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import '../../__mocks__/jquery.mjs';
import assert from 'assert';
import fs from 'fs';
import { JSDOM } from 'jsdom';
import sinon from 'sinon';
import path from 'path';

import { rootDir } from '../../js/app-config.mjs';
Expand All @@ -16,6 +17,8 @@ import {
savePreferences,
} from '../../js/user-preferences.mjs';
import { preferencesApi } from '../../renderer/preload-scripts/preferences-api.mjs';
import { i18nTranslatorMock } from '../../renderer/i18n-translator.js';
i18nTranslatorMock.mock('getTranslationInLanguageData', sinon.stub().returnsThis());

const isCheckBox = true;
const weekdays = [
Expand Down Expand Up @@ -296,14 +299,6 @@ describe('Test Preferences Window', () =>
listenerLanguage();
});

it('Click reset and check button text change', () =>
{
const resetText = $('#reset-button').text();
$('#reset-button').trigger('click');
const resetTextAfterClick = $('#reset-button').text();
assert.notStrictEqual(resetText, resetTextAfterClick);
});

it('Click reset and check that setting was restored', () =>
{
changeItemValue('count-today', true);
Expand Down
8 changes: 5 additions & 3 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ html[data-theme="dark"] {
--table-header-label-shadow: var(--table-border);
--error: red;
--punch-bground: rgb(164 158 207);
--reset-color: rgb(242 93 77);
--punch-color: white;
--punch-disable-bground: rgb(134 134 134);
--slider-background-color: var(--table-cell-offtime-bground);
Expand Down Expand Up @@ -101,7 +100,6 @@ html[data-theme="cadent-star"] {
--table-header-label-bground: rgb(255 238 227 / 90%);
--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 @@ -699,7 +697,7 @@ input:disabled + .slider {
text-align: center;
}

#preferences-window .reset-button {
#preferences-window #reset-button {
opacity: 0.9;
width: 25%;
height: 24px;
Expand All @@ -708,6 +706,10 @@ input:disabled + .slider {
background-color: var(--reset-color);
}

#preferences-window #reset-button:hover {
background-color: hsl(0, 100%, 60%);
}

/* Waiver page styles */

#workday-waiver-window .section-title {
Expand Down
2 changes: 1 addition & 1 deletion locales/bn/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"numberOfEntries": "এন্ট্রির সংখ্যা",
"overallBalanceStart": "সামগ্রিক ব্যালেন্স শুরুর তারিখ",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "শনি",
"startOnLogin": "লগইন শুরু করুন",
Expand Down
2 changes: 1 addition & 1 deletion locales/ca/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Nombre de entrades",
"overallBalanceStart": "Balanç general Data D'inici",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "Dis",
"startOnLogin": "Començar al inici de sessió",
Expand Down
2 changes: 1 addition & 1 deletion locales/de-DE/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Anzahl an Einträgen",
"overallBalanceStart": "Gesamtbilanz Startdatum",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "Sa",
"startOnLogin": "Starten beim Login",
Expand Down
2 changes: 1 addition & 1 deletion locales/el/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Αριθμός εγγραφών",
"overallBalanceStart": "Ημερομηνία Έναρξης Συνολικού Ισοζυγίου",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "Σαβ",
"startOnLogin": "Εκκίνηση κατά την είσοδο στο σύστημα",
Expand Down
2 changes: 1 addition & 1 deletion locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Number of Entries",
"overallBalanceStart": "Overall Balance Start Date",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "Sat",
"startOnLogin": "Start on Login",
Expand Down
2 changes: 1 addition & 1 deletion locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Número de entradas",
"overallBalanceStart": "Balance general Fecha de inicio",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "Sáb",
"startOnLogin": "Comienza en Login",
Expand Down
2 changes: 1 addition & 1 deletion locales/fa-IR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "تعداد موارد",
"overallBalanceStart": "تاریخ شروع محاسبه اختلاف ساعت های کاری",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "شنبه",
"startOnLogin": "بازکردن هنگام ورود به سیستم",
Expand Down
2 changes: 1 addition & 1 deletion locales/fr-FR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Nombre d'entrées",
"overallBalanceStart": "Date de début du solde global",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "Sam",
"startOnLogin": "Lancer au démarrage",
Expand Down
2 changes: 1 addition & 1 deletion locales/gu/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "પ્રવેશોની સંખ્યા",
"overallBalanceStart": "એકંદરે બેલેન્સ પ્રારંભ તારીખ",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "શનિ",
"startOnLogin": "લોગિન પર પ્રારંભ કરો",
Expand Down
2 changes: 1 addition & 1 deletion locales/he/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "כמות רשומות",
"overallBalanceStart": "זמן התחלה של מאזן כללי",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "יום שבת",
"startOnLogin": "התחל בעת חיבור",
Expand Down
2 changes: 1 addition & 1 deletion locales/hi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "प्रविष्टियोंकी संख्या",
"overallBalanceStart": "ओवरऑल बैलेंस स्टार्ट डेट",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "शनि",
"startOnLogin": "लॉगिन पर शुरू करें",
Expand Down
2 changes: 1 addition & 1 deletion locales/id/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Jumlah Entri",
"overallBalanceStart": "Rata Rata Keseluruhan Tanggal Mulai ",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "Sab",
"startOnLogin": "Mulai saat Login",
Expand Down
2 changes: 1 addition & 1 deletion locales/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Numero di record",
"overallBalanceStart": "Data di inizio bilanciamento complessivo",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "Sab",
"startOnLogin": "Avvia al login",
Expand Down
2 changes: 1 addition & 1 deletion locales/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "記録の数",
"overallBalanceStart": "累計計算の開始日",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "",
"startOnLogin": "ログイン時に起動",
Expand Down
2 changes: 1 addition & 1 deletion locales/ko/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "하루 작업 단위 개수",
"overallBalanceStart": "총 작업 달성도 집계 시작일",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "",
"startOnLogin": "시스템 시작 시 자동 실행",
Expand Down
2 changes: 1 addition & 1 deletion locales/mr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "प्रवेशांची संख्या",
"overallBalanceStart": "एकूणच शिल्लक प्रारंभ तारीख",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "शनि",
"startOnLogin": "लॉगिन वर प्रारंभ करा",
Expand Down
2 changes: 1 addition & 1 deletion locales/nl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Aantal invoergegevens",
"overallBalanceStart": "Algemeen overzicht startdatum",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "Za",
"startOnLogin": "Starten met inloggen",
Expand Down
2 changes: 1 addition & 1 deletion locales/pl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Liczba wpisów",
"overallBalanceStart": "Data rozpoczęcia ogólnej statystyki",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "Sob",
"startOnLogin": "Uruchom przy starcie systemu",
Expand Down
2 changes: 1 addition & 1 deletion locales/pt-BR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Número de entradas",
"overallBalanceStart": "Data de início do balanço total",
"reset": "Restaurar",
"resetted": "Restaurado!",
"reset-success": "Preferências restauradas para o padrão com sucesso!",
"reset-preferences": "Restaurar preferências padrão",
"sat": "Sáb",
"startOnLogin": "Iniciar com Login",
Expand Down
2 changes: 1 addition & 1 deletion locales/pt-MI/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Número de entradas",
"overallBalanceStart": "Data de início do balanço total",
"reset": "Resetá",
"resetted": "Resetô!",
"reset-success": "Vortamo direitin as preferência pro padrão!",
"reset-preferences": "Resetá pros trem original",
"sat": "Sáb",
"startOnLogin": "Iniciar com Login",
Expand Down
2 changes: 1 addition & 1 deletion locales/pt-PT/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Número de Registos",
"overallBalanceStart": "Data de Início do Balanço Total",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "Sáb",
"startOnLogin": "Iniciar com o Login",
Expand Down
2 changes: 1 addition & 1 deletion locales/ru-RU/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Количество записей",
"overallBalanceStart": "Дата начала общей статистики",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "Сб",
"startOnLogin": "Войти",
Expand Down
2 changes: 1 addition & 1 deletion locales/sv-SE/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Antal poster",
"overallBalanceStart": "Startdatum för totalsaldo",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "Lör",
"startOnLogin": "Start vid inloggning",
Expand Down
2 changes: 1 addition & 1 deletion locales/ta/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "உள்ளீடுகளின் எண்ணிக்கை",
"overallBalanceStart": "ஒட்டுமொத்த இருப்பு தொடக்க தேதி",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "சனி",
"startOnLogin": "உள்நுழைவில் தொடங்கவும்",
Expand Down
2 changes: 1 addition & 1 deletion locales/th-TH/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "จำนวนรายการ",
"overallBalanceStart": "ภาพรวมชั่วโมงที่เหลือในวันเริ่ม",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "เสาร์",
"startOnLogin": "เริ่มเมื่อเข้าสู่ระบบ",
Expand Down
2 changes: 1 addition & 1 deletion locales/tr-TR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Girdi Sayısı",
"overallBalanceStart": "Başlangıç Tarihinden İtibaren Genel Bilanço",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "Cmt",
"startOnLogin": "Giriş Yap",
Expand Down
2 changes: 1 addition & 1 deletion locales/uk-UA/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "Кількість записів",
"overallBalanceStart": "Дата початку загального балансу",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "Сб",
"startOnLogin": "Автозапуск при вході в систему",
Expand Down
2 changes: 1 addition & 1 deletion locales/zh-CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "纪录数量",
"overallBalanceStart": "总体结余开始日期",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "",
"startOnLogin": "登入系统后自动启动程序",
Expand Down
2 changes: 1 addition & 1 deletion locales/zh-TW/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"numberOfEntries": "紀錄數量",
"overallBalanceStart": "總體結餘開始日期",
"reset": "Reset",
"resetted": "Reset!",
"reset-success": "Preferences successfully reset to default!",
"reset-preferences": "Reset to default preferences",
"sat": "",
"startOnLogin": "登入系統後自動啟動程序",
Expand Down
2 changes: 1 addition & 1 deletion src/preferences.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<div class="section-title" data-i18n="$Preferences.reset">Reset</div>
<div class="flex-box" name="preferences-area">
<p><i class="fas fa-undo"></i><span data-i18n="$Preferences.reset-preferences">Reset to default preferences</span></p>
<button class="reset-button" name="reset-button" id="reset-button" type="button" data-i18n="$Preferences.reset">
<button name="reset-button" id="reset-button" type="button" data-i18n="$Preferences.reset">
Reset
</button>
</div>
Expand Down
Loading

0 comments on commit d21554c

Please sign in to comment.