From ed51b91e3ddb9936dad2c471c0f8cc9fa303f8f8 Mon Sep 17 00:00:00 2001 From: SrGooglo Date: Tue, 13 Jun 2023 22:41:46 +0000 Subject: [PATCH] added missings --- packages/app/constants/defaultSettings.json | 2 +- .../constants/settings/apparence/index.jsx | 1 + .../app/constants/settings/general/index.jsx | 224 +++++++++--------- .../app/constants/settings/player/index.jsx | 27 +++ .../app/constants/settings/profile/index.jsx | 11 +- .../app/constants/settings/security/index.jsx | 11 - 6 files changed, 143 insertions(+), 133 deletions(-) diff --git a/packages/app/constants/defaultSettings.json b/packages/app/constants/defaultSettings.json index f6900f6d..c29342f5 100755 --- a/packages/app/constants/defaultSettings.json +++ b/packages/app/constants/defaultSettings.json @@ -8,7 +8,7 @@ "longPressDelay": 600, "autoCollapseDelay": 500, "autoCollapseDelayEnabled": true, - "haptic_feedback": false, + "haptic_feedback": true, "collapseOnLooseFocus": true, "style.auto_darkMode": true, "feed_max_fetch": 20, diff --git a/packages/app/constants/settings/apparence/index.jsx b/packages/app/constants/settings/apparence/index.jsx index be5b2e3d..13978853 100755 --- a/packages/app/constants/settings/apparence/index.jsx +++ b/packages/app/constants/settings/apparence/index.jsx @@ -21,6 +21,7 @@ export default { group: "layout", emitEvent: "app.softReload", storaged: true, + mobile: false, }, { id: "style.reduceAnimations", diff --git a/packages/app/constants/settings/general/index.jsx b/packages/app/constants/settings/general/index.jsx index 57035c2a..84e25b0e 100755 --- a/packages/app/constants/settings/general/index.jsx +++ b/packages/app/constants/settings/general/index.jsx @@ -1,6 +1,4 @@ -import React from "react" import config from "config" -import { Select } from "antd" export default { id: "general", @@ -10,38 +8,42 @@ export default { order: 0, settings: [ { - "id": "language", - "storaged": true, - "group": "general", - "component": "Select", - "icon": "MdTranslate", - "title": "Language", - "description": "Choose a language for the application", - "props": { - children: config.i18n.languages.map((language) => { - return {language.name} + id: "language", + storaged: true, + group: "general", + component: "Select", + icon: "MdTranslate", + title: "Language", + description: "Choose a language for the application", + props: { + options: config.i18n.languages.map((language) => { + return { + label: language.name, + value: language.locale + } }) }, - "emitEvent": "changeLanguage" + emitEvent: "changeLanguage" }, { - "id": "haptic_feedback", - "storaged": true, - "group": "general", - "component": "Switch", - "icon": "MdVibration", - "title": "Haptic Feedback", - "description": "Enable haptic feedback on touch events.", + id: "haptic_feedback", + storaged: true, + group: "general", + component: "Switch", + icon: "MdVibration", + title: "Haptic Feedback", + description: "Enable haptic feedback on touch events.", + desktop: false }, { - "id": "longPressDelay", - "storaged": true, - "group": "general", - "component": "Slider", - "icon": "MdTimer", - "title": "Long press delay", - "description": "Set the delay before long press trigger is activated.", - "props": { + id: "longPressDelay", + storaged: true, + group: "general", + component: "Slider", + icon: "MdTimer", + title: "Long press delay", + description: "Set the delay before long press trigger is activated.", + props: { min: 300, max: 2000, step: 100, @@ -55,24 +57,29 @@ export default { } }, { - "id": "clear_internal_storage", - "storaged": false, - "group": "general", - "component": "Button", - "icon": "MdDelete", - "title": "Clear internal storage", - "description": "Clear all the data stored in the internal storage, including your current session. It will not affect the data stored in the cloud.", - "emitEvent": "app.clearInternalStorage" + id: "clear_internal_storage", + storaged: false, + group: "general", + component: "Button", + icon: "MdDelete", + title: "Clear internal storage", + description: "Clear all the data stored in the internal storage, including your current session. It will not affect the data stored in the cloud.", + emitEvent: "app.clearInternalStorage", + props: { + danger: true, + children: "Clear" + }, }, { - "id": "low_performance_mode", - "storaged": true, - "group": "general", - "component": "Switch", - "icon": "MdSlowMotionVideo", - "title": "Low performance mode", - "description": "Enable low performance mode to reduce the memory usage and improve the performance in low-end devices. This will disable some animations and other decorative features.", - "emitEvent": "app.lowPerformanceMode", + id: "low_performance_mode", + storaged: true, + group: "general", + component: "Switch", + icon: "MdSlowMotionVideo", + title: "Low performance mode", + description: "Enable low performance mode to reduce the memory usage and improve the performance in low-end devices. This will disable some animations and other decorative features.", + emitEvent: "app.lowPerformanceMode", + experimental: true, disabled: true, }, { @@ -83,6 +90,7 @@ export default { icon: "MdVolumeUp", title: "UI effects", description: "Enable the UI effects.", + mobile: false, }, { id: "ui.general_volume", @@ -100,64 +108,68 @@ export default { max: 100, step: 10, }, - emitEvent: "change:app.general_ui_volume" + emitEvent: "change:app.general_ui_volume", + mobile: false, }, { - "id": "notifications_sound", - "storaged": true, - "group": "notifications", - "component": "Switch", - "icon": "MdVolumeUp", - "title": "Notifications Sound", - "description": "Play a sound when a notification is received.", + id: "notifications_sound", + storaged: true, + group: "notifications", + component: "Switch", + icon: "MdVolumeUp", + title: "Notifications Sound", + description: "Play a sound when a notification is received.", }, { - "id": "notifications_vibrate", - "storaged": true, - "group": "notifications", - "component": "Switch", - "icon": "MdVibration", - "title": "Vibration", - "description": "Vibrate the device when a notification is received.", - "emitEvent": "changeNotificationsVibrate" + id: "notifications_vibrate", + storaged: true, + group: "notifications", + component: "Switch", + icon: "MdVibration", + title: "Vibration", + description: "Vibrate the device when a notification is received.", + emitEvent: "changeNotificationsVibrate", + desktop: false, }, { - "id": "notifications_sound_volume", - "storaged": true, - "group": "notifications", - "component": "Slider", - "icon": "MdVolumeUp", - "title": "Sound Volume", - "description": "Set the volume of the sound when a notification is received.", - "props": { + id: "notifications_sound_volume", + storaged: true, + group: "notifications", + component: "Slider", + icon: "MdVolumeUp", + title: "Sound Volume", + description: "Set the volume of the sound when a notification is received.", + props: { tipFormatter: (value) => { return `${value}%` } }, - "emitEvent": "changeNotificationsSoundVolume" + emitEvent: "changeNotificationsSoundVolume", + mobile: false, }, { - "id": "collapseOnLooseFocus", - "storaged": true, - "group": "sidebar", - "component": "Switch", - "icon": "Columns", - "title": "Auto Collapse", - "description": "Collapse the sidebar when loose focus", - "emitEvent": "settingChanged.sidebar_collapse", + id: "collapseOnLooseFocus", + storaged: true, + group: "sidebar", + component: "Switch", + icon: "Columns", + title: "Auto Collapse", + description: "Collapse the sidebar when loose focus", + emitEvent: "settingChanged.sidebar_collapse", + mobile: false, }, { - "id": "autoCollapseDelay", - "storaged": true, - "group": "sidebar", - "component": "Slider", - "icon": "MdTimer", - "dependsOn": { + id: "autoCollapseDelay", + storaged: true, + group: "sidebar", + component: "Slider", + icon: "MdTimer", + dependsOn: { "collapseOnLooseFocus": true }, - "title": "Auto Collapse timeout", - "description": "Set the delay before the sidebar is collapsed", - "props": { + title: "Auto Collapse timeout", + description: "Set the delay before the sidebar is collapsed", + props: { min: 0, max: 2000, step: 100, @@ -168,41 +180,21 @@ export default { 1500: "1.5s", 2000: "2s", } - } + }, + mobile: false, }, { - "id": "feed_max_fetch", - "title": "Fetch max items", - "description": "Set the maximum number of items to load per fetch in the feed list", - "component": "Slider", - "icon": "MdFormatListNumbered", - "group": "posts", - "props": { + id: "feed_max_fetch", + title: "Fetch max items", + description: "Set the maximum number of items to load per fetch in the feed list", + component: "Slider", + icon: "MdFormatListNumbered", + group: "posts", + props: { min: 5, max: 50, }, - "storaged": true, - }, - { - "id": "postCard_carrusel_auto", - "title": "Post autoplay", - "description": "Automatically play the post medias when the post has multiple medias", - "component": "Switch", - "icon": "MdPhotoCameraBack", - "group": "posts", - "storaged": true, - "emitEvent": "router.forceUpdate", - "disabled": true - }, - { - "id": "postCard_expansible_actions", - "title": "Expansible actions", - "description": "Automatically show or hide the actions bar", - "component": "Switch", - "icon": "MdCallToAction", - "group": "posts", - "storaged": true, - "emitEvent": "router.forceUpdate" + storaged: true, }, ] } \ No newline at end of file diff --git a/packages/app/constants/settings/player/index.jsx b/packages/app/constants/settings/player/index.jsx index 80d23797..ea1c91f9 100755 --- a/packages/app/constants/settings/player/index.jsx +++ b/packages/app/constants/settings/player/index.jsx @@ -92,6 +92,33 @@ export default { "player.compressor": true }, storaged: false, + }, + { + id: "player.gain", + title: "Gain", + icon: "MdGraphicEq", + group: "general", + description: "Adjust gain for audio output", + component: "Slider", + props: { + min: 1, + max: 2, + step: 0.1, + marks: { + 1: "Off", + 1.5: "50%", + 2: "100%" + } + }, + defaultValue: () => { + return app.cores.player.gain.values().gain + }, + onUpdate: (value) => { + app.cores.player.gain.modifyValues({ + gain: value + }) + }, + storaged: false, } ] } \ No newline at end of file diff --git a/packages/app/constants/settings/profile/index.jsx b/packages/app/constants/settings/profile/index.jsx index 431eb826..0a996589 100755 --- a/packages/app/constants/settings/profile/index.jsx +++ b/packages/app/constants/settings/profile/index.jsx @@ -51,7 +51,7 @@ export default { }) if (result) { - return result + return value } }, extraActions: [ @@ -89,7 +89,7 @@ export default { }) if (result) { - return result + return value } }, "debounced": true, @@ -105,6 +105,7 @@ export default { UploadButton ], "defaultValue": (ctx) => { + console.log(ctx) return ctx.userData.avatar }, "onUpdate": async (value) => { @@ -114,7 +115,7 @@ export default { if (result) { app.message.success("Avatar updated") - return result + return value } }, "debounced": true, @@ -139,7 +140,7 @@ export default { if (result) { app.message.success("Cover updated") - return result + return value } }, "debounced": true, @@ -166,7 +167,7 @@ export default { }) if (result) { - return result + return value } }, "debounced": true, diff --git a/packages/app/constants/settings/security/index.jsx b/packages/app/constants/settings/security/index.jsx index 9be27e26..66e6e0d9 100755 --- a/packages/app/constants/settings/security/index.jsx +++ b/packages/app/constants/settings/security/index.jsx @@ -34,17 +34,6 @@ export default { "icon": "Monitor", "component": loadable(() => import("../components/sessions")), "storaged": false - }, - { - "id": "logout", - "group": "security.other", - "component": "Button", - "icon": "LogOut", - "title": "Logout", - "description": "Logout from your account", - onUpdate: async () => { - await AuthModel.logout() - } } ] } \ No newline at end of file