From 01848471d8e5f8670a803f377f505552fad28cd3 Mon Sep 17 00:00:00 2001 From: Abby Wheelis Date: Mon, 11 Sep 2023 09:52:21 -0600 Subject: [PATCH 1/7] remove setTime action from notifs This setTime action is broken, so we must remove it from the notifications We can restore this is a few weeks after we migrate to React routing --- www/js/splash/notifScheduler.js | 41 +++++++++++++++++---------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/www/js/splash/notifScheduler.js b/www/js/splash/notifScheduler.js index 1fccda3e9..069af7a18 100644 --- a/www/js/splash/notifScheduler.js +++ b/www/js/splash/notifScheduler.js @@ -49,16 +49,17 @@ angular.module('emission.splash.notifscheduler', return true; } - const setUpActions = () => { - const action = { - id: 'action', - title: 'Change Time', - launch: true - }; - return new Promise((rs) => { - cordova.plugins.notification.local.addActions('reminder-actions', [action], rs); - }); - } + /* remove notif actions as they do not work, can restore post routing migration */ + // const setUpActions = () => { + // const action = { + // id: 'action', + // title: 'Change Time', + // launch: true + // }; + // return new Promise((rs) => { + // cordova.plugins.notification.local.addActions('reminder-actions', [action], rs); + // }); + // } function debugGetScheduled(prefix) { cordova.plugins.notification.local.getScheduled((notifs) => { @@ -141,15 +142,15 @@ angular.module('emission.splash.notifscheduler', title: scheme.title[localeCode], text: scheme.text[localeCode], trigger: {at: nDate}, - actions: 'reminder-actions', - data: { - action: { - redirectTo: 'root.main.control', - redirectParams: { - openTimeOfDayPicker: true - } - } - } + // actions: 'reminder-actions', + // data: { + // action: { + // redirectTo: 'root.main.control', + // redirectParams: { + // openTimeOfDayPicker: true + // } + // } + // } } }); cordova.plugins.notification.local.cancelAll(() => { @@ -262,7 +263,7 @@ angular.module('emission.splash.notifscheduler', Logger.log("No reminder schemes found in config, not scheduling notifications"); return; } - setUpActions(); + //setUpActions(); update(); }); From ada4d7c1d2b3fc3022ae12e58a141c556c314c95 Mon Sep 17 00:00:00 2001 From: Abby Wheelis Date: Mon, 11 Sep 2023 09:53:50 -0600 Subject: [PATCH 2/7] notif display not updating to remedy a lag in the displayed notification time, set the notification settings to refresh when the uiConfig changes, this allows the settings to refresh after it is properly set, and prevents the initially blank reminder time I was seeing --- www/js/control/ProfileSettings.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/js/control/ProfileSettings.jsx b/www/js/control/ProfileSettings.jsx index 62f79e67a..e97430f46 100644 --- a/www/js/control/ProfileSettings.jsx +++ b/www/js/control/ProfileSettings.jsx @@ -111,6 +111,11 @@ const ProfileSettings = () => { setAppVersion(ClientStats.getAppVersion()); } + //previously not loaded on regular refresh, this ensures it stays caught up + useEffect(() => { + refreshNotificationSettings(); + }, [uiConfig]) + const whenReady = function(newAppConfig){ var tempUiConfig = newAppConfig; From 426c44069ef3446ba8ec33bad3dbdf5fec335adf Mon Sep 17 00:00:00 2001 From: Abby Wheelis Date: Mon, 11 Sep 2023 10:12:28 -0600 Subject: [PATCH 3/7] remove unused code lingering code pending update to Samsung situation -- removed since it isn't used at all, and will add what is needed later --- www/js/control/AppStatusModal.tsx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/www/js/control/AppStatusModal.tsx b/www/js/control/AppStatusModal.tsx index 0d5b94a51..00143d10b 100644 --- a/www/js/control/AppStatusModal.tsx +++ b/www/js/control/AppStatusModal.tsx @@ -25,9 +25,6 @@ const AppStatusModal = ({permitVis, setPermitVis, dialogStyle, settingsScope}) = const [explainVis, setExplainVis] = useState(false); - const [backgroundRestricted, setBackgroundRestricted] = useState(false); - const [allowBackgroundInstructions, setAllowBackgroundInstructions] = useState>([]); - const [checkList, setCheckList] = useState([]); const [explanationList, setExplanationList] = useState>([]); const [haveSetText, setHaveSetText] = useState(false); @@ -313,13 +310,8 @@ const AppStatusModal = ({permitVis, setPermitVis, dialogStyle, settingsScope}) = setExplanationList(tempExplanations); - //waiting on samsung feedback, need more information - setBackgroundRestricted(false); - if(window['device'].manufacturer.toLowerCase() == "samsung") { - setBackgroundRestricted(true); - setAllowBackgroundInstructions(t("intro.allow_background.samsung")); - } - + //TODO - update samsung handling based on feedback + console.log("Explanation = "+explanationList); } From 3435e122f5b2ec9553ce7f581711efefa8ac6002 Mon Sep 17 00:00:00 2001 From: Abby Wheelis Date: Mon, 11 Sep 2023 10:33:37 -0600 Subject: [PATCH 4/7] update android app disable instructions After reports of the instructions being confusing on Android 13 - update text to specify more closely what needs to be changed on 13 in particular This app (https://www.followmee.com/FAQ.aspx?t=androidunusedapp#) had an instructions page that explained the process for different Android OS well --- www/i18n/en.json | 3 ++- www/js/appstatus/permissioncheck.js | 7 +++++-- www/js/control/AppStatusModal.tsx | 7 +++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/www/i18n/en.json b/www/i18n/en.json index be884a2a5..758960ade 100644 --- a/www/i18n/en.json +++ b/www/i18n/en.json @@ -274,7 +274,8 @@ "name": "Unused apps disabled", "description": { "android-disable-lt-12": "On the app settings page, go to 'Permissions' and ensure that the app permissions will not be automatically reset.", - "android-disable-gte-12": "On the app settings page, turn off 'Remove permissions and free up space.'", + "android-disable-12": "On the app settings page, turn off 'Remove permissions and free up space.'", + "android-disable-gte-13": "On the app settings page, turn off 'Pause app activity if unused.'", "ios": "Please allow." } }, diff --git a/www/js/appstatus/permissioncheck.js b/www/js/appstatus/permissioncheck.js index 9abd7f709..84067a701 100644 --- a/www/js/appstatus/permissioncheck.js +++ b/www/js/appstatus/permissioncheck.js @@ -351,8 +351,11 @@ controller("PermissionCheckControl", function($scope, $element, $attrs, return checkOrFix(ignoreBatteryOptCheck, $window.cordova.plugins.BEMDataCollection.isIgnoreBatteryOptimizations, $scope.recomputeBackgroundRestrictionStatus, false); }; - var androidUnusedDescTag = "intro.appstatus.unusedapprestrict.description.android-disable-gte-12"; - if ($scope.osver < 12) { + var androidUnusedDescTag = "intro.appstatus.unusedapprestrict.description.android-disable-gte-13"; + if ($scope.osver == 12) { + androidUnusedDescTag= "intro.appstatus.unusedapprestrict.description.android-disable-12"; + } + else if ($scope.osver < 12) { androidUnusedDescTag= "intro.appstatus.unusedapprestrict.description.android-disable-lt-12"; } let unusedAppsUnrestrictedCheck = { diff --git a/www/js/control/AppStatusModal.tsx b/www/js/control/AppStatusModal.tsx index 00143d10b..64c63f720 100644 --- a/www/js/control/AppStatusModal.tsx +++ b/www/js/control/AppStatusModal.tsx @@ -269,8 +269,11 @@ const AppStatusModal = ({permitVis, setPermitVis, dialogStyle, settingsScope}) = return checkOrFix(ignoreBatteryOptCheck, window['cordova'].plugins.BEMDataCollection.isIgnoreBatteryOptimizations, false); }; - var androidUnusedDescTag = "intro.appstatus.unusedapprestrict.description.android-disable-gte-12"; - if (osver < 12) { + var androidUnusedDescTag = "intro.appstatus.unusedapprestrict.description.android-disable-gte-13"; + if (osver == 12) { + androidUnusedDescTag= "intro.appstatus.unusedapprestrict.description.android-disable-12"; + } + else if (osver < 12) { androidUnusedDescTag= "intro.appstatus.unusedapprestrict.description.android-disable-lt-12"; } let unusedAppsUnrestrictedCheck = { From 99c5a0e2698bd26d16aab9678a4e31a71dae6261 Mon Sep 17 00:00:00 2001 From: Abby Wheelis Date: Mon, 11 Sep 2023 11:32:43 -0600 Subject: [PATCH 5/7] move appVersion out of dev zone move appVersion to be more visible to users also caught and fixed an error where appVersion was held as an object and not a string --- www/js/control/ProfileSettings.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/js/control/ProfileSettings.jsx b/www/js/control/ProfileSettings.jsx index e97430f46..f5327dfb6 100644 --- a/www/js/control/ProfileSettings.jsx +++ b/www/js/control/ProfileSettings.jsx @@ -80,7 +80,7 @@ const ProfileSettings = () => { const [syncSettings, setSyncSettings] = useState({}); const [cacheResult, setCacheResult] = useState(""); const [connectSettings, setConnectSettings] = useState({}); - const [appVersion, setAppVersion] = useState({}); + const [appVersion, setAppVersion] = useState(""); const [uiConfig, setUiConfig] = useState({}); const [consentDoc, setConsentDoc] = useState({}); const [dumpDate, setDumpDate] = useState(new Date()); @@ -512,8 +512,8 @@ const ProfileSettings = () => { - console.log("")} desc={appVersion}> + console.log("")} desc={appVersion}> {/* menu for "nuke data" */} From 4088959f1b7f107f3b85262d2a9da010bc661016 Mon Sep 17 00:00:00 2001 From: Abby Wheelis Date: Mon, 11 Sep 2023 12:36:04 -0600 Subject: [PATCH 6/7] make beginning of study the earliest dump date we should not allow users to download data from prior to the beginning of their study The month was setting as 1 in advance of the config, so I adjusted manually with the "-1" --- www/js/control/DataDatePicker.tsx | 3 +-- www/js/control/ProfileSettings.jsx | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/www/js/control/DataDatePicker.tsx b/www/js/control/DataDatePicker.tsx index b36054d26..83e0986b2 100644 --- a/www/js/control/DataDatePicker.tsx +++ b/www/js/control/DataDatePicker.tsx @@ -6,7 +6,7 @@ import { DatePickerModal } from 'react-native-paper-dates'; import { useTranslation } from "react-i18next"; import { getAngularService } from "../angular-react-helper"; -const DataDatePicker = ({date, setDate, open, setOpen}) => { +const DataDatePicker = ({date, setDate, open, setOpen, minDate}) => { const { t, i18n } = useTranslation(); //able to pull lang from this const ControlHelper = getAngularService("ControlHelper"); @@ -23,7 +23,6 @@ const DataDatePicker = ({date, setDate, open, setOpen}) => { [setOpen, setDate] ); - const minDate = new Date(2015, 1, 1); const maxDate = new Date(); return ( diff --git a/www/js/control/ProfileSettings.jsx b/www/js/control/ProfileSettings.jsx index f5327dfb6..15bd25c31 100644 --- a/www/js/control/ProfileSettings.jsx +++ b/www/js/control/ProfileSettings.jsx @@ -688,7 +688,9 @@ const ProfileSettings = () => { - + + From b3c45c35e0d17b69ecb0519b2664b84b9337d076 Mon Sep 17 00:00:00 2001 From: Abby Wheelis Date: Mon, 11 Sep 2023 17:04:42 -0600 Subject: [PATCH 7/7] update opcode Modal the styling on the opcode modal was not consistent with the other modals, I remedied this by passing the style in from ProfileSettings as a parameter --- www/js/control/PopOpCode.jsx | 8 ++------ www/js/control/ProfileSettings.jsx | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/www/js/control/PopOpCode.jsx b/www/js/control/PopOpCode.jsx index 04a866f18..8325b98c7 100644 --- a/www/js/control/PopOpCode.jsx +++ b/www/js/control/PopOpCode.jsx @@ -5,7 +5,7 @@ import { useTranslation } from "react-i18next"; import QrCode from "../components/QrCode"; import AlertBar from "./AlertBar"; -const PopOpCode = ({visibilityValue, tokenURL, action, setVis}) => { +const PopOpCode = ({visibilityValue, tokenURL, action, setVis, dialogStyle}) => { const { t } = useTranslation(); const { colors } = useTheme(); @@ -31,7 +31,7 @@ const PopOpCode = ({visibilityValue, tokenURL, action, setVis}) => { transparent={true}> setVis(false)} - style={styles.dialog(colors.elevation.level3)}> + style={dialogStyle}> {t("general-settings.qrcode")} {t("general-settings.qrcode-share-title")} @@ -51,10 +51,6 @@ const PopOpCode = ({visibilityValue, tokenURL, action, setVis}) => { ) } const styles = StyleSheet.create({ - dialog: (surfaceColor) => ({ - backgroundColor: surfaceColor, - margin: 1, - }), title: { alignItems: 'center', diff --git a/www/js/control/ProfileSettings.jsx b/www/js/control/ProfileSettings.jsx index 15bd25c31..e3dab82e3 100644 --- a/www/js/control/ProfileSettings.jsx +++ b/www/js/control/ProfileSettings.jsx @@ -599,7 +599,7 @@ const ProfileSettings = () => { {/* opcode viewing popup */} - + {/* {view permissions} */}