diff options
author | kytwb <412895+kytwb@users.noreply.github.com> | 2021-06-12 19:51:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-12 19:51:28 +0200 |
commit | b0ecce5eab2a6d0eed3ade7c43e252ca9bac7edb (patch) | |
tree | aed0253b61ca035f3388a7d6a369ffe75f195a58 /src/config.js | |
parent | Bypassed code signing since that is also incorrect in GH settings. (diff) | |
download | ferdium-app-b0ecce5eab2a6d0eed3ade7c43e252ca9bac7edb.tar.gz ferdium-app-b0ecce5eab2a6d0eed3ade7c43e252ca9bac7edb.tar.zst ferdium-app-b0ecce5eab2a6d0eed3ade7c43e252ca9bac7edb.zip |
Fix active Todos service behaviour (#1481)
* Return false instead of null in isTodosServiceAdded
* Resolve from TODOS_RECIPES_ID instead of hardcoded TODOS_RECIPE_ID
* Fix TodosWebview width toggling when isTodosServiceActive
* Add more todo service recipe IDs
* Refactor todos state management
* Moved todos service URL and recipe ID computation logic to todos/store
* Simplified TodosWebview by delegating to the store for the URL and
removing the (unused) payment logic
* Made the todos service computation logic in the Service model depend
on the logic in todos/store
* Made ServicesStore depend on the todos service logic from the Service
model
* Todos appearance fixes
* Hide double horizontal rules if todo settings are hidden due to an
added todo service
* Hide todos panel border when the panel is hidden or expanded
* Make expanded todos panel obey sidebar width and vertical style
settings
* Make todos/store use isValidExternalURL
* Harden isValidExternalURL against malformed URLs
* Reduce todo URL string duplication in config.js
Co-authored-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'src/config.js')
-rw-r--r-- | src/config.js | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/src/config.js b/src/config.js index 8930c755f..3a728b55e 100644 --- a/src/config.js +++ b/src/config.js | |||
@@ -62,19 +62,44 @@ export const SEARCH_ENGINE_URLS = { | |||
62 | [SEARCH_ENGINE_DDG]: ({ searchTerm }) => `https://duckduckgo.com/?q=${searchTerm}`, | 62 | [SEARCH_ENGINE_DDG]: ({ searchTerm }) => `https://duckduckgo.com/?q=${searchTerm}`, |
63 | }; | 63 | }; |
64 | 64 | ||
65 | export const CUSTOM_TODO_SERVICE = 'isUsingCustomTodoService'; | ||
66 | |||
67 | const TODO_TODOIST_URL = 'https://todoist.com/app'; | ||
68 | const TODO_FRANZ_TODOS_URL = 'https://app.franztodos.com'; | ||
69 | const TODO_TICKTICK_URL = 'https://ticktick.com/signin'; | ||
70 | const TODO_MSTODO_URL = 'https://todo.microsoft.com/?app#'; | ||
71 | const TODO_HABITICA_URL = 'https://habitica.com/login'; | ||
72 | const TODO_NOZBE_URL = 'https://app.nozbe.com/#login'; | ||
73 | const TODO_RTM_URL = 'https://www.rememberthemilk.com/login/'; | ||
74 | const TODO_ANYDO_URL = 'https://desktop.any.do/'; | ||
75 | const TODO_GOOGLETASKS_URL = 'https://tasks.google.com/embed/?origin=https%3A%2F%2Fcalendar.google.com&fullWidth=1'; | ||
76 | |||
77 | export const TODO_SERVICE_RECIPE_IDS = { | ||
78 | [TODO_TODOIST_URL]: 'todoist', | ||
79 | [TODO_FRANZ_TODOS_URL]: 'franz-todos', | ||
80 | [TODO_TICKTICK_URL]: 'TickTick', | ||
81 | [TODO_MSTODO_URL]: 'mstodo', | ||
82 | [TODO_HABITICA_URL]: 'habitica', | ||
83 | [TODO_ANYDO_URL]: 'anydo', | ||
84 | }; | ||
85 | |||
65 | export const TODO_APPS = { | 86 | export const TODO_APPS = { |
66 | 'https://todoist.com/app': 'Todoist', | 87 | [TODO_TODOIST_URL]: 'Todoist', |
67 | 'https://app.franztodos.com': 'Franz Todo', | 88 | [TODO_FRANZ_TODOS_URL]: 'Franz Todo', |
68 | 'https://ticktick.com/signin': 'TickTick', | 89 | [TODO_TICKTICK_URL]: 'TickTick', |
69 | 'https://todo.microsoft.com/?app#': 'Microsoft To Do', | 90 | [TODO_MSTODO_URL]: 'Microsoft To Do', |
70 | 'https://habitica.com/login': 'Habitica', | 91 | [TODO_HABITICA_URL]: 'Habitica', |
71 | 'https://app.nozbe.com/#login': 'Nozbe', | 92 | [TODO_NOZBE_URL]: 'Nozbe', |
72 | 'https://www.rememberthemilk.com/login/': 'Remember The Milk', | 93 | [TODO_RTM_URL]: 'Remember The Milk', |
73 | 'https://desktop.any.do/': 'Any.do', | 94 | [TODO_ANYDO_URL]: 'Any.do', |
74 | 'https://tasks.google.com/embed/?origin=https%3A%2F%2Fcalendar.google.com&fullWidth=1': 'Google Tasks', | 95 | [TODO_GOOGLETASKS_URL]: 'Google Tasks', |
75 | isUsingCustomTodoService: 'Other service', | 96 | [CUSTOM_TODO_SERVICE]: 'Other service', |
76 | }; | 97 | }; |
77 | 98 | ||
99 | export const DEFAULT_TODO_SERVICE = TODO_FRANZ_TODOS_URL; | ||
100 | export const DEFAULT_TODO_RECIPE_ID = TODO_SERVICE_RECIPE_IDS[DEFAULT_TODO_SERVICE]; | ||
101 | export const DEFAULT_TODO_SERVICE_NAME = TODO_APPS[DEFAULT_TODO_SERVICE]; | ||
102 | |||
78 | export const SIDEBAR_WIDTH = { | 103 | export const SIDEBAR_WIDTH = { |
79 | 35: 'Extremely slim sidebar', | 104 | 35: 'Extremely slim sidebar', |
80 | 45: 'Very slim sidebar', | 105 | 45: 'Very slim sidebar', |
@@ -123,7 +148,7 @@ export const DEFAULT_APP_SETTINGS = { | |||
123 | 148 | ||
124 | // Ferdi specific options | 149 | // Ferdi specific options |
125 | server: LIVE_FERDI_API, | 150 | server: LIVE_FERDI_API, |
126 | predefinedTodoServer: 'https://app.franztodos.com', | 151 | predefinedTodoServer: DEFAULT_TODO_SERVICE, |
127 | autohideMenuBar: false, | 152 | autohideMenuBar: false, |
128 | lockingFeatureEnabled: false, | 153 | lockingFeatureEnabled: false, |
129 | locked: false, | 154 | locked: false, |