Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b3b3a0e5a8 | ||
|
|
a92eeaf149 | ||
|
|
86989362fe | ||
|
|
cb81749dbf | ||
|
|
0bac419c3a | ||
|
|
1fa4748168 | ||
|
|
c1318a2cc4 | ||
|
|
cc2e656e14 |
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -9,9 +9,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v7
|
||||
- name: Use Node.js 20
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: 'npm'
|
||||
|
||||
@@ -1,2 +1,13 @@
|
||||
LICENSE.md
|
||||
dist/
|
||||
build/
|
||||
vendor/
|
||||
android/
|
||||
ios/
|
||||
resources/
|
||||
.bundle/
|
||||
.agents/
|
||||
.impeccable/
|
||||
package-lock.json
|
||||
Gemfile.lock
|
||||
skills-lock.json
|
||||
|
||||
@@ -13,8 +13,8 @@ android {
|
||||
applicationId "com.donetick.app"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 69
|
||||
versionName "1.2.48"
|
||||
versionCode 70
|
||||
versionName "1.2.49"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
aaptOptions {
|
||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||
|
||||
@@ -15,7 +15,17 @@ import globals from 'globals'
|
||||
|
||||
export default [
|
||||
{
|
||||
ignores: ['dist'],
|
||||
ignores: [
|
||||
'dist',
|
||||
'build',
|
||||
'vendor',
|
||||
'android',
|
||||
'ios',
|
||||
'resources',
|
||||
'public/assets',
|
||||
'.agents',
|
||||
'.impeccable',
|
||||
],
|
||||
},
|
||||
js.configs.recommended,
|
||||
react.configs.flat.recommended,
|
||||
@@ -51,7 +61,11 @@ export default [
|
||||
eslintConfigPrettier, // Disable any rules that conflict with prettier
|
||||
eslintPluginPrettierRecommended,
|
||||
{
|
||||
files: ['*.{js,ts}'],
|
||||
files: [
|
||||
'*.{js,mjs,cjs,ts}',
|
||||
'scripts/**/*.{js,mjs,cjs,ts}',
|
||||
'workers/**/*.{js,mjs,cjs,ts}',
|
||||
],
|
||||
languageOptions: {
|
||||
globals: globals.node,
|
||||
},
|
||||
@@ -72,9 +86,9 @@ export default [
|
||||
sourceType: 'module',
|
||||
},
|
||||
rules: {
|
||||
// Formatting rules (indent, space-infix-ops) are owned by prettier here —
|
||||
// re-enabling them fights prettier/prettier and makes --fix unable to converge.
|
||||
eqeqeq: 'error',
|
||||
indent: ['error', 2],
|
||||
'space-infix-ops': ['error', { int32Hint: false }],
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -31,8 +31,7 @@ Build a signed, App Store-ready .ipa
|
||||
|
||||
Upload the built .ipa to TestFlight
|
||||
|
||||
----
|
||||
|
||||
---
|
||||
|
||||
## Android
|
||||
|
||||
@@ -60,7 +59,7 @@ Build a signed release .apk (for sideloading/testing)
|
||||
|
||||
Upload the built .aab to the Play Store (internal testing track by default)
|
||||
|
||||
----
|
||||
---
|
||||
|
||||
This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.
|
||||
|
||||
|
||||
@@ -462,12 +462,12 @@
|
||||
CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 69;
|
||||
CURRENT_PROJECT_VERSION = 70;
|
||||
DEVELOPMENT_TEAM = 6UJJ78R3BS;
|
||||
INFOPLIST_FILE = App/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MARKETING_VERSION = 1.2.48;
|
||||
MARKETING_VERSION = 1.2.49;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.donetick.app;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
@@ -485,12 +485,12 @@
|
||||
CODE_SIGN_IDENTITY = "Apple Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "Donetick App Store(fastline)";
|
||||
CURRENT_PROJECT_VERSION = 69;
|
||||
CURRENT_PROJECT_VERSION = 70;
|
||||
DEVELOPMENT_TEAM = 6UJJ78R3BS;
|
||||
INFOPLIST_FILE = App/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MARKETING_VERSION = 1.2.48;
|
||||
MARKETING_VERSION = 1.2.49;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.donetick.app;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
|
||||
@@ -504,12 +504,12 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = DonetickWidget/DonetickWidget.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 69;
|
||||
CURRENT_PROJECT_VERSION = 70;
|
||||
DEVELOPMENT_TEAM = 6UJJ78R3BS;
|
||||
INFOPLIST_FILE = DonetickWidget/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
|
||||
MARKETING_VERSION = 1.2.48;
|
||||
MARKETING_VERSION = 1.2.49;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.donetick.app.widget;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
@@ -527,12 +527,12 @@
|
||||
CODE_SIGN_IDENTITY = "Apple Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "Donetick Widget App Store(fastline)";
|
||||
CURRENT_PROJECT_VERSION = 69;
|
||||
CURRENT_PROJECT_VERSION = 70;
|
||||
DEVELOPMENT_TEAM = 6UJJ78R3BS;
|
||||
INFOPLIST_FILE = DonetickWidget/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
|
||||
MARKETING_VERSION = 1.2.48;
|
||||
MARKETING_VERSION = 1.2.49;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.donetick.app.widget;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "donetick",
|
||||
"private": true,
|
||||
"version": "1.2.48",
|
||||
"version": "1.2.49",
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": ">=20.0.0",
|
||||
@@ -20,8 +20,9 @@
|
||||
"build-cf": "rm -rf package-lock.json && npm install && npm install --force @rollup/rollup-linux-x64-gnu@4.34.9 @swc/core-linux-x64-gnu && vite build",
|
||||
"build-selfhosted": "rm -rf package-lock.json && npm install && npm install --force @rollup/rollup-linux-x64-gnu@4.34.9 @swc/core-linux-x64-gnu && vite build --mode selfhosted",
|
||||
"build-win": "del package-lock.json && npm install && npm install --force @rollup/rollup-win32-x64-msvc @swc/core-win32-x64-msvc && vite build --mode selfhosted",
|
||||
"lint": "eslint && prettier -c .",
|
||||
"lint:ci": "eslint -f gha && prettier -c .",
|
||||
"lint": "eslint && prettier -c . && npm run lint:i18n",
|
||||
"lint:i18n": "node scripts/i18n-audit.mjs",
|
||||
"lint:ci": "eslint -f gha && prettier -c . && npm run lint:i18n",
|
||||
"lint:fix": "eslint --fix && prettier -w .",
|
||||
"preview": "vite preview",
|
||||
"setup-m1": "rm -rf node_modules package-lock.json && npm install && npm install --force @rollup/rollup-darwin-arm64 @swc/core-darwin-arm64",
|
||||
|
||||
@@ -259,7 +259,18 @@
|
||||
"clearFilters": "Clear filters",
|
||||
"count_one": "{{count}} archived task",
|
||||
"count_other": "{{count}} archived tasks",
|
||||
"matching": " matching \"{{term}}\""
|
||||
"matching": " matching \"{{term}}\"",
|
||||
"filtersTitle": "Filters",
|
||||
"sortArchivedDate": "Archived date",
|
||||
"sortName": "Name",
|
||||
"sortPriority": "Priority",
|
||||
"sortDueDate": "Due date",
|
||||
"noMatchTitle": "No archived tasks match",
|
||||
"noMatchSearch": "Nothing in the archive matches \"{{term}}\".",
|
||||
"noMatchFilters": "There are archived tasks, but none fit the filters that are currently on.",
|
||||
"emptyTitle": "Nothing archived",
|
||||
"emptyDescription": "Archiving hides a task without deleting it. Anything you archive from your task list shows up here, ready to restore.",
|
||||
"backToTasks": "Back to tasks"
|
||||
},
|
||||
"edit": {
|
||||
"deleteConfirm": "Are you sure you want to delete this chore?"
|
||||
@@ -273,7 +284,11 @@
|
||||
"filterUpdated": "Filter Updated",
|
||||
"filterUpdatedMsg": "\"{{name}}\" has been updated successfully",
|
||||
"advancedFilterCreated": "Advanced Filter Created",
|
||||
"advancedFilterCreatedMsg": "\"{{name}}\" has been created successfully"
|
||||
"advancedFilterCreatedMsg": "\"{{name}}\" has been created successfully",
|
||||
"reject": "Reject",
|
||||
"pending": "Pending",
|
||||
"schedule": "Schedule",
|
||||
"nudge": "Nudge"
|
||||
},
|
||||
"multiToolbar": {
|
||||
"skip": "Skip",
|
||||
@@ -282,7 +297,27 @@
|
||||
"skipTitle": "Skip selected tasks (/)",
|
||||
"archiveTitle": "Archive selected tasks (X)",
|
||||
"archive": "Archive",
|
||||
"deleteTitle": "Delete selected tasks (Shift+X)"
|
||||
"deleteTitle": "Delete selected tasks (Shift+X)",
|
||||
"mixed": "Mixed",
|
||||
"due": "Due",
|
||||
"dueTitleSet": "Due date on selected tasks: {{value}}",
|
||||
"dueTitleEmpty": "Set due date on selected tasks",
|
||||
"presetToday": "Today",
|
||||
"presetTomorrow": "Tomorrow",
|
||||
"presetNextWeek": "Next week",
|
||||
"pickDate": "Pick date…",
|
||||
"noDueDate": "No due date",
|
||||
"moveTitle": "Move selected tasks to a project",
|
||||
"move": "Move",
|
||||
"defaultProject": "Default Project",
|
||||
"moreTitle": "Set priority, assignee, or labels",
|
||||
"more": "More",
|
||||
"priority": "Priority",
|
||||
"assignee": "Assignee",
|
||||
"labels": "Labels",
|
||||
"labelsHint": "Tap to add · tap again to remove",
|
||||
"done": "Done",
|
||||
"noPriority": "None"
|
||||
},
|
||||
"remind": {
|
||||
"title": "Reminders"
|
||||
@@ -350,7 +385,11 @@
|
||||
"search": "Search",
|
||||
"newChore": "New Chore",
|
||||
"unassigned": "Unassigned",
|
||||
"changeDueDate": "Change due date"
|
||||
"changeDueDate": "Change due date",
|
||||
"colDue": "Due",
|
||||
"colChore": "Chore",
|
||||
"colAssignee": "Assignee",
|
||||
"colAction": "Action"
|
||||
},
|
||||
"dataError": {
|
||||
"attachmentsFailed": "Failed to fetch attachments"
|
||||
@@ -380,7 +419,21 @@
|
||||
"today": "Today",
|
||||
"tomorrow": "Tomorrow",
|
||||
"weekend": "Weekend",
|
||||
"nextWeek": "Next week"
|
||||
"nextWeek": "Next week",
|
||||
"title": "Due Date",
|
||||
"apply": "Apply",
|
||||
"remove": "Remove",
|
||||
"quickDate": "Quick date",
|
||||
"quickTime": "Quick time",
|
||||
"nextMonth": "Next month",
|
||||
"morning": "Morning",
|
||||
"noon": "Noon",
|
||||
"afternoon": "Afternoon",
|
||||
"evening": "Evening",
|
||||
"night": "Night",
|
||||
"customTime": "Custom time",
|
||||
"anytime": "Anytime",
|
||||
"specificTime": "Specific time"
|
||||
},
|
||||
"photoTask": {
|
||||
"title": "Scan photo to create task",
|
||||
@@ -391,11 +444,32 @@
|
||||
"processNatively": "Process Natively",
|
||||
"processImage": "Process Image",
|
||||
"createTask": "Create Task",
|
||||
"failedScan": "Failed scan"
|
||||
"failedScan": "Failed scan",
|
||||
"retake": "Retake",
|
||||
"upload": "Upload",
|
||||
"keepAsAttachment": "Keep photo as attachment",
|
||||
"altCaptured": "Captured document",
|
||||
"altProcessing": "Processing",
|
||||
"taskIdentified": "Task identified"
|
||||
},
|
||||
"descriptionPlaceholder": "Enter description...",
|
||||
"notifTemplate": {
|
||||
"notificationTemplate": {
|
||||
"onDueDate": "On due date",
|
||||
"timing": {
|
||||
"before": "Before",
|
||||
"ondue": "Due",
|
||||
"after": "After"
|
||||
},
|
||||
"unitName": {
|
||||
"m": "minutes",
|
||||
"h": "hours",
|
||||
"d": "days"
|
||||
},
|
||||
"unitShort": {
|
||||
"m": "Mins",
|
||||
"h": "Hours",
|
||||
"d": "Days"
|
||||
},
|
||||
"beforeDue": "{{count}} {{unit}} before due",
|
||||
"afterDue": "{{count}} {{unit}} after due",
|
||||
"errDuplicate": "This notification setting already exists. Please use a different timing.",
|
||||
@@ -405,5 +479,364 @@
|
||||
"dueAlert": "Due Alert",
|
||||
"followUp": "Follow-up",
|
||||
"rememberFuture": "Remember for Future Tasks"
|
||||
},
|
||||
"choreEdit": {
|
||||
"errNameRequired": "Name is required",
|
||||
"errFrequencyInvalid": "Invalid frequency, the {{unit}} should be > 0",
|
||||
"errSelectDayOfWeek": "Please select at least one day of the week",
|
||||
"errSelectDayOccurrence": "Please select at least one day occurrence for the month",
|
||||
"errSelectMonth": "Please select at least one month",
|
||||
"errStartDateRequired": "Start date is required",
|
||||
"errDueDateRequired": "Due date is required",
|
||||
"errThingTrigger": "Thing trigger is invalid",
|
||||
"errTitle": "Please resolve the following errors:",
|
||||
"savedOfflineTitle": "Saved Offline",
|
||||
"savedOfflineMessage": "Your changes will sync when you are back online.",
|
||||
"savedTitle": "Chore Saved",
|
||||
"savedMessage": "Your task has been saved successfully!",
|
||||
"saveFailedTitle": "Save Failed",
|
||||
"saveFailedMessage": "Failed to save chore, please try again.",
|
||||
"uploadFailedTitle": "Upload Failed",
|
||||
"uploadFailedMessage": "Failed to upload attachment.",
|
||||
"scanFailedTitle": "Scan Failed",
|
||||
"scanFailedMessage": "Could not scan the document.",
|
||||
"scanReadFailedMessage": "Could not read the scanned image.",
|
||||
"deleteFailedTitle": "Delete Failed",
|
||||
"deleteAttachmentFailed": "Failed to delete attachment.",
|
||||
"deleteChoreFailed": "Failed to delete chore: {{error}}",
|
||||
"deleteChoreTitle": "Delete Chore",
|
||||
"name": "Name",
|
||||
"nameDesc": "What is the name of this task?",
|
||||
"description": "Description",
|
||||
"descriptionDesc": "What is this task about?",
|
||||
"priority": "Priority",
|
||||
"priorityDesc": "How important is this task?",
|
||||
"noPriority": "No Priority",
|
||||
"project": "Project",
|
||||
"projectDesc": "Which project does this task belong to?",
|
||||
"defaultProject": "Default Project",
|
||||
"labels": "Labels",
|
||||
"labelsDesc": "Things to remember about this task or to tag it",
|
||||
"addNewLabel": "Add New Label",
|
||||
"subTasks": "Sub Tasks",
|
||||
"attachments": "Attachments",
|
||||
"attachmentsDesc": "Files attached to this task",
|
||||
"uploadFile": "Upload File",
|
||||
"scan": "Scan",
|
||||
"assignees": "Assignees",
|
||||
"assigneesDesc": "Who can do this task?",
|
||||
"anyone": "Anyone",
|
||||
"rememberFuture": "Remember for Future Tasks",
|
||||
"currentlyAssigned": "Currently Assigned To",
|
||||
"currentlyAssignedDesc": "Who is assigned the next due?",
|
||||
"noAssigneesPlaceholder": "No Assignees yet can perform this task",
|
||||
"selectAssigneePlaceholder": "Select an assignee for this task",
|
||||
"assignStrategy": "Assignment Strategy",
|
||||
"assignStrategyDesc": "How to pick the next assignee for the following task?",
|
||||
"strategy": {
|
||||
"random": "Random",
|
||||
"least_assigned": "Least Assigned",
|
||||
"least_completed": "Least Completed",
|
||||
"keep_last_assigned": "Keep Last Assigned",
|
||||
"random_except_last_assigned": "Random Except Last Assigned",
|
||||
"round_robin": "Round Robin",
|
||||
"no_assignee": "No Assignee"
|
||||
},
|
||||
"startDate": "Start Date",
|
||||
"dueDate": "Due Date",
|
||||
"triggerDueHint": "Due Date will be set when the trigger of the thing is met",
|
||||
"giveDueDate": "Give this task a due date",
|
||||
"giveDueDateHelp": "Task needs to be completed by a specific time",
|
||||
"startWhen": "When does this task start?",
|
||||
"dueWhen": "When is the next first time this task is due?",
|
||||
"setSpecificTime": "Set a specific time",
|
||||
"dueAtSpecifiedTime": "Task will be due at the specified time",
|
||||
"dueEndOfDay": "Task will be due at the end of the day (11:59 PM)",
|
||||
"timeLabel": "Time:",
|
||||
"taskWindow": "Task Window",
|
||||
"taskWindowDesc": "Define when this task can be completed and when it expires",
|
||||
"earliestCompletion": "Set earliest completion time",
|
||||
"earliestCompletionHelp": "Task becomes available to complete X hours before the due date",
|
||||
"hoursLabel": "Hours:",
|
||||
"hoursPlaceholder": "Hours",
|
||||
"afterDueDate": "after due date",
|
||||
"schedulingPrefs": "Scheduling Preferences",
|
||||
"schedulingPrefsDesc": "How to reschedule the next due date?",
|
||||
"rescheduleFromDue": "Reschedule from due date",
|
||||
"rescheduleFromDueHelp": "the next task will be scheduled from the original due date, even if the previous task was completed late",
|
||||
"rescheduleFromCompletion": "Reschedule from completion date",
|
||||
"rescheduleFromCompletionHelp": "the next task will be scheduled from the actual completion date of the previous task",
|
||||
"notifications": "Notifications",
|
||||
"notificationsPlanWarning": "Task notifications are not available in the Basic plan. Upgrade to Plus to receive reminders when tasks are due or completed.",
|
||||
"notifyForTask": "Notify for this task",
|
||||
"notifyForTaskHelp": "When should receive notifications for this task",
|
||||
"notificationSchedule": "Notification Schedule",
|
||||
"whoToNotify": "Who to Notify",
|
||||
"allAssignees": "All Assignees",
|
||||
"allAssigneesHelp": "Notify all assignees",
|
||||
"specificGroup": "Specific Group",
|
||||
"specificGroupHelp": "Notify a specific group",
|
||||
"telegramGroupIdLabel": "Telegram Group ID:",
|
||||
"telegramGroupIdPlaceholder": "Telegram Group ID",
|
||||
"taskSettings": "Task Settings:",
|
||||
"pointsSystem": "Points System",
|
||||
"assignPoints": "Assign points for completion",
|
||||
"assignPointsHelp": "Assign points to this task and user will earn points when they completed it",
|
||||
"pointsLabel": "Points:",
|
||||
"pointsPlaceholder": "Points",
|
||||
"approvalRequirement": "Approval Requirement",
|
||||
"requireApproval": "Require admin approval",
|
||||
"requireApprovalHelp": "This task will need approval from an admin before being marked as complete",
|
||||
"privacySettings": "Privacy Settings",
|
||||
"privacyDesc": "Who can see this task?",
|
||||
"public": "Public",
|
||||
"publicHelp": "Everyone in your circle",
|
||||
"limited": "Limited",
|
||||
"limitedHelp": "You and others that are assigned to the task",
|
||||
"limitedDisabledHint": " (No assignees selected, Limited option is disabled)",
|
||||
"createdBy": "Created by",
|
||||
"updatedBy": "Updated by",
|
||||
"archive": "Archive",
|
||||
"unarchive": "Unarchive",
|
||||
"create": "Create"
|
||||
},
|
||||
"addTask": {
|
||||
"title": "Create new task",
|
||||
"defaultProject": "Default Project",
|
||||
"anyone": "Anyone",
|
||||
"taskPlaceholder": "Type your task...",
|
||||
"descriptionChip": "Description",
|
||||
"subtasksChip": "Subtasks",
|
||||
"creating": "Creating…",
|
||||
"createCount": "Create {{count}} Tasks",
|
||||
"useTask": "Use Task",
|
||||
"processing": "Processing",
|
||||
"create": "Create"
|
||||
},
|
||||
"repeat": {
|
||||
"days": {
|
||||
"monday": "Monday",
|
||||
"tuesday": "Tuesday",
|
||||
"wednesday": "Wednesday",
|
||||
"thursday": "Thursday",
|
||||
"friday": "Friday",
|
||||
"saturday": "Saturday",
|
||||
"sunday": "Sunday"
|
||||
},
|
||||
"months": {
|
||||
"january": "January",
|
||||
"february": "February",
|
||||
"march": "March",
|
||||
"april": "April",
|
||||
"may": "May",
|
||||
"june": "June",
|
||||
"july": "July",
|
||||
"august": "August",
|
||||
"september": "September",
|
||||
"october": "October",
|
||||
"november": "November",
|
||||
"december": "December"
|
||||
},
|
||||
"freqType": {
|
||||
"daily": "Daily",
|
||||
"weekly": "Weekly",
|
||||
"monthly": "Monthly",
|
||||
"yearly": "Yearly",
|
||||
"adaptive": "Adaptive",
|
||||
"custom": "Custom"
|
||||
},
|
||||
"freqMessage": {
|
||||
"adaptive": "This chore will be scheduled dynamically based on previous completion dates.",
|
||||
"custom": "This chore will be scheduled based on a custom frequency."
|
||||
},
|
||||
"weekPattern": {
|
||||
"every_week": "Every week",
|
||||
"week_of_month": "Specific occurrences in the month"
|
||||
},
|
||||
"weekPatternHelp": {
|
||||
"every_week": "Task repeats every week on selected days",
|
||||
"week_of_month": "Task repeats on specific day occurrences each month (e.g., 1st Monday, 3rd Friday)"
|
||||
},
|
||||
"occurrence": {
|
||||
"1": "1st occurrence",
|
||||
"2": "2nd occurrence",
|
||||
"3": "3rd occurrence",
|
||||
"4": "4th occurrence",
|
||||
"last": "Last occurrence"
|
||||
},
|
||||
"ordinal": {
|
||||
"1": "1st",
|
||||
"2": "2nd",
|
||||
"3": "3rd",
|
||||
"4": "4th",
|
||||
"last": "last"
|
||||
},
|
||||
"unit": {
|
||||
"hours": "Hours",
|
||||
"days": "Days",
|
||||
"weeks": "Weeks",
|
||||
"months": "Months",
|
||||
"years": "Years"
|
||||
},
|
||||
"repeatOnType": {
|
||||
"interval": "Interval",
|
||||
"days_of_the_week": "Days of the week",
|
||||
"day_of_the_month": "Day of the month"
|
||||
},
|
||||
"timeOfDay": "Time of day: ",
|
||||
"every": "Every: ",
|
||||
"unitPlaceholder": "Unit",
|
||||
"selectAll": "Select All",
|
||||
"unselectAll": "Unselect All",
|
||||
"selectOccurrences": "Select which occurrences of the selected days:",
|
||||
"occurrenceExample": "Example: \"1st Monday\" means the first Monday of each month",
|
||||
"onThe": "on the ",
|
||||
"ofAboveMonths": "of the above month/s",
|
||||
"title": "Repeat:",
|
||||
"repeatThisTask": "Repeat this task",
|
||||
"repeatThisTaskHelp": "Is this something needed to be done regularly?",
|
||||
"howOften": "How often should it be repeated?",
|
||||
"repeatOn": "Repeat on:",
|
||||
"triggerLabel": "Trigger this task based on a thing state",
|
||||
"triggerHelp": "Is this something that should be done when a thing state changes?",
|
||||
"triggerPlanWarning": "Thing-based triggers are not available in the Basic plan. Upgrade to Plus to automatically trigger tasks when device states change.",
|
||||
"previewEvery": "Every {{days}} at {{time}}",
|
||||
"previewOccurrence": "Every {{occurrences}} {{days}} of the month at {{time}}",
|
||||
"defaultTime": "6:00 PM",
|
||||
"daysShort": {
|
||||
"monday": "Mon",
|
||||
"tuesday": "Tue",
|
||||
"wednesday": "Wed",
|
||||
"thursday": "Thu",
|
||||
"friday": "Fri",
|
||||
"saturday": "Sat",
|
||||
"sunday": "Sun"
|
||||
},
|
||||
"monthsShort": {
|
||||
"january": "Jan",
|
||||
"february": "Feb",
|
||||
"march": "Mar",
|
||||
"april": "Apr",
|
||||
"may": "May",
|
||||
"june": "Jun",
|
||||
"july": "Jul",
|
||||
"august": "Aug",
|
||||
"september": "Sep",
|
||||
"october": "Oct",
|
||||
"november": "Nov",
|
||||
"december": "Dec"
|
||||
},
|
||||
"occurrenceShort": {
|
||||
"1": "1st",
|
||||
"2": "2nd",
|
||||
"3": "3rd",
|
||||
"4": "4th",
|
||||
"last": "Last"
|
||||
},
|
||||
"picker": {
|
||||
"modalTitle": "Repeat Schedule",
|
||||
"trigger": "Repeat",
|
||||
"clearAria": "Clear repeat schedule",
|
||||
"remove": "Remove",
|
||||
"apply": "Apply",
|
||||
"frequency": "Frequency",
|
||||
"scheduleType": "Schedule type",
|
||||
"timeOfDay": "Time of day",
|
||||
"repeatEvery": "Repeat every",
|
||||
"days": "Days",
|
||||
"pattern": "Pattern",
|
||||
"everyWeek": "Every week",
|
||||
"specificWeeks": "Specific weeks",
|
||||
"occurrences": "Occurrences",
|
||||
"months": "Months",
|
||||
"dayOfMonth": "Day of month"
|
||||
}
|
||||
},
|
||||
"advancedOptions": {
|
||||
"points": "Points",
|
||||
"pointsDescription": "Award points for completing this task",
|
||||
"requireApproval": "Require approval",
|
||||
"requireApprovalDescription": "Task needs admin sign-off before it can be closed",
|
||||
"limitedVisibility": "Limited visibility",
|
||||
"limitedVisibilityDisabled": "Assign someone to enable limited visibility",
|
||||
"limitedVisibilityDescription": "Only you and assignees can see this task",
|
||||
"assignStrategy": "Assign strategy",
|
||||
"assignStrategyDescription": "How to pick the next assignee each recurrence",
|
||||
"availableFrom": "Available from",
|
||||
"availableFromDescription": "Hours before the due date the task becomes available",
|
||||
"strategy": {
|
||||
"keep_last_assigned": "Keep same assignee",
|
||||
"random": "Random",
|
||||
"least_completed": "Least completed",
|
||||
"round_robin": "Round robin"
|
||||
},
|
||||
"hrs": "hrs",
|
||||
"setDueDateHint": "Set a due date to configure completion window",
|
||||
"more": "More"
|
||||
},
|
||||
"filterBuilder": {
|
||||
"dueDateOption": {
|
||||
"isOverdue": "Overdue",
|
||||
"isDueToday": "Today",
|
||||
"isDueTomorrow": "Tomorrow",
|
||||
"isDueThisWeek": "This Week",
|
||||
"isDueThisMonth": "This Month",
|
||||
"hasNoDueDate": "No Due Date",
|
||||
"hasDueDate": "Has Due Date"
|
||||
},
|
||||
"status": {
|
||||
"0": "Active",
|
||||
"1": "Started",
|
||||
"2": "In Progress",
|
||||
"3": "Pending Approval"
|
||||
},
|
||||
"include": "Include",
|
||||
"exclude": "Exclude",
|
||||
"has": "Has",
|
||||
"doesntHave": "Doesn't Have",
|
||||
"assignee": "Assignee",
|
||||
"createdBy": "Created By",
|
||||
"statusHeading": "Status",
|
||||
"priority": "Priority",
|
||||
"dueDate": "Due Date",
|
||||
"labels": "Labels",
|
||||
"projects": "Projects",
|
||||
"defaultProject": "Default Project",
|
||||
"points": "Points",
|
||||
"project": "Project",
|
||||
"filterFallback": "Filter",
|
||||
"notPrefix": "Not ",
|
||||
"customDueDate": "Custom",
|
||||
"clear": "Clear"
|
||||
},
|
||||
"empty": {
|
||||
"errorTitle": "Can't reach Donetick",
|
||||
"errorDescription": "Your tasks are safe. We just could not load them right now, check your connection and try again.",
|
||||
"errorAction": "Try again",
|
||||
"noTasksTitle": "No tasks yet",
|
||||
"noTasksDescription": "Create your first task and Donetick keeps track of when it is due, whose turn it is, and what comes next.",
|
||||
"createTask": "Create a task",
|
||||
"moreOptions": "More options",
|
||||
"noMatchTitle": "No tasks match this view",
|
||||
"noMatchSearch": "Nothing matches \"{{term}}\". Try a different search, or clear what is narrowing the list.",
|
||||
"noMatchFilters": "You have tasks, but none of them fit the filters that are currently on.",
|
||||
"clearSearch": "Clear search",
|
||||
"showEveryone": "Show everyone's tasks",
|
||||
"clearFilters": "Clear filters",
|
||||
"projectTitle": "Nothing in {{name}} yet",
|
||||
"projectDescription": "Tasks you add to this project show up here. Your other tasks are still where you left them.",
|
||||
"addTaskHere": "Add a task here",
|
||||
"seeOutsideProjects": "See tasks outside projects",
|
||||
"noProjectTitle": "No tasks here yet",
|
||||
"noProjectDescription": "Tasks that do not belong to a project live here. Add one, or switch projects to see what is in them.",
|
||||
"dayFreeDescription": "This day is free. Add a task if you want something to land here.",
|
||||
"addTask": "Add task",
|
||||
"assignee": {
|
||||
"assigned_to_me": "There are tasks here, but none of them are assigned to you. Switch back to everyone to see the rest.",
|
||||
"available_for_me": "There are tasks here, but none of them are available for you to pick up. Switch back to everyone to see the rest.",
|
||||
"assigned_to_others": "There are tasks here, but none of them are assigned to someone else. Switch back to everyone to see the rest.",
|
||||
"assigned_to_me_tasks": "There are tasks here, but none of them are assigned to you. Switch back to everyone to see the rest.",
|
||||
"created_by_me": "There are tasks here, but none of them are created by you. Switch back to everyone to see the rest."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,32 @@
|
||||
"error": "Error",
|
||||
"success": "Success",
|
||||
"warning": "Warning",
|
||||
"colors": {
|
||||
"Salmon": "Salmon",
|
||||
"Teal": "Teal",
|
||||
"Sky Blue": "Sky Blue",
|
||||
"Grape": "Grape",
|
||||
"Sunshine": "Sunshine",
|
||||
"Coral": "Coral",
|
||||
"Lavender": "Lavender",
|
||||
"Rose": "Rose",
|
||||
"Charcoal": "Charcoal",
|
||||
"Sienna": "Sienna",
|
||||
"Mint": "Mint",
|
||||
"Amber": "Amber",
|
||||
"Cobalt": "Cobalt",
|
||||
"Emerald": "Emerald",
|
||||
"Peach": "Peach",
|
||||
"Ocean": "Ocean",
|
||||
"Mustard": "Mustard",
|
||||
"Ruby": "Ruby",
|
||||
"Periwinkle": "Periwinkle",
|
||||
"Turquoise": "Turquoise",
|
||||
"Lime": "Lime",
|
||||
"Blush": "Blush",
|
||||
"Ash": "Ash",
|
||||
"Sand": "Sand"
|
||||
},
|
||||
"refresh": "Refresh",
|
||||
"copy": "Copy",
|
||||
"copied": "Copied!",
|
||||
@@ -186,7 +212,18 @@
|
||||
"accountPrefs": "Account & preferences",
|
||||
"invitePeople": "Invite People",
|
||||
"addMembers": "Add members to your circle",
|
||||
"sidePanelSettings": "Side Panel Settings"
|
||||
"sidePanelSettings": "Side Panel Settings",
|
||||
"planFree": "Free",
|
||||
"planPlus": "Plus",
|
||||
"planPlusExpiring": "Plus (expires soon)",
|
||||
"switchUser": "Switch User",
|
||||
"impersonateUser": "Impersonate User",
|
||||
"switchToLight": "Switch to Light",
|
||||
"switchToDark": "Switch to Dark",
|
||||
"unlockPremium": "Unlock premium features",
|
||||
"impersonating": "Impersonating",
|
||||
"toggleThemeAppearance": "Toggle theme appearance",
|
||||
"upgradeToPlus": "Upgrade to Plus"
|
||||
},
|
||||
"realtime": {
|
||||
"newTaskTitle": "New Task Created",
|
||||
@@ -217,5 +254,206 @@
|
||||
"cancelAll": "Cancel All"
|
||||
},
|
||||
"attachments": "Attachments",
|
||||
"fileNumbered": "File {{index}}"
|
||||
"fileNumbered": "File {{index}}",
|
||||
"onboarding": {
|
||||
"sources": {
|
||||
"speak": "Speak",
|
||||
"snap": "Snap",
|
||||
"type": "Type"
|
||||
},
|
||||
"capture": {
|
||||
"voiceCaption": "Dates, labels and points from your words",
|
||||
"deviceCaption": "Read on your device",
|
||||
"typeCaption": "#labels @people *points as you type",
|
||||
"trashTitle": "♻️ Take out the trash",
|
||||
"trashDue": "Due tomorrow",
|
||||
"trashRepeat": "Every Monday",
|
||||
"homeLabel": "Home",
|
||||
"vehicleTitle": "🚗 Vehicle Registration Renewal",
|
||||
"vehicleDue": "Due Aug 3",
|
||||
"acTitle": "💨 Change the AC filter",
|
||||
"acDue": "Due Fri",
|
||||
"acRepeat": "Every 3 months"
|
||||
},
|
||||
"schedule": {
|
||||
"fromDueDate": "Reschedule from due date",
|
||||
"fromCompletionDate": "Reschedule from completion date",
|
||||
"due": "Due",
|
||||
"done": "Done",
|
||||
"next": "Next"
|
||||
},
|
||||
"nfc": {
|
||||
"tagOnWasher": "Tag on the washer",
|
||||
"tapToOpen": "Tap to open",
|
||||
"swapFilter": "Swap the washer filter",
|
||||
"done": "Done",
|
||||
"skip": "Skip",
|
||||
"startTimer": "Start timer",
|
||||
"waitingApproval": "{{name}} marked it done · waiting on you",
|
||||
"approve": "Approve",
|
||||
"reject": "Reject",
|
||||
"completed": "Completed",
|
||||
"note": "Used the delicate cycle — filter needs a clean next time.",
|
||||
"metaJustNow": "Just now · ★ 5 pts",
|
||||
"metaLastWeek": "Last week · ★ 5 pts"
|
||||
},
|
||||
"circle": {
|
||||
"kitchenTitle": "Kitchen deep clean",
|
||||
"kitchenDue": "Due Sat",
|
||||
"kitchenRepeat": "Every week",
|
||||
"takesTurns": "Takes turns"
|
||||
},
|
||||
"turns": {
|
||||
"binsTitle": "🗑️ Take bins to the curb",
|
||||
"binsDue": "Due Tomorrow",
|
||||
"binsRepeat": "Every week",
|
||||
"completed": "Completed",
|
||||
"metaJustNow": "Just now · ★ 5 pts"
|
||||
},
|
||||
"widget": {
|
||||
"schoolForms": "School forms",
|
||||
"takeOutTrash": "Take out the trash",
|
||||
"waterPlants": "Water the plants",
|
||||
"today": "Today",
|
||||
"left": "{{count}} left"
|
||||
},
|
||||
"reminders": {
|
||||
"trashTitle": "Take out the trash",
|
||||
"trashBody": "Due in 30 minutes · Bin night",
|
||||
"finishedTitle": "Amalie finished Kitchen deep clean",
|
||||
"finishedBody": "Your turn is next Saturday"
|
||||
},
|
||||
"things": {
|
||||
"waterBill": "Water bill",
|
||||
"acFilter": "AC filter",
|
||||
"trashDay": "Trash day",
|
||||
"dogMedicine": "Dog's medicine",
|
||||
"whoseTurn": "Whose turn to cook",
|
||||
"monthly": "Monthly",
|
||||
"everyThreeMonths": "Every 3 months",
|
||||
"everyMonday": "Every Monday",
|
||||
"daily": "Daily",
|
||||
"weekly": "Weekly",
|
||||
"tagBills": "Bills",
|
||||
"tagHome": "Home",
|
||||
"tagPets": "Pets",
|
||||
"tagCooking": "Cooking"
|
||||
},
|
||||
"slides": {
|
||||
"problemTitle": "Stop forgetting the little things",
|
||||
"problemBody": "Donetick remembers the last time it happened, and when it's due next. So nobody else has to.",
|
||||
"captureTitle": "Add it before you forget it",
|
||||
"captureBody": "Type it, say it out loud, or snap a photo. Donetick fills in the due date, priority, labels, and who's on it.",
|
||||
"scheduleTitle": "It comes back exactly when it should",
|
||||
"scheduleBody": "Every week, every 3 months, or a month after you actually did it. Finishing late doesn't throw the rest of the year off.",
|
||||
"circleTitle": "Everyone gets a turn, No more arguing",
|
||||
"circleBody": "Rotate in the order you pick, or at random. Donetick remembers who went last, so turns stay fair.",
|
||||
"remindersTitle": "A nudge right when it matters & Widgets!",
|
||||
"remindersBody": "Get a reminder before something's due, or send a heads-up when someone forgets theirs. Today's list sits on your home screen too."
|
||||
},
|
||||
"carousel": {
|
||||
"skip": "Skip",
|
||||
"ariaLabel": "What you can do with Donetick",
|
||||
"goToStep": "Go to step {{number}}",
|
||||
"slidePosition": "{{index}} of {{total}}",
|
||||
"turnOnReminders": "Turn on reminders",
|
||||
"notNow": "Not now",
|
||||
"next": "Next"
|
||||
},
|
||||
"heardAbout": {
|
||||
"title": "Where'd you hear about Donetick?",
|
||||
"subtitle": "Helps us know what's working. Totally optional.",
|
||||
"detailPlaceholder": "Tell us where",
|
||||
"continue": "Continue",
|
||||
"skip": "Skip",
|
||||
"sources": {
|
||||
"appStore": "App Store / Google Play",
|
||||
"reddit": "Reddit or a forum",
|
||||
"friend": "Friend or family",
|
||||
"video": "YouTube or TikTok",
|
||||
"search": "Search engine",
|
||||
"other": "Something else"
|
||||
}
|
||||
},
|
||||
"privacy": {
|
||||
"title": "Help us improve Donetick",
|
||||
"subtitle": "Your server, your data. Both of these are off from this point unless you turn them on.",
|
||||
"crashReportsLabel": "Share crash reports",
|
||||
"crashReportsDescription": "When Donetick crashes, send us the error and what led to it (device, app version, the screen you were on) no task content. It's how we catch bugs that never show up in our own testing and ship fixes faster.",
|
||||
"analyticsLabel": "Share anonymous usage analytics",
|
||||
"analyticsDescription": "Send anonymous usage events which features get used, which get ignored so we know what to build next instead of guessing. No task content, no personal data, nothing tied back to you."
|
||||
}
|
||||
},
|
||||
"errorReport": {
|
||||
"titleBug": "Report an issue",
|
||||
"titleCrash": "Report this problem",
|
||||
"subtitleBug": "Tell us what went wrong and we’ll attach the technical details for you.",
|
||||
"subtitleCrash": "A sentence about what you were doing turns this into something we can actually fix.",
|
||||
"labelBug": "What went wrong?",
|
||||
"labelCrash": "What were you doing?",
|
||||
"placeholderBug": "e.g. Completing a chore from the list doesn’t update the due date",
|
||||
"placeholderCrash": "e.g. I tapped a chore in My Chores and the screen went blank",
|
||||
"email": "Email",
|
||||
"emailOptional": "(optional — only if you want a reply)",
|
||||
"emailPlaceholder": "you@example.com",
|
||||
"showWhatGetsSent": "Show what gets sent",
|
||||
"hideWhatGetsSent": "Hide what gets sent",
|
||||
"copyDiagnostics": "Copy diagnostics",
|
||||
"collecting": "Collecting diagnostics…",
|
||||
"privacyNote": "No chore names, notes or attachments are included.",
|
||||
"send": "Send report",
|
||||
"cancel": "Cancel",
|
||||
"notNow": "Not now",
|
||||
"sentTitle": "Report sent",
|
||||
"sentBody": "Thanks! this goes straight to the people who can fix it.",
|
||||
"reference": "Reference",
|
||||
"copyReference": "Copy reference",
|
||||
"done": "Done",
|
||||
"githubTitle": "Finish on GitHub",
|
||||
"githubBody": "Nothing has been sent. We've filled in an issue with your notes and the diagnostics — review it and post when you're happy with it.",
|
||||
"openIssue": "Open pre-filled issue",
|
||||
"copied": "Copied",
|
||||
"copyInstead": "Copy details instead",
|
||||
"close": "Close"
|
||||
},
|
||||
"circleSetup": {
|
||||
"inviteTitle": "Bring your squad in",
|
||||
"inviteSubtitle": "Everyone who joins your Circle sees the same chores, takes their own turn, and stays in sync automatically.",
|
||||
"joinTitle": "Join a circle",
|
||||
"joinSubtitle": "Enter the code you were given and we'll send a request to join — the circle owner just needs to approve it.",
|
||||
"loadingCode": "Loading…",
|
||||
"copyCodeAria": "Copy circle code",
|
||||
"copyLinkInstead": "Copy invite link instead",
|
||||
"continue": "Continue",
|
||||
"joinInstead": "Join an existing circle instead",
|
||||
"codePlaceholder": "Enter code",
|
||||
"joinButton": "Join Circle",
|
||||
"back": "Back",
|
||||
"codeCopied": "Code copied to clipboard",
|
||||
"linkCopied": "Link copied to clipboard",
|
||||
"requestSentTitle": "Request Sent",
|
||||
"requestSentBody": "Your join request has been sent! The circle owner will need to approve it before you can see their chores. You'll get a notification once you're in.",
|
||||
"alreadyMember": "You are already a member of this circle",
|
||||
"joinFailed": "Failed to join circle"
|
||||
},
|
||||
"joinCircle": {
|
||||
"title": "You're invited to join a circle",
|
||||
"incompleteTitle": "Invite link is incomplete",
|
||||
"incompleteSubtitle": "This invite link is missing a code. Ask the person who invited you to send a new link.",
|
||||
"goToDonetick": "Go to Donetick",
|
||||
"signedOutSubtitle": "Sign in or create a Donetick account to continue. We'll send your join request once you're signed in.",
|
||||
"signIn": "Sign in",
|
||||
"createAccount": "Create an account",
|
||||
"sendingTitle": "Sending your request",
|
||||
"sendingSubtitle": "Sending your request…",
|
||||
"greetingSubtitle": "Hi {{name}}. Send a request to share this circle's chores with its members.",
|
||||
"adminReviewNote": "A circle admin will review your request before you get access.",
|
||||
"sendRequest": "Send join request",
|
||||
"requestSentTitle": "Request sent",
|
||||
"requestSentBody": "Your request has been sent. A circle admin will need to approve it before you can access the circle and its chores. We'll notify you when it's approved.",
|
||||
"gotIt": "Got it",
|
||||
"alreadyMember": "You are already a member of this circle",
|
||||
"joinFailed": "Failed to join circle",
|
||||
"requestError": "Could not send your join request. Please try again."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,20 @@
|
||||
"onTime": "On Time",
|
||||
"onTimeLabel": "On time"
|
||||
},
|
||||
"card": {
|
||||
"wasDue": "Was due {{date}}",
|
||||
"daysBeforeDue_one": "{{count}}d before due date",
|
||||
"daysBeforeDue_other": "{{count}}d before due date",
|
||||
"daysAfterDue_one": "{{count}}d after due date",
|
||||
"daysAfterDue_other": "{{count}}d after due date",
|
||||
"hoursBeforeDue_one": "{{count}}h before due date",
|
||||
"hoursBeforeDue_other": "{{count}}h before due date",
|
||||
"hoursAfterDue_one": "{{count}}h after due date",
|
||||
"hoursAfterDue_other": "{{count}}h after due date",
|
||||
"assignedTo": "Assigned to {{name}}",
|
||||
"points_one": "★ {{count}} pt",
|
||||
"points_other": "★ {{count}} pts"
|
||||
},
|
||||
"detail": {
|
||||
"title": "Activity Detail",
|
||||
"openTask": "Open Task",
|
||||
|
||||
@@ -3,6 +3,32 @@
|
||||
"chooseIcon": "Choose Project Icon",
|
||||
"availableIcons": "Available Icons"
|
||||
},
|
||||
"icons": {
|
||||
"FolderOpen": "Folder",
|
||||
"Work": "Work",
|
||||
"Home": "Home",
|
||||
"School": "School",
|
||||
"BusinessCenter": "Business",
|
||||
"Code": "Code",
|
||||
"Build": "Build",
|
||||
"Palette": "Design",
|
||||
"SportsSoccer": "Sports",
|
||||
"FitnessCenter": "Fitness",
|
||||
"ShoppingCart": "Shopping",
|
||||
"Restaurant": "Food",
|
||||
"Flight": "Travel",
|
||||
"Book": "Study",
|
||||
"MusicNote": "Music",
|
||||
"PhotoCamera": "Photo",
|
||||
"Games": "Games",
|
||||
"Science": "Science",
|
||||
"AccountBalance": "Finance",
|
||||
"LocalHospital": "Health",
|
||||
"DirectionsCar": "Auto",
|
||||
"Pets": "Pets",
|
||||
"Garden": "Garden",
|
||||
"Computer": "Tech"
|
||||
},
|
||||
"defaultChip": "Default",
|
||||
"tasks_one": "{{count}} task",
|
||||
"tasks_other": "{{count}} tasks",
|
||||
@@ -34,6 +60,11 @@
|
||||
"errorUpdate": "Failed to update project",
|
||||
"errorCreate": "Failed to create project",
|
||||
"namePlaceholder": "Enter project name...",
|
||||
"descriptionPlaceholder": "Optional project description..."
|
||||
"descriptionPlaceholder": "Optional project description...",
|
||||
"nameLabel": "Project Name",
|
||||
"descriptionLabel": "Description",
|
||||
"iconLabel": "Project Icon",
|
||||
"selectIcon": "Select Icon",
|
||||
"colorLabel": "Project Color"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,8 @@
|
||||
"joinCircle": "Join Circle",
|
||||
"joinedPending": "Joined circle successfully, wait for the circle owner to accept your request.",
|
||||
"alreadyMember": "You are already a member of this circle",
|
||||
"joinFailed": "Failed to join circle"
|
||||
"joinFailed": "Failed to join circle",
|
||||
"copyLink": "Copy Link"
|
||||
},
|
||||
"accountSettings": {
|
||||
"title": "Account Settings",
|
||||
@@ -423,7 +424,8 @@
|
||||
"name": "Weekly Goals",
|
||||
"description": "Shows weekly progress and family completion stats"
|
||||
}
|
||||
}
|
||||
},
|
||||
"detailedDescription": "Customize the layout and visibility of cards in the sidepanel. the section only available on large screen devices such as tablets and desktops.."
|
||||
},
|
||||
"theme": {
|
||||
"title": "Theme Preferences",
|
||||
@@ -457,7 +459,8 @@
|
||||
"ymd": "YYYY-MM-DD (ISO)",
|
||||
"long": "Long format (e.g., January 1, 2024)",
|
||||
"short": "Short format (e.g., Jan 1, 2024)"
|
||||
}
|
||||
},
|
||||
"descriptionLong": "Customize language, date format, and regional preferences for your account. These settings will apply throughout the application."
|
||||
},
|
||||
"advanced": {
|
||||
"title": "Advanced Settings",
|
||||
@@ -534,7 +537,13 @@
|
||||
},
|
||||
"passwordChange": {
|
||||
"minLength": "Password must be at least 8 characters",
|
||||
"maxLength": "Password must be less than 64 characters"
|
||||
"maxLength": "Password must be less than 64 characters",
|
||||
"description": "Choose a password between 8 and 64 characters.",
|
||||
"mismatch": "Passwords do not match",
|
||||
"newPassword": "New password",
|
||||
"newPasswordPlaceholder": "Enter password",
|
||||
"confirmPassword": "Confirm password",
|
||||
"confirmPasswordPlaceholder": "Repeat password"
|
||||
},
|
||||
"payment": {
|
||||
"cancelledTitle": "Payment has been cancelled",
|
||||
@@ -566,7 +575,12 @@
|
||||
"includeAssets": "Include uploaded files and assets",
|
||||
"warningLabel": "Warning:",
|
||||
"restoreWarning": "Restoring a backup will replace all your current data. This action cannot be undone.",
|
||||
"restoreKeyPlaceholder": "Enter the encryption key used for this backup"
|
||||
"restoreKeyPlaceholder": "Enter the encryption key used for this backup",
|
||||
"title": "Backup & Restore",
|
||||
"createTab": "Create Backup",
|
||||
"restoreTab": "Restore Backup",
|
||||
"creating": "Creating backup...",
|
||||
"restoring": "Restoring backup..."
|
||||
},
|
||||
"deletion": {
|
||||
"passwordRequired": "Please enter your password to continue",
|
||||
@@ -576,9 +590,50 @@
|
||||
"transferIntro": "You own circles that require ownership transfer before deletion. Please select new owners:",
|
||||
"selectOwner": "Select new owner",
|
||||
"confirmPrompt": "Please enter your password and type DELETE to confirm",
|
||||
"typeDelete": "DELETE"
|
||||
"typeDelete": "DELETE",
|
||||
"warningLead": "This action cannot be undone.",
|
||||
"warningIntro": "Deleting your account will permanently remove:",
|
||||
"removesProfile": "Your user profile and authentication data",
|
||||
"removesChores": "All your chores, chore history, and time tracking sessions",
|
||||
"removesTokens": "API tokens, MFA sessions, and password reset tokens",
|
||||
"removesStorage": "Storage files and usage data",
|
||||
"removesPoints": "Points history and notifications",
|
||||
"removesCircles": "Circle memberships and relationships",
|
||||
"passwordToContinue": "Enter your password to continue",
|
||||
"circleLabel": "Circle: {{name}}",
|
||||
"newOwner": "New Owner",
|
||||
"logoutNotice": "On successful deletion, you will be logged out and redirected to the login page.",
|
||||
"passwordLabel": "Password",
|
||||
"typeToConfirm": "Type \"{{word}}\" to confirm"
|
||||
},
|
||||
"realtime": {
|
||||
"titleSse": "Real-time Updates (SSE)"
|
||||
"titleSse": "Real-time Updates (SSE)",
|
||||
"subtitleSse": "Get instant notifications via Server-Sent Events"
|
||||
},
|
||||
"nativeCancel": {
|
||||
"title": "Cancel Subscription",
|
||||
"dismiss": "Dismiss",
|
||||
"cancelViaStore": "I'll cancel from my app store",
|
||||
"cancelDesktop": "Cancel desktop subscription",
|
||||
"intro": "To cancel your subscription, please follow the instructions for your platform (you should cancel through the same platform you used to subscribe).",
|
||||
"iosHeading": "For iOS (iPhone/iPad):",
|
||||
"iosStep1": "1. Open the <b>Settings</b> app on your device",
|
||||
"iosStep2": "2. Tap your name at the top of the screen",
|
||||
"iosStep3": "3. Tap <b>Subscriptions</b>",
|
||||
"iosStep4": "4. Find and tap <b>Donetick</b>",
|
||||
"iosStep5": "5. Tap <b>Cancel Subscription</b>",
|
||||
"iosNote": "<b>Note:</b> If you subscribed through iOS and are using the web/desktop version, you must cancel through iOS Settings as described above.",
|
||||
"androidHeading": "For Android:",
|
||||
"androidStep1": "1. Open the <b>Google Play Store</b> app",
|
||||
"androidStep2": "2. Tap the profile icon in the top right",
|
||||
"androidStep3": "3. Tap <b>Payments & subscriptions</b>",
|
||||
"androidStep4": "4. Tap <b>Subscriptions</b>",
|
||||
"androidStep5": "5. Find and tap <b>Donetick</b>",
|
||||
"androidStep6": "6. Tap <b>Cancel subscription</b>",
|
||||
"androidNote": "<b>Note:</b> If you subscribed through Google Play and are using the web/desktop version, you must cancel through Google Play as described above.",
|
||||
"webHeading": "For Web/Desktop Subscriptions:",
|
||||
"webBody": "If you originally subscribed through our website or desktop app, you can cancel your subscription by going to the Account Settings section on our website. using a web browser",
|
||||
"webNote": "<b>Important:</b> You must cancel your subscription through the same platform where you originally subscribed. If you subscribed through the iOS App Store or Google Play Store (even if you're now using the web/desktop version), you must cancel through that original platform using the instructions above.",
|
||||
"footer": "Your subscription will remain active until the end of your current billing period."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,5 +14,47 @@
|
||||
"visualization": "Data Visualization",
|
||||
"changeHistory": "Change History",
|
||||
"updated": "Updated"
|
||||
},
|
||||
"view": {
|
||||
"title": "Things",
|
||||
"description": "Things are custom fields that can be attached to tasks to capture additional information. They can be of type text, number, or boolean. You can associate things with tasks and have the task due once condition is met",
|
||||
"searchPlaceholder": "Search things",
|
||||
"sortName": "Name",
|
||||
"sortType": "Type",
|
||||
"sortState": "State",
|
||||
"sortUpdated": "Last updated",
|
||||
"filterTitle": "Type",
|
||||
"filterAll": "All types",
|
||||
"emptyTitle": "No things yet",
|
||||
"emptyDescription": "A thing tracks a value, like a counter or a switch, that other tasks can react to. Create one to trigger tasks automatically.",
|
||||
"emptyAction": "Create a thing",
|
||||
"noResultsTitle": "No things match",
|
||||
"noResultsSearch": "No thing matches \"{{term}}\".",
|
||||
"noResultsFilter": "No thing matches the current filter.",
|
||||
"clearSearch": "Clear search",
|
||||
"showAll": "Show all things",
|
||||
"toggle": "Toggle"
|
||||
},
|
||||
"types": {
|
||||
"text": "Text",
|
||||
"number": "Number",
|
||||
"boolean": "Boolean"
|
||||
},
|
||||
"notify": {
|
||||
"savedTitle": "Saved",
|
||||
"savedMessage": "Thing saved successfully",
|
||||
"saveFailTitle": "Unable to save thing",
|
||||
"queuedMessage": "You are offline and the request has been queued",
|
||||
"saveFailMessage": "An error occurred while saving the thing",
|
||||
"deleteTitle": "Delete Things",
|
||||
"deleteMessage": "Are you sure you want to delete this Thing?",
|
||||
"deleteBlockedTitle": "Unable to Delete Thing",
|
||||
"deleteBlockedMessage": "Unable to delete thing with associated tasks",
|
||||
"deleteFailTitle": "Unable to delete thing",
|
||||
"deleteFailMessage": "An error occurred while deleting the thing",
|
||||
"updatedTitle": "Updated",
|
||||
"updatedMessage": "Thing state updated successfully",
|
||||
"updateFailTitle": "Unable to update thing state",
|
||||
"updateFailMessage": "An error occurred while updating the thing state"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,5 +35,11 @@
|
||||
"endTime": "End Time",
|
||||
"leaveEmpty": "Leave empty if session is ongoing",
|
||||
"noSessionForChore": "No timer session found for this chore.",
|
||||
"saveChanges": "Save Changes"
|
||||
"saveChanges": "Save Changes",
|
||||
"emptySessionsTitle": "No work sessions yet",
|
||||
"emptySessionsDescription": "Start the timer on this task and each session lands here.",
|
||||
"percentActive": "{{percent}}% active",
|
||||
"activityTimeline": "Activity Timeline",
|
||||
"liveSession": "Live Session",
|
||||
"live": "Live"
|
||||
}
|
||||
|
||||
137
scripts/i18n-audit.mjs
Normal file
137
scripts/i18n-audit.mjs
Normal file
@@ -0,0 +1,137 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Fails if any t() / <Trans> key in src/ has no entry in public/locales/en/.
|
||||
*
|
||||
* Why this is a script and not an ESLint rule: the namespace for a bare
|
||||
* t('foo') comes from the useTranslation('chores') call at the top of the
|
||||
* component, so resolving a key needs whole-file context that a per-node lint
|
||||
* rule does not have. Editor i18n plugins get this wrong constantly — they
|
||||
* assume the default namespace and flag half the codebase.
|
||||
*
|
||||
* Usage: node scripts/i18n-audit.mjs [--orphans]
|
||||
* --orphans also list en/*.json keys that nothing in src/ references
|
||||
*/
|
||||
|
||||
import { readdirSync, readFileSync, statSync } from 'node:fs'
|
||||
import { basename, join } from 'node:path'
|
||||
|
||||
const LOCALE_DIR = 'public/locales/en'
|
||||
const SRC_DIR = 'src'
|
||||
const DEFAULT_NS = 'common'
|
||||
|
||||
const bundles = Object.fromEntries(
|
||||
readdirSync(LOCALE_DIR)
|
||||
.filter(f => f.endsWith('.json'))
|
||||
.map(f => [
|
||||
basename(f, '.json'),
|
||||
JSON.parse(readFileSync(join(LOCALE_DIR, f), 'utf8')),
|
||||
]),
|
||||
)
|
||||
|
||||
const walk = dir =>
|
||||
readdirSync(dir).flatMap(entry => {
|
||||
const full = join(dir, entry)
|
||||
return statSync(full).isDirectory()
|
||||
? walk(full)
|
||||
: /\.jsx?$/.test(full)
|
||||
? [full]
|
||||
: []
|
||||
})
|
||||
|
||||
const lookup = (ns, key) =>
|
||||
key.split('.').reduce((cur, part) => {
|
||||
if (cur === null || typeof cur !== 'object' || !(part in cur)) return null
|
||||
return cur[part]
|
||||
}, bundles[ns] ?? null)
|
||||
|
||||
/**
|
||||
* i18next appends _one/_other to plural keys, so `card.points` is present in
|
||||
* the bundle as `card.points_one` + `card.points_other`. Treat a leaf whose
|
||||
* siblings carry a plural suffix as resolved.
|
||||
*/
|
||||
const exists = (ns, key) => {
|
||||
if (lookup(ns, key) !== null) return true
|
||||
const dot = key.lastIndexOf('.')
|
||||
const parent =
|
||||
dot === -1 ? (bundles[ns] ?? null) : lookup(ns, key.slice(0, dot))
|
||||
const leaf = key.slice(dot + 1)
|
||||
return (
|
||||
parent !== null &&
|
||||
typeof parent === 'object' &&
|
||||
Object.keys(parent).some(k => k.startsWith(`${leaf}_`))
|
||||
)
|
||||
}
|
||||
|
||||
const collectKeys = src => {
|
||||
const found = new Set()
|
||||
const push = re => {
|
||||
for (const m of src.matchAll(re)) found.add(m[1])
|
||||
}
|
||||
// t('key') / t("key") / t(`key`)
|
||||
push(/\bt\(\s*'([A-Za-z][\w.:-]*)'/g)
|
||||
push(/\bt\(\s*"([A-Za-z][\w.:-]*)"/g)
|
||||
push(/\bt\(\s*`([A-Za-z][\w.:-]*)`/g)
|
||||
// t(`prefix.${expr}`) — the interpolated leaf is unknowable, but the
|
||||
// prefix must at least resolve to an object
|
||||
push(/\bt\(\s*`([A-Za-z][\w.:-]*)\.\$\{/g)
|
||||
return found
|
||||
}
|
||||
|
||||
const failures = []
|
||||
|
||||
for (const file of walk(SRC_DIR).sort()) {
|
||||
const src = readFileSync(file, 'utf8')
|
||||
const nsMatch = src.match(/useTranslation\(\s*(?:'([^']+)'|\[\s*'([^']+)')/)
|
||||
const hasTrans = src.includes('i18nKey')
|
||||
if (!nsMatch && !hasTrans) continue
|
||||
|
||||
const fallbackNs = nsMatch ? (nsMatch[1] ?? nsMatch[2]) : DEFAULT_NS
|
||||
|
||||
const check = (raw, kind, nsOverride) => {
|
||||
const [ns, key] = raw.includes(':')
|
||||
? raw.split(/:(.+)/)
|
||||
: [nsOverride ?? fallbackNs, raw]
|
||||
if (!exists(ns, key)) failures.push(`${file} ${kind} ${ns}:${key}`)
|
||||
}
|
||||
|
||||
for (const raw of collectKeys(src)) check(raw, 't()')
|
||||
|
||||
// <Trans i18nKey='x' ns='y'> and thin wrappers that forward i18nKey
|
||||
const transNs = src.match(/\bns='([^']+)'/)?.[1]
|
||||
for (const m of src.matchAll(/i18nKey=(?:'([^']+)'|\{'([^']+)'\})/g)) {
|
||||
check(m[1] ?? m[2], 'Trans', transNs)
|
||||
}
|
||||
}
|
||||
|
||||
if (process.argv.includes('--orphans')) {
|
||||
const allSrc = walk(SRC_DIR)
|
||||
.map(f => readFileSync(f, 'utf8'))
|
||||
.join('\n')
|
||||
const flatten = (obj, prefix = '') =>
|
||||
Object.entries(obj).flatMap(([k, v]) =>
|
||||
v !== null && typeof v === 'object'
|
||||
? flatten(v, `${prefix}${k}.`)
|
||||
: [`${prefix}${k}`],
|
||||
)
|
||||
const orphans = []
|
||||
for (const [ns, bundle] of Object.entries(bundles)) {
|
||||
for (const key of flatten(bundle)) {
|
||||
const leaf = key.replace(/_(one|other|zero|two|few|many)$/, '')
|
||||
if (!allSrc.includes(leaf) && !allSrc.includes(leaf.split('.').pop())) {
|
||||
orphans.push(`${ns}:${leaf}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (orphans.length) {
|
||||
console.log(`\nPossibly unused (${new Set(orphans).size}):`)
|
||||
console.log([...new Set(orphans)].sort().join('\n'))
|
||||
}
|
||||
}
|
||||
|
||||
const unique = [...new Set(failures)].sort()
|
||||
if (unique.length) {
|
||||
console.error(`i18n audit: ${unique.length} unresolved key(s)\n`)
|
||||
console.error(unique.join('\n'))
|
||||
process.exit(1)
|
||||
}
|
||||
console.log('i18n audit: all keys resolve')
|
||||
@@ -30,13 +30,13 @@ function getRelativeLabel(notification, t) {
|
||||
const { unit, value } = notification
|
||||
const numericValue = Number(value)
|
||||
if (numericValue === 0) {
|
||||
return t('notifTemplate.onDueDate')
|
||||
return t('notificationTemplate.onDueDate')
|
||||
}
|
||||
const unitName = t(`notifTemplate.unitName.${unit}`)
|
||||
const unitName = t(`notificationTemplate.unitName.${unit}`)
|
||||
const absValue = Math.abs(numericValue)
|
||||
return numericValue < 0
|
||||
? t('notifTemplate.beforeDue', { count: absValue, unit: unitName })
|
||||
: t('notifTemplate.afterDue', { count: absValue, unit: unitName })
|
||||
? t('notificationTemplate.beforeDue', { count: absValue, unit: unitName })
|
||||
: t('notificationTemplate.afterDue', { count: absValue, unit: unitName })
|
||||
}
|
||||
|
||||
// Helper functions to convert between internal value and UI representation
|
||||
@@ -223,7 +223,7 @@ const NotificationTemplate = ({
|
||||
if (!currentNotification) return
|
||||
|
||||
if (isDuplicate(currentNotification, idx, currentList)) {
|
||||
setError(t('notifTemplate.errDuplicate'))
|
||||
setError(t('notificationTemplate.errDuplicate'))
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -235,14 +235,14 @@ const NotificationTemplate = ({
|
||||
|
||||
if (type === 'due') {
|
||||
if (notificationsRef.current.some(n => Number(n.value) === 0)) {
|
||||
setError(t('notifTemplate.errOneDue'))
|
||||
setError(t('notificationTemplate.errOneDue'))
|
||||
return
|
||||
}
|
||||
newNotification = { value: 0, unit: 'm' }
|
||||
} else {
|
||||
newNotification = getSmartSuggestion(type)
|
||||
if (!newNotification) {
|
||||
setError(t('notifTemplate.errAllConfigured', { type }))
|
||||
setError(t('notificationTemplate.errAllConfigured', { type }))
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -578,7 +578,7 @@ const NotificationTemplate = ({
|
||||
value={opt.value}
|
||||
disabled={opt.value === 'ondue' && hasOnDueElsewhere}
|
||||
>
|
||||
{t(`notifTemplate.timing.${opt.value}`)}
|
||||
{t(`notificationTemplate.timing.${opt.value}`)}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
@@ -641,7 +641,7 @@ const NotificationTemplate = ({
|
||||
>
|
||||
{timeUnits.map(opt => (
|
||||
<Option key={opt.value} value={opt.value}>
|
||||
{t(`notifTemplate.unitShort.${opt.value}`)}
|
||||
{t(`notificationTemplate.unitShort.${opt.value}`)}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
@@ -691,7 +691,7 @@ const NotificationTemplate = ({
|
||||
},
|
||||
}}
|
||||
>
|
||||
{t('notifTemplate.reminder')}
|
||||
{t('notificationTemplate.reminder')}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => addSmartNotification('due')}
|
||||
@@ -713,7 +713,7 @@ const NotificationTemplate = ({
|
||||
},
|
||||
}}
|
||||
>
|
||||
{t('notifTemplate.dueAlert')}
|
||||
{t('notificationTemplate.dueAlert')}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => addSmartNotification('followup')}
|
||||
@@ -732,7 +732,7 @@ const NotificationTemplate = ({
|
||||
},
|
||||
}}
|
||||
>
|
||||
{t('notifTemplate.followUp')}
|
||||
{t('notificationTemplate.followUp')}
|
||||
</Button>
|
||||
</Box>
|
||||
{showSaveDefault && (
|
||||
@@ -765,7 +765,7 @@ const NotificationTemplate = ({
|
||||
setShowSaveDefault(false)
|
||||
}}
|
||||
>
|
||||
{t('notifTemplate.rememberFuture')}
|
||||
{t('notificationTemplate.rememberFuture')}
|
||||
</Button>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
@@ -81,12 +81,12 @@ const SSESettings = () => {
|
||||
{t('realtime.titleSse')}
|
||||
{!isPlusAccount(userProfile) && (
|
||||
<Chip variant='soft' color='warning' sx={{ ml: 1 }}>
|
||||
Plus Feature
|
||||
{t('common.plusFeature')}
|
||||
</Chip>
|
||||
)}
|
||||
</Typography>
|
||||
<Typography level='body-sm' color='neutral'>
|
||||
Get instant notifications via Server-Sent Events
|
||||
{t('realtime.subtitleSse')}
|
||||
</Typography>
|
||||
</Box>
|
||||
{isSSEEnabled() && isPlusAccount(userProfile) && (
|
||||
|
||||
@@ -63,20 +63,20 @@ const UserProfileAvatar = () => {
|
||||
const isPlusUser = isPlusAccount(userProfile)
|
||||
|
||||
const getSubscriptionStatus = () => {
|
||||
if (!userProfile) return 'Free'
|
||||
if (!userProfile) return t('userMenu.planFree')
|
||||
|
||||
if (userProfile.subscription === 'active') {
|
||||
return 'Plus'
|
||||
return t('userMenu.planPlus')
|
||||
}
|
||||
|
||||
if (
|
||||
userProfile.subscription === 'cancelled' &&
|
||||
moment().isBefore(userProfile.expiration)
|
||||
) {
|
||||
return 'Plus (expires soon)'
|
||||
return t('userMenu.planPlusExpiring')
|
||||
}
|
||||
|
||||
return 'Free'
|
||||
return t('userMenu.planFree')
|
||||
}
|
||||
|
||||
const handleLogout = () => {
|
||||
@@ -270,7 +270,7 @@ const UserProfileAvatar = () => {
|
||||
fontWeight: 500,
|
||||
}}
|
||||
>
|
||||
Impersonating
|
||||
{t('userMenu.impersonating')}
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
@@ -296,7 +296,9 @@ const UserProfileAvatar = () => {
|
||||
</ListItemDecorator>
|
||||
<ListItemContent>
|
||||
<Typography level='body-sm' sx={{ fontWeight: 500 }}>
|
||||
{isImpersonating ? 'Switch User' : 'Impersonate User'}
|
||||
{isImpersonating
|
||||
? t('userMenu.switchUser')
|
||||
: t('userMenu.impersonateUser')}
|
||||
</Typography>
|
||||
<Typography
|
||||
level='body-xs'
|
||||
@@ -432,13 +434,15 @@ const UserProfileAvatar = () => {
|
||||
</ListItemDecorator>
|
||||
<ListItemContent>
|
||||
<Typography level='body-sm' sx={{ fontWeight: 500 }}>
|
||||
{isDarkMode ? 'Switch to Light' : 'Switch to Dark'}
|
||||
{isDarkMode
|
||||
? t('userMenu.switchToLight')
|
||||
: t('userMenu.switchToDark')}
|
||||
</Typography>
|
||||
<Typography
|
||||
level='body-xs'
|
||||
sx={{ color: 'var(--joy-palette-text-tertiary)' }}
|
||||
>
|
||||
Toggle theme appearance
|
||||
{t('userMenu.toggleThemeAppearance')}
|
||||
</Typography>
|
||||
</ListItemContent>
|
||||
</MenuItem>
|
||||
@@ -465,9 +469,11 @@ const UserProfileAvatar = () => {
|
||||
fontWeight: 500,
|
||||
}}
|
||||
>
|
||||
Upgrade to Plus
|
||||
{t('userMenu.upgradeToPlus')}
|
||||
</Typography>
|
||||
<Typography level='body-xs'>
|
||||
{t('userMenu.unlockPremium')}
|
||||
</Typography>
|
||||
<Typography level='body-xs'>Unlock premium features</Typography>
|
||||
</ListItemContent>
|
||||
</MenuItem>
|
||||
)}
|
||||
@@ -516,7 +522,7 @@ const UserProfileAvatar = () => {
|
||||
level='body-sm'
|
||||
sx={{ fontWeight: 500, color: 'var(--joy-palette-danger-500)' }}
|
||||
>
|
||||
Logout
|
||||
{t('logout')}
|
||||
</Typography>
|
||||
</ListItemContent>
|
||||
</MenuItem>
|
||||
|
||||
@@ -37,6 +37,7 @@ import {
|
||||
} from '@mui/joy'
|
||||
import moment from 'moment'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useNavigate, useParams, useSearchParams } from 'react-router-dom'
|
||||
|
||||
import DurationInput from '../../components/common/DurationInput'
|
||||
@@ -94,6 +95,7 @@ const REPEAT_ON_TYPE = ['interval', 'days_of_the_week', 'day_of_the_month']
|
||||
const NO_DUE_DATE_REQUIRED_TYPE = ['no_repeat', 'once']
|
||||
const NO_DUE_DATE_ALLOWED_TYPE = ['trigger']
|
||||
const ChoreEdit = () => {
|
||||
const { t } = useTranslation('chores')
|
||||
const { data: userProfile, isLoading: isUserProfileLoading } =
|
||||
useUserProfile()
|
||||
|
||||
@@ -207,16 +209,18 @@ const ChoreEdit = () => {
|
||||
const errors = {}
|
||||
|
||||
if (name.trim() === '') {
|
||||
errors.name = 'Name is required'
|
||||
errors.name = t('choreEdit.errNameRequired')
|
||||
}
|
||||
if (frequencyType === 'interval' && !frequency > 0) {
|
||||
errors.frequency = `Invalid frequency, the ${frequencyMetadata.unit} should be > 0`
|
||||
errors.frequency = t('choreEdit.errFrequencyInvalid', {
|
||||
unit: frequencyMetadata.unit,
|
||||
})
|
||||
}
|
||||
if (
|
||||
frequencyType === 'days_of_the_week' &&
|
||||
frequencyMetadata['days']?.length === 0
|
||||
) {
|
||||
errors.frequency = 'Please select at least one day of the week'
|
||||
errors.frequency = t('choreEdit.errSelectDayOfWeek')
|
||||
}
|
||||
|
||||
// Validate advanced scheduling patterns
|
||||
@@ -226,14 +230,13 @@ const ChoreEdit = () => {
|
||||
(!frequencyMetadata?.occurrences ||
|
||||
frequencyMetadata.occurrences.length === 0)
|
||||
) {
|
||||
errors.frequency =
|
||||
'Please select at least one day occurrence for the month'
|
||||
errors.frequency = t('choreEdit.errSelectDayOccurrence')
|
||||
}
|
||||
if (
|
||||
frequencyType === 'day_of_the_month' &&
|
||||
frequencyMetadata['months']?.length === 0
|
||||
) {
|
||||
errors.frequency = 'Please select at least one month'
|
||||
errors.frequency = t('choreEdit.errSelectMonth')
|
||||
}
|
||||
if (
|
||||
dueDate === null &&
|
||||
@@ -243,14 +246,14 @@ const ChoreEdit = () => {
|
||||
if (REPEAT_ON_TYPE.includes(frequencyType)) {
|
||||
console.log('VALIDATION:', dueDate, frequencyType)
|
||||
|
||||
errors.dueDate = 'Start date is required'
|
||||
errors.dueDate = t('choreEdit.errStartDateRequired')
|
||||
} else {
|
||||
errors.dueDate = 'Due date is required'
|
||||
errors.dueDate = t('choreEdit.errDueDateRequired')
|
||||
}
|
||||
}
|
||||
if (frequencyType === 'trigger') {
|
||||
if (!isThingValid) {
|
||||
errors.thingTrigger = 'Thing trigger is invalid'
|
||||
errors.thingTrigger = t('choreEdit.errThingTrigger')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,7 +266,7 @@ const ChoreEdit = () => {
|
||||
<ListItem key={key}>{errors[key]}</ListItem>
|
||||
))
|
||||
showError({
|
||||
title: 'Please resolve the following errors:',
|
||||
title: t('choreEdit.errTitle'),
|
||||
message: <List>{errorList}</List>,
|
||||
})
|
||||
return false
|
||||
@@ -417,13 +420,13 @@ const ChoreEdit = () => {
|
||||
result?.res?._pendingCreate
|
||||
) {
|
||||
showSuccess({
|
||||
title: 'Saved Offline',
|
||||
message: 'Your changes will sync when you are back online.',
|
||||
title: t('choreEdit.savedOfflineTitle'),
|
||||
message: t('choreEdit.savedOfflineMessage'),
|
||||
})
|
||||
} else {
|
||||
showSuccess({
|
||||
title: 'Chore Saved',
|
||||
message: 'Your task has been saved successfully!',
|
||||
title: t('choreEdit.savedTitle'),
|
||||
message: t('choreEdit.savedMessage'),
|
||||
})
|
||||
}
|
||||
Navigate('/chores')
|
||||
@@ -431,10 +434,10 @@ const ChoreEdit = () => {
|
||||
.catch(error => {
|
||||
console.error('Failed to save chore:', error)
|
||||
showError({
|
||||
title: 'Save Failed',
|
||||
title: t('choreEdit.saveFailedTitle'),
|
||||
message: error?.isServerMessage
|
||||
? error.message
|
||||
: 'Failed to save chore, please try again.',
|
||||
: t('choreEdit.saveFailedMessage'),
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -693,8 +696,8 @@ const ChoreEdit = () => {
|
||||
})
|
||||
if (!response.ok) {
|
||||
showError({
|
||||
title: 'Upload Failed',
|
||||
message: 'Failed to upload attachment.',
|
||||
title: t('choreEdit.uploadFailedTitle'),
|
||||
message: t('choreEdit.uploadFailedMessage'),
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -710,8 +713,8 @@ const ChoreEdit = () => {
|
||||
])
|
||||
} catch {
|
||||
showError({
|
||||
title: 'Upload Failed',
|
||||
message: 'Failed to upload attachment.',
|
||||
title: t('choreEdit.uploadFailedTitle'),
|
||||
message: t('choreEdit.uploadFailedMessage'),
|
||||
})
|
||||
} finally {
|
||||
setIsUploadingAttachment(false)
|
||||
@@ -725,16 +728,16 @@ const ChoreEdit = () => {
|
||||
if (cancelled) return
|
||||
if (error || !image) {
|
||||
showError({
|
||||
title: 'Scan Failed',
|
||||
message: error || 'Could not scan the document.',
|
||||
title: t('choreEdit.scanFailedTitle'),
|
||||
message: error || t('choreEdit.scanFailedMessage'),
|
||||
})
|
||||
return
|
||||
}
|
||||
const file = await imageSourceToFile(image, `scan-${Date.now()}.jpg`)
|
||||
if (!file) {
|
||||
showError({
|
||||
title: 'Scan Failed',
|
||||
message: 'Could not read the scanned image.',
|
||||
title: t('choreEdit.scanFailedTitle'),
|
||||
message: t('choreEdit.scanReadFailedMessage'),
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -744,10 +747,10 @@ const ChoreEdit = () => {
|
||||
const handleDelete = () => {
|
||||
setConfirmModelConfig({
|
||||
isOpen: true,
|
||||
title: 'Delete Chore',
|
||||
confirmText: 'Delete',
|
||||
cancelText: 'Cancel',
|
||||
message: 'Are you sure you want to delete this chore?',
|
||||
title: t('choreEdit.deleteChoreTitle'),
|
||||
confirmText: t('common:delete'),
|
||||
cancelText: t('common:cancel'),
|
||||
message: t('edit.deleteConfirm'),
|
||||
onClose: isConfirmed => {
|
||||
if (isConfirmed === true) {
|
||||
deleteChores.mutate([choreId], {
|
||||
@@ -756,8 +759,10 @@ const ChoreEdit = () => {
|
||||
},
|
||||
onError: error => {
|
||||
showError({
|
||||
title: 'Delete Failed',
|
||||
message: `Failed to delete chore: ${error.message}`,
|
||||
title: t('choreEdit.deleteFailedTitle'),
|
||||
message: t('choreEdit.deleteChoreFailed', {
|
||||
error: error.message,
|
||||
}),
|
||||
})
|
||||
},
|
||||
})
|
||||
@@ -789,10 +794,8 @@ const ChoreEdit = () => {
|
||||
|
||||
<Box mb={3}>
|
||||
<FormControl error={errors.name}>
|
||||
<Typography level='h4'>Name</Typography>
|
||||
<Typography level='body-md'>
|
||||
What is the name of this task?
|
||||
</Typography>
|
||||
<Typography level='h4'>{t('choreEdit.name')}</Typography>
|
||||
<Typography level='body-md'>{t('choreEdit.nameDesc')}</Typography>
|
||||
<Input value={name} onChange={e => setName(e.target.value)} />
|
||||
<FormHelperText error>{errors.name}</FormHelperText>
|
||||
</FormControl>
|
||||
@@ -800,8 +803,10 @@ const ChoreEdit = () => {
|
||||
|
||||
<Box mb={3}>
|
||||
<FormControl error={errors.description}>
|
||||
<Typography level='h4'>Description</Typography>
|
||||
<Typography level='body-md'>What is this task about?</Typography>
|
||||
<Typography level='h4'>{t('choreEdit.description')}</Typography>
|
||||
<Typography level='body-md'>
|
||||
{t('choreEdit.descriptionDesc')}
|
||||
</Typography>
|
||||
<RichTextEditor
|
||||
value={description}
|
||||
onChange={setDescription}
|
||||
@@ -814,8 +819,8 @@ const ChoreEdit = () => {
|
||||
</Box>
|
||||
|
||||
<Box mb={3}>
|
||||
<Typography level='h4'>Priority</Typography>
|
||||
<Typography level='body-md'>How important is this task?</Typography>
|
||||
<Typography level='h4'>{t('choreEdit.priority')}</Typography>
|
||||
<Typography level='body-md'>{t('choreEdit.priorityDesc')}</Typography>
|
||||
|
||||
{/* Priority Chip Selection */}
|
||||
<Box
|
||||
@@ -861,7 +866,7 @@ const ChoreEdit = () => {
|
||||
minHeight: 34,
|
||||
}}
|
||||
>
|
||||
No Priority
|
||||
{t('choreEdit.noPriority')}
|
||||
</Chip>
|
||||
</Box>
|
||||
</Box>
|
||||
@@ -869,9 +874,9 @@ const ChoreEdit = () => {
|
||||
{/* Project Selection - Show only if there are multiple projects */}
|
||||
{projects.length >= 1 && (
|
||||
<Box mb={3}>
|
||||
<Typography level='h4'>Project</Typography>
|
||||
<Typography level='h4'>{t('choreEdit.project')}</Typography>
|
||||
<Typography level='body-md'>
|
||||
Which project does this task belong to?
|
||||
{t('choreEdit.projectDesc')}
|
||||
</Typography>
|
||||
<Select
|
||||
value={projectId}
|
||||
@@ -906,7 +911,7 @@ const ChoreEdit = () => {
|
||||
)
|
||||
})()}
|
||||
</Avatar>
|
||||
Default Project
|
||||
{t('choreEdit.defaultProject')}
|
||||
</Box>
|
||||
</Option>
|
||||
{projects.map(project => (
|
||||
@@ -947,10 +952,8 @@ const ChoreEdit = () => {
|
||||
)}
|
||||
|
||||
<Box mb={3}>
|
||||
<Typography level='h4'>Labels</Typography>
|
||||
<Typography level='body-md'>
|
||||
Things to remember about this task or to tag it
|
||||
</Typography>
|
||||
<Typography level='h4'>{t('choreEdit.labels')}</Typography>
|
||||
<Typography level='body-md'>{t('choreEdit.labelsDesc')}</Typography>
|
||||
<Select
|
||||
multiple
|
||||
onChange={(event, newValue) => {
|
||||
@@ -1010,13 +1013,13 @@ const ChoreEdit = () => {
|
||||
}}
|
||||
>
|
||||
<Add />
|
||||
Add New Label
|
||||
{t('choreEdit.addNewLabel')}
|
||||
</MenuItem>
|
||||
</Select>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Typography level='h4'>Sub Tasks</Typography>
|
||||
<Typography level='h4'>{t('choreEdit.subTasks')}</Typography>
|
||||
{/* <FormControl sx={{ mt: 1 }}>
|
||||
<Checkbox
|
||||
onChange={e => {
|
||||
@@ -1049,8 +1052,10 @@ const ChoreEdit = () => {
|
||||
</Box>
|
||||
|
||||
<Box mt={3}>
|
||||
<Typography level='h4'>Attachments</Typography>
|
||||
<Typography level='body-md'>Files attached to this task</Typography>
|
||||
<Typography level='h4'>{t('choreEdit.attachments')}</Typography>
|
||||
<Typography level='body-md'>
|
||||
{t('choreEdit.attachmentsDesc')}
|
||||
</Typography>
|
||||
<Card variant='outlined' sx={{ mt: 2, p: 1.5 }}>
|
||||
{attachments.length > 0 && (
|
||||
<Box
|
||||
@@ -1140,8 +1145,8 @@ const ChoreEdit = () => {
|
||||
})
|
||||
.catch(() => {
|
||||
showError({
|
||||
title: 'Delete Failed',
|
||||
message: 'Failed to delete attachment.',
|
||||
title: t('choreEdit.deleteFailedTitle'),
|
||||
message: t('choreEdit.deleteAttachmentFailed'),
|
||||
})
|
||||
})
|
||||
}}
|
||||
@@ -1166,8 +1171,8 @@ const ChoreEdit = () => {
|
||||
})
|
||||
.catch(() => {
|
||||
showError({
|
||||
title: 'Delete Failed',
|
||||
message: 'Failed to delete attachment.',
|
||||
title: t('choreEdit.deleteFailedTitle'),
|
||||
message: t('choreEdit.deleteAttachmentFailed'),
|
||||
})
|
||||
})
|
||||
}}
|
||||
@@ -1188,7 +1193,7 @@ const ChoreEdit = () => {
|
||||
startDecorator={isUploadingAttachment ? null : <UploadFile />}
|
||||
loading={isUploadingAttachment}
|
||||
>
|
||||
Upload File
|
||||
{t('choreEdit.uploadFile')}
|
||||
<input
|
||||
type='file'
|
||||
hidden
|
||||
@@ -1208,7 +1213,7 @@ const ChoreEdit = () => {
|
||||
disabled={isUploadingAttachment}
|
||||
onClick={handleScanAttachment}
|
||||
>
|
||||
Scan
|
||||
{t('choreEdit.scan')}
|
||||
</Button>
|
||||
)}
|
||||
</Box>
|
||||
@@ -1219,8 +1224,10 @@ const ChoreEdit = () => {
|
||||
{/* Section 2: Assignment & Responsibility */}
|
||||
<Box mb={4}>
|
||||
<Box mb={3}>
|
||||
<Typography level='h4'>Assignees</Typography>
|
||||
<Typography level='body-md'>Who can do this task?</Typography>
|
||||
<Typography level='h4'>{t('choreEdit.assignees')}</Typography>
|
||||
<Typography level='body-md'>
|
||||
{t('choreEdit.assigneesDesc')}
|
||||
</Typography>
|
||||
<Card>
|
||||
<List
|
||||
orientation='horizontal'
|
||||
@@ -1242,7 +1249,7 @@ const ChoreEdit = () => {
|
||||
overlay
|
||||
disableIcon
|
||||
variant='soft'
|
||||
label='Anyone'
|
||||
label={t('choreEdit.anyone')}
|
||||
/>
|
||||
</ListItem>
|
||||
|
||||
@@ -1308,7 +1315,7 @@ const ChoreEdit = () => {
|
||||
setShowSaveAssigneeDefault(false)
|
||||
}}
|
||||
>
|
||||
Remember for Future Tasks
|
||||
{t('choreEdit.rememberFuture')}
|
||||
</Button>
|
||||
</Box>
|
||||
)}
|
||||
@@ -1323,15 +1330,17 @@ const ChoreEdit = () => {
|
||||
assignStrategyValue === 'no_assignee' ? 'none' : 'block',
|
||||
}}
|
||||
>
|
||||
<Typography level='h4'>Currently Assigned To</Typography>
|
||||
<Typography level='h4'>
|
||||
{t('choreEdit.currentlyAssigned')}
|
||||
</Typography>
|
||||
<Typography level='body-md'>
|
||||
Who is assigned the next due?
|
||||
{t('choreEdit.currentlyAssignedDesc')}
|
||||
</Typography>
|
||||
<Select
|
||||
placeholder={
|
||||
assignees.length === 0
|
||||
? 'No Assignees yet can perform this task'
|
||||
: 'Select an assignee for this task'
|
||||
? t('choreEdit.noAssigneesPlaceholder')
|
||||
: t('choreEdit.selectAssigneePlaceholder')
|
||||
}
|
||||
disabled={assignees.length === 0}
|
||||
value={assignedToValue}
|
||||
@@ -1348,9 +1357,11 @@ const ChoreEdit = () => {
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Typography level='h4'>Assignment Strategy</Typography>
|
||||
<Typography level='h4'>
|
||||
{t('choreEdit.assignStrategy')}
|
||||
</Typography>
|
||||
<Typography level='body-md'>
|
||||
How to pick the next assignee for the following task?
|
||||
{t('choreEdit.assignStrategyDesc')}
|
||||
</Typography>
|
||||
<Card>
|
||||
<List
|
||||
@@ -1369,10 +1380,7 @@ const ChoreEdit = () => {
|
||||
overlay
|
||||
disableIcon
|
||||
variant='soft'
|
||||
label={item
|
||||
.split('_')
|
||||
.map(x => x.charAt(0).toUpperCase() + x.slice(1))
|
||||
.join(' ')}
|
||||
label={t(`choreEdit.strategy.${item}`)}
|
||||
/>
|
||||
</ListItem>
|
||||
))}
|
||||
@@ -1412,11 +1420,13 @@ const ChoreEdit = () => {
|
||||
|
||||
<Box mt={3} mb={3}>
|
||||
<Typography level='h4'>
|
||||
{REPEAT_ON_TYPE.includes(frequencyType) ? 'Start Date' : 'Due Date'}
|
||||
{REPEAT_ON_TYPE.includes(frequencyType)
|
||||
? t('choreEdit.startDate')
|
||||
: t('choreEdit.dueDate')}
|
||||
</Typography>
|
||||
{frequencyType === 'trigger' && !dueDate && (
|
||||
<Typography level='body-sm'>
|
||||
Due Date will be set when the trigger of the thing is met
|
||||
{t('choreEdit.triggerDueHint')}
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
@@ -1442,11 +1452,9 @@ const ChoreEdit = () => {
|
||||
defaultChecked={dueDate !== null}
|
||||
checked={dueDate !== null}
|
||||
overlay
|
||||
label='Give this task a due date'
|
||||
label={t('choreEdit.giveDueDate')}
|
||||
/>
|
||||
<FormHelperText>
|
||||
Task needs to be completed by a specific time
|
||||
</FormHelperText>
|
||||
<FormHelperText>{t('choreEdit.giveDueDateHelp')}</FormHelperText>
|
||||
</FormControl>
|
||||
)}
|
||||
{dueDate && (
|
||||
@@ -1454,8 +1462,8 @@ const ChoreEdit = () => {
|
||||
<FormControl error={Boolean(errors.dueDate)} sx={{ mt: 2 }}>
|
||||
<Typography level='body-md'>
|
||||
{REPEAT_ON_TYPE.includes(frequencyType)
|
||||
? 'When does this task start?'
|
||||
: 'When is the next first time this task is due?'}
|
||||
? t('choreEdit.startWhen')
|
||||
: t('choreEdit.dueWhen')}
|
||||
</Typography>
|
||||
<Input
|
||||
type='date'
|
||||
@@ -1471,19 +1479,19 @@ const ChoreEdit = () => {
|
||||
checked={useCustomTime}
|
||||
onChange={e => handleUseCustomTimeChange(e.target.checked)}
|
||||
overlay
|
||||
label='Set a specific time'
|
||||
label={t('choreEdit.setSpecificTime')}
|
||||
/>
|
||||
<FormHelperText>
|
||||
{useCustomTime
|
||||
? 'Task will be due at the specified time'
|
||||
: 'Task will be due at the end of the day (11:59 PM)'}
|
||||
? t('choreEdit.dueAtSpecifiedTime')
|
||||
: t('choreEdit.dueEndOfDay')}
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
{useCustomTime && (
|
||||
<Box sx={{ mt: 2, ml: 4 }}>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
Time:
|
||||
{t('choreEdit.timeLabel')}
|
||||
</Typography>
|
||||
<Input
|
||||
type='time'
|
||||
@@ -1499,9 +1507,9 @@ const ChoreEdit = () => {
|
||||
|
||||
{dueDate && (
|
||||
<Box mb={3}>
|
||||
<Typography level='h4'>Task Window</Typography>
|
||||
<Typography level='h4'>{t('choreEdit.taskWindow')}</Typography>
|
||||
<Typography level='body-md'>
|
||||
Define when this task can be completed and when it expires
|
||||
{t('choreEdit.taskWindowDesc')}
|
||||
</Typography>
|
||||
|
||||
{/* Available From (Completion Window) */}
|
||||
@@ -1516,10 +1524,10 @@ const ChoreEdit = () => {
|
||||
}
|
||||
}}
|
||||
overlay
|
||||
label='Set earliest completion time'
|
||||
label={t('choreEdit.earliestCompletion')}
|
||||
/>
|
||||
<FormHelperText>
|
||||
Task becomes available to complete X hours before the due date
|
||||
{t('choreEdit.earliestCompletionHelp')}
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
@@ -1531,7 +1539,9 @@ const ChoreEdit = () => {
|
||||
ml: 4,
|
||||
}}
|
||||
>
|
||||
<Typography level='body-sm'>Hours:</Typography>
|
||||
<Typography level='body-sm'>
|
||||
{t('choreEdit.hoursLabel')}
|
||||
</Typography>
|
||||
<Input
|
||||
type='number'
|
||||
value={completionWindow}
|
||||
@@ -1542,7 +1552,7 @@ const ChoreEdit = () => {
|
||||
max: 24 * 7,
|
||||
},
|
||||
}}
|
||||
placeholder='Hours'
|
||||
placeholder={t('choreEdit.hoursPlaceholder')}
|
||||
onChange={e => {
|
||||
setCompletionWindow(parseInt(e.target.value))
|
||||
}}
|
||||
@@ -1589,7 +1599,9 @@ const ChoreEdit = () => {
|
||||
size='sm'
|
||||
minValue={0}
|
||||
/>
|
||||
<Typography level='body-sm'>after due date</Typography>
|
||||
<Typography level='body-sm'>
|
||||
{t('choreEdit.afterDueDate')}
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
@@ -1597,9 +1609,9 @@ const ChoreEdit = () => {
|
||||
|
||||
{!['once', 'no_repeat'].includes(frequencyType) && (
|
||||
<Box>
|
||||
<Typography level='h4'>Scheduling Preferences</Typography>
|
||||
<Typography level='h4'>{t('choreEdit.schedulingPrefs')}</Typography>
|
||||
<Typography level='body-md'>
|
||||
How to reschedule the next due date?
|
||||
{t('choreEdit.schedulingPrefsDesc')}
|
||||
</Typography>
|
||||
<RadioGroup name='tiers' sx={{ gap: 1, '& > div': { p: 1 } }}>
|
||||
<FormControl>
|
||||
@@ -1607,11 +1619,10 @@ const ChoreEdit = () => {
|
||||
overlay
|
||||
checked={!isRolling}
|
||||
onClick={() => setIsRolling(false)}
|
||||
label='Reschedule from due date'
|
||||
label={t('choreEdit.rescheduleFromDue')}
|
||||
/>
|
||||
<FormHelperText>
|
||||
the next task will be scheduled from the original due date,
|
||||
even if the previous task was completed late
|
||||
{t('choreEdit.rescheduleFromDueHelp')}
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
<FormControl>
|
||||
@@ -1622,11 +1633,10 @@ const ChoreEdit = () => {
|
||||
setIsRolling(true)
|
||||
setDeadlineOffset(-1)
|
||||
}}
|
||||
label='Reschedule from completion date'
|
||||
label={t('choreEdit.rescheduleFromCompletion')}
|
||||
/>
|
||||
<FormHelperText>
|
||||
the next task will be scheduled from the actual completion
|
||||
date of the previous task
|
||||
{t('choreEdit.rescheduleFromCompletionHelp')}
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
</RadioGroup>
|
||||
@@ -1635,11 +1645,10 @@ const ChoreEdit = () => {
|
||||
{/* Section 3.1: Notifications */}
|
||||
|
||||
<Box mb={3}>
|
||||
<Typography level='h4'>Notifications</Typography>
|
||||
<Typography level='h4'>{t('choreEdit.notifications')}</Typography>
|
||||
{!isPlusAccount(userProfile) && (
|
||||
<Typography level='body-sm' color='warning' sx={{ mb: 1 }}>
|
||||
Task notifications are not available in the Basic plan. Upgrade to
|
||||
Plus to receive reminders when tasks are due or completed.
|
||||
{t('choreEdit.notificationsPlanWarning')}
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
@@ -1655,14 +1664,14 @@ const ChoreEdit = () => {
|
||||
checked={isNotificable}
|
||||
disabled={!isPlusAccount(userProfile)}
|
||||
overlay
|
||||
label='Notify for this task'
|
||||
label={t('choreEdit.notifyForTask')}
|
||||
/>
|
||||
<FormHelperText
|
||||
sx={{
|
||||
opacity: !isPlusAccount(userProfile) ? 0.5 : 1,
|
||||
}}
|
||||
>
|
||||
When should receive notifications for this task
|
||||
{t('choreEdit.notifyForTaskHelp')}
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
</Box>
|
||||
@@ -1677,7 +1686,7 @@ const ChoreEdit = () => {
|
||||
>
|
||||
<Card variant='outlined'>
|
||||
<Typography level='h4' mb={2}>
|
||||
Notification Schedule
|
||||
{t('choreEdit.notificationSchedule')}
|
||||
</Typography>
|
||||
<Box sx={{ p: 0.5 }}>
|
||||
<NotificationTemplate
|
||||
@@ -1695,16 +1704,18 @@ const ChoreEdit = () => {
|
||||
</Box>
|
||||
|
||||
<Typography level='h4' mt={3} mb={2}>
|
||||
Who to Notify
|
||||
{t('choreEdit.whoToNotify')}
|
||||
</Typography>
|
||||
<FormControl>
|
||||
<Checkbox
|
||||
overlay
|
||||
disabled={true}
|
||||
checked={true}
|
||||
label='All Assignees'
|
||||
label={t('choreEdit.allAssignees')}
|
||||
/>
|
||||
<FormHelperText>Notify all assignees</FormHelperText>
|
||||
<FormHelperText>
|
||||
{t('choreEdit.allAssigneesHelp')}
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
<FormControl>
|
||||
@@ -1725,9 +1736,11 @@ const ChoreEdit = () => {
|
||||
? notificationMetadata?.circleGroup
|
||||
: false
|
||||
}
|
||||
label='Specific Group'
|
||||
label={t('choreEdit.specificGroup')}
|
||||
/>
|
||||
<FormHelperText>Notify a specific group</FormHelperText>
|
||||
<FormHelperText>
|
||||
{t('choreEdit.specificGroupHelp')}
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
{notificationMetadata?.circleGroup && (
|
||||
@@ -1737,11 +1750,13 @@ const ChoreEdit = () => {
|
||||
ml: 4,
|
||||
}}
|
||||
>
|
||||
<Typography level='body-sm'>Telegram Group ID:</Typography>
|
||||
<Typography level='body-sm'>
|
||||
{t('choreEdit.telegramGroupIdLabel')}
|
||||
</Typography>
|
||||
<Input
|
||||
type='number'
|
||||
value={notificationMetadata?.circleGroupID}
|
||||
placeholder='Telegram Group ID'
|
||||
placeholder={t('choreEdit.telegramGroupIdPlaceholder')}
|
||||
onChange={e => {
|
||||
setNotificationMetadata({
|
||||
...notificationMetadata,
|
||||
@@ -1766,11 +1781,11 @@ const ChoreEdit = () => {
|
||||
pb: 1,
|
||||
}}
|
||||
>
|
||||
Task Settings:
|
||||
{t('choreEdit.taskSettings')}
|
||||
</Typography>
|
||||
|
||||
<Box mb={3}>
|
||||
<Typography level='h4'>Points System</Typography>
|
||||
<Typography level='h4'>{t('choreEdit.pointsSystem')}</Typography>
|
||||
<FormControl sx={{ mt: 1 }}>
|
||||
<Checkbox
|
||||
onChange={e => {
|
||||
@@ -1782,12 +1797,9 @@ const ChoreEdit = () => {
|
||||
}}
|
||||
checked={points > -1}
|
||||
overlay
|
||||
label='Assign points for completion'
|
||||
label={t('choreEdit.assignPoints')}
|
||||
/>
|
||||
<FormHelperText>
|
||||
Assign points to this task and user will earn points when they
|
||||
completed it
|
||||
</FormHelperText>
|
||||
<FormHelperText>{t('choreEdit.assignPointsHelp')}</FormHelperText>
|
||||
</FormControl>
|
||||
{points != -1 && (
|
||||
<Card variant='outlined' sx={{ mt: 2 }}>
|
||||
@@ -1797,7 +1809,9 @@ const ChoreEdit = () => {
|
||||
ml: 4,
|
||||
}}
|
||||
>
|
||||
<Typography level='body-sm'>Points:</Typography>
|
||||
<Typography level='body-sm'>
|
||||
{t('choreEdit.pointsLabel')}
|
||||
</Typography>
|
||||
<Input
|
||||
type='number'
|
||||
value={points}
|
||||
@@ -1808,7 +1822,7 @@ const ChoreEdit = () => {
|
||||
max: 1000,
|
||||
},
|
||||
}}
|
||||
placeholder='Points'
|
||||
placeholder={t('choreEdit.pointsPlaceholder')}
|
||||
onChange={e => {
|
||||
setPoints(parseInt(e.target.value))
|
||||
}}
|
||||
@@ -1819,7 +1833,9 @@ const ChoreEdit = () => {
|
||||
</Box>
|
||||
|
||||
<Box mb={3}>
|
||||
<Typography level='h4'>Approval Requirement</Typography>
|
||||
<Typography level='h4'>
|
||||
{t('choreEdit.approvalRequirement')}
|
||||
</Typography>
|
||||
<FormControl sx={{ mt: 1 }}>
|
||||
<Checkbox
|
||||
onChange={e => {
|
||||
@@ -1827,18 +1843,17 @@ const ChoreEdit = () => {
|
||||
}}
|
||||
checked={requireApproval}
|
||||
overlay
|
||||
label='Require admin approval'
|
||||
label={t('choreEdit.requireApproval')}
|
||||
/>
|
||||
<FormHelperText>
|
||||
This task will need approval from an admin before being marked as
|
||||
complete
|
||||
{t('choreEdit.requireApprovalHelp')}
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Typography level='h4'>Privacy Settings</Typography>
|
||||
<Typography level='body-md'>Who can see this task?</Typography>
|
||||
<Typography level='h4'>{t('choreEdit.privacySettings')}</Typography>
|
||||
<Typography level='body-md'>{t('choreEdit.privacyDesc')}</Typography>
|
||||
<RadioGroup
|
||||
name='isPrivate'
|
||||
value={isPrivate}
|
||||
@@ -1852,20 +1867,20 @@ const ChoreEdit = () => {
|
||||
}}
|
||||
>
|
||||
<FormControl>
|
||||
<Radio overlay value={false} label='Public' />
|
||||
<FormHelperText>Everyone in your circle</FormHelperText>
|
||||
<Radio overlay value={false} label={t('choreEdit.public')} />
|
||||
<FormHelperText>{t('choreEdit.publicHelp')}</FormHelperText>
|
||||
</FormControl>
|
||||
<FormControl>
|
||||
<Radio
|
||||
overlay
|
||||
disabled={anyone || assignableTo.length === 0}
|
||||
value={true}
|
||||
label='Limited'
|
||||
label={t('choreEdit.limited')}
|
||||
/>
|
||||
<FormHelperText>
|
||||
You and others that are assigned to the task
|
||||
{t('choreEdit.limitedHelp')}
|
||||
{anyone || assignableTo.length === 0
|
||||
? ' (No assignees selected, Limited option is disabled)'
|
||||
? t('choreEdit.limitedDisabledHint')
|
||||
: ''}
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
@@ -1893,7 +1908,7 @@ const ChoreEdit = () => {
|
||||
setShowSavePrivacyDefault(false)
|
||||
}}
|
||||
>
|
||||
Remember for Future Tasks
|
||||
{t('choreEdit.rememberFuture')}
|
||||
</Button>
|
||||
</Box>
|
||||
)}
|
||||
@@ -1910,7 +1925,7 @@ const ChoreEdit = () => {
|
||||
}}
|
||||
>
|
||||
<Typography level='body1'>
|
||||
Created by{' '}
|
||||
{t('choreEdit.createdBy')}{' '}
|
||||
<Chip variant='solid'>
|
||||
{membersData.res.find(f => f.userId === createdBy)?.displayName}
|
||||
</Chip>{' '}
|
||||
@@ -1921,7 +1936,7 @@ const ChoreEdit = () => {
|
||||
<Divider sx={{ my: 1 }} />
|
||||
|
||||
<Typography level='body1'>
|
||||
Updated by{' '}
|
||||
{t('choreEdit.updatedBy')}{' '}
|
||||
<Chip variant='solid'>
|
||||
{
|
||||
membersData.res.find(f => f.userId === updatedBy)
|
||||
@@ -1971,7 +1986,7 @@ const ChoreEdit = () => {
|
||||
: unarchiveChore.mutate(choreId)
|
||||
}}
|
||||
>
|
||||
{isActive ? 'Archive' : 'Unarchive'}
|
||||
{isActive ? t('choreEdit.archive') : t('choreEdit.unarchive')}
|
||||
</Button>
|
||||
<MenuButton
|
||||
slots={{ root: IconButton }}
|
||||
@@ -1987,7 +2002,7 @@ const ChoreEdit = () => {
|
||||
</ButtonGroup>
|
||||
<Menu placement='top-end'>
|
||||
<MenuItem color='danger' onClick={handleDelete}>
|
||||
Delete
|
||||
{t('common:delete')}
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</Dropdown>
|
||||
@@ -1999,13 +2014,13 @@ const ChoreEdit = () => {
|
||||
window.history.back()
|
||||
}}
|
||||
>
|
||||
Cancel
|
||||
{t('common:cancel')}
|
||||
{showKeyboardShortcuts && (
|
||||
<KeyboardShortcutHint shortcut='Esc' sx={{ ml: 1 }} />
|
||||
)}
|
||||
</Button>
|
||||
<Button color='primary' variant='solid' onClick={HandleSaveChore}>
|
||||
{choreId > 0 ? 'Save' : 'Create'}
|
||||
{choreId > 0 ? t('common:save') : t('choreEdit.create')}
|
||||
{showKeyboardShortcuts && (
|
||||
<KeyboardShortcutHint shortcut='Enter' sx={{ ml: 1 }} />
|
||||
)}
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
} from '@mui/joy'
|
||||
import moment from 'moment'
|
||||
import { useEffect } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
import { useLocalization } from '../../contexts/LocalizationContext'
|
||||
import { useUserProfile } from '../../queries/UserQueries'
|
||||
@@ -33,11 +34,7 @@ const FREQUENCY_TYPES_RADIOS = [
|
||||
'custom',
|
||||
]
|
||||
|
||||
const FREQUENCY_TYPE_MESSAGE = {
|
||||
adaptive:
|
||||
'This chore will be scheduled dynamically based on previous completion dates.',
|
||||
custom: 'This chore will be scheduled based on a custom frequency.',
|
||||
}
|
||||
const FREQUENCY_TYPE_WITH_MESSAGE = ['adaptive', 'custom']
|
||||
const REPEAT_ON_TYPE = ['interval', 'days_of_the_week', 'day_of_the_month']
|
||||
const MONTHS = [
|
||||
'january',
|
||||
@@ -64,46 +61,40 @@ const DAYS = [
|
||||
'sunday',
|
||||
]
|
||||
|
||||
const WEEK_PATTERNS = {
|
||||
every_week: 'Every week',
|
||||
week_of_month: 'Specific occurrences in the month',
|
||||
}
|
||||
const WEEK_PATTERNS = ['every_week', 'week_of_month']
|
||||
|
||||
const DAY_OCCURRENCE_VALUES = [1, 2, 3, 4, -1]
|
||||
|
||||
// -1 is the "last occurrence" sentinel; everything else keys off its number.
|
||||
const occurrenceKey = value => (value === -1 ? 'last' : String(value))
|
||||
|
||||
const DAY_OCCURRENCE_OPTIONS = [
|
||||
{ value: 1, label: '1st occurrence' },
|
||||
{ value: 2, label: '2nd occurrence' },
|
||||
{ value: 3, label: '3rd occurrence' },
|
||||
{ value: 4, label: '4th occurrence' },
|
||||
{ value: -1, label: 'Last occurrence' },
|
||||
]
|
||||
// Helper function to generate schedule preview text
|
||||
const generateSchedulePreview = (metadata, formatTimeFn) => {
|
||||
const generateSchedulePreview = (metadata, formatTimeFn, t) => {
|
||||
if (!metadata?.days?.length) return ''
|
||||
|
||||
const dayNames = metadata.days
|
||||
.map(day => day.charAt(0).toUpperCase() + day.slice(1, 3))
|
||||
.map(day => t(`repeat.daysShort.${day}`))
|
||||
.join(', ')
|
||||
|
||||
const timeStr = metadata.time ? formatTimeFn(metadata.time) : '6:00 PM'
|
||||
|
||||
if (metadata.weekPattern === 'every_week' || !metadata.weekPattern) {
|
||||
return `Every ${dayNames} at ${timeStr}`
|
||||
}
|
||||
const timeStr = metadata.time
|
||||
? formatTimeFn(metadata.time)
|
||||
: t('repeat.defaultTime')
|
||||
|
||||
if (
|
||||
metadata.weekPattern === 'week_of_month' &&
|
||||
metadata.occurrences?.length
|
||||
) {
|
||||
const occurrenceStr = metadata.occurrences
|
||||
.map(w => {
|
||||
if (w === -1) return 'last'
|
||||
return `${w}${w === 1 ? 'st' : w === 2 ? 'nd' : w === 3 ? 'rd' : 'th'}`
|
||||
})
|
||||
.map(w => t(`repeat.ordinal.${occurrenceKey(w)}`))
|
||||
.join(', ')
|
||||
return `Every ${occurrenceStr} ${dayNames} of the month at ${timeStr}`
|
||||
return t('repeat.previewOccurrence', {
|
||||
occurrences: occurrenceStr,
|
||||
days: dayNames,
|
||||
time: timeStr,
|
||||
})
|
||||
}
|
||||
|
||||
return `Every ${dayNames} at ${timeStr}`
|
||||
return t('repeat.previewEvery', { days: dayNames, time: timeStr })
|
||||
}
|
||||
|
||||
export const RepeatOnSections = ({
|
||||
@@ -114,6 +105,7 @@ export const RepeatOnSections = ({
|
||||
onFrequencyUpdate,
|
||||
}) => {
|
||||
const { fmt } = useLocalization()
|
||||
const { t } = useTranslation('chores')
|
||||
// if time on frequencyMetadata is not set, try to set it to the nextDueDate if available,
|
||||
// otherwise set it to 18:00 of the current day
|
||||
useEffect(() => {
|
||||
@@ -142,7 +134,7 @@ export const RepeatOnSections = ({
|
||||
flexDirection: 'column',
|
||||
}}
|
||||
>
|
||||
<Typography level='h5'>Time of day: </Typography>
|
||||
<Typography level='h5'>{t('repeat.timeOfDay')}</Typography>
|
||||
<Input
|
||||
type='time'
|
||||
sx={{ width: '150px' }}
|
||||
@@ -165,7 +157,7 @@ export const RepeatOnSections = ({
|
||||
return (
|
||||
<>
|
||||
<Grid item sm={12} sx={{ display: 'flex', alignItems: 'center' }}>
|
||||
<Typography level='h5'>Every: </Typography>
|
||||
<Typography level='h5'>{t('repeat.every')}</Typography>
|
||||
<Input
|
||||
slotProps={{
|
||||
input: {
|
||||
@@ -180,7 +172,7 @@ export const RepeatOnSections = ({
|
||||
}}
|
||||
/>
|
||||
<Select
|
||||
placeholder='Unit'
|
||||
placeholder={t('repeat.unitPlaceholder')}
|
||||
value={frequencyMetadata?.unit || 'days'}
|
||||
sx={{ ml: 1 }}
|
||||
>
|
||||
@@ -195,7 +187,7 @@ export const RepeatOnSections = ({
|
||||
})
|
||||
}}
|
||||
>
|
||||
{item.charAt(0).toUpperCase() + item.slice(1)}
|
||||
{t(`repeat.unit.${item}`)}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
@@ -239,7 +231,7 @@ export const RepeatOnSections = ({
|
||||
overlay
|
||||
disableIcon
|
||||
variant='soft'
|
||||
label={item.charAt(0).toUpperCase() + item.slice(1)}
|
||||
label={t(`repeat.days.${item}`)}
|
||||
/>
|
||||
</ListItem>
|
||||
))}
|
||||
@@ -268,8 +260,8 @@ export const RepeatOnSections = ({
|
||||
disableIcon
|
||||
>
|
||||
{frequencyMetadata?.days?.length === 7
|
||||
? 'Unselect All'
|
||||
: 'Select All'}
|
||||
? t('repeat.unselectAll')
|
||||
: t('repeat.selectAll')}
|
||||
</Button>
|
||||
</Card>
|
||||
</Grid>
|
||||
@@ -291,20 +283,16 @@ export const RepeatOnSections = ({
|
||||
}}
|
||||
sx={{ gap: 1, '& > div': { p: 1 } }}
|
||||
>
|
||||
{Object.entries(WEEK_PATTERNS).map(([value, label]) => (
|
||||
{WEEK_PATTERNS.map(value => (
|
||||
<FormControl key={value}>
|
||||
<Radio value={value} label={label} variant='soft' />
|
||||
{value === 'every_week' && (
|
||||
<FormHelperText>
|
||||
Task repeats every week on selected days
|
||||
</FormHelperText>
|
||||
)}
|
||||
{value === 'week_of_month' && (
|
||||
<FormHelperText>
|
||||
Task repeats on specific day occurrences each month
|
||||
(e.g., 1st Monday, 3rd Friday)
|
||||
</FormHelperText>
|
||||
)}
|
||||
<Radio
|
||||
value={value}
|
||||
label={t(`repeat.weekPattern.${value}`)}
|
||||
variant='soft'
|
||||
/>
|
||||
<FormHelperText>
|
||||
{t(`repeat.weekPatternHelp.${value}`)}
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
))}
|
||||
</RadioGroup>
|
||||
@@ -312,10 +300,10 @@ export const RepeatOnSections = ({
|
||||
{frequencyMetadata?.weekPattern === 'week_of_month' && (
|
||||
<Box mt={2}>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
Select which occurrences of the selected days:
|
||||
{t('repeat.selectOccurrences')}
|
||||
</Typography>
|
||||
<Typography level='body-xs' color='neutral' mb={2}>
|
||||
Example: "1st Monday" means the first Monday of each month
|
||||
{t('repeat.occurrenceExample')}
|
||||
</Typography>
|
||||
<Card>
|
||||
<List
|
||||
@@ -326,23 +314,21 @@ export const RepeatOnSections = ({
|
||||
'--ListItem-radius': '20px',
|
||||
}}
|
||||
>
|
||||
{DAY_OCCURRENCE_OPTIONS.map(option => (
|
||||
<ListItem key={option.value}>
|
||||
{DAY_OCCURRENCE_VALUES.map(option => (
|
||||
<ListItem key={option}>
|
||||
<Checkbox
|
||||
checked={
|
||||
frequencyMetadata?.occurrences?.includes(
|
||||
option.value,
|
||||
option,
|
||||
) || false
|
||||
}
|
||||
onChange={() => {
|
||||
const currentOccurrences =
|
||||
frequencyMetadata?.occurrences || []
|
||||
const newOccurrences =
|
||||
currentOccurrences.includes(option.value)
|
||||
? currentOccurrences.filter(
|
||||
w => w !== option.value,
|
||||
)
|
||||
: [...currentOccurrences, option.value]
|
||||
currentOccurrences.includes(option)
|
||||
? currentOccurrences.filter(w => w !== option)
|
||||
: [...currentOccurrences, option]
|
||||
onFrequencyMetadataUpdate({
|
||||
...frequencyMetadata,
|
||||
occurrences: newOccurrences.sort((a, b) => {
|
||||
@@ -355,7 +341,9 @@ export const RepeatOnSections = ({
|
||||
overlay
|
||||
disableIcon
|
||||
variant='soft'
|
||||
label={option.label}
|
||||
label={t(
|
||||
`repeat.occurrence.${occurrenceKey(option)}`,
|
||||
)}
|
||||
/>
|
||||
</ListItem>
|
||||
))}
|
||||
@@ -367,7 +355,7 @@ export const RepeatOnSections = ({
|
||||
onClick={() => {
|
||||
if (
|
||||
frequencyMetadata?.occurrences?.length ===
|
||||
DAY_OCCURRENCE_OPTIONS.length
|
||||
DAY_OCCURRENCE_VALUES.length
|
||||
) {
|
||||
onFrequencyMetadataUpdate({
|
||||
...frequencyMetadata,
|
||||
@@ -376,9 +364,7 @@ export const RepeatOnSections = ({
|
||||
} else {
|
||||
onFrequencyMetadataUpdate({
|
||||
...frequencyMetadata,
|
||||
occurrences: DAY_OCCURRENCE_OPTIONS.map(
|
||||
option => option.value,
|
||||
),
|
||||
occurrences: [...DAY_OCCURRENCE_VALUES],
|
||||
})
|
||||
}
|
||||
}}
|
||||
@@ -386,9 +372,9 @@ export const RepeatOnSections = ({
|
||||
disableIcon
|
||||
>
|
||||
{frequencyMetadata?.occurrences?.length ===
|
||||
DAY_OCCURRENCE_OPTIONS.length
|
||||
? 'Unselect All'
|
||||
: 'Select All'}
|
||||
DAY_OCCURRENCE_VALUES.length
|
||||
? t('repeat.unselectAll')
|
||||
: t('repeat.selectAll')}
|
||||
</Button>
|
||||
</Card>
|
||||
</Box>
|
||||
@@ -400,7 +386,7 @@ export const RepeatOnSections = ({
|
||||
{frequencyMetadata?.days?.length > 0 && (
|
||||
<Card mt={2} p={2}>
|
||||
<Typography level='body-sm' color='primary'>
|
||||
{generateSchedulePreview(frequencyMetadata, fmt.time)}
|
||||
{generateSchedulePreview(frequencyMetadata, fmt.time, t)}
|
||||
</Typography>
|
||||
</Card>
|
||||
)}
|
||||
@@ -458,7 +444,7 @@ export const RepeatOnSections = ({
|
||||
overlay
|
||||
disableIcon
|
||||
variant='soft'
|
||||
label={item.charAt(0).toUpperCase() + item.slice(1)}
|
||||
label={t(`repeat.months.${item}`)}
|
||||
/>
|
||||
</ListItem>
|
||||
))}
|
||||
@@ -485,8 +471,8 @@ export const RepeatOnSections = ({
|
||||
disableIcon
|
||||
>
|
||||
{frequencyMetadata?.months?.length === 12
|
||||
? 'Unselect All'
|
||||
: 'Select All'}
|
||||
? t('repeat.unselectAll')
|
||||
: t('repeat.selectAll')}
|
||||
</Button>
|
||||
</Card>
|
||||
</Grid>
|
||||
@@ -497,7 +483,7 @@ export const RepeatOnSections = ({
|
||||
mb: 1.5,
|
||||
}}
|
||||
>
|
||||
<Typography>on the </Typography>
|
||||
<Typography>{t('repeat.onThe')}</Typography>
|
||||
<Input
|
||||
sx={{ width: '80px' }}
|
||||
type='number'
|
||||
@@ -513,7 +499,7 @@ export const RepeatOnSections = ({
|
||||
onFrequencyUpdate(e.target.value)
|
||||
}}
|
||||
/>
|
||||
<Typography>of the above month/s</Typography>
|
||||
<Typography>{t('repeat.ofAboveMonths')}</Typography>
|
||||
</Box>
|
||||
{timePickerComponent}
|
||||
</>
|
||||
@@ -540,10 +526,11 @@ const RepeatSection = ({
|
||||
viewOnly = false,
|
||||
}) => {
|
||||
const { data: userProfile } = useUserProfile({ enabled: !viewOnly })
|
||||
const { t } = useTranslation('chores')
|
||||
|
||||
return (
|
||||
<Box mt={2}>
|
||||
<Typography level='h4'>Repeat:</Typography>
|
||||
<Typography level='h4'>{t('repeat.title')}</Typography>
|
||||
<FormControl sx={{ mt: 1 }}>
|
||||
<Checkbox
|
||||
onChange={e => {
|
||||
@@ -556,16 +543,14 @@ const RepeatSection = ({
|
||||
checked={!['once', 'trigger'].includes(frequencyType)}
|
||||
value={!['once', 'trigger'].includes(frequencyType)}
|
||||
overlay
|
||||
label='Repeat this task'
|
||||
label={t('repeat.repeatThisTask')}
|
||||
/>
|
||||
<FormHelperText>
|
||||
Is this something needed to be done regularly?
|
||||
</FormHelperText>
|
||||
<FormHelperText>{t('repeat.repeatThisTaskHelp')}</FormHelperText>
|
||||
</FormControl>
|
||||
{!['once', 'trigger'].includes(frequencyType) && (
|
||||
<>
|
||||
<Card sx={{ mt: 1 }}>
|
||||
<Typography level='h5'>How often should it be repeated?</Typography>
|
||||
<Typography level='h5'>{t('repeat.howOften')}</Typography>
|
||||
|
||||
<List
|
||||
orientation='horizontal'
|
||||
@@ -609,21 +594,22 @@ const RepeatSection = ({
|
||||
overlay
|
||||
disableIcon
|
||||
variant='soft'
|
||||
label={
|
||||
item.charAt(0).toUpperCase() +
|
||||
item.slice(1).replace('_', ' ')
|
||||
}
|
||||
label={t(`repeat.freqType.${item}`)}
|
||||
/>
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
<Typography>{FREQUENCY_TYPE_MESSAGE[frequencyType]}</Typography>
|
||||
<Typography>
|
||||
{FREQUENCY_TYPE_WITH_MESSAGE.includes(frequencyType)
|
||||
? t(`repeat.freqMessage.${frequencyType}`)
|
||||
: ''}
|
||||
</Typography>
|
||||
{frequencyType === 'custom' ||
|
||||
(REPEAT_ON_TYPE.includes(frequencyType) && (
|
||||
<>
|
||||
<Grid container spacing={1} mt={2}>
|
||||
<Grid item>
|
||||
<Typography>Repeat on:</Typography>
|
||||
<Typography>{t('repeat.repeatOn')}</Typography>
|
||||
<Box
|
||||
sx={{ display: 'flex', alignItems: 'center', gap: 2 }}
|
||||
>
|
||||
@@ -678,21 +664,7 @@ const RepeatSection = ({
|
||||
}}
|
||||
value={item}
|
||||
disableIcon
|
||||
label={item
|
||||
.split('_')
|
||||
.map((i, idx) => {
|
||||
// first or last word
|
||||
if (
|
||||
idx === 0 ||
|
||||
idx === item.split('_').length - 1
|
||||
) {
|
||||
return (
|
||||
i.charAt(0).toUpperCase() + i.slice(1)
|
||||
)
|
||||
}
|
||||
return i
|
||||
})
|
||||
.join(' ')}
|
||||
label={t(`repeat.repeatOnType.${item}`)}
|
||||
variant='plain'
|
||||
sx={{
|
||||
px: 2,
|
||||
@@ -749,24 +721,23 @@ const RepeatSection = ({
|
||||
value={frequencyType === 'trigger'}
|
||||
disabled={!isPlusAccount(userProfile)}
|
||||
overlay
|
||||
label='Trigger this task based on a thing state'
|
||||
label={t('repeat.triggerLabel')}
|
||||
/>
|
||||
<FormHelperText
|
||||
sx={{
|
||||
opacity: !isPlusAccount(userProfile) ? 0.5 : 1,
|
||||
}}
|
||||
>
|
||||
Is this something that should be done when a thing state changes?{' '}
|
||||
{t('repeat.triggerHelp')}{' '}
|
||||
{userProfile && !isPlusAccount(userProfile) && (
|
||||
<Chip variant='soft' color='warning'>
|
||||
Plus Feature
|
||||
{t('settings:common.plusFeature')}
|
||||
</Chip>
|
||||
)}
|
||||
</FormHelperText>
|
||||
{!isPlusAccount(userProfile) && (
|
||||
<Typography level='body-sm' color='warning' sx={{ mt: 1 }}>
|
||||
Thing-based triggers are not available in the Basic plan. Upgrade to
|
||||
Plus to automatically trigger tasks when device states change.
|
||||
{t('repeat.triggerPlanWarning')}
|
||||
</Typography>
|
||||
)}
|
||||
</FormControl>
|
||||
|
||||
@@ -765,7 +765,7 @@ const ArchivedTasks = () => {
|
||||
borderRadius: '50%',
|
||||
}}
|
||||
onClick={() => setIsFilterSheetOpen(true)}
|
||||
title='Filters'
|
||||
title={t('archived.filtersTitle')}
|
||||
>
|
||||
<FilterList />
|
||||
</IconButton>
|
||||
@@ -774,10 +774,10 @@ const ArchivedTasks = () => {
|
||||
{/* Sort Menu */}
|
||||
<SortAndFilterMenu
|
||||
sortOptions={[
|
||||
{ name: 'Archived date', value: 'archivedAt' },
|
||||
{ name: 'Name', value: 'name' },
|
||||
{ name: 'Priority', value: 'priority' },
|
||||
{ name: 'Due date', value: 'dueDate' },
|
||||
{ name: t('archived.sortArchivedDate'), value: 'archivedAt' },
|
||||
{ name: t('archived.sortName'), value: 'name' },
|
||||
{ name: t('archived.sortPriority'), value: 'priority' },
|
||||
{ name: t('archived.sortDueDate'), value: 'dueDate' },
|
||||
]}
|
||||
selectedSort={sortBy}
|
||||
onSortChange={setSortBy}
|
||||
@@ -1045,11 +1045,11 @@ const ArchivedTasks = () => {
|
||||
variant='no-results'
|
||||
fullHeight
|
||||
icon={<SearchOff />}
|
||||
title='No archived tasks match'
|
||||
title={t('archived.noMatchTitle')}
|
||||
description={
|
||||
searchTerm
|
||||
? `Nothing in the archive matches "${searchTerm}".`
|
||||
: 'There are archived tasks, but none fit the filters that are currently on.'
|
||||
? t('archived.noMatchSearch', { term: searchTerm })
|
||||
: t('archived.noMatchFilters')
|
||||
}
|
||||
primaryAction={
|
||||
searchTerm
|
||||
@@ -1069,9 +1069,9 @@ const ArchivedTasks = () => {
|
||||
<EmptyState
|
||||
fullHeight
|
||||
icon={<Archive />}
|
||||
title='Nothing archived'
|
||||
description='Archiving hides a task without deleting it. Anything you archive from your task list shows up here, ready to restore.'
|
||||
primaryAction={{ label: 'Back to tasks', to: '/chores' }}
|
||||
title={t('archived.emptyTitle')}
|
||||
description={t('archived.emptyDescription')}
|
||||
primaryAction={{ label: t('archived.backToTasks'), to: '/chores' }}
|
||||
/>
|
||||
)
|
||||
) : (
|
||||
|
||||
@@ -152,7 +152,7 @@ const ChoreListView = ({
|
||||
>
|
||||
<ThumbDown sx={{ fontSize: 20 }} />
|
||||
<Typography level='body-xs' sx={{ mt: 0.5 }}>
|
||||
Reject
|
||||
{t('list.reject')}
|
||||
</Typography>
|
||||
</Box>
|
||||
</SwipeAction>
|
||||
@@ -173,7 +173,7 @@ const ChoreListView = ({
|
||||
>
|
||||
<HourglassEmpty sx={{ fontSize: 20 }} />
|
||||
<Typography level='body-xs' sx={{ mt: 0.5 }}>
|
||||
Pending
|
||||
{t('list.pending')}
|
||||
</Typography>
|
||||
</Box>
|
||||
</SwipeAction>
|
||||
@@ -231,7 +231,7 @@ const ChoreListView = ({
|
||||
>
|
||||
<Schedule sx={{ fontSize: 20 }} />
|
||||
<Typography level='body-xs' sx={{ mt: 0.5 }}>
|
||||
Schedule
|
||||
{t('list.schedule')}
|
||||
</Typography>
|
||||
</Box>
|
||||
</SwipeAction>
|
||||
@@ -251,7 +251,7 @@ const ChoreListView = ({
|
||||
>
|
||||
<Edit sx={{ fontSize: 20 }} />
|
||||
<Typography level='body-xs' sx={{ mt: 0.5 }}>
|
||||
Edit
|
||||
{t('common:edit')}
|
||||
</Typography>
|
||||
</Box>
|
||||
</SwipeAction>
|
||||
@@ -272,7 +272,7 @@ const ChoreListView = ({
|
||||
>
|
||||
<Notifications sx={{ fontSize: 20 }} />
|
||||
<Typography level='body-xs' sx={{ mt: 0.5 }}>
|
||||
Nudge
|
||||
{t('list.nudge')}
|
||||
</Typography>
|
||||
</Box>
|
||||
</SwipeAction>
|
||||
@@ -293,7 +293,7 @@ const ChoreListView = ({
|
||||
>
|
||||
<Delete sx={{ fontSize: 20 }} />
|
||||
<Typography level='body-xs' sx={{ mt: 0.5 }}>
|
||||
Delete
|
||||
{t('common:delete')}
|
||||
</Typography>
|
||||
</Box>
|
||||
</SwipeAction>
|
||||
|
||||
@@ -77,13 +77,17 @@ import { INSIGHT_FILTER_DEFS } from './SmartInsightsCard'
|
||||
|
||||
// Mirrors the assignee options in the toolbar, phrased to drop into a
|
||||
// sentence ("none of them are assigned to you").
|
||||
const ASSIGNEE_FILTER_LABELS = {
|
||||
assigned_to_me: 'assigned to you',
|
||||
available_for_me: 'available for you to pick up',
|
||||
assigned_to_others: 'assigned to someone else',
|
||||
assigned_to_me_tasks: 'assigned to you',
|
||||
created_by_me: 'created by you',
|
||||
}
|
||||
// Which assignee filters describe a subset of "everyone" — the empty-state
|
||||
// copy for each lives under `chores:empty.assignee.*` as a whole sentence,
|
||||
// since the fragment ("assigned to you") cannot be slotted mid-sentence in
|
||||
// every language.
|
||||
const ASSIGNEE_FILTER_KEYS = [
|
||||
'assigned_to_me',
|
||||
'available_for_me',
|
||||
'assigned_to_others',
|
||||
'assigned_to_me_tasks',
|
||||
'created_by_me',
|
||||
]
|
||||
|
||||
const MyChores = () => {
|
||||
const { data: userProfile, isLoading: isUserProfileLoading } =
|
||||
@@ -899,7 +903,8 @@ const MyChores = () => {
|
||||
// The assignee filter ("Mine", "Available to me", ...) is applied inside
|
||||
// ChoresGrouper, not in projectFilteredChores, so it can hide every task
|
||||
// while the unfiltered list still looks full. It narrows like any other.
|
||||
const assigneeFilterLabel = ASSIGNEE_FILTER_LABELS[selectedChoreFilter]
|
||||
const hasAssigneeNarrowing =
|
||||
ASSIGNEE_FILTER_KEYS.includes(selectedChoreFilter)
|
||||
const hasAssigneeFilter = Boolean(
|
||||
selectedChoreFilter && selectedChoreFilter !== 'anyone',
|
||||
)
|
||||
@@ -919,7 +924,7 @@ const MyChores = () => {
|
||||
// Worth its own wording: the assignee filter is the one narrowing that is
|
||||
// easy to forget you left on, so name it rather than saying "filters".
|
||||
const isAssigneeOnlyNarrowing = Boolean(
|
||||
assigneeFilterLabel &&
|
||||
hasAssigneeNarrowing &&
|
||||
!searchTerm?.length &&
|
||||
!hasQuickFilters &&
|
||||
!activeFilterId,
|
||||
@@ -973,13 +978,12 @@ const MyChores = () => {
|
||||
variant='error'
|
||||
fullHeight
|
||||
icon={<CloudOff />}
|
||||
title={"Can't reach Donetick"}
|
||||
title={t('empty.errorTitle')}
|
||||
description={
|
||||
choresErrorDetails?.message ||
|
||||
'Your tasks are safe. We just could not load them right now, check your connection and try again.'
|
||||
choresErrorDetails?.message || t('empty.errorDescription')
|
||||
}
|
||||
primaryAction={{
|
||||
label: 'Try again',
|
||||
label: t('empty.errorAction'),
|
||||
onClick: () => {
|
||||
refetchChores()
|
||||
queryClient.invalidateQueries(['circleMembers'])
|
||||
@@ -1163,15 +1167,15 @@ const MyChores = () => {
|
||||
variant='empty'
|
||||
fullHeight
|
||||
icon={<EditCalendar />}
|
||||
title='No tasks yet'
|
||||
description='Create your first task and Donetick keeps track of when it is due, whose turn it is, and what comes next.'
|
||||
title={t('empty.noTasksTitle')}
|
||||
description={t('empty.noTasksDescription')}
|
||||
primaryAction={{
|
||||
label: 'Create a task',
|
||||
label: t('empty.createTask'),
|
||||
startDecorator: <Add />,
|
||||
onClick: () => setAddTaskModalOpen(true),
|
||||
}}
|
||||
secondaryAction={{
|
||||
label: 'More options',
|
||||
label: t('empty.moreOptions'),
|
||||
onClick: () => Navigate('/chores/create'),
|
||||
}}
|
||||
/>
|
||||
@@ -1183,21 +1187,21 @@ const MyChores = () => {
|
||||
variant='no-results'
|
||||
fullHeight
|
||||
icon={<SearchOff />}
|
||||
title='No tasks match this view'
|
||||
title={t('empty.noMatchTitle')}
|
||||
description={
|
||||
searchTerm?.length > 0
|
||||
? `Nothing matches "${searchTerm}". Try a different search, or clear what is narrowing the list.`
|
||||
? t('empty.noMatchSearch', { term: searchTerm })
|
||||
: isAssigneeOnlyNarrowing
|
||||
? `There are tasks here, but none of them are ${assigneeFilterLabel}. Switch back to everyone to see the rest.`
|
||||
: 'You have tasks, but none of them fit the filters that are currently on.'
|
||||
? t(`empty.assignee.${selectedChoreFilter}`)
|
||||
: t('empty.noMatchFilters')
|
||||
}
|
||||
primaryAction={{
|
||||
label:
|
||||
searchTerm?.length > 0
|
||||
? 'Clear search'
|
||||
? t('empty.clearSearch')
|
||||
: isAssigneeOnlyNarrowing
|
||||
? "Show everyone's tasks"
|
||||
: 'Clear filters',
|
||||
? t('empty.showEveryone')
|
||||
: t('empty.clearFilters'),
|
||||
onClick: clearNarrowing,
|
||||
}}
|
||||
/>
|
||||
@@ -1206,15 +1210,15 @@ const MyChores = () => {
|
||||
variant='empty'
|
||||
fullHeight
|
||||
icon={<EditCalendar />}
|
||||
title={`Nothing in ${selectedProject.name} yet`}
|
||||
description='Tasks you add to this project show up here. Your other tasks are still where you left them.'
|
||||
title={t('empty.projectTitle', { name: selectedProject.name })}
|
||||
description={t('empty.projectDescription')}
|
||||
primaryAction={{
|
||||
label: 'Add a task here',
|
||||
label: t('empty.addTaskHere'),
|
||||
startDecorator: <Add />,
|
||||
onClick: () => setAddTaskModalOpen(true),
|
||||
}}
|
||||
secondaryAction={{
|
||||
label: 'See tasks outside projects',
|
||||
label: t('empty.seeOutsideProjects'),
|
||||
onClick: () => setSelectedProjectWithCache(null),
|
||||
}}
|
||||
/>
|
||||
@@ -1223,10 +1227,10 @@ const MyChores = () => {
|
||||
variant='empty'
|
||||
fullHeight
|
||||
icon={<EditCalendar />}
|
||||
title='No tasks here yet'
|
||||
description='Tasks that do not belong to a project live here. Add one, or switch projects to see what is in them.'
|
||||
title={t('empty.noProjectTitle')}
|
||||
description={t('empty.noProjectDescription')}
|
||||
primaryAction={{
|
||||
label: 'Create a task',
|
||||
label: t('empty.createTask'),
|
||||
startDecorator: <Add />,
|
||||
onClick: () => setAddTaskModalOpen(true),
|
||||
}}
|
||||
@@ -1404,9 +1408,9 @@ const MyChores = () => {
|
||||
size='sm'
|
||||
icon={<EditCalendar />}
|
||||
title={t('list.nothingScheduled')}
|
||||
description='This day is free. Add a task if you want something to land here.'
|
||||
description={t('empty.dayFreeDescription')}
|
||||
primaryAction={{
|
||||
label: 'Add task',
|
||||
label: t('empty.addTask'),
|
||||
startDecorator: <Add />,
|
||||
onClick: () => setAddTaskModalOpen(true),
|
||||
}}
|
||||
|
||||
@@ -252,23 +252,27 @@ const ChoreToolbar = ({
|
||||
if (!condition?.type) return 'Filter'
|
||||
|
||||
const typeLabels = {
|
||||
assignee: 'Assignee',
|
||||
createdBy: 'Created By',
|
||||
status: 'Status',
|
||||
priority: 'Priority',
|
||||
assignee: t('filterBuilder.assignee'),
|
||||
createdBy: t('filterBuilder.createdBy'),
|
||||
status: t('filterBuilder.statusHeading'),
|
||||
priority: t('filterBuilder.priority'),
|
||||
label: t('labels.label'),
|
||||
project: 'Project',
|
||||
dueDate: 'Due Date',
|
||||
points: 'Points',
|
||||
project: t('filterBuilder.project'),
|
||||
dueDate: t('filterBuilder.dueDate'),
|
||||
points: t('filterBuilder.points'),
|
||||
}
|
||||
|
||||
const typeLabel = typeLabels[condition.type] || 'Filter'
|
||||
const prefix = condition.operator === 'isNot' ? 'Not ' : ''
|
||||
const typeLabel =
|
||||
typeLabels[condition.type] || t('filterBuilder.filterFallback')
|
||||
const prefix =
|
||||
condition.operator === 'isNot' ? t('filterBuilder.notPrefix') : ''
|
||||
|
||||
if (condition.type === 'dueDate') {
|
||||
const dueDateLabel =
|
||||
DUE_DATE_OPTIONS.find(o => o.value === condition.operator)?.label ||
|
||||
'Custom'
|
||||
const dueDateLabel = DUE_DATE_OPTIONS.some(
|
||||
o => o.value === condition.operator,
|
||||
)
|
||||
? t(`filterBuilder.dueDateOption.${condition.operator}`)
|
||||
: t('filterBuilder.customDueDate')
|
||||
return `${typeLabel}: ${dueDateLabel}`
|
||||
}
|
||||
|
||||
@@ -292,9 +296,9 @@ const ChoreToolbar = ({
|
||||
return member?.displayName || member?.username || String(value)
|
||||
}
|
||||
if (condition.type === 'status') {
|
||||
return (
|
||||
CHORE_STATUSES.find(s => s.value === value)?.label || String(value)
|
||||
)
|
||||
return CHORE_STATUSES.some(s => s.value === value)
|
||||
? t(`filterBuilder.status.${value}`)
|
||||
: String(value)
|
||||
}
|
||||
if (condition.type === 'priority') {
|
||||
return Priorities.find(p => p.value === value)?.name || String(value)
|
||||
|
||||
@@ -9,17 +9,20 @@ import {
|
||||
TaskAlt,
|
||||
} from '@mui/icons-material'
|
||||
import { Avatar, Box, Chip, Divider, Input, Typography } from '@mui/joy'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
import Priorities from '../../../utils/Priorities'
|
||||
|
||||
// `labelKey` resolves against `chores:filterBuilder.dueDateOption.*` — these
|
||||
// are also read by ChoreToolbarPrototype, which translates them the same way.
|
||||
export const DUE_DATE_OPTIONS = [
|
||||
{ value: 'isOverdue', label: 'Overdue', color: 'danger' },
|
||||
{ value: 'isDueToday', label: 'Today', color: 'warning' },
|
||||
{ value: 'isDueTomorrow', label: 'Tomorrow', color: 'primary' },
|
||||
{ value: 'isDueThisWeek', label: 'This Week', color: 'primary' },
|
||||
{ value: 'isDueThisMonth', label: 'This Month', color: 'neutral' },
|
||||
{ value: 'hasNoDueDate', label: 'No Due Date', color: 'neutral' },
|
||||
{ value: 'hasDueDate', label: 'Has Due Date', color: 'neutral' },
|
||||
{ value: 'isOverdue', color: 'danger' },
|
||||
{ value: 'isDueToday', color: 'warning' },
|
||||
{ value: 'isDueTomorrow', color: 'primary' },
|
||||
{ value: 'isDueThisWeek', color: 'primary' },
|
||||
{ value: 'isDueThisMonth', color: 'neutral' },
|
||||
{ value: 'hasNoDueDate', color: 'neutral' },
|
||||
{ value: 'hasDueDate', color: 'neutral' },
|
||||
]
|
||||
|
||||
export const POINTS_OPERATORS = [
|
||||
@@ -31,10 +34,10 @@ export const POINTS_OPERATORS = [
|
||||
]
|
||||
|
||||
export const CHORE_STATUSES = [
|
||||
{ value: 0, label: 'Active' },
|
||||
{ value: 1, label: 'Started' },
|
||||
{ value: 2, label: 'In Progress' },
|
||||
{ value: 3, label: 'Pending Approval' },
|
||||
{ value: 0 },
|
||||
{ value: 1 },
|
||||
{ value: 2 },
|
||||
{ value: 3 },
|
||||
]
|
||||
|
||||
export const defaultSelections = () => ({
|
||||
@@ -119,35 +122,39 @@ const SectionHeader = ({ children, icon, label }) => (
|
||||
</Box>
|
||||
)
|
||||
|
||||
const IncludeExcludeToggle = ({
|
||||
labels = ['Include', 'Exclude'],
|
||||
onChange,
|
||||
value,
|
||||
}) => (
|
||||
<Box sx={{ display: 'flex', gap: 0.5, ml: 'auto' }}>
|
||||
{[
|
||||
{ op: 'is', label: labels[0] },
|
||||
{ op: 'isNot', label: labels[1] },
|
||||
].map(o => (
|
||||
<Chip
|
||||
key={o.op}
|
||||
size='sm'
|
||||
variant={value === o.op ? 'solid' : 'soft'}
|
||||
color={
|
||||
value === o.op ? (o.op === 'isNot' ? 'danger' : 'primary') : 'neutral'
|
||||
}
|
||||
onClick={() => onChange(o.op)}
|
||||
sx={{
|
||||
cursor: 'pointer',
|
||||
userSelect: 'none',
|
||||
transition: 'all 0.15s ease',
|
||||
}}
|
||||
>
|
||||
{o.label}
|
||||
</Chip>
|
||||
))}
|
||||
</Box>
|
||||
)
|
||||
const IncludeExcludeToggle = ({ labelKeys, onChange, value }) => {
|
||||
const { t } = useTranslation('chores')
|
||||
const [includeKey, excludeKey] = labelKeys ?? ['include', 'exclude']
|
||||
return (
|
||||
<Box sx={{ display: 'flex', gap: 0.5, ml: 'auto' }}>
|
||||
{[
|
||||
{ op: 'is', labelKey: includeKey },
|
||||
{ op: 'isNot', labelKey: excludeKey },
|
||||
].map(o => (
|
||||
<Chip
|
||||
key={o.op}
|
||||
size='sm'
|
||||
variant={value === o.op ? 'solid' : 'soft'}
|
||||
color={
|
||||
value === o.op
|
||||
? o.op === 'isNot'
|
||||
? 'danger'
|
||||
: 'primary'
|
||||
: 'neutral'
|
||||
}
|
||||
onClick={() => onChange(o.op)}
|
||||
sx={{
|
||||
cursor: 'pointer',
|
||||
userSelect: 'none',
|
||||
transition: 'all 0.15s ease',
|
||||
}}
|
||||
>
|
||||
{t(`filterBuilder.${o.labelKey}`)}
|
||||
</Chip>
|
||||
))}
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Reusable filter conditions UI used by both the filter sheet in ChoreToolbar
|
||||
@@ -163,6 +170,7 @@ const FilterBuilderContent = ({
|
||||
projects = [],
|
||||
selections,
|
||||
}) => {
|
||||
const { t } = useTranslation('chores')
|
||||
const toggleValue = (type, value) =>
|
||||
onSelectionsChange(prev => {
|
||||
const cur = prev[type].values || []
|
||||
@@ -272,7 +280,7 @@ const FilterBuilderContent = ({
|
||||
{/* Assignee */}
|
||||
{members.length > 0 && (
|
||||
<>
|
||||
<SectionHeader icon={<Person />} label='Assignee'>
|
||||
<SectionHeader icon={<Person />} label={t('filterBuilder.assignee')}>
|
||||
<IncludeExcludeToggle
|
||||
value={selections.assignee.operator}
|
||||
onChange={op => setOperator('assignee', op)}
|
||||
@@ -286,7 +294,7 @@ const FilterBuilderContent = ({
|
||||
{/* Created By */}
|
||||
{members.length > 0 && (
|
||||
<>
|
||||
<SectionHeader icon={<Person />} label='Created By'>
|
||||
<SectionHeader icon={<Person />} label={t('filterBuilder.createdBy')}>
|
||||
<IncludeExcludeToggle
|
||||
value={selections.createdBy.operator}
|
||||
onChange={op => setOperator('createdBy', op)}
|
||||
@@ -298,17 +306,29 @@ const FilterBuilderContent = ({
|
||||
)}
|
||||
|
||||
{/* Status */}
|
||||
<SectionHeader icon={<TaskAlt />} label='Status'>
|
||||
<SectionHeader
|
||||
icon={<TaskAlt />}
|
||||
label={t('filterBuilder.statusHeading')}
|
||||
>
|
||||
<IncludeExcludeToggle
|
||||
value={selections.status.operator}
|
||||
onChange={op => setOperator('status', op)}
|
||||
/>
|
||||
</SectionHeader>
|
||||
{chipRow('status', CHORE_STATUSES)}
|
||||
{chipRow(
|
||||
'status',
|
||||
CHORE_STATUSES.map(st => ({
|
||||
value: st.value,
|
||||
label: t(`filterBuilder.status.${st.value}`),
|
||||
})),
|
||||
)}
|
||||
<Divider sx={{ my: 2.5 }} />
|
||||
|
||||
{/* Priority */}
|
||||
<SectionHeader icon={<PriorityHigh />} label='Priority'>
|
||||
<SectionHeader
|
||||
icon={<PriorityHigh />}
|
||||
label={t('filterBuilder.priority')}
|
||||
>
|
||||
<IncludeExcludeToggle
|
||||
value={selections.priority.operator}
|
||||
onChange={op => setOperator('priority', op)}
|
||||
@@ -329,7 +349,10 @@ const FilterBuilderContent = ({
|
||||
<Divider sx={{ my: 2.5 }} />
|
||||
|
||||
{/* Due Date */}
|
||||
<SectionHeader icon={<CalendarMonth />} label='Due Date' />
|
||||
<SectionHeader
|
||||
icon={<CalendarMonth />}
|
||||
label={t('filterBuilder.dueDate')}
|
||||
/>
|
||||
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1 }}>
|
||||
{DUE_DATE_OPTIONS.map(opt => {
|
||||
const isSelected = selections.dueDate.operator === opt.value
|
||||
@@ -348,7 +371,7 @@ const FilterBuilderContent = ({
|
||||
transition: 'all 0.15s ease',
|
||||
}}
|
||||
>
|
||||
{opt.label}
|
||||
{t(`filterBuilder.dueDateOption.${opt.value}`)}
|
||||
</Chip>
|
||||
)
|
||||
})}
|
||||
@@ -358,11 +381,11 @@ const FilterBuilderContent = ({
|
||||
{/* Labels */}
|
||||
{labels.length > 0 && (
|
||||
<>
|
||||
<SectionHeader icon={<Label />} label='Labels'>
|
||||
<SectionHeader icon={<Label />} label={t('filterBuilder.labels')}>
|
||||
<IncludeExcludeToggle
|
||||
value={selections.label.operator}
|
||||
onChange={op => setOperator('label', op)}
|
||||
labels={['Has', "Doesn't Have"]}
|
||||
labelKeys={['has', 'doesntHave']}
|
||||
/>
|
||||
</SectionHeader>
|
||||
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1 }}>
|
||||
@@ -410,14 +433,17 @@ const FilterBuilderContent = ({
|
||||
{/* Projects */}
|
||||
{projects.length > 0 && (
|
||||
<>
|
||||
<SectionHeader icon={<FolderOpen />} label='Projects'>
|
||||
<SectionHeader
|
||||
icon={<FolderOpen />}
|
||||
label={t('filterBuilder.projects')}
|
||||
>
|
||||
<IncludeExcludeToggle
|
||||
value={selections.project.operator}
|
||||
onChange={op => setOperator('project', op)}
|
||||
/>
|
||||
</SectionHeader>
|
||||
{chipRow('project', [
|
||||
{ value: 'default', label: 'Default Project' },
|
||||
{ value: 'default', label: t('filterBuilder.defaultProject') },
|
||||
...projects
|
||||
.filter(p => p.id !== 'default')
|
||||
.map(p => ({ value: p.id, label: p.name })),
|
||||
@@ -427,7 +453,7 @@ const FilterBuilderContent = ({
|
||||
)}
|
||||
|
||||
{/* Points */}
|
||||
<SectionHeader icon={<Stars />} label='Points' />
|
||||
<SectionHeader icon={<Stars />} label={t('filterBuilder.points')} />
|
||||
<Box
|
||||
sx={{ display: 'flex', gap: 1, alignItems: 'center', flexWrap: 'wrap' }}
|
||||
>
|
||||
@@ -479,7 +505,7 @@ const FilterBuilderContent = ({
|
||||
}
|
||||
sx={{ cursor: 'pointer' }}
|
||||
>
|
||||
Clear
|
||||
{t('filterBuilder.clear')}
|
||||
</Chip>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
@@ -78,19 +78,19 @@ const dateOnly = date => ({
|
||||
const DUE_DATE_PRESETS = [
|
||||
{
|
||||
key: 'today',
|
||||
label: 'Today',
|
||||
labelKey: 'presetToday',
|
||||
resolve: () => dateOnly(moment()),
|
||||
hint: () => moment().format('ddd, MMM D'),
|
||||
},
|
||||
{
|
||||
key: 'tomorrow',
|
||||
label: 'Tomorrow',
|
||||
labelKey: 'presetTomorrow',
|
||||
resolve: () => dateOnly(moment().add(1, 'day')),
|
||||
hint: () => moment().add(1, 'day').format('ddd, MMM D'),
|
||||
},
|
||||
{
|
||||
key: 'next-week',
|
||||
label: 'Next week',
|
||||
labelKey: 'presetNextWeek',
|
||||
resolve: () => dateOnly(moment().add(1, 'week').startOf('isoWeek')),
|
||||
hint: () => moment().add(1, 'week').startOf('isoWeek').format('ddd, MMM D'),
|
||||
},
|
||||
@@ -189,18 +189,18 @@ const MultiSelectToolbar = ({
|
||||
}
|
||||
|
||||
const dueDateValue = summary.dueDate?.isMixed
|
||||
? 'Mixed'
|
||||
? t('multiToolbar.mixed')
|
||||
: summary.dueDate?.value
|
||||
? moment(summary.dueDate.value).format('MMM D')
|
||||
: null
|
||||
|
||||
const priorityValue = summary.priority?.isMixed
|
||||
? 'Mixed'
|
||||
? t('multiToolbar.mixed')
|
||||
: Priorities.find(p => p.value === summary.priority?.value)?.name.trim() ||
|
||||
null
|
||||
|
||||
const assigneeValue = summary.assignee?.isMixed
|
||||
? 'Mixed'
|
||||
? t('multiToolbar.mixed')
|
||||
: members.find(m => m.userId === summary.assignee?.value)?.displayName ||
|
||||
null
|
||||
|
||||
@@ -389,11 +389,11 @@ const MultiSelectToolbar = ({
|
||||
}}
|
||||
title={
|
||||
dueDateValue
|
||||
? `Due date on selected tasks: ${dueDateValue}`
|
||||
: 'Set due date on selected tasks'
|
||||
? t('multiToolbar.dueTitleSet', { value: dueDateValue })
|
||||
: t('multiToolbar.dueTitleEmpty')
|
||||
}
|
||||
>
|
||||
Due
|
||||
{t('multiToolbar.due')}
|
||||
</Button>
|
||||
<Menu
|
||||
size='md'
|
||||
@@ -414,7 +414,9 @@ const MultiSelectToolbar = ({
|
||||
<CalendarMonth sx={{ fontSize: 18 }} />
|
||||
</ListItemDecorator>
|
||||
<ListItemContent>
|
||||
<Typography level='body-sm'>{preset.label}</Typography>
|
||||
<Typography level='body-sm'>
|
||||
{t(`multiToolbar.${preset.labelKey}`)}
|
||||
</Typography>
|
||||
<Typography
|
||||
level='body-xs'
|
||||
sx={{ color: 'text.tertiary' }}
|
||||
@@ -435,7 +437,9 @@ const MultiSelectToolbar = ({
|
||||
<EditCalendar sx={{ fontSize: 18 }} />
|
||||
</ListItemDecorator>
|
||||
<ListItemContent>
|
||||
<Typography level='body-sm'>Pick date…</Typography>
|
||||
<Typography level='body-sm'>
|
||||
{t('multiToolbar.pickDate')}
|
||||
</Typography>
|
||||
</ListItemContent>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
@@ -449,7 +453,9 @@ const MultiSelectToolbar = ({
|
||||
<Remove sx={{ fontSize: 18 }} />
|
||||
</ListItemDecorator>
|
||||
<ListItemContent>
|
||||
<Typography level='body-sm'>No due date</Typography>
|
||||
<Typography level='body-sm'>
|
||||
{t('multiToolbar.noDueDate')}
|
||||
</Typography>
|
||||
</ListItemContent>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
@@ -500,9 +506,9 @@ const MultiSelectToolbar = ({
|
||||
sx={{
|
||||
'--Button-paddingInline': { xs: '0.75rem', sm: '1rem' },
|
||||
}}
|
||||
title='Move selected tasks to a project'
|
||||
title={t('multiToolbar.moveTitle')}
|
||||
>
|
||||
Move
|
||||
{t('multiToolbar.move')}
|
||||
</Button>
|
||||
<Menu
|
||||
size='md'
|
||||
@@ -514,14 +520,19 @@ const MultiSelectToolbar = ({
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
closeProjectMenu()
|
||||
onMoveToProject({ id: null, name: 'Default Project' })
|
||||
onMoveToProject({
|
||||
id: null,
|
||||
name: t('multiToolbar.defaultProject'),
|
||||
})
|
||||
}}
|
||||
>
|
||||
<ListItemDecorator>
|
||||
{renderProjectAvatar(LABEL_COLORS[0].value, 'FolderOpen')}
|
||||
</ListItemDecorator>
|
||||
<ListItemContent>
|
||||
<Typography level='body-sm'>Default Project</Typography>
|
||||
<Typography level='body-sm'>
|
||||
{t('multiToolbar.defaultProject')}
|
||||
</Typography>
|
||||
</ListItemContent>
|
||||
</MenuItem>
|
||||
{projects.map(project => (
|
||||
@@ -608,9 +619,9 @@ const MultiSelectToolbar = ({
|
||||
sx={{
|
||||
'--Button-paddingInline': { xs: '0.75rem', sm: '1rem' },
|
||||
}}
|
||||
title='Set priority, assignee, or labels'
|
||||
title={t('multiToolbar.moreTitle')}
|
||||
>
|
||||
More
|
||||
{t('multiToolbar.more')}
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
@@ -634,7 +645,7 @@ const MultiSelectToolbar = ({
|
||||
onClick={() => setMoreOpen(false)}
|
||||
sx={{ minWidth: 140 }}
|
||||
>
|
||||
Done
|
||||
{t('multiToolbar.done')}
|
||||
</Button>
|
||||
}
|
||||
>
|
||||
@@ -646,7 +657,7 @@ const MultiSelectToolbar = ({
|
||||
<>
|
||||
<SectionHeader
|
||||
icon={<Flag />}
|
||||
label='Priority'
|
||||
label={t('multiToolbar.priority')}
|
||||
value={priorityValue}
|
||||
/>
|
||||
<ChipRow>
|
||||
@@ -677,7 +688,7 @@ const MultiSelectToolbar = ({
|
||||
onClick={runAndClose(() => onSetPriority(0))}
|
||||
sx={selectableChipSx}
|
||||
>
|
||||
None
|
||||
{t('multiToolbar.noPriority')}
|
||||
</Chip>
|
||||
</ChipRow>
|
||||
</>
|
||||
@@ -688,7 +699,7 @@ const MultiSelectToolbar = ({
|
||||
<Divider sx={{ my: 2.5 }} />
|
||||
<SectionHeader
|
||||
icon={<Person />}
|
||||
label='Assignee'
|
||||
label={t('multiToolbar.assignee')}
|
||||
value={assigneeValue}
|
||||
/>
|
||||
<ChipRow>
|
||||
@@ -731,8 +742,8 @@ const MultiSelectToolbar = ({
|
||||
only some of the selection has it — tapping completes the set. */}
|
||||
<SectionHeader
|
||||
icon={<LabelIcon />}
|
||||
label='Labels'
|
||||
value='Tap to add · tap again to remove'
|
||||
label={t('multiToolbar.labels')}
|
||||
value={t('multiToolbar.labelsHint')}
|
||||
/>
|
||||
<ChipRow>
|
||||
{labels.map(label => {
|
||||
|
||||
@@ -180,11 +180,11 @@ const ChoresOverview = () => {
|
||||
<thead>
|
||||
<tr>
|
||||
{/* first column has minium size because its icon */}
|
||||
<th style={{ width: 100 }}>Due</th>
|
||||
<th>Chore</th>
|
||||
<th>Assignee</th>
|
||||
<th>Due</th>
|
||||
<th>Action</th>
|
||||
<th style={{ width: 100 }}>{t('overview.colDue')}</th>
|
||||
<th>{t('overview.colChore')}</th>
|
||||
<th>{t('overview.colAssignee')}</th>
|
||||
<th>{t('overview.colDue')}</th>
|
||||
<th>{t('overview.colAction')}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Box, Button, CircularProgress, Input, Typography } from '@mui/joy'
|
||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useNavigate, useSearchParams } from 'react-router-dom'
|
||||
|
||||
import useAcknowledgmentModal from '../../hooks/useAcknowledgmentModal'
|
||||
@@ -23,6 +24,7 @@ const enter = (delay = 0) => ({
|
||||
})
|
||||
|
||||
const JoinCircleView = () => {
|
||||
const { t } = useTranslation()
|
||||
const { data: userProfile, isLoading: isProfileLoading } = useUserProfile()
|
||||
// Read the token rather than useAuth(): the provider's copy only updates
|
||||
// through its own login(), so signup and the OAuth callback — which save
|
||||
@@ -49,20 +51,18 @@ const JoinCircleView = () => {
|
||||
clearPendingInvite()
|
||||
if (resp.ok) {
|
||||
showAcknowledgment(
|
||||
'Your request has been sent. A circle admin will need to approve ' +
|
||||
"it before you can access the circle and its chores. We'll " +
|
||||
"notify you when it's approved.",
|
||||
'Request sent',
|
||||
t('joinCircle.requestSentBody'),
|
||||
t('joinCircle.requestSentTitle'),
|
||||
() => navigate('/chores'),
|
||||
'Got it',
|
||||
t('joinCircle.gotIt'),
|
||||
'success',
|
||||
)
|
||||
} else {
|
||||
setIsJoining(false)
|
||||
if (resp.status === 409) {
|
||||
showError('You are already a member of this circle')
|
||||
showError(t('joinCircle.alreadyMember'))
|
||||
} else {
|
||||
showError('Failed to join circle')
|
||||
showError(t('joinCircle.joinFailed'))
|
||||
}
|
||||
navigate('/chores')
|
||||
}
|
||||
@@ -70,9 +70,9 @@ const JoinCircleView = () => {
|
||||
.catch(() => {
|
||||
setIsJoining(false)
|
||||
clearPendingInvite()
|
||||
showError('Could not send your join request. Please try again.')
|
||||
showError(t('joinCircle.requestError'))
|
||||
})
|
||||
}, [code, navigate, showAcknowledgment, showError])
|
||||
}, [code, navigate, showAcknowledgment, showError, t])
|
||||
|
||||
// Coming back from login/signup the user already said yes by opening the
|
||||
// link, so send the request instead of asking a second time. This step used
|
||||
@@ -102,14 +102,13 @@ const JoinCircleView = () => {
|
||||
/>
|
||||
)
|
||||
|
||||
let title = "You're invited to join a circle"
|
||||
let title = t('joinCircle.title')
|
||||
let subtitle = null
|
||||
let body = null
|
||||
|
||||
if (!code) {
|
||||
title = 'Invite link is incomplete'
|
||||
subtitle =
|
||||
'This invite link is missing a code. Ask the person who invited you to send a new link.'
|
||||
title = t('joinCircle.incompleteTitle')
|
||||
subtitle = t('joinCircle.incompleteSubtitle')
|
||||
body = (
|
||||
<Button
|
||||
fullWidth
|
||||
@@ -117,14 +116,13 @@ const JoinCircleView = () => {
|
||||
sx={authButtonSx}
|
||||
onClick={() => navigate('/chores')}
|
||||
>
|
||||
Go to Donetick
|
||||
{t('joinCircle.goToDonetick')}
|
||||
</Button>
|
||||
)
|
||||
// A token that no longer resolves to a profile is as good as signed out —
|
||||
// better to offer sign-in than to spin forever.
|
||||
} else if (!isAuthenticated || (!isProfileLoading && !userProfile)) {
|
||||
subtitle =
|
||||
"Sign in or create a Donetick account to continue. We'll send your join request once you're signed in."
|
||||
subtitle = t('joinCircle.signedOutSubtitle')
|
||||
body = (
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 1.5 }}>
|
||||
{inviteCodeField}
|
||||
@@ -134,7 +132,7 @@ const JoinCircleView = () => {
|
||||
sx={authButtonSx}
|
||||
onClick={() => goToAuth('/login')}
|
||||
>
|
||||
Sign in
|
||||
{t('joinCircle.signIn')}
|
||||
</Button>
|
||||
<Button
|
||||
fullWidth
|
||||
@@ -144,32 +142,32 @@ const JoinCircleView = () => {
|
||||
sx={authButtonSx}
|
||||
onClick={() => goToAuth('/signup')}
|
||||
>
|
||||
Create an account
|
||||
{t('joinCircle.createAccount')}
|
||||
</Button>
|
||||
</Box>
|
||||
)
|
||||
} else if (isProfileLoading || isJoining) {
|
||||
title = 'Sending your request'
|
||||
subtitle = 'Sending your request…'
|
||||
title = t('joinCircle.sendingTitle')
|
||||
subtitle = t('joinCircle.sendingSubtitle')
|
||||
body = (
|
||||
<Box sx={{ display: 'flex', justifyContent: 'center', py: 2 }}>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
)
|
||||
} else {
|
||||
subtitle =
|
||||
`Hi ${userProfile?.displayName || userProfile?.username}. ` +
|
||||
"Send a request to share this circle's chores with its members."
|
||||
subtitle = t('joinCircle.greetingSubtitle', {
|
||||
name: userProfile?.displayName || userProfile?.username,
|
||||
})
|
||||
body = (
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 1.5 }}>
|
||||
<Typography
|
||||
level='body-sm'
|
||||
sx={{ textAlign: 'center', color: 'text.secondary' }}
|
||||
>
|
||||
A circle admin will review your request before you get access.
|
||||
{t('joinCircle.adminReviewNote')}
|
||||
</Typography>
|
||||
<Button fullWidth size='lg' sx={authButtonSx} onClick={submitJoin}>
|
||||
Send join request
|
||||
{t('joinCircle.sendRequest')}
|
||||
</Button>
|
||||
<Button
|
||||
fullWidth
|
||||
@@ -182,7 +180,7 @@ const JoinCircleView = () => {
|
||||
navigate('/chores')
|
||||
}}
|
||||
>
|
||||
Cancel
|
||||
{t('common:cancel')}
|
||||
</Button>
|
||||
</Box>
|
||||
)
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
Typography,
|
||||
} from '@mui/joy'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
import { useResponsiveModal } from '../../hooks/useResponsiveModal.js'
|
||||
import {
|
||||
@@ -106,6 +107,7 @@ const IconHalo = ({ color = 'primary', icon }) => (
|
||||
*/
|
||||
const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
const { ResponsiveModal } = useResponsiveModal()
|
||||
const { t } = useTranslation('common')
|
||||
const isBugReport = !error
|
||||
|
||||
const [report, setReport] = useState(null)
|
||||
@@ -175,21 +177,25 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
level='h4'
|
||||
sx={{ fontWeight: 700, letterSpacing: '-0.01em' }}
|
||||
>
|
||||
{isBugReport ? 'Report an issue' : 'Report this problem'}
|
||||
{isBugReport
|
||||
? t('errorReport.titleBug')
|
||||
: t('errorReport.titleCrash')}
|
||||
</Typography>
|
||||
<Typography
|
||||
level='body-sm'
|
||||
sx={{ color: 'text.secondary', mt: 0.5, textWrap: 'pretty' }}
|
||||
>
|
||||
{isBugReport
|
||||
? 'Tell us what went wrong and we’ll attach the technical details for you.'
|
||||
: 'A sentence about what you were doing turns this into something we can actually fix.'}
|
||||
? t('errorReport.subtitleBug')
|
||||
: t('errorReport.subtitleCrash')}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
<FormControl sx={{ ...enter(100) }}>
|
||||
<FormLabel sx={{ fontWeight: 600 }}>
|
||||
{isBugReport ? 'What went wrong?' : 'What were you doing?'}
|
||||
{isBugReport
|
||||
? t('errorReport.labelBug')
|
||||
: t('errorReport.labelCrash')}
|
||||
</FormLabel>
|
||||
<Textarea
|
||||
minRows={3}
|
||||
@@ -199,24 +205,24 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
onChange={e => setDescription(e.target.value)}
|
||||
placeholder={
|
||||
isBugReport
|
||||
? 'e.g. Completing a chore from the list doesn’t update the due date'
|
||||
: 'e.g. I tapped a chore in My Chores and the screen went blank'
|
||||
? t('errorReport.placeholderBug')
|
||||
: t('errorReport.placeholderCrash')
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
|
||||
<FormControl sx={{ ...enter(140) }}>
|
||||
<FormLabel sx={{ fontWeight: 600 }}>
|
||||
Email{' '}
|
||||
{t('errorReport.email')}{' '}
|
||||
<Typography level='body-xs' sx={{ color: 'text.tertiary' }}>
|
||||
(optional — only if you want a reply)
|
||||
{t('errorReport.emailOptional')}
|
||||
</Typography>
|
||||
</FormLabel>
|
||||
<Input
|
||||
type='email'
|
||||
value={email}
|
||||
onChange={e => setEmail(e.target.value)}
|
||||
placeholder='you@example.com'
|
||||
placeholder={t('errorReport.emailPlaceholder')}
|
||||
/>
|
||||
</FormControl>
|
||||
|
||||
@@ -236,7 +242,9 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
}
|
||||
sx={{ px: 0 }}
|
||||
>
|
||||
{showDetails ? 'Hide' : 'Show'} what gets sent
|
||||
{showDetails
|
||||
? t('errorReport.hideWhatGetsSent')
|
||||
: t('errorReport.showWhatGetsSent')}
|
||||
</Button>
|
||||
|
||||
{showDetails && (
|
||||
@@ -258,7 +266,7 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
color={copied ? 'success' : 'neutral'}
|
||||
onClick={copyDetails}
|
||||
sx={{ position: 'absolute', top: 6, right: 6, minWidth: 0 }}
|
||||
aria-label='Copy diagnostics'
|
||||
aria-label={t('errorReport.copyDiagnostics')}
|
||||
>
|
||||
{copied ? (
|
||||
<CheckRounded fontSize='small' />
|
||||
@@ -276,7 +284,7 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
color: 'text.secondary',
|
||||
}}
|
||||
>
|
||||
{reportText || 'Collecting diagnostics…'}
|
||||
{reportText || t('errorReport.collecting')}
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
@@ -284,7 +292,7 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
level='body-xs'
|
||||
sx={{ color: 'text.tertiary', mt: 1, display: 'block' }}
|
||||
>
|
||||
No chore names, notes or attachments are included.
|
||||
{t('errorReport.privacyNote')}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
@@ -298,7 +306,7 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
disabled={!report || (isBugReport && !description.trim())}
|
||||
onClick={handleSubmit}
|
||||
>
|
||||
Send report
|
||||
{t('errorReport.send')}
|
||||
</Button>
|
||||
<Box sx={{ textAlign: 'center' }}>
|
||||
<Link
|
||||
@@ -309,7 +317,9 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
underline='hover'
|
||||
onClick={onClose}
|
||||
>
|
||||
{isBugReport ? 'Cancel' : 'Not now'}
|
||||
{isBugReport
|
||||
? t('errorReport.cancel')
|
||||
: t('errorReport.notNow')}
|
||||
</Link>
|
||||
</Box>
|
||||
</Stack>
|
||||
@@ -323,13 +333,13 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
</Box>
|
||||
<Box sx={{ ...enter(50) }}>
|
||||
<Typography level='h4' sx={{ fontWeight: 700 }}>
|
||||
Report sent
|
||||
{t('errorReport.sentTitle')}
|
||||
</Typography>
|
||||
<Typography
|
||||
level='body-sm'
|
||||
sx={{ color: 'text.secondary', mt: 0.5 }}
|
||||
>
|
||||
Thanks! this goes straight to the people who can fix it.
|
||||
{t('errorReport.sentBody')}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
@@ -350,7 +360,7 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
>
|
||||
<Box sx={{ textAlign: 'left' }}>
|
||||
<Typography level='body-xs' sx={{ color: 'text.tertiary' }}>
|
||||
Reference
|
||||
{t('errorReport.reference')}
|
||||
</Typography>
|
||||
<Typography
|
||||
sx={{
|
||||
@@ -371,14 +381,14 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
setTimeout(() => setCopied(false), 2000)
|
||||
}}
|
||||
sx={{ minWidth: 0 }}
|
||||
aria-label='Copy reference'
|
||||
aria-label={t('errorReport.copyReference')}
|
||||
>
|
||||
{copied ? <CheckRounded /> : <ContentCopyRounded />}
|
||||
</Button>
|
||||
</Box>
|
||||
|
||||
<Button size='lg' fullWidth onClick={onClose} sx={{ ...enter(150) }}>
|
||||
Done
|
||||
{t('errorReport.done')}
|
||||
</Button>
|
||||
</Stack>
|
||||
)}
|
||||
@@ -390,15 +400,13 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
</Box>
|
||||
<Box sx={{ ...enter(50) }}>
|
||||
<Typography level='h4' sx={{ fontWeight: 700 }}>
|
||||
Finish on GitHub
|
||||
{t('errorReport.githubTitle')}
|
||||
</Typography>
|
||||
<Typography
|
||||
level='body-sm'
|
||||
sx={{ color: 'text.secondary', mt: 0.5, textWrap: 'pretty' }}
|
||||
>
|
||||
Nothing has been sent. We've filled in an issue with your
|
||||
notes and the diagnostics — review it and post when you're
|
||||
happy with it.
|
||||
{t('errorReport.githubBody')}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Stack spacing={1} sx={{ ...enter(100) }}>
|
||||
@@ -411,7 +419,7 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
onClose()
|
||||
}}
|
||||
>
|
||||
Open pre-filled issue
|
||||
{t('errorReport.openIssue')}
|
||||
</Button>
|
||||
<Button
|
||||
variant='plain'
|
||||
@@ -421,7 +429,7 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
}
|
||||
onClick={copyDetails}
|
||||
>
|
||||
{copied ? 'Copied' : 'Copy details instead'}
|
||||
{copied ? t('errorReport.copied') : t('errorReport.copyInstead')}
|
||||
</Button>
|
||||
<Box sx={{ textAlign: 'center' }}>
|
||||
<Link
|
||||
@@ -432,7 +440,7 @@ const ErrorReportModal = ({ error, errorInfo, onClose, open }) => {
|
||||
underline='hover'
|
||||
onClick={onClose}
|
||||
>
|
||||
Close
|
||||
{t('errorReport.close')}
|
||||
</Link>
|
||||
</Box>
|
||||
</Stack>
|
||||
|
||||
@@ -202,7 +202,7 @@ const AdvancedFilterBuilder = ({
|
||||
{FILTER_COLORS.map(c => (
|
||||
<Box
|
||||
key={c.value}
|
||||
title={t(`common:colors.${c.key}`)}
|
||||
title={t(`common:colors.${c.name}`)}
|
||||
onClick={() => setFilterColor(c.value)}
|
||||
sx={{
|
||||
width: 26,
|
||||
|
||||
@@ -104,7 +104,7 @@ function BackupRestoreModal({ isOpen, onClose, showNotification }) {
|
||||
handleClose()
|
||||
} else {
|
||||
const errorData = await response.json()
|
||||
setError(errorData.message || 'Failed to create backup')
|
||||
setError(errorData.message || t('backup.createFailed'))
|
||||
}
|
||||
} catch (err) {
|
||||
setError(t('backup.createFailed'))
|
||||
@@ -156,7 +156,7 @@ function BackupRestoreModal({ isOpen, onClose, showNotification }) {
|
||||
handleClose()
|
||||
} else {
|
||||
const errorData = await response.json()
|
||||
setError(errorData.message || 'Failed to restore backup')
|
||||
setError(errorData.message || t('backup.restoreFailed'))
|
||||
}
|
||||
} catch (err) {
|
||||
setError(t('backup.restoreFailed'))
|
||||
@@ -288,7 +288,7 @@ function BackupRestoreModal({ isOpen, onClose, showNotification }) {
|
||||
size='lg'
|
||||
fullWidth={true}
|
||||
unmountDelay={250}
|
||||
title='Backup & Restore'
|
||||
title={t('backup.title')}
|
||||
closeOnBackdrop={!loading}
|
||||
closeOnEscape={!loading}
|
||||
footer={
|
||||
@@ -299,7 +299,8 @@ function BackupRestoreModal({ isOpen, onClose, showNotification }) {
|
||||
disabled: loading,
|
||||
}}
|
||||
primary={{
|
||||
label: activeTab === 0 ? 'Create Backup' : 'Restore Backup',
|
||||
label:
|
||||
activeTab === 0 ? t('backup.createTab') : t('backup.restoreTab'),
|
||||
color: activeTab === 0 ? 'primary' : 'warning',
|
||||
onClick: activeTab === 0 ? handleCreateBackup : handleRestore,
|
||||
loading,
|
||||
@@ -320,7 +321,7 @@ function BackupRestoreModal({ isOpen, onClose, showNotification }) {
|
||||
>
|
||||
<CircularProgress />
|
||||
<Typography level='body-md' sx={{ ml: 2 }}>
|
||||
{activeTab === 0 ? 'Creating backup...' : 'Restoring backup...'}
|
||||
{activeTab === 0 ? t('backup.creating') : t('backup.restoring')}
|
||||
</Typography>
|
||||
</Box>
|
||||
) : (
|
||||
@@ -329,8 +330,8 @@ function BackupRestoreModal({ isOpen, onClose, showNotification }) {
|
||||
onChange={(event, newValue) => setActiveTab(newValue)}
|
||||
>
|
||||
<TabList>
|
||||
<Tab>Create Backup</Tab>
|
||||
<Tab>Restore Backup</Tab>
|
||||
<Tab>{t('backup.createTab')}</Tab>
|
||||
<Tab>{t('backup.restoreTab')}</Tab>
|
||||
</TabList>
|
||||
|
||||
<TabPanel value={0}>{renderBackupTab()}</TabPanel>
|
||||
|
||||
@@ -90,7 +90,7 @@ const IconPickerModal = ({
|
||||
lineHeight: 1.2,
|
||||
}}
|
||||
>
|
||||
{t(`icons.${iconData.key}`)}
|
||||
{t(`icons.${iconData.value}`)}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Grid>
|
||||
|
||||
@@ -1,27 +1,38 @@
|
||||
import { Box, Typography } from '@mui/joy'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
|
||||
import ModalActions from '../../../components/common/ModalActions'
|
||||
import { useResponsiveModal } from '../../../hooks/useResponsiveModal'
|
||||
|
||||
// The store steps embed bolded UI names mid-sentence, so they go through
|
||||
// <Trans> rather than t() — translators keep the emphasis where their own
|
||||
// word order needs it.
|
||||
const Step = ({ i18nKey, ...props }) => (
|
||||
<Typography level='body-sm' {...props}>
|
||||
<Trans i18nKey={i18nKey} ns='settings' components={{ b: <strong /> }} />
|
||||
</Typography>
|
||||
)
|
||||
|
||||
const NativeCancelSubscriptionModal = ({ isOpen, onClose }) => {
|
||||
const { ResponsiveModal } = useResponsiveModal()
|
||||
const { t } = useTranslation('settings')
|
||||
|
||||
return (
|
||||
<ResponsiveModal
|
||||
open={isOpen}
|
||||
onClose={onClose}
|
||||
size='lg'
|
||||
title='Cancel Subscription'
|
||||
title={t('nativeCancel.title')}
|
||||
footer={
|
||||
<ModalActions
|
||||
stackOnMobile
|
||||
tertiary={{ label: 'Dismiss', onClick: onClose }}
|
||||
tertiary={{ label: t('nativeCancel.dismiss'), onClick: onClose }}
|
||||
secondary={{
|
||||
label: "I'll cancel from my app store",
|
||||
label: t('nativeCancel.cancelViaStore'),
|
||||
onClick: onClose,
|
||||
}}
|
||||
primary={{
|
||||
label: 'Cancel desktop subscription',
|
||||
label: t('nativeCancel.cancelDesktop'),
|
||||
color: 'danger',
|
||||
onClick: () => onClose('desktop'),
|
||||
}}
|
||||
@@ -30,87 +41,46 @@ const NativeCancelSubscriptionModal = ({ isOpen, onClose }) => {
|
||||
>
|
||||
<Box>
|
||||
<Typography level='body-md' mb={3}>
|
||||
To cancel your subscription, please follow the instructions for your
|
||||
platform (you should cancel through the same platform you used to
|
||||
subscribe).
|
||||
{t('nativeCancel.intro')}
|
||||
</Typography>
|
||||
|
||||
<Box mb={3}>
|
||||
<Typography level='title-md' mb={2} color='primary'>
|
||||
For iOS (iPhone/iPad):
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
1. Open the <strong>Settings</strong> app on your device
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
2. Tap your name at the top of the screen
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
3. Tap <strong>Subscriptions</strong>
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
4. Find and tap <strong>Donetick</strong>
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={2}>
|
||||
5. Tap <strong>Cancel Subscription</strong>
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={2} color='warning'>
|
||||
<strong>Note:</strong> If you subscribed through iOS and are using
|
||||
the web/desktop version, you must cancel through iOS Settings as
|
||||
described above.
|
||||
{t('nativeCancel.iosHeading')}
|
||||
</Typography>
|
||||
<Step i18nKey='nativeCancel.iosStep1' mb={1} />
|
||||
<Step i18nKey='nativeCancel.iosStep2' mb={1} />
|
||||
<Step i18nKey='nativeCancel.iosStep3' mb={1} />
|
||||
<Step i18nKey='nativeCancel.iosStep4' mb={1} />
|
||||
<Step i18nKey='nativeCancel.iosStep5' mb={2} />
|
||||
<Step i18nKey='nativeCancel.iosNote' mb={2} color='warning' />
|
||||
</Box>
|
||||
|
||||
<Box mb={3}>
|
||||
<Typography level='title-md' mb={2} color='primary'>
|
||||
For Android:
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
1. Open the <strong>Google Play Store</strong> app
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
2. Tap the profile icon in the top right
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
3. Tap <strong>Payments & subscriptions</strong>
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
4. Tap <strong>Subscriptions</strong>
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
5. Find and tap <strong>Donetick</strong>
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={2}>
|
||||
6. Tap <strong>Cancel subscription</strong>
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={2} color='warning'>
|
||||
<strong>Note:</strong> If you subscribed through Google Play and are
|
||||
using the web/desktop version, you must cancel through Google Play
|
||||
as described above.
|
||||
{t('nativeCancel.androidHeading')}
|
||||
</Typography>
|
||||
<Step i18nKey='nativeCancel.androidStep1' mb={1} />
|
||||
<Step i18nKey='nativeCancel.androidStep2' mb={1} />
|
||||
<Step i18nKey='nativeCancel.androidStep3' mb={1} />
|
||||
<Step i18nKey='nativeCancel.androidStep4' mb={1} />
|
||||
<Step i18nKey='nativeCancel.androidStep5' mb={1} />
|
||||
<Step i18nKey='nativeCancel.androidStep6' mb={2} />
|
||||
<Step i18nKey='nativeCancel.androidNote' mb={2} color='warning' />
|
||||
</Box>
|
||||
|
||||
<Box mb={3}>
|
||||
<Typography level='title-md' mb={2} color='primary'>
|
||||
For Web/Desktop Subscriptions:
|
||||
{t('nativeCancel.webHeading')}
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={2}>
|
||||
If you originally subscribed through our website or desktop app, you
|
||||
can cancel your subscription by going to the Account Settings
|
||||
section on our website. using a web browser
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={2} color='warning'>
|
||||
<strong>Important:</strong> You must cancel your subscription
|
||||
through the same platform where you originally subscribed. If you
|
||||
subscribed through the iOS App Store or Google Play Store (even if
|
||||
you're now using the web/desktop version), you must cancel
|
||||
through that original platform using the instructions above.
|
||||
{t('nativeCancel.webBody')}
|
||||
</Typography>
|
||||
<Step i18nKey='nativeCancel.webNote' mb={2} color='warning' />
|
||||
</Box>
|
||||
|
||||
<Typography level='body-sm' mb={3} color='neutral'>
|
||||
Your subscription will remain active until the end of your current
|
||||
billing period.
|
||||
{t('nativeCancel.footer')}
|
||||
</Typography>
|
||||
</Box>
|
||||
</ResponsiveModal>
|
||||
|
||||
@@ -18,7 +18,7 @@ function PasswordChangeModal({ isOpen, onClose }) {
|
||||
if (!passwordTouched || !confirmPasswordTouched) return
|
||||
|
||||
if (password !== confirmPassword) {
|
||||
setPasswordError('Passwords do not match')
|
||||
setPasswordError(t('passwordChange.mismatch'))
|
||||
} else if (password.length < 8) {
|
||||
setPasswordError(t('passwordChange.minLength'))
|
||||
} else if (password.length > 64) {
|
||||
@@ -42,7 +42,7 @@ function PasswordChangeModal({ isOpen, onClose }) {
|
||||
onClose={() => handleAction(false)}
|
||||
size='sm'
|
||||
title={t('accountSettings.changePassword')}
|
||||
description='Choose a password between 8 and 64 characters.'
|
||||
description={t('passwordChange.description')}
|
||||
footer={
|
||||
<ModalActions
|
||||
secondary={{
|
||||
@@ -58,13 +58,15 @@ function PasswordChangeModal({ isOpen, onClose }) {
|
||||
}
|
||||
>
|
||||
<FormControl sx={{ mb: 2 }}>
|
||||
<Typography level='body-sm'>New password</Typography>
|
||||
<Typography level='body-sm'>
|
||||
{t('passwordChange.newPassword')}
|
||||
</Typography>
|
||||
<Input
|
||||
required
|
||||
name='password'
|
||||
type='password'
|
||||
autoComplete='new-password'
|
||||
placeholder='Enter password'
|
||||
placeholder={t('passwordChange.newPasswordPlaceholder')}
|
||||
value={password}
|
||||
onChange={event => {
|
||||
setPasswordTouched(true)
|
||||
@@ -74,13 +76,15 @@ function PasswordChangeModal({ isOpen, onClose }) {
|
||||
</FormControl>
|
||||
|
||||
<FormControl error={Boolean(passwordError)}>
|
||||
<Typography level='body-sm'>Confirm password</Typography>
|
||||
<Typography level='body-sm'>
|
||||
{t('passwordChange.confirmPassword')}
|
||||
</Typography>
|
||||
<Input
|
||||
required
|
||||
name='confirmPassword'
|
||||
type='password'
|
||||
autoComplete='new-password'
|
||||
placeholder='Repeat password'
|
||||
placeholder={t('passwordChange.confirmPasswordPlaceholder')}
|
||||
value={confirmPassword}
|
||||
onChange={event => {
|
||||
setConfirmPasswordTouched(true)
|
||||
|
||||
@@ -151,7 +151,7 @@ const ProjectModal = ({ isOpen, onClose, onSave, project }) => {
|
||||
<Stack spacing={3}>
|
||||
{/* Project Name */}
|
||||
<FormControl required>
|
||||
<FormLabel>Project Name</FormLabel>
|
||||
<FormLabel>{t('modal.nameLabel')}</FormLabel>
|
||||
<Input
|
||||
value={projectName}
|
||||
onChange={e => setProjectName(e.target.value)}
|
||||
@@ -163,7 +163,7 @@ const ProjectModal = ({ isOpen, onClose, onSave, project }) => {
|
||||
|
||||
{/* Project Description */}
|
||||
<FormControl>
|
||||
<FormLabel>Description</FormLabel>
|
||||
<FormLabel>{t('modal.descriptionLabel')}</FormLabel>
|
||||
<Textarea
|
||||
value={projectDescription}
|
||||
onChange={e => setProjectDescription(e.target.value)}
|
||||
@@ -176,7 +176,7 @@ const ProjectModal = ({ isOpen, onClose, onSave, project }) => {
|
||||
|
||||
{/* Icon Selection */}
|
||||
<FormControl>
|
||||
<FormLabel>Project Icon</FormLabel>
|
||||
<FormLabel>{t('modal.iconLabel')}</FormLabel>
|
||||
<Button
|
||||
variant='outlined'
|
||||
onClick={() => setIsIconPickerOpen(true)}
|
||||
@@ -212,19 +212,20 @@ const ProjectModal = ({ isOpen, onClose, onSave, project }) => {
|
||||
}
|
||||
sx={{ justifyContent: 'flex-start' }}
|
||||
>
|
||||
{PROJECT_ICONS.find(icon => icon.value === projectIcon)?.name ||
|
||||
'Select Icon'}
|
||||
{PROJECT_ICONS.some(icon => icon.value === projectIcon)
|
||||
? t(`icons.${projectIcon}`)
|
||||
: t('modal.selectIcon')}
|
||||
</Button>
|
||||
</FormControl>
|
||||
|
||||
{/* Color Selection */}
|
||||
<FormControl>
|
||||
<FormLabel>Project Color</FormLabel>
|
||||
<FormLabel>{t('modal.colorLabel')}</FormLabel>
|
||||
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1 }}>
|
||||
{PROJECT_COLORS.map(colorOption => (
|
||||
<Box
|
||||
key={colorOption.value}
|
||||
title={colorOption.name}
|
||||
title={t(`common:colors.${colorOption.name}`)}
|
||||
onClick={() => setProjectColor(colorOption.value)}
|
||||
sx={{
|
||||
width: 26,
|
||||
|
||||
@@ -17,6 +17,10 @@ import ModalActions from '../../../components/common/ModalActions'
|
||||
import { useResponsiveModal } from '../../../hooks/useResponsiveModal'
|
||||
import { CheckUserDeletion, DeleteUser } from '../../../utils/Fetcher'
|
||||
|
||||
// Sent verbatim to the delete endpoint, so it stays English in every locale —
|
||||
// the label around it is what gets translated.
|
||||
const CONFIRMATION_WORD = 'DELETE'
|
||||
|
||||
function UserDeletionModal({ isOpen, onClose }) {
|
||||
const { t } = useTranslation('settings')
|
||||
const { ResponsiveModal } = useResponsiveModal()
|
||||
@@ -99,7 +103,7 @@ function UserDeletionModal({ isOpen, onClose }) {
|
||||
}
|
||||
|
||||
const executeUserDeletion = async () => {
|
||||
if (password.trim() === '' || confirmation !== 'DELETE') {
|
||||
if (password.trim() === '' || confirmation !== CONFIRMATION_WORD) {
|
||||
setError(t('deletion.passwordAndDelete'))
|
||||
return
|
||||
}
|
||||
@@ -153,33 +157,27 @@ function UserDeletionModal({ isOpen, onClose }) {
|
||||
const renderWarningStep = () => (
|
||||
<>
|
||||
<Typography level='body-md' mb={2}>
|
||||
<strong>This action cannot be undone.</strong> Deleting your account
|
||||
will permanently remove:
|
||||
<strong>{t('deletion.warningLead')}</strong>{' '}
|
||||
{t('deletion.warningIntro')}
|
||||
</Typography>
|
||||
|
||||
<Box mb={3}>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
• Your user profile and authentication data
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
• All your chores, chore history, and time tracking sessions
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
• API tokens, MFA sessions, and password reset tokens
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
• Storage files and usage data
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
• Points history and notifications
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={1}>
|
||||
• Circle memberships and relationships
|
||||
</Typography>
|
||||
{[
|
||||
'removesProfile',
|
||||
'removesChores',
|
||||
'removesTokens',
|
||||
'removesStorage',
|
||||
'removesPoints',
|
||||
'removesCircles',
|
||||
].map(key => (
|
||||
<Typography key={key} level='body-sm' mb={1}>
|
||||
• {t(`deletion.${key}`)}
|
||||
</Typography>
|
||||
))}
|
||||
</Box>
|
||||
|
||||
<FormControl sx={{ mb: 2 }}>
|
||||
<FormLabel>Enter your password to continue</FormLabel>
|
||||
<FormLabel>{t('deletion.passwordToContinue')}</FormLabel>
|
||||
<Input
|
||||
type='password'
|
||||
value={password}
|
||||
@@ -200,16 +198,15 @@ function UserDeletionModal({ isOpen, onClose }) {
|
||||
<>
|
||||
<Typography level='body-md' mb={3}>
|
||||
{t('deletion.transferIntro')}
|
||||
select new owners:
|
||||
</Typography>
|
||||
|
||||
{circlesRequiringTransfer.map(circle => (
|
||||
<Card key={circle.id} sx={{ mb: 2, p: 2 }}>
|
||||
<Typography level='title-sm' mb={1}>
|
||||
Circle: {circle.name}
|
||||
{t('deletion.circleLabel', { name: circle.name })}
|
||||
</Typography>
|
||||
<FormControl>
|
||||
<FormLabel>New Owner</FormLabel>
|
||||
<FormLabel>{t('deletion.newOwner')}</FormLabel>
|
||||
<Select
|
||||
placeholder={t('deletion.selectOwner')}
|
||||
value={
|
||||
@@ -243,12 +240,11 @@ function UserDeletionModal({ isOpen, onClose }) {
|
||||
{t('deletion.confirmPrompt')}
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={2}>
|
||||
on successful deletion, you will be logged out and redirected to the
|
||||
login page.
|
||||
{t('deletion.logoutNotice')}
|
||||
</Typography>
|
||||
|
||||
<FormControl sx={{ mb: 2 }}>
|
||||
<FormLabel>Password</FormLabel>
|
||||
<FormLabel>{t('deletion.passwordLabel')}</FormLabel>
|
||||
<Input
|
||||
type='password'
|
||||
value={password}
|
||||
@@ -258,7 +254,9 @@ function UserDeletionModal({ isOpen, onClose }) {
|
||||
</FormControl>
|
||||
|
||||
<FormControl sx={{ mb: 3 }}>
|
||||
<FormLabel>Type "DELETE" to confirm</FormLabel>
|
||||
<FormLabel>
|
||||
{t('deletion.typeToConfirm', { word: CONFIRMATION_WORD })}
|
||||
</FormLabel>
|
||||
<Input
|
||||
value={confirmation}
|
||||
onChange={e => setConfirmation(e.target.value)}
|
||||
@@ -323,7 +321,7 @@ function UserDeletionModal({ isOpen, onClose }) {
|
||||
? !password
|
||||
: step === 2
|
||||
? circlesRequiringTransfer.length !== transferOptions.length
|
||||
: !password || confirmation !== 'DELETE',
|
||||
: !password || confirmation !== CONFIRMATION_WORD,
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
} from '@mui/icons-material'
|
||||
import { Box, Button, IconButton, Input, Link, Typography } from '@mui/joy'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
|
||||
import useAcknowledgmentModal from '../../hooks/useAcknowledgmentModal'
|
||||
@@ -80,6 +81,7 @@ const IconHalo = ({ icon }) => (
|
||||
* a gate.
|
||||
*/
|
||||
const CircleSetupView = () => {
|
||||
const { t } = useTranslation()
|
||||
const navigate = useNavigate()
|
||||
const { showNotification } = useNotification()
|
||||
const { ackModalConfig, showAcknowledgment } = useAcknowledgmentModal()
|
||||
@@ -101,14 +103,20 @@ const CircleSetupView = () => {
|
||||
|
||||
const copyCode = () => {
|
||||
navigator.clipboard.writeText(inviteCode)
|
||||
showNotification({ type: 'success', message: 'Code copied to clipboard' })
|
||||
showNotification({
|
||||
type: 'success',
|
||||
message: t('circleSetup.codeCopied'),
|
||||
})
|
||||
}
|
||||
|
||||
const copyLink = () => {
|
||||
navigator.clipboard.writeText(
|
||||
`${window.location.protocol}//${window.location.host}/circle/join?code=${inviteCode}`,
|
||||
)
|
||||
showNotification({ type: 'success', message: 'Link copied to clipboard' })
|
||||
showNotification({
|
||||
type: 'success',
|
||||
message: t('circleSetup.linkCopied'),
|
||||
})
|
||||
}
|
||||
|
||||
const joinCircle = async () => {
|
||||
@@ -120,8 +128,8 @@ const CircleSetupView = () => {
|
||||
if (resp.ok) {
|
||||
clearPendingInvite()
|
||||
showAcknowledgment(
|
||||
"Your join request has been sent! The circle owner will need to approve it before you can see their chores. You'll get a notification once you're in.",
|
||||
'Request Sent',
|
||||
t('circleSetup.requestSentBody'),
|
||||
t('circleSetup.requestSentTitle'),
|
||||
finish,
|
||||
)
|
||||
} else {
|
||||
@@ -129,8 +137,8 @@ const CircleSetupView = () => {
|
||||
type: 'error',
|
||||
message:
|
||||
resp.status === 409
|
||||
? 'You are already a member of this circle'
|
||||
: 'Failed to join circle',
|
||||
? t('circleSetup.alreadyMember')
|
||||
: t('circleSetup.joinFailed'),
|
||||
})
|
||||
}
|
||||
} finally {
|
||||
@@ -190,7 +198,9 @@ const CircleSetupView = () => {
|
||||
textWrap: 'balance',
|
||||
}}
|
||||
>
|
||||
{mode === 'invite' ? 'Bring your squad in' : 'Join a circle'}
|
||||
{mode === 'invite'
|
||||
? t('circleSetup.inviteTitle')
|
||||
: t('circleSetup.joinTitle')}
|
||||
</Typography>
|
||||
<Typography
|
||||
level='body-md'
|
||||
@@ -201,8 +211,8 @@ const CircleSetupView = () => {
|
||||
}}
|
||||
>
|
||||
{mode === 'invite'
|
||||
? 'Everyone who joins your Circle sees the same chores, takes their own turn, and stays in sync automatically.'
|
||||
: "Enter the code you were given and we'll send a request to join — the circle owner just needs to approve it."}
|
||||
? t('circleSetup.inviteSubtitle')
|
||||
: t('circleSetup.joinSubtitle')}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
@@ -233,14 +243,14 @@ const CircleSetupView = () => {
|
||||
color: inviteCode ? 'text.primary' : 'text.tertiary',
|
||||
}}
|
||||
>
|
||||
{inviteCode ?? 'Loading…'}
|
||||
{inviteCode ?? t('circleSetup.loadingCode')}
|
||||
</Typography>
|
||||
<IconButton
|
||||
variant='soft'
|
||||
color='primary'
|
||||
disabled={!inviteCode}
|
||||
onClick={copyCode}
|
||||
aria-label='Copy circle code'
|
||||
aria-label={t('circleSetup.copyCodeAria')}
|
||||
>
|
||||
<ContentCopyRounded />
|
||||
</IconButton>
|
||||
@@ -257,13 +267,13 @@ const CircleSetupView = () => {
|
||||
disabled={!inviteCode}
|
||||
onClick={copyLink}
|
||||
>
|
||||
Copy invite link instead
|
||||
{t('circleSetup.copyLinkInstead')}
|
||||
</Link>
|
||||
</Box>
|
||||
|
||||
<Box sx={{ mt: 1, ...enter(190) }}>
|
||||
<Button size='lg' fullWidth onClick={finish} sx={authButtonSx}>
|
||||
Continue
|
||||
{t('circleSetup.continue')}
|
||||
</Button>
|
||||
</Box>
|
||||
|
||||
@@ -277,7 +287,7 @@ const CircleSetupView = () => {
|
||||
startDecorator={<GroupAddRounded fontSize='small' />}
|
||||
onClick={() => setMode('join')}
|
||||
>
|
||||
Join an existing circle instead
|
||||
{t('circleSetup.joinInstead')}
|
||||
</Link>
|
||||
</Box>
|
||||
</Box>
|
||||
@@ -285,7 +295,7 @@ const CircleSetupView = () => {
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 1.5 }}>
|
||||
<Box sx={{ ...enter(120) }}>
|
||||
<Input
|
||||
placeholder='Enter code'
|
||||
placeholder={t('circleSetup.codePlaceholder')}
|
||||
value={joinCode}
|
||||
onChange={e => setJoinCode(e.target.value)}
|
||||
size='lg'
|
||||
@@ -302,7 +312,7 @@ const CircleSetupView = () => {
|
||||
onClick={joinCircle}
|
||||
sx={authButtonSx}
|
||||
>
|
||||
Join Circle
|
||||
{t('circleSetup.joinButton')}
|
||||
</Button>
|
||||
</Box>
|
||||
<Box sx={{ textAlign: 'center', ...enter(200) }}>
|
||||
@@ -318,7 +328,7 @@ const CircleSetupView = () => {
|
||||
setMode('invite')
|
||||
}}
|
||||
>
|
||||
Back
|
||||
{t('circleSetup.back')}
|
||||
</Link>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { CheckRounded } from '@mui/icons-material'
|
||||
import { Box, Button, Input, Link, Switch, Typography } from '@mui/joy'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
|
||||
import { track } from '../../analytics'
|
||||
@@ -23,16 +24,12 @@ const enter = (delay = 0) => ({
|
||||
'@media (prefers-reduced-motion: reduce)': { animation: 'none' },
|
||||
})
|
||||
|
||||
const SOURCES = [
|
||||
'App Store / Google Play',
|
||||
'Reddit or a forum',
|
||||
'Friend or family',
|
||||
'YouTube or TikTok',
|
||||
'Search engine',
|
||||
'Something else',
|
||||
]
|
||||
// Keys, not labels: the selected value is recorded as the acquisition source,
|
||||
// so it has to stay stable across locales. Display copy lives in
|
||||
// `common:onboarding.heardAbout.sources.*`.
|
||||
const SOURCES = ['appStore', 'reddit', 'friend', 'video', 'search', 'other']
|
||||
|
||||
const OTHER = 'Something else'
|
||||
const OTHER = 'other'
|
||||
|
||||
const Shell = ({ children }) => (
|
||||
<Box
|
||||
@@ -70,6 +67,7 @@ const Shell = ({ children }) => (
|
||||
* attribute, so it gets the privacy prompt below instead.
|
||||
*/
|
||||
const AcquisitionSurvey = ({ onDone }) => {
|
||||
const { t } = useTranslation()
|
||||
const [selected, setSelected] = useState(null)
|
||||
const [detail, setDetail] = useState('')
|
||||
|
||||
@@ -102,13 +100,13 @@ const AcquisitionSurvey = ({ onDone }) => {
|
||||
textWrap: 'balance',
|
||||
}}
|
||||
>
|
||||
Where'd you hear about Donetick?
|
||||
{t('onboarding.heardAbout.title')}
|
||||
</Typography>
|
||||
<Typography
|
||||
level='body-md'
|
||||
sx={{ mt: 1, color: 'text.secondary', textWrap: 'pretty' }}
|
||||
>
|
||||
Helps us know what's working. Totally optional.
|
||||
{t('onboarding.heardAbout.subtitle')}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
@@ -143,7 +141,7 @@ const AcquisitionSurvey = ({ onDone }) => {
|
||||
transition: `border-color 200ms ${EASE}, background-color 200ms ${EASE}`,
|
||||
}}
|
||||
>
|
||||
{source}
|
||||
{t(`onboarding.heardAbout.sources.${source}`)}
|
||||
<Box
|
||||
sx={{
|
||||
flex: '0 0 auto',
|
||||
@@ -170,7 +168,7 @@ const AcquisitionSurvey = ({ onDone }) => {
|
||||
{selected === OTHER && (
|
||||
<Box sx={{ mt: 0.5, ...enter(0) }}>
|
||||
<Input
|
||||
placeholder='Tell us where'
|
||||
placeholder={t('onboarding.heardAbout.detailPlaceholder')}
|
||||
value={detail}
|
||||
onChange={e => setDetail(e.target.value)}
|
||||
size='lg'
|
||||
@@ -183,7 +181,7 @@ const AcquisitionSurvey = ({ onDone }) => {
|
||||
|
||||
<Box sx={{ mt: 3, ...enter(120) }}>
|
||||
<Button size='lg' fullWidth onClick={finish} sx={authButtonSx}>
|
||||
Continue
|
||||
{t('onboarding.heardAbout.continue')}
|
||||
</Button>
|
||||
</Box>
|
||||
|
||||
@@ -196,27 +194,15 @@ const AcquisitionSurvey = ({ onDone }) => {
|
||||
underline='hover'
|
||||
onClick={finish}
|
||||
>
|
||||
Skip
|
||||
{t('onboarding.heardAbout.skip')}
|
||||
</Link>
|
||||
</Box>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
const PRIVACY_TOGGLES = [
|
||||
{
|
||||
key: 'crashReports',
|
||||
label: 'Share crash reports',
|
||||
description:
|
||||
"When Donetick crashes, send us the error and what led to it (device, app version, the screen you were on) no task content. It's how we catch bugs that never show up in our own testing and ship fixes faster.",
|
||||
},
|
||||
{
|
||||
key: 'analytics',
|
||||
label: 'Share anonymous usage analytics',
|
||||
description:
|
||||
'Send anonymous usage events which features get used, which get ignored so we know what to build next instead of guessing. No task content, no personal data, nothing tied back to you.',
|
||||
},
|
||||
]
|
||||
// Copy lives in `common:onboarding.privacy.*`, keyed off `key`.
|
||||
const PRIVACY_TOGGLES = ['crashReports', 'analytics']
|
||||
|
||||
/**
|
||||
* The self-hosted counterpart to the attribution survey: since a self-hosted
|
||||
@@ -225,6 +211,7 @@ const PRIVACY_TOGGLES = [
|
||||
* an opt-in, not an opt-out.
|
||||
*/
|
||||
const PrivacyPreferences = ({ onDone }) => {
|
||||
const { t } = useTranslation()
|
||||
const [crashReports, setCrashReports] = useState(false)
|
||||
const [analytics, setAnalytics] = useState(false)
|
||||
|
||||
@@ -253,14 +240,13 @@ const PrivacyPreferences = ({ onDone }) => {
|
||||
textWrap: 'balance',
|
||||
}}
|
||||
>
|
||||
Help us improve Donetick
|
||||
{t('onboarding.privacy.title')}
|
||||
</Typography>
|
||||
<Typography
|
||||
level='body-md'
|
||||
sx={{ mt: 1, color: 'text.secondary', textWrap: 'pretty' }}
|
||||
>
|
||||
Your server, your data. Both of these are off from this point unless
|
||||
you turn them on.
|
||||
{t('onboarding.privacy.subtitle')}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
@@ -272,7 +258,7 @@ const PrivacyPreferences = ({ onDone }) => {
|
||||
...enter(60),
|
||||
}}
|
||||
>
|
||||
{PRIVACY_TOGGLES.map(({ description, key, label }) => (
|
||||
{PRIVACY_TOGGLES.map(key => (
|
||||
<Box
|
||||
key={key}
|
||||
sx={{
|
||||
@@ -290,13 +276,13 @@ const PrivacyPreferences = ({ onDone }) => {
|
||||
>
|
||||
<Box sx={{ minWidth: 0 }}>
|
||||
<Typography level='title-sm' sx={{ fontWeight: 600 }}>
|
||||
{label}
|
||||
{t(`onboarding.privacy.${key}Label`)}
|
||||
</Typography>
|
||||
<Typography
|
||||
level='body-sm'
|
||||
sx={{ mt: 0.25, color: 'text.secondary' }}
|
||||
>
|
||||
{description}
|
||||
{t(`onboarding.privacy.${key}Description`)}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Switch
|
||||
@@ -310,7 +296,7 @@ const PrivacyPreferences = ({ onDone }) => {
|
||||
|
||||
<Box sx={{ mt: 3, ...enter(120) }}>
|
||||
<Button size='lg' fullWidth onClick={finish} sx={authButtonSx}>
|
||||
Continue
|
||||
{t('onboarding.heardAbout.continue')}
|
||||
</Button>
|
||||
</Box>
|
||||
</>
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
} from '@mui/icons-material'
|
||||
import { Box, Button, Typography } from '@mui/joy'
|
||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
|
||||
import { track } from '../../analytics'
|
||||
@@ -31,75 +32,57 @@ const SWIPE_THRESHOLD = 56
|
||||
* back. Every title is an outcome — nobody buys "reschedule from completion
|
||||
* date", they buy never arguing about trash day again.
|
||||
*/
|
||||
// Copy lives in `common:onboarding.slides.*` — this array is module-level and
|
||||
// cannot call t(), so each slide carries its key and is translated at render.
|
||||
const SLIDES = [
|
||||
{
|
||||
key: 'problem',
|
||||
title: 'Stop forgetting the little things',
|
||||
body: "Donetick remembers the last time it happened, and when it's due next. So nobody else has to.",
|
||||
Visual: ProblemVignette,
|
||||
},
|
||||
{
|
||||
key: 'capture',
|
||||
title: 'Add it before you forget it',
|
||||
body: "Type it, say it out loud, or snap a photo. Donetick fills in the due date, priority, labels, and who's on it.",
|
||||
Visual: CaptureVignette,
|
||||
},
|
||||
// {
|
||||
// key: 'schedule',
|
||||
// title: 'It comes back exactly when it should',
|
||||
// body: "Every week, every 3 months, or a month after you actually did it. Finishing late doesn't throw the rest of the year off.",
|
||||
// Visual: ScheduleVignette,
|
||||
// },
|
||||
{
|
||||
key: 'circle',
|
||||
title: 'Everyone gets a turn, No more arguing',
|
||||
body: 'Rotate in the order you pick, or at random. Donetick remembers who went last, so turns stay fair.',
|
||||
Visual: TakesTurnsVignette,
|
||||
},
|
||||
{
|
||||
key: 'reminders',
|
||||
title: 'A nudge right when it matters & Widgets!',
|
||||
body: "Get a reminder before something's due, or send a heads-up when someone forgets theirs. Today's list sits on your home screen too.",
|
||||
Visual: RemindersVignette,
|
||||
permission: true,
|
||||
},
|
||||
{ key: 'problem', Visual: ProblemVignette },
|
||||
{ key: 'capture', Visual: CaptureVignette },
|
||||
// { key: 'schedule', Visual: ScheduleVignette },
|
||||
{ key: 'circle', Visual: TakesTurnsVignette },
|
||||
{ key: 'reminders', Visual: RemindersVignette, permission: true },
|
||||
]
|
||||
|
||||
const Dots = ({ activeIndex, count, onSelect }) => (
|
||||
<Box sx={{ display: 'flex', justifyContent: 'center', gap: 1 }}>
|
||||
{Array.from({ length: count }, (_, index) => {
|
||||
const active = index === activeIndex
|
||||
return (
|
||||
<Box
|
||||
key={index}
|
||||
component='button'
|
||||
type='button'
|
||||
aria-label={`Go to step ${index + 1}`}
|
||||
aria-current={active ? 'step' : undefined}
|
||||
onClick={() => onSelect(index)}
|
||||
sx={{
|
||||
border: 'none',
|
||||
p: 0,
|
||||
cursor: 'pointer',
|
||||
height: 6,
|
||||
width: active ? 22 : 6,
|
||||
borderRadius: '999px',
|
||||
bgcolor: active ? 'primary.500' : 'neutral.softBg',
|
||||
transition: `width 280ms ${EASE}, background-color 280ms ease`,
|
||||
'&:focus-visible': {
|
||||
outline: '2px solid',
|
||||
outlineColor: 'primary.500',
|
||||
outlineOffset: '3px',
|
||||
},
|
||||
'@media (prefers-reduced-motion: reduce)': { transition: 'none' },
|
||||
}}
|
||||
/>
|
||||
)
|
||||
})}
|
||||
</Box>
|
||||
)
|
||||
const Dots = ({ activeIndex, count, onSelect }) => {
|
||||
const { t } = useTranslation()
|
||||
return (
|
||||
<Box sx={{ display: 'flex', justifyContent: 'center', gap: 1 }}>
|
||||
{Array.from({ length: count }, (_, index) => {
|
||||
const active = index === activeIndex
|
||||
return (
|
||||
<Box
|
||||
key={index}
|
||||
component='button'
|
||||
type='button'
|
||||
aria-label={t('onboarding.carousel.goToStep', {
|
||||
number: index + 1,
|
||||
})}
|
||||
aria-current={active ? 'step' : undefined}
|
||||
onClick={() => onSelect(index)}
|
||||
sx={{
|
||||
border: 'none',
|
||||
p: 0,
|
||||
cursor: 'pointer',
|
||||
height: 6,
|
||||
width: active ? 22 : 6,
|
||||
borderRadius: '999px',
|
||||
bgcolor: active ? 'primary.500' : 'neutral.softBg',
|
||||
transition: `width 280ms ${EASE}, background-color 280ms ease`,
|
||||
'&:focus-visible': {
|
||||
outline: '2px solid',
|
||||
outlineColor: 'primary.500',
|
||||
outlineOffset: '3px',
|
||||
},
|
||||
'@media (prefers-reduced-motion: reduce)': { transition: 'none' },
|
||||
}}
|
||||
/>
|
||||
)
|
||||
})}
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
const OnboardingView = () => {
|
||||
const { t } = useTranslation()
|
||||
const navigate = useNavigate()
|
||||
const [activeIndex, setActiveIndex] = useState(0)
|
||||
const [drag, setDrag] = useState(0)
|
||||
@@ -227,7 +210,7 @@ const OnboardingView = () => {
|
||||
onClick={finish}
|
||||
sx={{ fontWeight: 600, borderRadius: '999px' }}
|
||||
>
|
||||
Skip
|
||||
{t('onboarding.carousel.skip')}
|
||||
</Button>
|
||||
</Box>
|
||||
|
||||
@@ -235,7 +218,7 @@ const OnboardingView = () => {
|
||||
ref={viewportRef}
|
||||
role='group'
|
||||
aria-roledescription='carousel'
|
||||
aria-label='What you can do with Donetick'
|
||||
aria-label={t('onboarding.carousel.ariaLabel')}
|
||||
onPointerDown={onPointerDown}
|
||||
onPointerMove={onPointerMove}
|
||||
onPointerUp={endDrag}
|
||||
@@ -270,7 +253,10 @@ const OnboardingView = () => {
|
||||
key={slide.key}
|
||||
role='group'
|
||||
aria-roledescription='slide'
|
||||
aria-label={`${index + 1} of ${SLIDES.length}`}
|
||||
aria-label={t('onboarding.carousel.slidePosition', {
|
||||
index: index + 1,
|
||||
total: SLIDES.length,
|
||||
})}
|
||||
aria-hidden={!active}
|
||||
sx={{
|
||||
flex: '0 0 100%',
|
||||
@@ -320,7 +306,7 @@ const OnboardingView = () => {
|
||||
},
|
||||
}}
|
||||
>
|
||||
{slide.title}
|
||||
{t(`onboarding.slides.${slide.key}Title`)}
|
||||
</Typography>
|
||||
<Typography
|
||||
level='body-md'
|
||||
@@ -333,7 +319,7 @@ const OnboardingView = () => {
|
||||
animation: `slideCopyIn 460ms ${EASE} 140ms both`,
|
||||
}}
|
||||
>
|
||||
{slide.body}
|
||||
{t(`onboarding.slides.${slide.key}Body`)}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
@@ -366,7 +352,7 @@ const OnboardingView = () => {
|
||||
startDecorator={<NotificationsActiveRounded />}
|
||||
sx={authButtonSx}
|
||||
>
|
||||
Turn on reminders
|
||||
{t('onboarding.carousel.turnOnReminders')}
|
||||
</Button>
|
||||
<Button
|
||||
variant='plain'
|
||||
@@ -379,7 +365,7 @@ const OnboardingView = () => {
|
||||
onClick={finish}
|
||||
sx={{ ...authButtonSx, mt: -1.5 }}
|
||||
>
|
||||
Not now
|
||||
{t('onboarding.carousel.notNow')}
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
@@ -390,7 +376,7 @@ const OnboardingView = () => {
|
||||
endDecorator={!isLast ? <ArrowForwardRounded /> : null}
|
||||
sx={authButtonSx}
|
||||
>
|
||||
{isLast ? 'Get started' : 'Next'}
|
||||
{isLast ? t('getStarted') : t('onboarding.carousel.next')}
|
||||
</Button>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,7 @@ import { Purchases } from '@revenuecat/purchases-capacitor'
|
||||
import { useQueryClient } from '@tanstack/react-query'
|
||||
import moment from 'moment'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
|
||||
import RealTimeSettings from '../../components/RealTimeSettings'
|
||||
@@ -57,6 +58,7 @@ import StorageSettings from './StorageSettings'
|
||||
import ThemeToggle from './ThemeToggle'
|
||||
|
||||
const Settings = () => {
|
||||
const { t } = useTranslation('settings')
|
||||
const { data: userProfile } = useUserProfile()
|
||||
const queryClient = useQueryClient()
|
||||
const { showNotification } = useNotification()
|
||||
@@ -83,8 +85,8 @@ const Settings = () => {
|
||||
message,
|
||||
title,
|
||||
onConfirm,
|
||||
confirmText = 'Confirm',
|
||||
cancelText = 'Cancel',
|
||||
confirmText = t('common.confirm'),
|
||||
cancelText = t('common.cancel'),
|
||||
color = 'primary',
|
||||
) => {
|
||||
setConfirmModalConfig({
|
||||
@@ -112,7 +114,7 @@ const Settings = () => {
|
||||
} catch (error) {
|
||||
showNotification({
|
||||
type: 'error',
|
||||
message: 'Failed to refresh member requests',
|
||||
message: t('circleSettings.refreshFailed'),
|
||||
})
|
||||
} finally {
|
||||
setIsRefreshing(false)
|
||||
@@ -195,27 +197,29 @@ const Settings = () => {
|
||||
|
||||
const getSubscriptionDetails = () => {
|
||||
if (userProfile?.subscription === 'active') {
|
||||
return `You are currently subscribed to the Plus plan. Your subscription will renew on ${fmt.date(
|
||||
userProfile?.expiration,
|
||||
)}.`
|
||||
return t('accountSettings.activeDescription', {
|
||||
date: fmt.date(userProfile?.expiration),
|
||||
})
|
||||
} else if (userProfile?.subscription === 'cancelled') {
|
||||
return `You have cancelled your subscription. Your account will be downgraded to the Free plan on ${fmt.date(
|
||||
userProfile?.expiration,
|
||||
)}.`
|
||||
return t('accountSettings.cancelledDescription', {
|
||||
date: fmt.date(userProfile?.expiration),
|
||||
})
|
||||
} else {
|
||||
return `You are currently on the Free plan. Upgrade to the Plus plan to unlock more features.`
|
||||
return t('accountSettings.freeDescription')
|
||||
}
|
||||
}
|
||||
const getSubscriptionStatus = () => {
|
||||
if (userProfile?.subscription === 'active') {
|
||||
return `Plus`
|
||||
return t('accountSettings.plus')
|
||||
} else if (userProfile?.subscription === 'cancelled') {
|
||||
if (moment().isBefore(userProfile?.expiration)) {
|
||||
return `Plus(until ${fmt.date(userProfile?.expiration)})`
|
||||
return t('accountSettings.plusUntil', {
|
||||
date: fmt.date(userProfile?.expiration),
|
||||
})
|
||||
}
|
||||
return `Free`
|
||||
return t('accountSettings.free')
|
||||
} else {
|
||||
return `Free`
|
||||
return t('accountSettings.free')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,18 +245,15 @@ const Settings = () => {
|
||||
<Container>
|
||||
<ProfileSettings />
|
||||
<div className='grid gap-4 py-4' id='circle'>
|
||||
<Typography level='h3'>Circle settings</Typography>
|
||||
<Typography level='h3'>{t('circleSettings.title')}</Typography>
|
||||
<Divider />
|
||||
<Typography level='body-md'>
|
||||
Your account is automatically connected to a Circle when you create or
|
||||
join one. Easily invite friends by sharing the unique Circle code or
|
||||
link below. You'll receive a notification below when someone requests
|
||||
to join your Circle.
|
||||
{t('circleSettings.description')}
|
||||
</Typography>
|
||||
<Typography level='title-sm' mb={-1}>
|
||||
{userCircles[0]?.userRole === 'member'
|
||||
? `You part of ${userCircles[0]?.name} `
|
||||
: `You circle code is:`}
|
||||
? t('circleSettings.memberOf', { name: userCircles[0]?.name })
|
||||
: t('circleSettings.yourCircleCode')}
|
||||
|
||||
<Input
|
||||
value={userCircles[0]?.invite_code}
|
||||
@@ -269,11 +270,11 @@ const Settings = () => {
|
||||
navigator.clipboard.writeText(userCircles[0]?.invite_code)
|
||||
showNotification({
|
||||
type: 'success',
|
||||
message: 'Code copied to clipboard',
|
||||
message: t('circleSettings.codeCopied'),
|
||||
})
|
||||
}}
|
||||
>
|
||||
Copy Code
|
||||
{t('circleSettings.copyCode')}
|
||||
</Button>
|
||||
<Button
|
||||
variant='soft'
|
||||
@@ -287,11 +288,11 @@ const Settings = () => {
|
||||
)
|
||||
showNotification({
|
||||
type: 'success',
|
||||
message: 'Link copied to clipboard',
|
||||
message: t('circleSettings.linkCopied'),
|
||||
})
|
||||
}}
|
||||
>
|
||||
Copy Link
|
||||
{t('circleSettings.copyLink')}
|
||||
</Button>
|
||||
{userCircles.length > 0 && userCircles[0]?.userRole === 'member' && (
|
||||
<Button
|
||||
@@ -300,35 +301,37 @@ const Settings = () => {
|
||||
sx={{ ml: 1 }}
|
||||
onClick={() => {
|
||||
showConfirmation(
|
||||
'Are you sure you want to leave your circle?',
|
||||
'Leave Circle',
|
||||
t('circleSettings.leaveConfirmMessage'),
|
||||
t('circleSettings.leaveConfirmTitle'),
|
||||
() => {
|
||||
LeaveCircle(userCircles[0]?.id).then(resp => {
|
||||
if (resp.ok) {
|
||||
showNotification({
|
||||
type: 'success',
|
||||
message: 'Left circle successfully',
|
||||
message: t('circleSettings.leftCircle'),
|
||||
})
|
||||
} else {
|
||||
showNotification({
|
||||
type: 'error',
|
||||
message: 'Failed to leave circle',
|
||||
message: t('circleSettings.leaveFailed'),
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
'Leave',
|
||||
'Cancel',
|
||||
t('circleSettings.leaveConfirmButton'),
|
||||
t('common.cancel'),
|
||||
'danger',
|
||||
)
|
||||
}}
|
||||
>
|
||||
Leave Circle
|
||||
{t('circleSettings.leave')}
|
||||
</Button>
|
||||
)}
|
||||
</Typography>
|
||||
|
||||
<Typography level='title-md'>Circle Members</Typography>
|
||||
<Typography level='title-md'>
|
||||
{t('circleSettings.circleMembers')}
|
||||
</Typography>
|
||||
{circleMembers.map(member => (
|
||||
<Card key={member.id} className='p-4'>
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
@@ -336,19 +339,27 @@ const Settings = () => {
|
||||
<Typography level='body-md'>
|
||||
{member.displayName.charAt(0).toUpperCase() +
|
||||
member.displayName.slice(1)}
|
||||
{member.userId === userProfile.id ? '(You)' : ''}{' '}
|
||||
{member.userId === userProfile.id
|
||||
? t('circleSettings.you')
|
||||
: ''}{' '}
|
||||
<Chip>
|
||||
{' '}
|
||||
{member.isActive ? member.role : 'Pending Approval'}
|
||||
{member.isActive
|
||||
? member.role
|
||||
: t('circleSettings.pendingApproval')}
|
||||
</Chip>
|
||||
</Typography>
|
||||
{member.isActive ? (
|
||||
<Typography level='body-sm'>
|
||||
Joined on {fmt.date(member.createdAt)}
|
||||
{t('circleSettings.joinedOn', {
|
||||
date: fmt.date(member.createdAt),
|
||||
})}
|
||||
</Typography>
|
||||
) : (
|
||||
<Typography level='body-sm' color='danger'>
|
||||
Request to join {fmt.date(member.updatedAt)}
|
||||
{t('circleSettings.requestedToJoin', {
|
||||
date: fmt.date(member.updatedAt),
|
||||
})}
|
||||
</Typography>
|
||||
)}
|
||||
</Box>
|
||||
@@ -378,28 +389,14 @@ const Settings = () => {
|
||||
} else {
|
||||
showNotification({
|
||||
type: 'error',
|
||||
message: 'Failed to update role',
|
||||
message: t('circleSettings.roleUpdateFailed'),
|
||||
})
|
||||
}
|
||||
})
|
||||
}}
|
||||
>
|
||||
{[
|
||||
{
|
||||
value: 'member',
|
||||
description: 'Just a regular member of the circle',
|
||||
},
|
||||
{
|
||||
value: 'manager',
|
||||
description:
|
||||
'Can impersonate users and perform actions on their behalf',
|
||||
},
|
||||
{
|
||||
value: 'admin',
|
||||
description: 'Full access to the circle',
|
||||
},
|
||||
].map((option, index) => (
|
||||
<Option value={option.value} key={index}>
|
||||
{['member', 'manager', 'admin'].map((option, index) => (
|
||||
<Option value={option} key={index}>
|
||||
<Box
|
||||
sx={{
|
||||
display: 'flex',
|
||||
@@ -414,14 +411,13 @@ const Settings = () => {
|
||||
level='title-sm'
|
||||
sx={{ mb: 0, mt: 0, lineHeight: 1.1 }}
|
||||
>
|
||||
{option.value.charAt(0).toUpperCase() +
|
||||
option.value.slice(1)}
|
||||
{t(`circleSettings.roles.${option}`)}
|
||||
</Typography>
|
||||
<Typography
|
||||
level='body-sm'
|
||||
sx={{ mt: 0, mb: 0, lineHeight: 1.1 }}
|
||||
>
|
||||
{option.description}
|
||||
{t(`circleSettings.roles.${option}Description`)}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Option>
|
||||
@@ -437,8 +433,10 @@ const Settings = () => {
|
||||
size='sm'
|
||||
onClick={() => {
|
||||
showConfirmation(
|
||||
`Are you sure you want to remove ${member.displayName} from your circle?`,
|
||||
'Remove Member',
|
||||
t('circleSettings.removeMemberMessage', {
|
||||
name: member.displayName,
|
||||
}),
|
||||
t('circleSettings.removeMemberTitle'),
|
||||
() => {
|
||||
DeleteCircleMember(
|
||||
member.circleId,
|
||||
@@ -447,7 +445,7 @@ const Settings = () => {
|
||||
if (resp.ok) {
|
||||
showNotification({
|
||||
type: 'success',
|
||||
message: 'Removed member successfully',
|
||||
message: t('circleSettings.memberRemoved'),
|
||||
})
|
||||
// Invalidate and refetch circle-related queries
|
||||
queryClient.invalidateQueries(['circleMembers'])
|
||||
@@ -463,8 +461,8 @@ const Settings = () => {
|
||||
}
|
||||
})
|
||||
},
|
||||
'Remove',
|
||||
'Cancel',
|
||||
t('common.remove'),
|
||||
t('common.cancel'),
|
||||
'danger',
|
||||
)
|
||||
}}
|
||||
@@ -485,11 +483,15 @@ const Settings = () => {
|
||||
mb: 1,
|
||||
}}
|
||||
>
|
||||
<Typography level='title-md'>Circle Member Requests</Typography>
|
||||
<Typography level='title-md'>
|
||||
{t('circleSettings.circleMemberRequests')}
|
||||
</Typography>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
{lastRefresh && (
|
||||
<Typography level='body-sm' color='neutral'>
|
||||
Last updated: {fmt.dateTime(lastRefresh)}
|
||||
{t('circleSettings.lastUpdated', {
|
||||
time: fmt.dateTime(lastRefresh),
|
||||
})}
|
||||
</Typography>
|
||||
)}
|
||||
<Button
|
||||
@@ -501,7 +503,9 @@ const Settings = () => {
|
||||
isRefreshing ? <CircularProgress size='sm' /> : <Refresh />
|
||||
}
|
||||
>
|
||||
{isRefreshing ? 'Refreshing...' : 'Refresh'}
|
||||
{isRefreshing
|
||||
? t('circleSettings.refreshing')
|
||||
: t('common.refresh')}
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
@@ -509,21 +513,24 @@ const Settings = () => {
|
||||
{circleMemberRequests.map(request => (
|
||||
<Card key={request.id} className='p-4'>
|
||||
<Typography level='body-md'>
|
||||
{request.displayName} wants to join your circle.
|
||||
{t('circleSettings.wantsToJoin', { name: request.displayName })}
|
||||
</Typography>
|
||||
<Button
|
||||
variant='soft'
|
||||
color='success'
|
||||
onClick={() => {
|
||||
showConfirmation(
|
||||
`Are you sure you want to accept ${request.displayName} (username: ${request.username}) to join your circle?`,
|
||||
'Accept Member Request',
|
||||
t('circleSettings.acceptRequestMessage', {
|
||||
name: request.displayName,
|
||||
username: request.username,
|
||||
}),
|
||||
t('circleSettings.acceptRequestTitle'),
|
||||
() => {
|
||||
AcceptCircleMemberRequest(request.id).then(resp => {
|
||||
if (resp.ok) {
|
||||
showNotification({
|
||||
type: 'success',
|
||||
message: 'Accepted request successfully',
|
||||
message: t('circleSettings.requestAccepted'),
|
||||
})
|
||||
// Invalidate and refetch circle-related queries
|
||||
queryClient.invalidateQueries(['circleMembers'])
|
||||
@@ -540,26 +547,25 @@ const Settings = () => {
|
||||
}
|
||||
})
|
||||
},
|
||||
'Accept',
|
||||
'Cancel',
|
||||
t('circleSettings.accept'),
|
||||
t('common.cancel'),
|
||||
)
|
||||
}}
|
||||
>
|
||||
Accept
|
||||
{t('circleSettings.accept')}
|
||||
</Button>
|
||||
</Card>
|
||||
))}
|
||||
<Divider> or </Divider>
|
||||
<Divider> {t('circleSettings.or')} </Divider>
|
||||
|
||||
<Typography level='body-md'>
|
||||
if want to join someone else's Circle? Ask them for their unique
|
||||
Circle code or join link. Enter the code below to join their Circle.
|
||||
{t('circleSettings.joinOtherDescription')}
|
||||
</Typography>
|
||||
|
||||
<Typography level='title-sm' mb={-1}>
|
||||
Enter Circle code:
|
||||
{t('circleSettings.enterCircleCode')}
|
||||
<Input
|
||||
placeholder='Enter code'
|
||||
placeholder={t('circleSettings.enterCodePlaceholder')}
|
||||
value={circleInviteCode}
|
||||
onChange={e => setCircleInviteCode(e.target.value)}
|
||||
size='lg'
|
||||
@@ -575,20 +581,19 @@ const Settings = () => {
|
||||
if (resp.ok) {
|
||||
showNotification({
|
||||
type: 'success',
|
||||
message:
|
||||
'Joined circle successfully, wait for the circle owner to accept your request.',
|
||||
message: t('circleSettings.joinedPending'),
|
||||
})
|
||||
setTimeout(() => navigate('/'), 3000)
|
||||
} else {
|
||||
if (resp.status === 409) {
|
||||
showNotification({
|
||||
type: 'error',
|
||||
message: 'You are already a member of this circle',
|
||||
message: t('circleSettings.alreadyMember'),
|
||||
})
|
||||
} else {
|
||||
showNotification({
|
||||
type: 'error',
|
||||
message: 'Failed to join circle',
|
||||
message: t('circleSettings.joinFailed'),
|
||||
})
|
||||
}
|
||||
setTimeout(() => navigate('/'), 3000)
|
||||
@@ -596,24 +601,21 @@ const Settings = () => {
|
||||
})
|
||||
}}
|
||||
>
|
||||
Join Circle
|
||||
{t('circleSettings.joinCircle')}
|
||||
</Button>
|
||||
</Typography>
|
||||
{circleMembers.find(m => userProfile.id == m.userId)?.role ===
|
||||
'admin' && (
|
||||
<>
|
||||
<Typography level='title-lg' mt={2}>
|
||||
Webhook
|
||||
{t('advanced.webhookTitle')}
|
||||
</Typography>
|
||||
<Typography level='body-md' mt={-1}>
|
||||
Webhooks allow you to send real-time notifications to other
|
||||
services when events happen in your Circle. Configure a webhook
|
||||
URL to receive real-time updates.
|
||||
{t('advanced.webhookDescription')}
|
||||
</Typography>
|
||||
{!isPlusAccount(userProfile) && (
|
||||
<Typography level='body-sm' color='warning' sx={{ mt: 1 }}>
|
||||
Webhook notifications are not available in the Basic plan.
|
||||
Upgrade to Plus to receive real-time updates via webhooks.
|
||||
{t('advanced.webhookPlusNotice')}
|
||||
</Typography>
|
||||
)}
|
||||
<FormControl sx={{ mt: 1 }}>
|
||||
@@ -627,7 +629,7 @@ const Settings = () => {
|
||||
}
|
||||
}}
|
||||
variant='soft'
|
||||
label='Enable Webhook'
|
||||
label={t('advanced.webhookToggle')}
|
||||
disabled={!isPlusAccount(userProfile)}
|
||||
overlay
|
||||
/>
|
||||
@@ -636,10 +638,10 @@ const Settings = () => {
|
||||
opacity: !isPlusAccount(userProfile) ? 0.5 : 1,
|
||||
}}
|
||||
>
|
||||
Enable webhook notifications for tasks and things updates.{' '}
|
||||
{t('advanced.webhookHelper')}{' '}
|
||||
{userProfile && !isPlusAccount(userProfile) && (
|
||||
<Chip variant='soft' color='warning'>
|
||||
Plus Feature
|
||||
{t('common.plusFeature')}
|
||||
</Chip>
|
||||
)}
|
||||
</FormHelperText>
|
||||
@@ -647,7 +649,9 @@ const Settings = () => {
|
||||
|
||||
{webhookURL !== null && (
|
||||
<Box>
|
||||
<Typography level='title-sm'>Webhook URL</Typography>
|
||||
<Typography level='title-sm'>
|
||||
{t('advanced.webhookURL')}
|
||||
</Typography>
|
||||
<Input
|
||||
value={webhookURL ? webhookURL : ''}
|
||||
onChange={e => setWebhookURL(e.target.value)}
|
||||
@@ -670,19 +674,19 @@ const Settings = () => {
|
||||
if (resp.ok) {
|
||||
showNotification({
|
||||
type: 'success',
|
||||
message: 'Webhook URL updated successfully',
|
||||
message: t('advanced.webhookUpdated'),
|
||||
})
|
||||
} else {
|
||||
showNotification({
|
||||
type: 'error',
|
||||
message: 'Failed to update webhook URL',
|
||||
message: t('advanced.webhookUpdateFailed'),
|
||||
})
|
||||
}
|
||||
})
|
||||
}}
|
||||
disabled={!isPlusAccount(userProfile)}
|
||||
>
|
||||
Save
|
||||
{t('common.save')}
|
||||
</Button>
|
||||
</Box>
|
||||
)}
|
||||
@@ -695,13 +699,13 @@ const Settings = () => {
|
||||
</div>
|
||||
|
||||
<div className='grid gap-4 py-4' id='account'>
|
||||
<Typography level='h3'>Account Settings</Typography>
|
||||
<Typography level='h3'>{t('accountSettings.title')}</Typography>
|
||||
<Divider />
|
||||
<Typography level='body-md'>
|
||||
Change your account settings, type or update your password
|
||||
{t('accountSettings.description')}
|
||||
</Typography>
|
||||
<Typography level='title-md' mb={-1}>
|
||||
Account Type : {getSubscriptionStatus()}
|
||||
{t('accountSettings.accountType', { type: getSubscriptionStatus() })}
|
||||
</Typography>
|
||||
<Typography level='body-sm'>{getSubscriptionDetails()}</Typography>
|
||||
<Box>
|
||||
@@ -733,8 +737,7 @@ const Settings = () => {
|
||||
queryClient.refetchQueries(['userProfile'])
|
||||
showNotification({
|
||||
type: 'success',
|
||||
message:
|
||||
'Purchase successful! Please restart the app to access Plus features.',
|
||||
message: t('accountSettings.purchase.success'),
|
||||
})
|
||||
// invalidate user profile to get new subscription status:
|
||||
}
|
||||
@@ -749,57 +752,49 @@ const Settings = () => {
|
||||
// Store problem
|
||||
showNotification({
|
||||
type: 'error',
|
||||
message:
|
||||
'Store connection issue. Please check your network and try again.',
|
||||
message: t('accountSettings.purchase.storeConnection'),
|
||||
})
|
||||
} else if (error.code === '3') {
|
||||
// Purchase not allowed
|
||||
showNotification({
|
||||
type: 'error',
|
||||
message:
|
||||
'Purchases are not allowed on this device. Please check your device restrictions.',
|
||||
message: t('accountSettings.purchase.notAllowed'),
|
||||
})
|
||||
} else if (error.code === '4') {
|
||||
// Product not available
|
||||
showNotification({
|
||||
type: 'error',
|
||||
message:
|
||||
'This subscription is not available. Please try again later.',
|
||||
message: t('accountSettings.purchase.unavailable'),
|
||||
})
|
||||
} else if (error.code === '5') {
|
||||
// Receipt already in use
|
||||
showNotification({
|
||||
type: 'error',
|
||||
message:
|
||||
'This purchase has already been processed. If you believe this is an error, please contact support.',
|
||||
message: t('accountSettings.purchase.alreadyProcessed'),
|
||||
})
|
||||
} else if (error.code === '6') {
|
||||
// Missing receipt file
|
||||
showNotification({
|
||||
type: 'error',
|
||||
message:
|
||||
'Purchase receipt missing. Please try purchasing again.',
|
||||
message: t('accountSettings.purchase.receiptMissing'),
|
||||
})
|
||||
} else if (error.code === '7') {
|
||||
// Network error
|
||||
showNotification({
|
||||
type: 'error',
|
||||
message:
|
||||
'Network error. Please check your connection and try again.',
|
||||
message: t('accountSettings.purchase.networkError'),
|
||||
})
|
||||
} else if (error.code === '8') {
|
||||
// Invalid receipt
|
||||
showNotification({
|
||||
type: 'error',
|
||||
message:
|
||||
'Invalid purchase receipt. Please contact support if this persists.',
|
||||
message: t('accountSettings.purchase.invalidReceipt'),
|
||||
})
|
||||
} else if (error.code === '9') {
|
||||
// Payment pending
|
||||
showNotification({
|
||||
type: 'warning',
|
||||
message:
|
||||
'Payment is pending approval. You will receive access once approved.',
|
||||
message: t('accountSettings.purchase.pending'),
|
||||
})
|
||||
} else {
|
||||
// Generic error
|
||||
@@ -808,7 +803,11 @@ const Settings = () => {
|
||||
console.error('Error occurred in purchase flow')
|
||||
showNotification({
|
||||
type: 'error',
|
||||
message: `Purchase failed: ${error.message || 'Unknown error'}. Please try again or contact support.`,
|
||||
message: t('accountSettings.purchase.failed', {
|
||||
error:
|
||||
error.message ||
|
||||
t('accountSettings.purchase.unknownError'),
|
||||
}),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -817,7 +816,7 @@ const Settings = () => {
|
||||
}
|
||||
}}
|
||||
>
|
||||
Upgrade
|
||||
{t('accountSettings.upgrade')}
|
||||
</Button>
|
||||
|
||||
{userProfile?.subscription === 'active' && (
|
||||
@@ -833,14 +832,14 @@ const Settings = () => {
|
||||
setNativeCancelModal(true)
|
||||
}}
|
||||
>
|
||||
Cancel
|
||||
{t('accountSettings.cancel')}
|
||||
</Button>
|
||||
)}
|
||||
</Box>
|
||||
{import.meta.env.VITE_IS_SELF_HOSTED === 'true' && (
|
||||
<Box>
|
||||
<Typography level='title-md' mb={1}>
|
||||
Password :
|
||||
{t('accountSettings.password')}
|
||||
</Typography>
|
||||
<Typography mb={1} level='body-sm'></Typography>
|
||||
<Button
|
||||
@@ -849,7 +848,7 @@ const Settings = () => {
|
||||
setChangePasswordModal(true)
|
||||
}}
|
||||
>
|
||||
Change Password
|
||||
{t('accountSettings.changePassword')}
|
||||
</Button>
|
||||
{changePasswordModal ? (
|
||||
<PassowrdChangeModal
|
||||
@@ -860,12 +859,12 @@ const Settings = () => {
|
||||
if (resp.ok) {
|
||||
showNotification({
|
||||
type: 'success',
|
||||
message: 'Password changed successfully',
|
||||
message: t('accountSettings.passwordChanged'),
|
||||
})
|
||||
} else {
|
||||
showNotification({
|
||||
type: 'error',
|
||||
message: 'Password change failed',
|
||||
message: t('accountSettings.passwordChangeFailed'),
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -879,18 +878,17 @@ const Settings = () => {
|
||||
|
||||
<Box>
|
||||
<Typography level='title-md' mb={1} color='danger'>
|
||||
Danger Zone
|
||||
{t('accountSettings.dangerZone')}
|
||||
</Typography>
|
||||
<Typography level='body-sm' mb={2} color='neutral'>
|
||||
Once you delete your account, there is no going back. Please be
|
||||
certain.
|
||||
{t('accountSettings.dangerZoneDescription')}
|
||||
</Typography>
|
||||
<Button
|
||||
variant='outlined'
|
||||
color='danger'
|
||||
onClick={() => setUserDeletionModal(true)}
|
||||
>
|
||||
Delete Account
|
||||
{t('accountSettings.deleteAccount')}
|
||||
</Button>
|
||||
</Box>
|
||||
</div>
|
||||
@@ -899,32 +897,26 @@ const Settings = () => {
|
||||
<APITokenSettings />
|
||||
<StorageSettings />
|
||||
<div className='grid gap-4 py-4' id='sidepanel'>
|
||||
<Typography level='h3'>Sidepanel Customization</Typography>
|
||||
<Typography level='h3'>{t('sidepanel.title')}</Typography>
|
||||
<Divider />
|
||||
<Typography level='body-md'>
|
||||
Customize the layout and visibility of cards in the sidepanel. the
|
||||
section only available on large screen devices such as tablets and
|
||||
desktops..
|
||||
{t('sidepanel.detailedDescription')}
|
||||
</Typography>
|
||||
<SidepanelSettings />
|
||||
</div>
|
||||
|
||||
<div className='grid gap-4 py-4' id='theme'>
|
||||
<Typography level='h3'>Theme preferences</Typography>
|
||||
<Typography level='h3'>{t('theme.title')}</Typography>
|
||||
<Divider />
|
||||
<Typography level='body-md'>
|
||||
Choose how the site looks to you. Select a single theme, or sync with
|
||||
your system and automatically switch between day and night themes.
|
||||
</Typography>
|
||||
<Typography level='body-md'>{t('theme.description')}</Typography>
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
|
||||
<div className='grid gap-4 py-4' id='localization'>
|
||||
<Typography level='h3'>Localization</Typography>
|
||||
<Typography level='h3'>{t('localization.title')}</Typography>
|
||||
<Divider />
|
||||
<Typography level='body-md'>
|
||||
Customize language, date format, and regional preferences for your
|
||||
account. These settings will apply throughout the application.
|
||||
{t('localization.descriptionLong')}
|
||||
</Typography>
|
||||
<LocalizationSettings />
|
||||
</div>
|
||||
|
||||
@@ -33,6 +33,7 @@ import {
|
||||
} from '@mui/joy'
|
||||
import Fuse from 'fuse.js'
|
||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
|
||||
import { track } from '../../analytics'
|
||||
@@ -52,6 +53,7 @@ import CreateThingModal from '../Modals/Inputs/CreateThingModal'
|
||||
import EditThingStateModal from '../Modals/Inputs/EditThingState'
|
||||
|
||||
const ThingCardContent = ({ onCardClick, onToggleActions, thing }) => {
|
||||
const { t } = useTranslation('things')
|
||||
const getThingIcon = type => {
|
||||
if (type === 'text') {
|
||||
return <Flip />
|
||||
@@ -190,7 +192,7 @@ const ThingCardContent = ({ onCardClick, onToggleActions, thing }) => {
|
||||
px: 0.75,
|
||||
}}
|
||||
>
|
||||
{thing?.type}
|
||||
{t(`types.${thing?.type}`, thing?.type)}
|
||||
</Chip>
|
||||
</Box>
|
||||
</Box>
|
||||
@@ -214,6 +216,7 @@ const ThingCardContent = ({ onCardClick, onToggleActions, thing }) => {
|
||||
}
|
||||
|
||||
const ThingsView = () => {
|
||||
const { t } = useTranslation('things')
|
||||
const navigate = useNavigate()
|
||||
const [things, setThings] = useState([])
|
||||
const [isShowCreateThingModal, setIsShowCreateThingModal] = useState(false)
|
||||
@@ -325,21 +328,21 @@ const ThingsView = () => {
|
||||
}
|
||||
showNotification({
|
||||
type: 'success',
|
||||
title: 'Saved',
|
||||
message: 'Thing saved successfully',
|
||||
title: t('notify.savedTitle'),
|
||||
message: t('notify.savedMessage'),
|
||||
})
|
||||
})
|
||||
})
|
||||
.catch(error => {
|
||||
if (error?.queued) {
|
||||
showError({
|
||||
title: 'Unable to save thing',
|
||||
message: 'You are offline and the request has been queued',
|
||||
title: t('notify.saveFailTitle'),
|
||||
message: t('notify.queuedMessage'),
|
||||
})
|
||||
} else {
|
||||
showError({
|
||||
title: 'Unable to save thing',
|
||||
message: 'An error occurred while saving the thing',
|
||||
title: t('notify.saveFailTitle'),
|
||||
message: t('notify.saveFailMessage'),
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -351,10 +354,10 @@ const ThingsView = () => {
|
||||
const handleDeleteClick = thing => {
|
||||
setConfirmModelConfig({
|
||||
isOpen: true,
|
||||
title: 'Delete Things',
|
||||
confirmText: 'Delete',
|
||||
cancelText: 'Cancel',
|
||||
message: 'Are you sure you want to delete this Thing?',
|
||||
title: t('notify.deleteTitle'),
|
||||
confirmText: t('common:delete'),
|
||||
cancelText: t('common:cancel'),
|
||||
message: t('notify.deleteMessage'),
|
||||
onClose: isConfirmed => {
|
||||
if (isConfirmed === true) {
|
||||
DeleteThing(thing.id)
|
||||
@@ -368,8 +371,8 @@ const ThingsView = () => {
|
||||
setThings(currentThings)
|
||||
} else if (response.status === 405) {
|
||||
showError({
|
||||
title: 'Unable to Delete Thing',
|
||||
message: 'Unable to delete thing with associated tasks',
|
||||
title: t('notify.deleteBlockedTitle'),
|
||||
message: t('notify.deleteBlockedMessage'),
|
||||
})
|
||||
}
|
||||
// if method not allwo show snackbar:
|
||||
@@ -377,13 +380,13 @@ const ThingsView = () => {
|
||||
.catch(error => {
|
||||
if (error?.queued) {
|
||||
showError({
|
||||
title: 'Unable to delete thing',
|
||||
message: 'You are offline and the request has been queued',
|
||||
title: t('notify.deleteFailTitle'),
|
||||
message: t('notify.queuedMessage'),
|
||||
})
|
||||
} else {
|
||||
showError({
|
||||
title: 'Unable to delete thing',
|
||||
message: 'An error occurred while deleting the thing',
|
||||
title: t('notify.deleteFailTitle'),
|
||||
message: t('notify.deleteFailMessage'),
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -416,21 +419,21 @@ const ThingsView = () => {
|
||||
setThings(currentThings)
|
||||
showNotification({
|
||||
type: 'success',
|
||||
title: 'Updated',
|
||||
message: 'Thing state updated successfully',
|
||||
title: t('notify.updatedTitle'),
|
||||
message: t('notify.updatedMessage'),
|
||||
})
|
||||
})
|
||||
})
|
||||
.catch(error => {
|
||||
if (error?.queued) {
|
||||
showError({
|
||||
title: 'Unable to update thing state',
|
||||
message: 'You are offline and the request has been queued',
|
||||
title: t('notify.updateFailTitle'),
|
||||
message: t('notify.queuedMessage'),
|
||||
})
|
||||
} else {
|
||||
showError({
|
||||
title: 'Unable to update thing state',
|
||||
message: 'An error occurred while updating the thing state',
|
||||
title: t('notify.updateFailTitle'),
|
||||
message: t('notify.updateFailMessage'),
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -448,15 +451,15 @@ const ThingsView = () => {
|
||||
setThings(currentThings)
|
||||
showNotification({
|
||||
type: 'success',
|
||||
title: 'Updated',
|
||||
message: 'Thing state updated successfully',
|
||||
title: t('notify.updatedTitle'),
|
||||
message: t('notify.updatedMessage'),
|
||||
})
|
||||
})
|
||||
})
|
||||
.catch(error => {
|
||||
showError({
|
||||
title: 'Unable to update thing state',
|
||||
message: 'An error occurred while updating the thing state',
|
||||
title: t('notify.updateFailTitle'),
|
||||
message: t('notify.updateFailMessage'),
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -470,13 +473,10 @@ const ThingsView = () => {
|
||||
level='h3'
|
||||
sx={{ fontWeight: 'lg', color: 'text.primary' }}
|
||||
>
|
||||
Things
|
||||
{t('view.title')}
|
||||
</Typography>
|
||||
<Typography level='body-sm' sx={{ color: 'text.secondary' }}>
|
||||
Things are custom fields that can be attached to tasks to capture
|
||||
additional information. They can be of type text, number, or
|
||||
boolean. You can associate things with tasks and have the task due
|
||||
once condition is met
|
||||
{t('view.description')}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Box>
|
||||
@@ -486,7 +486,7 @@ const ThingsView = () => {
|
||||
>
|
||||
<Input
|
||||
slotProps={{ input: { ref: searchInputRef } }}
|
||||
placeholder='Search things'
|
||||
placeholder={t('view.searchPlaceholder')}
|
||||
value={searchTerm}
|
||||
fullWidth
|
||||
sx={{
|
||||
@@ -512,21 +512,21 @@ const ThingsView = () => {
|
||||
/>
|
||||
<SortAndFilterMenu
|
||||
sortOptions={[
|
||||
{ name: 'Name', value: 'name' },
|
||||
{ name: 'Type', value: 'type' },
|
||||
{ name: 'State', value: 'state' },
|
||||
{ name: 'Last updated', value: 'updated' },
|
||||
{ name: t('view.sortName'), value: 'name' },
|
||||
{ name: t('view.sortType'), value: 'type' },
|
||||
{ name: t('view.sortState'), value: 'state' },
|
||||
{ name: t('view.sortUpdated'), value: 'updated' },
|
||||
]}
|
||||
selectedSort={sortBy}
|
||||
onSortChange={setSortBy}
|
||||
sortDirection={sortDirection}
|
||||
onSortDirectionChange={setSortDirection}
|
||||
filterTitle='Type'
|
||||
filterTitle={t('view.filterTitle')}
|
||||
filterOptions={[
|
||||
{ name: 'All types', value: 'all' },
|
||||
{ name: 'Text', value: 'text' },
|
||||
{ name: 'Number', value: 'number' },
|
||||
{ name: 'Boolean', value: 'boolean' },
|
||||
{ name: t('view.filterAll'), value: 'all' },
|
||||
{ name: t('types.text'), value: 'text' },
|
||||
{ name: t('types.number'), value: 'number' },
|
||||
{ name: t('types.boolean'), value: 'boolean' },
|
||||
]}
|
||||
selectedFilter={typeFilter}
|
||||
onFilterChange={value => {
|
||||
@@ -550,10 +550,10 @@ const ThingsView = () => {
|
||||
<EmptyState
|
||||
fullHeight
|
||||
icon={<Widgets />}
|
||||
title='No things yet'
|
||||
description='A thing tracks a value, like a counter or a switch, that other tasks can react to. Create one to trigger tasks automatically.'
|
||||
title={t('view.emptyTitle')}
|
||||
description={t('view.emptyDescription')}
|
||||
primaryAction={{
|
||||
label: 'Create a thing',
|
||||
label: t('view.emptyAction'),
|
||||
startDecorator: <Add />,
|
||||
onClick: () => {
|
||||
setCreateModalThing(null)
|
||||
@@ -567,14 +567,14 @@ const ThingsView = () => {
|
||||
variant='no-results'
|
||||
fullHeight
|
||||
icon={<SearchOff />}
|
||||
title='No things match'
|
||||
title={t('view.noResultsTitle')}
|
||||
description={
|
||||
searchTerm
|
||||
? `No thing matches "${searchTerm}".`
|
||||
: 'No thing matches the current filter.'
|
||||
? t('view.noResultsSearch', { term: searchTerm })
|
||||
: t('view.noResultsFilter')
|
||||
}
|
||||
primaryAction={{
|
||||
label: searchTerm ? 'Clear search' : 'Show all things',
|
||||
label: searchTerm ? t('view.clearSearch') : t('view.showAll'),
|
||||
onClick: () => {
|
||||
handleSearchClose()
|
||||
setTypeFilter('all')
|
||||
@@ -628,7 +628,9 @@ const ThingsView = () => {
|
||||
<ToggleOff sx={{ fontSize: 20 }} />
|
||||
)}
|
||||
<Typography level='body-xs' sx={{ mt: 0.5 }}>
|
||||
{thing?.type === 'text' ? 'Edit' : 'Toggle'}
|
||||
{thing?.type === 'text'
|
||||
? t('common:edit')
|
||||
: t('view.toggle')}
|
||||
</Typography>
|
||||
</Box>
|
||||
</SwipeAction>
|
||||
@@ -647,7 +649,7 @@ const ThingsView = () => {
|
||||
>
|
||||
<Edit sx={{ fontSize: 20 }} />
|
||||
<Typography level='body-xs' sx={{ mt: 0.5 }}>
|
||||
Edit
|
||||
{t('common:edit')}
|
||||
</Typography>
|
||||
</Box>
|
||||
</SwipeAction>
|
||||
@@ -666,7 +668,7 @@ const ThingsView = () => {
|
||||
>
|
||||
<Delete sx={{ fontSize: 20 }} />
|
||||
<Typography level='body-xs' sx={{ mt: 0.5 }}>
|
||||
Delete
|
||||
{t('common:delete')}
|
||||
</Typography>
|
||||
</Box>
|
||||
</SwipeAction>
|
||||
|
||||
@@ -462,7 +462,7 @@ const TimerDetails = () => {
|
||||
color: 'text.primary',
|
||||
}}
|
||||
>
|
||||
Active Work
|
||||
{t('activeWork')}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box>
|
||||
@@ -572,7 +572,7 @@ const TimerDetails = () => {
|
||||
color: 'text.primary',
|
||||
}}
|
||||
>
|
||||
Sessions
|
||||
{t('sessions')}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box>
|
||||
@@ -661,12 +661,18 @@ const TimerDetails = () => {
|
||||
level='body-sm'
|
||||
sx={{ color: 'text.secondary', fontWeight: 'medium' }}
|
||||
>
|
||||
Work vs Break Distribution
|
||||
{t('distribution')}
|
||||
</Typography>
|
||||
<Typography level='body-sm' sx={{ color: 'text.tertiary' }}>
|
||||
{calculateCurrentActiveDuration() > 0
|
||||
? `${Math.round((calculateCurrentActiveDuration() / calculateTotalDuration()) * 100)}% active`
|
||||
: 'No active time yet'}
|
||||
? t('percentActive', {
|
||||
percent: Math.round(
|
||||
(calculateCurrentActiveDuration() /
|
||||
calculateTotalDuration()) *
|
||||
100,
|
||||
),
|
||||
})
|
||||
: t('noActiveTime')}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box
|
||||
@@ -695,7 +701,7 @@ const TimerDetails = () => {
|
||||
level='body-sm'
|
||||
sx={{ color: 'text.secondary', fontWeight: 'medium', mb: 2 }}
|
||||
>
|
||||
Activity Timeline
|
||||
{t('activityTimeline')}
|
||||
</Typography>
|
||||
|
||||
{timerData &&
|
||||
@@ -803,7 +809,7 @@ const TimerDetails = () => {
|
||||
level='body-xs'
|
||||
sx={{ color: 'text.tertiary' }}
|
||||
>
|
||||
Active Work
|
||||
{t('activeWork')}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box
|
||||
@@ -852,7 +858,7 @@ const TimerDetails = () => {
|
||||
level='body-xs'
|
||||
sx={{ color: 'text.tertiary' }}
|
||||
>
|
||||
Live Session
|
||||
{t('liveSession')}
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
@@ -918,7 +924,7 @@ const TimerDetails = () => {
|
||||
mb: 2,
|
||||
}}
|
||||
>
|
||||
<Typography level='h4'>Session Breakdown</Typography>
|
||||
<Typography level='h4'>{t('sessionBreakdown')}</Typography>
|
||||
{!editingSessions[timerData.id] && (
|
||||
<Button
|
||||
variant='outlined'
|
||||
@@ -1112,7 +1118,7 @@ const TimerDetails = () => {
|
||||
variant='soft'
|
||||
sx={{ fontSize: '0.7rem' }}
|
||||
>
|
||||
Live
|
||||
{t('live')}
|
||||
</Chip>
|
||||
)}
|
||||
{/* User chip showing who started the session */}
|
||||
@@ -1211,8 +1217,8 @@ const TimerDetails = () => {
|
||||
<EmptyState
|
||||
size='sm'
|
||||
icon={<AccessTime />}
|
||||
title='No work sessions yet'
|
||||
description='Start the timer on this task and each session lands here.'
|
||||
title={t('emptySessionsTitle')}
|
||||
description={t('emptySessionsDescription')}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
@@ -1237,7 +1243,7 @@ const TimerDetails = () => {
|
||||
}}
|
||||
>
|
||||
<Typography level='body-md' sx={{ fontWeight: 'bold' }}>
|
||||
Sessions
|
||||
{t('sessions')}
|
||||
</Typography>
|
||||
<Button
|
||||
size='sm'
|
||||
@@ -1340,9 +1346,7 @@ const TimerDetails = () => {
|
||||
)
|
||||
}
|
||||
/>
|
||||
<FormHelperText>
|
||||
Leave empty if session is ongoing
|
||||
</FormHelperText>
|
||||
<FormHelperText>{t('leaveEmpty')}</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
<Box>
|
||||
|
||||
@@ -15,6 +15,7 @@ import * as chrono from 'chrono-node'
|
||||
import moment from 'moment'
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { flushSync } from 'react-dom'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
import KeyboardShortcutHint from '../../components/common/KeyboardShortcutHint'
|
||||
import ModalActions from '../../components/common/ModalActions'
|
||||
@@ -186,6 +187,7 @@ const POINTS_SUGGESTIONS = {
|
||||
const PARSE_DEBOUNCE_MS = 150
|
||||
|
||||
const TaskInput = ({ initialMode, isModalOpen, onChoreUpdate, onClose }) => {
|
||||
const { t } = useTranslation('chores')
|
||||
const { ResponsiveModal } = useResponsiveModal()
|
||||
const isMobile = useMediaQuery(theme => theme.breakpoints.down('sm'))
|
||||
const pickerEmptyDisplay = isMobile ? 'icon' : 'icon-text'
|
||||
@@ -229,13 +231,13 @@ const TaskInput = ({ initialMode, isModalOpen, onChoreUpdate, onClose }) => {
|
||||
value: 'userId',
|
||||
display: 'displayName',
|
||||
options: [
|
||||
{ userId: 'anyone', displayName: 'Anyone' },
|
||||
{ userId: 'anyone', displayName: t('addTask.anyone') },
|
||||
...(circleMembers?.res || []),
|
||||
],
|
||||
},
|
||||
'*': POINTS_SUGGESTIONS,
|
||||
}),
|
||||
[userLabels, circleMembers, handleCreateLabel],
|
||||
[userLabels, circleMembers, handleCreateLabel, t],
|
||||
)
|
||||
|
||||
const [taskText, setTaskText] = useState('')
|
||||
@@ -1156,7 +1158,7 @@ const TaskInput = ({ initialMode, isModalOpen, onChoreUpdate, onClose }) => {
|
||||
onClose={handleCloseModal}
|
||||
size='lg'
|
||||
fullWidth={true}
|
||||
title='Create new task'
|
||||
title={t('addTask.title')}
|
||||
footer={
|
||||
<ModalActions>
|
||||
{!showScan && !showVoice && projects?.length >= 1 && (
|
||||
@@ -1177,7 +1179,9 @@ const TaskInput = ({ initialMode, isModalOpen, onChoreUpdate, onClose }) => {
|
||||
fontWeight: 'normal',
|
||||
}}
|
||||
>
|
||||
{selectedProject.name}
|
||||
{selectedProject.id === 'default'
|
||||
? t('addTask.defaultProject')
|
||||
: selectedProject.name}
|
||||
</MenuButton>
|
||||
<Menu
|
||||
placement='top-start'
|
||||
@@ -1199,7 +1203,9 @@ const TaskInput = ({ initialMode, isModalOpen, onChoreUpdate, onClose }) => {
|
||||
sx={{ fontSize: 18, color: project.color }}
|
||||
/>
|
||||
</ListItemDecorator>
|
||||
{project.name}
|
||||
{project.id === 'default'
|
||||
? t('addTask.defaultProject')
|
||||
: project.name}
|
||||
</MenuItem>
|
||||
)
|
||||
})}
|
||||
@@ -1211,7 +1217,7 @@ const TaskInput = ({ initialMode, isModalOpen, onChoreUpdate, onClose }) => {
|
||||
color='neutral'
|
||||
onClick={handleCloseModal}
|
||||
>
|
||||
Cancel
|
||||
{t('common:cancel')}
|
||||
{showKeyboardShortcuts && (
|
||||
<KeyboardShortcutHint
|
||||
shortcut='Esc'
|
||||
@@ -1231,10 +1237,12 @@ const TaskInput = ({ initialMode, isModalOpen, onChoreUpdate, onClose }) => {
|
||||
onClick={handleVoiceConfirm}
|
||||
>
|
||||
{creatingVoiceTasks
|
||||
? 'Creating…'
|
||||
? t('addTask.creating')
|
||||
: voiceState.segments.length > 1
|
||||
? `Create ${voiceState.segments.length} Tasks`
|
||||
: 'Use Task'}
|
||||
? t('addTask.createCount', {
|
||||
count: voiceState.segments.length,
|
||||
})
|
||||
: t('addTask.useTask')}
|
||||
</Button>
|
||||
)}
|
||||
{showScan && scanState.primaryAction && (
|
||||
@@ -1249,7 +1257,7 @@ const TaskInput = ({ initialMode, isModalOpen, onChoreUpdate, onClose }) => {
|
||||
)}
|
||||
{showScan && scanState.phase === 'processing' && (
|
||||
<Button variant='solid' color='primary' loading disabled>
|
||||
Processing
|
||||
{t('addTask.processing')}
|
||||
</Button>
|
||||
)}
|
||||
{!showScan && !showVoice && (
|
||||
@@ -1260,7 +1268,7 @@ const TaskInput = ({ initialMode, isModalOpen, onChoreUpdate, onClose }) => {
|
||||
disabled={!taskTitle.trim() || isAttachingScan}
|
||||
onClick={submitChore}
|
||||
>
|
||||
Create
|
||||
{t('addTask.create')}
|
||||
{showKeyboardShortcuts && (
|
||||
<KeyboardShortcutHint shortcut='Enter' sx={{ ml: 1 }} />
|
||||
)}
|
||||
@@ -1349,7 +1357,7 @@ const TaskInput = ({ initialMode, isModalOpen, onChoreUpdate, onClose }) => {
|
||||
onVoiceClick={
|
||||
voiceAvailable ? () => setShowVoice(true) : undefined
|
||||
}
|
||||
placeholder='Type your task...'
|
||||
placeholder={t('addTask.taskPlaceholder')}
|
||||
onChange={text => {
|
||||
setTaskText(text)
|
||||
if (!text) setTaskTitle('')
|
||||
@@ -1484,7 +1492,9 @@ const TaskInput = ({ initialMode, isModalOpen, onChoreUpdate, onClose }) => {
|
||||
}}
|
||||
>
|
||||
<Add sx={{ fontSize: 20 }} />
|
||||
<Typography level='body-sm'>Description</Typography>
|
||||
<Typography level='body-sm'>
|
||||
{t('addTask.descriptionChip')}
|
||||
</Typography>
|
||||
</Button>
|
||||
)}
|
||||
{!hasSubTasks && (
|
||||
@@ -1507,7 +1517,9 @@ const TaskInput = ({ initialMode, isModalOpen, onChoreUpdate, onClose }) => {
|
||||
}}
|
||||
>
|
||||
<Add sx={{ fontSize: 20 }} />
|
||||
<Typography level='body-sm'>Subtasks</Typography>
|
||||
<Typography level='body-sm'>
|
||||
{t('addTask.subtasksChip')}
|
||||
</Typography>
|
||||
</Button>
|
||||
)}
|
||||
<AdvancedOptionsTrigger
|
||||
|
||||
@@ -18,12 +18,13 @@ import {
|
||||
Switch,
|
||||
Typography,
|
||||
} from '@mui/joy'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
const STRATEGY_OPTIONS = [
|
||||
{ value: 'keep_last_assigned', label: 'Keep same assignee' },
|
||||
{ value: 'random', label: 'Random' },
|
||||
{ value: 'least_completed', label: 'Least completed' },
|
||||
{ value: 'round_robin', label: 'Round robin' },
|
||||
const STRATEGY_VALUES = [
|
||||
'keep_last_assigned',
|
||||
'random',
|
||||
'least_completed',
|
||||
'round_robin',
|
||||
]
|
||||
|
||||
const FieldRow = ({ children, description, label, onLabelClick }) => (
|
||||
@@ -67,6 +68,7 @@ export const AdvancedOptionsTrigger = ({
|
||||
onToggle,
|
||||
open,
|
||||
}) => {
|
||||
const { t } = useTranslation('chores')
|
||||
const showLabel = emptyDisplay === 'icon-text' || open || activeCount > 0
|
||||
|
||||
return (
|
||||
@@ -104,7 +106,7 @@ export const AdvancedOptionsTrigger = ({
|
||||
'max-width 0.25s ease-in-out, opacity 0.2s ease-in-out, transform 0.25s ease-in-out',
|
||||
}}
|
||||
>
|
||||
More
|
||||
{t('advancedOptions.more')}
|
||||
</Typography>
|
||||
</Button>
|
||||
|
||||
@@ -153,6 +155,7 @@ const AdvancedOptionsSection = ({
|
||||
points,
|
||||
requireApproval,
|
||||
}) => {
|
||||
const { t } = useTranslation('chores')
|
||||
const displayPoints = points <= 0 ? 0 : points
|
||||
|
||||
const handleDecrement = () => {
|
||||
@@ -199,8 +202,8 @@ const AdvancedOptionsSection = ({
|
||||
>
|
||||
{/* Points */}
|
||||
<FieldRow
|
||||
label='Points'
|
||||
description='Award points for completing this task'
|
||||
label={t('advancedOptions.points')}
|
||||
description={t('advancedOptions.pointsDescription')}
|
||||
>
|
||||
<IconButton
|
||||
size='sm'
|
||||
@@ -238,8 +241,8 @@ const AdvancedOptionsSection = ({
|
||||
|
||||
{/* Require approval */}
|
||||
<FieldRow
|
||||
label='Require approval'
|
||||
description='Task needs admin sign-off before it can be closed'
|
||||
label={t('advancedOptions.requireApproval')}
|
||||
description={t('advancedOptions.requireApprovalDescription')}
|
||||
onLabelClick={() => onRequireApprovalChange(!requireApproval)}
|
||||
>
|
||||
<Switch
|
||||
@@ -251,11 +254,11 @@ const AdvancedOptionsSection = ({
|
||||
|
||||
{/* Privacy */}
|
||||
<FieldRow
|
||||
label='Limited visibility'
|
||||
label={t('advancedOptions.limitedVisibility')}
|
||||
description={
|
||||
!hasAssignees
|
||||
? 'Assign someone to enable limited visibility'
|
||||
: 'Only you and assignees can see this task'
|
||||
? t('advancedOptions.limitedVisibilityDisabled')
|
||||
: t('advancedOptions.limitedVisibilityDescription')
|
||||
}
|
||||
onLabelClick={
|
||||
hasAssignees ? () => onIsPrivateChange(!isPrivate) : undefined
|
||||
@@ -272,8 +275,8 @@ const AdvancedOptionsSection = ({
|
||||
{/* Assignment strategy — only shown when there are multiple assignees */}
|
||||
{hasMultipleAssignees && (
|
||||
<FieldRow
|
||||
label='Assign strategy'
|
||||
description='How to pick the next assignee each recurrence'
|
||||
label={t('advancedOptions.assignStrategy')}
|
||||
description={t('advancedOptions.assignStrategyDescription')}
|
||||
>
|
||||
<Select
|
||||
size='sm'
|
||||
@@ -281,9 +284,9 @@ const AdvancedOptionsSection = ({
|
||||
onChange={(_, v) => onAssignStrategyChange(v)}
|
||||
sx={{ minWidth: 190 }}
|
||||
>
|
||||
{STRATEGY_OPTIONS.map(opt => (
|
||||
<Option key={opt.value} value={opt.value}>
|
||||
{opt.label}
|
||||
{STRATEGY_VALUES.map(opt => (
|
||||
<Option key={opt} value={opt}>
|
||||
{t(`advancedOptions.strategy.${opt}`)}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
@@ -294,8 +297,8 @@ const AdvancedOptionsSection = ({
|
||||
{hasDueDate ? (
|
||||
<>
|
||||
<FieldRow
|
||||
label='Available from'
|
||||
description='Hours before the due date the task becomes available'
|
||||
label={t('advancedOptions.availableFrom')}
|
||||
description={t('advancedOptions.availableFromDescription')}
|
||||
>
|
||||
<Input
|
||||
type='number'
|
||||
@@ -308,7 +311,7 @@ const AdvancedOptionsSection = ({
|
||||
}}
|
||||
endDecorator={
|
||||
<Typography level='body-xs' textColor='text.tertiary'>
|
||||
hrs
|
||||
{t('advancedOptions.hrs')}
|
||||
</Typography>
|
||||
}
|
||||
sx={{ width: 96 }}
|
||||
@@ -322,7 +325,7 @@ const AdvancedOptionsSection = ({
|
||||
textColor='text.tertiary'
|
||||
sx={{ my: 0.5, fontStyle: 'italic' }}
|
||||
>
|
||||
Set a due date to configure completion window
|
||||
{t('advancedOptions.setDueDateHint')}
|
||||
</Typography>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
import moment from 'moment'
|
||||
import { useEffect, useState } from 'react'
|
||||
import Calendar from 'react-calendar'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
import ModalActions from '../../components/common/ModalActions'
|
||||
import { useLocalization } from '../../contexts/LocalizationContext'
|
||||
@@ -93,16 +94,17 @@ const toDateKey = date => moment(date).format('YYYY-MM-DD')
|
||||
* reschedule a task — task cards, swipe actions, action menus.
|
||||
*/
|
||||
const DueDatePickerModal = ({
|
||||
applyLabel = 'Apply',
|
||||
applyLabel,
|
||||
dueDateOnly,
|
||||
dueTime,
|
||||
onApply,
|
||||
onClose,
|
||||
onRemove,
|
||||
open,
|
||||
title = 'Due Date',
|
||||
title,
|
||||
useCustomTime,
|
||||
}) => {
|
||||
const { t } = useTranslation('chores')
|
||||
const { ResponsiveModal } = useResponsiveModal()
|
||||
const { firstDayOfWeek } = useLocalization()
|
||||
|
||||
@@ -172,21 +174,24 @@ const DueDatePickerModal = ({
|
||||
<ResponsiveModal
|
||||
open={open}
|
||||
onClose={onClose}
|
||||
title={title}
|
||||
title={title ?? t('duePicker.title')}
|
||||
fullWidth={false}
|
||||
footer={
|
||||
<ModalActions
|
||||
tertiary={
|
||||
onRemove && dueDateOnly
|
||||
? {
|
||||
label: 'Remove',
|
||||
label: t('duePicker.remove'),
|
||||
color: 'danger',
|
||||
onClick: onRemove,
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
secondary={{ label: 'Cancel', onClick: onClose }}
|
||||
primary={{ label: applyLabel, onClick: handleSave }}
|
||||
secondary={{ label: t('common:cancel'), onClick: onClose }}
|
||||
primary={{
|
||||
label: applyLabel ?? t('duePicker.apply'),
|
||||
onClick: handleSave,
|
||||
}}
|
||||
/>
|
||||
}
|
||||
>
|
||||
@@ -201,33 +206,33 @@ const DueDatePickerModal = ({
|
||||
letterSpacing: '0.05em',
|
||||
}}
|
||||
>
|
||||
Quick date
|
||||
{t('duePicker.quickDate')}
|
||||
</Typography>
|
||||
<List orientation='horizontal' wrap sx={{ ...pillListSx, mb: 1.5 }}>
|
||||
{[
|
||||
{
|
||||
key: 'today',
|
||||
label: 'Today',
|
||||
label: t('duePicker.today'),
|
||||
icon: <Today sx={{ fontSize: 14 }} />,
|
||||
},
|
||||
{
|
||||
key: 'tomorrow',
|
||||
label: 'Tomorrow',
|
||||
label: t('duePicker.tomorrow'),
|
||||
icon: <WbSunny sx={{ fontSize: 14 }} />,
|
||||
},
|
||||
{
|
||||
key: 'weekend',
|
||||
label: 'Weekend',
|
||||
label: t('duePicker.weekend'),
|
||||
icon: <Weekend sx={{ fontSize: 14 }} />,
|
||||
},
|
||||
{
|
||||
key: 'next-week',
|
||||
label: 'Next week',
|
||||
label: t('duePicker.nextWeek'),
|
||||
icon: <NextWeek sx={{ fontSize: 14 }} />,
|
||||
},
|
||||
{
|
||||
key: 'next-month',
|
||||
label: 'Next month',
|
||||
label: t('duePicker.nextMonth'),
|
||||
icon: <EventNote sx={{ fontSize: 14 }} />,
|
||||
},
|
||||
].map(opt => {
|
||||
@@ -268,33 +273,33 @@ const DueDatePickerModal = ({
|
||||
letterSpacing: '0.05em',
|
||||
}}
|
||||
>
|
||||
Quick time
|
||||
{t('duePicker.quickTime')}
|
||||
</Typography>
|
||||
<List orientation='horizontal' wrap sx={{ ...pillListSx, mb: 1.5 }}>
|
||||
{[
|
||||
{
|
||||
time: '09:00',
|
||||
label: 'Morning',
|
||||
label: t('duePicker.morning'),
|
||||
icon: <LightMode sx={{ fontSize: 14 }} />,
|
||||
},
|
||||
{
|
||||
time: '12:00',
|
||||
label: 'Noon',
|
||||
label: t('duePicker.noon'),
|
||||
icon: <WbSunny sx={{ fontSize: 14 }} />,
|
||||
},
|
||||
{
|
||||
time: '15:00',
|
||||
label: 'Afternoon',
|
||||
label: t('duePicker.afternoon'),
|
||||
icon: <WbTwilight sx={{ fontSize: 14 }} />,
|
||||
},
|
||||
{
|
||||
time: '18:00',
|
||||
label: 'Evening',
|
||||
label: t('duePicker.evening'),
|
||||
icon: <NightsStay sx={{ fontSize: 14 }} />,
|
||||
},
|
||||
{
|
||||
time: '22:00',
|
||||
label: 'Night',
|
||||
label: t('duePicker.night'),
|
||||
icon: <Bedtime sx={{ fontSize: 14 }} />,
|
||||
},
|
||||
].map(opt => (
|
||||
@@ -506,7 +511,7 @@ const DueDatePickerModal = ({
|
||||
letterSpacing: '0.05em',
|
||||
}}
|
||||
>
|
||||
Custom time
|
||||
{t('duePicker.customTime')}
|
||||
</Typography>
|
||||
<Input
|
||||
type='time'
|
||||
@@ -525,7 +530,7 @@ const DueDatePickerModal = ({
|
||||
disabled={!localDueDateOnly}
|
||||
onClick={() => setLocalUseCustomTime(false)}
|
||||
>
|
||||
Anytime
|
||||
{t('duePicker.anytime')}
|
||||
</Button>
|
||||
<Button
|
||||
size='sm'
|
||||
@@ -534,7 +539,7 @@ const DueDatePickerModal = ({
|
||||
disabled={!localDueDateOnly}
|
||||
onClick={() => setLocalUseCustomTime(true)}
|
||||
>
|
||||
Specific time
|
||||
{t('duePicker.specificTime')}
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
@@ -350,7 +350,7 @@ const PhotoTaskModal = ({ onClose, onTaskExtracted, open }) => {
|
||||
{phase === 'preview' && capturedImage && (
|
||||
<img
|
||||
src={capturedImage}
|
||||
alt='Captured document'
|
||||
alt={t('photoTask.altCaptured')}
|
||||
style={{ width: '100%', display: 'block' }}
|
||||
/>
|
||||
)}
|
||||
@@ -372,7 +372,7 @@ const PhotoTaskModal = ({ onClose, onTaskExtracted, open }) => {
|
||||
{capturedImage && (
|
||||
<img
|
||||
src={capturedImage}
|
||||
alt='Processing'
|
||||
alt={t('photoTask.altProcessing')}
|
||||
style={{
|
||||
width: '100%',
|
||||
borderRadius: 8,
|
||||
@@ -408,7 +408,9 @@ const PhotoTaskModal = ({ onClose, onTaskExtracted, open }) => {
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 1.5 }}>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<CheckCircle color='success' />
|
||||
<Typography level='title-sm'>Task identified</Typography>
|
||||
<Typography level='title-sm'>
|
||||
{t('photoTask.taskIdentified')}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box
|
||||
sx={{
|
||||
@@ -531,7 +533,7 @@ const PhotoTaskModal = ({ onClose, onTaskExtracted, open }) => {
|
||||
startDecorator={<Replay />}
|
||||
onClick={handleRetake}
|
||||
>
|
||||
Retake
|
||||
{t('photoTask.retake')}
|
||||
</Button>
|
||||
{isNativeScanner &&
|
||||
capturedImage &&
|
||||
@@ -570,7 +572,7 @@ const PhotoTaskModal = ({ onClose, onTaskExtracted, open }) => {
|
||||
startDecorator={<Replay />}
|
||||
onClick={handleRetake}
|
||||
>
|
||||
Retake
|
||||
{t('photoTask.retake')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
@@ -591,7 +593,7 @@ const PhotoTaskModal = ({ onClose, onTaskExtracted, open }) => {
|
||||
startDecorator={<Replay />}
|
||||
onClick={handleRetake}
|
||||
>
|
||||
Retake
|
||||
{t('photoTask.retake')}
|
||||
</Button>
|
||||
<Button variant='solid' color='primary' onClick={handleConfirm}>
|
||||
{t('photoTask.createTask')}
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
} from '@mui/joy'
|
||||
import moment from 'moment'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
import ModalActions from '../../components/common/ModalActions'
|
||||
import { useResponsiveModal } from '../../hooks/useResponsiveModal'
|
||||
@@ -54,13 +55,10 @@ const MONTHS = [
|
||||
'december',
|
||||
]
|
||||
|
||||
const OCCURRENCE_OPTIONS = [
|
||||
{ value: 1, label: '1st' },
|
||||
{ value: 2, label: '2nd' },
|
||||
{ value: 3, label: '3rd' },
|
||||
{ value: 4, label: '4th' },
|
||||
{ value: -1, label: 'Last' },
|
||||
]
|
||||
const OCCURRENCE_VALUES = [1, 2, 3, 4, -1]
|
||||
|
||||
// -1 is the "last occurrence" sentinel; everything else keys off its number.
|
||||
const occurrenceKey = value => (value === -1 ? 'last' : String(value))
|
||||
|
||||
const defaultMetadata = () => ({
|
||||
unit: 'days',
|
||||
@@ -119,26 +117,29 @@ const SectionLabel = ({ children }) => (
|
||||
)
|
||||
|
||||
// Shared time-of-day picker
|
||||
const TimeRow = ({ metadata, onUpdate }) => (
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5, mt: 2 }}>
|
||||
<SectionLabel>Time of day</SectionLabel>
|
||||
<Input
|
||||
type='time'
|
||||
size='sm'
|
||||
value={moment(metadata?.time).format('HH:mm')}
|
||||
onChange={e =>
|
||||
onUpdate({
|
||||
...metadata,
|
||||
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||
time: moment(
|
||||
moment(new Date()).format('YYYY-MM-DD') + 'T' + e.target.value,
|
||||
).format(),
|
||||
})
|
||||
}
|
||||
sx={{ width: 120 }}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
const TimeRow = ({ metadata, onUpdate }) => {
|
||||
const { t } = useTranslation('chores')
|
||||
return (
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5, mt: 2 }}>
|
||||
<SectionLabel>{t('repeat.picker.timeOfDay')}</SectionLabel>
|
||||
<Input
|
||||
type='time'
|
||||
size='sm'
|
||||
value={moment(metadata?.time).format('HH:mm')}
|
||||
onChange={e =>
|
||||
onUpdate({
|
||||
...metadata,
|
||||
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||
time: moment(
|
||||
moment(new Date()).format('YYYY-MM-DD') + 'T' + e.target.value,
|
||||
).format(),
|
||||
})
|
||||
}
|
||||
sx={{ width: 120 }}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
const pillListSx = {
|
||||
'--List-gap': '8px',
|
||||
@@ -151,51 +152,55 @@ const IntervalSection = ({
|
||||
frequencyMetadata,
|
||||
onFrequencyMetadataUpdate,
|
||||
onFrequencyUpdate,
|
||||
}) => (
|
||||
<Box>
|
||||
<SectionLabel>Repeat every</SectionLabel>
|
||||
<Box
|
||||
sx={{ display: 'flex', alignItems: 'center', gap: 1, flexWrap: 'wrap' }}
|
||||
>
|
||||
<Input
|
||||
type='number'
|
||||
size='sm'
|
||||
value={frequency}
|
||||
onChange={e =>
|
||||
onFrequencyUpdate(Math.max(1, parseInt(e.target.value, 10) || 1))
|
||||
}
|
||||
sx={{ width: 72 }}
|
||||
slotProps={{ input: { min: 1, max: 999 } }}
|
||||
}) => {
|
||||
const { t } = useTranslation('chores')
|
||||
return (
|
||||
<Box>
|
||||
<SectionLabel>{t('repeat.picker.repeatEvery')}</SectionLabel>
|
||||
<Box
|
||||
sx={{ display: 'flex', alignItems: 'center', gap: 1, flexWrap: 'wrap' }}
|
||||
>
|
||||
<Input
|
||||
type='number'
|
||||
size='sm'
|
||||
value={frequency}
|
||||
onChange={e =>
|
||||
onFrequencyUpdate(Math.max(1, parseInt(e.target.value, 10) || 1))
|
||||
}
|
||||
sx={{ width: 72 }}
|
||||
slotProps={{ input: { min: 1, max: 999 } }}
|
||||
/>
|
||||
<List orientation='horizontal' wrap sx={pillListSx}>
|
||||
{['days', 'weeks', 'months', 'years'].map(unit => (
|
||||
<ListItem key={unit}>
|
||||
<Checkbox
|
||||
checked={frequencyMetadata?.unit === unit}
|
||||
onClick={() =>
|
||||
onFrequencyMetadataUpdate({ ...frequencyMetadata, unit })
|
||||
}
|
||||
overlay
|
||||
disableIcon
|
||||
variant='soft'
|
||||
label={t(`repeat.unit.${unit}`)}
|
||||
/>
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
</Box>
|
||||
<TimeRow
|
||||
metadata={frequencyMetadata}
|
||||
onUpdate={onFrequencyMetadataUpdate}
|
||||
/>
|
||||
<List orientation='horizontal' wrap sx={pillListSx}>
|
||||
{['days', 'weeks', 'months', 'years'].map(unit => (
|
||||
<ListItem key={unit}>
|
||||
<Checkbox
|
||||
checked={frequencyMetadata?.unit === unit}
|
||||
onClick={() =>
|
||||
onFrequencyMetadataUpdate({ ...frequencyMetadata, unit })
|
||||
}
|
||||
overlay
|
||||
disableIcon
|
||||
variant='soft'
|
||||
label={unit.charAt(0).toUpperCase() + unit.slice(1)}
|
||||
/>
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
</Box>
|
||||
<TimeRow
|
||||
metadata={frequencyMetadata}
|
||||
onUpdate={onFrequencyMetadataUpdate}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// Days of week section
|
||||
const DaysOfWeekSection = ({
|
||||
frequencyMetadata,
|
||||
onFrequencyMetadataUpdate,
|
||||
}) => {
|
||||
const { t } = useTranslation('chores')
|
||||
const selectedDays = frequencyMetadata?.days || []
|
||||
const weekPattern = frequencyMetadata?.weekPattern || 'every_week'
|
||||
const selectedOccurrences = frequencyMetadata?.occurrences || []
|
||||
@@ -216,7 +221,7 @@ const DaysOfWeekSection = ({
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<SectionLabel>Days</SectionLabel>
|
||||
<SectionLabel>{t('repeat.picker.days')}</SectionLabel>
|
||||
<List orientation='horizontal' wrap sx={pillListSx}>
|
||||
{DAYS.map(day => (
|
||||
<ListItem key={day}>
|
||||
@@ -226,14 +231,14 @@ const DaysOfWeekSection = ({
|
||||
overlay
|
||||
disableIcon
|
||||
variant='soft'
|
||||
label={day.charAt(0).toUpperCase() + day.slice(1, 3)}
|
||||
label={t(`repeat.daysShort.${day}`)}
|
||||
/>
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
|
||||
<Box sx={{ mt: 2 }}>
|
||||
<SectionLabel>Pattern</SectionLabel>
|
||||
<SectionLabel>{t('repeat.picker.pattern')}</SectionLabel>
|
||||
<RadioGroup
|
||||
orientation='horizontal'
|
||||
value={weekPattern}
|
||||
@@ -255,15 +260,15 @@ const DaysOfWeekSection = ({
|
||||
}}
|
||||
>
|
||||
{[
|
||||
{ value: 'every_week', label: 'Every week' },
|
||||
{ value: 'week_of_month', label: 'Specific weeks' },
|
||||
{ value: 'every_week', labelKey: 'everyWeek' },
|
||||
{ value: 'week_of_month', labelKey: 'specificWeeks' },
|
||||
].map(opt => (
|
||||
<Radio
|
||||
key={opt.value}
|
||||
value={opt.value}
|
||||
color='neutral'
|
||||
disableIcon
|
||||
label={opt.label}
|
||||
label={t(`repeat.picker.${opt.labelKey}`)}
|
||||
variant='plain'
|
||||
sx={{ px: 1.5, py: 0.5 }}
|
||||
slotProps={{
|
||||
@@ -284,17 +289,17 @@ const DaysOfWeekSection = ({
|
||||
|
||||
{weekPattern === 'week_of_month' && (
|
||||
<Box sx={{ mt: 1.5 }}>
|
||||
<SectionLabel>Occurrences</SectionLabel>
|
||||
<SectionLabel>{t('repeat.picker.occurrences')}</SectionLabel>
|
||||
<List orientation='horizontal' wrap sx={pillListSx}>
|
||||
{OCCURRENCE_OPTIONS.map(opt => (
|
||||
<ListItem key={opt.value}>
|
||||
{OCCURRENCE_VALUES.map(opt => (
|
||||
<ListItem key={opt}>
|
||||
<Checkbox
|
||||
checked={selectedOccurrences.includes(opt.value)}
|
||||
onClick={() => toggleOccurrence(opt.value)}
|
||||
checked={selectedOccurrences.includes(opt)}
|
||||
onClick={() => toggleOccurrence(opt)}
|
||||
overlay
|
||||
disableIcon
|
||||
variant='soft'
|
||||
label={opt.label}
|
||||
label={t(`repeat.occurrenceShort.${occurrenceKey(opt)}`)}
|
||||
/>
|
||||
</ListItem>
|
||||
))}
|
||||
@@ -317,6 +322,7 @@ const DayOfMonthSection = ({
|
||||
onFrequencyMetadataUpdate,
|
||||
onFrequencyUpdate,
|
||||
}) => {
|
||||
const { t } = useTranslation('chores')
|
||||
const selectedMonths = frequencyMetadata?.months || []
|
||||
|
||||
const toggleMonth = month => {
|
||||
@@ -328,7 +334,7 @@ const DayOfMonthSection = ({
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<SectionLabel>Months</SectionLabel>
|
||||
<SectionLabel>{t('repeat.picker.months')}</SectionLabel>
|
||||
<List orientation='horizontal' wrap sx={pillListSx}>
|
||||
{MONTHS.map(month => (
|
||||
<ListItem key={month}>
|
||||
@@ -338,14 +344,14 @@ const DayOfMonthSection = ({
|
||||
overlay
|
||||
disableIcon
|
||||
variant='soft'
|
||||
label={month.charAt(0).toUpperCase() + month.slice(1, 3)}
|
||||
label={t(`repeat.monthsShort.${month}`)}
|
||||
/>
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5, mt: 2 }}>
|
||||
<SectionLabel>Day of month</SectionLabel>
|
||||
<SectionLabel>{t('repeat.picker.dayOfMonth')}</SectionLabel>
|
||||
<Input
|
||||
type='number'
|
||||
size='sm'
|
||||
@@ -383,6 +389,7 @@ const RepeatPickerField = ({
|
||||
const [localFrequencyMetadata, setLocalFrequencyMetadata] =
|
||||
useState(defaultMetadata)
|
||||
const { ResponsiveModal } = useResponsiveModal()
|
||||
const { t } = useTranslation('chores')
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen) return
|
||||
@@ -394,7 +401,9 @@ const RepeatPickerField = ({
|
||||
|
||||
const hasRepeat = Boolean(value)
|
||||
const shouldShowLabel = hasRepeat || emptyDisplay === 'icon-text'
|
||||
const displayLabel = hasRepeat ? getRecurrentChipText(value) : 'Repeat'
|
||||
const displayLabel = hasRepeat
|
||||
? getRecurrentChipText(value)
|
||||
: t('repeat.picker.trigger')
|
||||
const displayType = getDisplayType(localFrequencyType)
|
||||
|
||||
const handleTypeSelect = type => {
|
||||
@@ -474,7 +483,7 @@ const RepeatPickerField = ({
|
||||
|
||||
{hasRepeat && onClear && (
|
||||
<IconButton
|
||||
aria-label='Clear repeat schedule'
|
||||
aria-label={t('repeat.picker.clearAria')}
|
||||
size='sm'
|
||||
variant='soft'
|
||||
color='danger'
|
||||
@@ -499,13 +508,13 @@ const RepeatPickerField = ({
|
||||
<ResponsiveModal
|
||||
open={isOpen}
|
||||
onClose={() => setIsOpen(false)}
|
||||
title='Repeat Schedule'
|
||||
title={t('repeat.picker.modalTitle')}
|
||||
footer={
|
||||
<ModalActions
|
||||
tertiary={
|
||||
hasRepeat
|
||||
? {
|
||||
label: 'Remove',
|
||||
label: t('repeat.picker.remove'),
|
||||
color: 'danger',
|
||||
onClick: () => {
|
||||
onClear?.()
|
||||
@@ -514,15 +523,18 @@ const RepeatPickerField = ({
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
secondary={{ label: 'Cancel', onClick: () => setIsOpen(false) }}
|
||||
primary={{ label: 'Apply', onClick: handleSave }}
|
||||
secondary={{
|
||||
label: t('common:cancel'),
|
||||
onClick: () => setIsOpen(false),
|
||||
}}
|
||||
primary={{ label: t('repeat.picker.apply'), onClick: handleSave }}
|
||||
/>
|
||||
}
|
||||
>
|
||||
{/* Frequency type selector */}
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2.5 }}>
|
||||
<Box>
|
||||
<SectionLabel>Frequency</SectionLabel>
|
||||
<SectionLabel>{t('repeat.picker.frequency')}</SectionLabel>
|
||||
<List orientation='horizontal' wrap sx={pillListSx}>
|
||||
{FREQUENCY_TYPES.map(type => (
|
||||
<ListItem key={type}>
|
||||
@@ -532,7 +544,7 @@ const RepeatPickerField = ({
|
||||
overlay
|
||||
disableIcon
|
||||
variant='soft'
|
||||
label={type.charAt(0).toUpperCase() + type.slice(1)}
|
||||
label={t(`repeat.freqType.${type}`)}
|
||||
/>
|
||||
</ListItem>
|
||||
))}
|
||||
@@ -543,7 +555,7 @@ const RepeatPickerField = ({
|
||||
{displayType === 'custom' && (
|
||||
<>
|
||||
<Box>
|
||||
<SectionLabel>Schedule type</SectionLabel>
|
||||
<SectionLabel>{t('repeat.picker.scheduleType')}</SectionLabel>
|
||||
<RadioGroup
|
||||
orientation='horizontal'
|
||||
value={localFrequencyType}
|
||||
@@ -563,14 +575,7 @@ const RepeatPickerField = ({
|
||||
value={type}
|
||||
color='neutral'
|
||||
disableIcon
|
||||
label={type
|
||||
.split('_')
|
||||
.map((w, i, arr) =>
|
||||
i === 0 || i === arr.length - 1
|
||||
? w.charAt(0).toUpperCase() + w.slice(1)
|
||||
: w,
|
||||
)
|
||||
.join(' ')}
|
||||
label={t(`repeat.repeatOnType.${type}`)}
|
||||
variant='plain'
|
||||
sx={{ px: 1.5, py: 0.5 }}
|
||||
slotProps={{
|
||||
|
||||
@@ -132,7 +132,7 @@ const ScanPanel = ({
|
||||
}
|
||||
}
|
||||
if (phase === 'error') {
|
||||
return { label: 'Retake', icon: <Replay />, onClick: retake }
|
||||
return { label: t('photoTask.retake'), icon: <Replay />, onClick: retake }
|
||||
}
|
||||
return null
|
||||
}, [
|
||||
@@ -160,7 +160,7 @@ const ScanPanel = ({
|
||||
size='sm'
|
||||
checked={keepImage}
|
||||
onChange={e => setKeepImage(e.target.checked)}
|
||||
label='Keep photo as attachment'
|
||||
label={t('photoTask.keepAsAttachment')}
|
||||
sx={{ '--Checkbox-size': '18px' }}
|
||||
/>
|
||||
)
|
||||
@@ -248,7 +248,7 @@ const ScanPanel = ({
|
||||
startDecorator={<PhotoCamera fontSize='small' />}
|
||||
onClick={openFilePicker}
|
||||
>
|
||||
Upload
|
||||
{t('photoTask.upload')}
|
||||
</Button>
|
||||
)}
|
||||
{keepImageToggle}
|
||||
@@ -278,7 +278,7 @@ const ScanPanel = ({
|
||||
>
|
||||
<img
|
||||
src={capturedImage}
|
||||
alt='Processing'
|
||||
alt={t('photoTask.altProcessing')}
|
||||
style={{
|
||||
width: '100%',
|
||||
display: 'block',
|
||||
|
||||
Reference in New Issue
Block a user