Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile changes to unblock routing #1029

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c240f79
convert the log page to React
Sep 11, 2023
ef6ba26
Merge remote-tracking branch 'upstream/label_dashboard_profile_sept_2…
Sep 12, 2023
c8ceafe
refactor dialogStyle and create Action Menu
Sep 12, 2023
b682e53
ActionMenu title
Sep 12, 2023
7e55e83
add SensedPage, fix scrolling
Sep 12, 2023
4c430d2
take out old code
Sep 12, 2023
f1f9b57
update log page to load more
Sep 12, 2023
e21cb6e
load on enter
Sep 12, 2023
496b353
refactor .then() to try/catch
Sep 12, 2023
fe44ae6
resolve error
Sep 12, 2023
e50f0a1
remove infiniteScrollComplete broadcasts
Sep 12, 2023
fd32aee
fix sensed formatting
Sep 12, 2023
d20bf2e
i18n for ui strings
Sep 13, 2023
f132056
remove old functions
Sep 13, 2023
723c5e7
factor out "Locations" and "Motion Type"
Sep 13, 2023
d04d5ee
combine dev-errors into errors
Sep 13, 2023
5e7a50c
React Control Helpers
Sep 14, 2023
9255675
fix medium accuracy
Sep 14, 2023
1b8a43c
remove update complete listeners
Sep 14, 2023
9078488
eliminate settingsScope
Sep 14, 2023
e02db4a
remove "safeToggle"
Sep 14, 2023
d55760f
prevent "missing argument errors"
Sep 14, 2023
2cb1145
remove safe toggle code
Sep 14, 2023
1189700
isolate forceSync code to ControlSyncHelper
Sep 14, 2023
df78758
don't store a duplicate copy of the collectConfig
Sep 14, 2023
1551eee
move functions into helpers
Sep 15, 2023
1cfb190
restore log statement
Sep 15, 2023
f012973
fetch DB before updating
Sep 15, 2023
c46e2dc
move sync rows to devZone
Sep 18, 2023
7f8ff42
move from .then to await
Sep 18, 2023
2876872
endTripForceSync using await
Sep 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion www/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
"nuke-all": "Nuke all buffers and cache",
"test-notification": "Test local notification",
"check-log": "Check log",
"log-title" : "Log",
"check-sensed-data": "Check sensed data",
"sensed-title": "Sensed Data: Transitions",
"collection": "Collection",
"sync": "Sync",
"button-accept": "I accept",
Expand Down Expand Up @@ -360,7 +362,9 @@
"errors": {
"while-populating-composite": "Error while populating composite trips",
"while-loading-another-week": "Error while loading travel of {{when}} week",
"while-loading-specific-week": "Error while loading travel for the week of {{day}}"
"while-loading-specific-week": "Error while loading travel for the week of {{day}}",
"while-log-messages": "While getting messages from the log ",
"while-max-index" : "While getting max index "
},
"consent-text": {
"title":"NREL OPENPATH PRIVACY POLICY/TERMS OF USE",
Expand Down
1 change: 0 additions & 1 deletion www/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import './js/survey/input-matcher.js';
import './js/survey/multilabel/infinite_scroll_filters.js';
import './js/survey/multilabel/multi-label-ui.js';
import './js/diary.js';
import './js/recent.js';
import './js/diary/services.js';
import './js/survey/external/launch.js';
import './js/survey/enketo/answer.js';
Expand Down
41 changes: 41 additions & 0 deletions www/js/components/ActionMenu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from "react";
import { Modal } from "react-native";
import { Dialog, Button, useTheme } from "react-native-paper";
import { useTranslation } from "react-i18next";
import { settingStyles } from "../control/ProfileSettings";

const ActionMenu = ({vis, setVis, title, actionSet, onAction, onExit}) => {

const { t } = useTranslation();
const { colors } = useTheme();

return (
<Modal visible={vis} onDismiss={() => setVis(false)}
transparent={true}>
<Dialog visible={vis}
onDismiss={() => setVis(false)}
style={settingStyles.dialog(colors.elevation.level3)}>
<Dialog.Title>{title}</Dialog.Title>
<Dialog.Content>
{actionSet?.map((e) =>
<Button key={e.text}
onPress={() => {
onAction(e);
setVis(false);
}}>
{e.text}
</Button>
)}
</Dialog.Content>
<Dialog.Actions>
<Button onPress={() => {setVis(false);
onExit();}}>{
t('general-settings.cancel')}
</Button>
</Dialog.Actions>
</Dialog>
</Modal>
)
}

export default ActionMenu;
2 changes: 1 addition & 1 deletion www/js/control/AlertBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Snackbar } from 'react-native-paper';
import { useTranslation } from "react-i18next";
import { SafeAreaView } from "react-native-safe-area-context";

const AlertBar = ({visible, setVisible, messageKey, messageAddition}) => {
const AlertBar = ({visible, setVisible, messageKey, messageAddition=undefined}) => {
const { t } = useTranslation();
const onDismissSnackBar = () => setVisible(false);

Expand Down
13 changes: 3 additions & 10 deletions www/js/control/AppStatusModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ import useAppConfig from "../useAppConfig";
import useAppStateChange from "../useAppStateChange";
import ExplainPermissions from "../appstatus/ExplainPermissions";
import AlertBar from "./AlertBar";
import { settingStyles } from "./ProfileSettings";

const AppStatusModal = ({permitVis, setPermitVis, dialogStyle, settingsScope}) => {
Abby-Wheelis marked this conversation as resolved.
Show resolved Hide resolved
const AppStatusModal = ({permitVis, setPermitVis}) => {
const { t } = useTranslation();
const { colors } = useTheme();
const { appConfig, loading } = useAppConfig();

console.log("settings scope in app status modal", settingsScope);

const { height: windowHeight } = useWindowDimensions();
const [osver, setOsver] = useState(0);
const [platform, setPlatform] = useState<string>("");
Expand Down Expand Up @@ -369,12 +368,6 @@ const AppStatusModal = ({permitVis, setPermitVis, dialogStyle, settingsScope}) =
refreshAllChecks();
});

//refresh when recompute message is broadcast
settingsScope.$on("recomputeAppStatus", function() {
console.log("PERMISSION CHECK: recomputing state");
refreshAllChecks();
});

//load when ready
useEffect(() => {
if (appConfig && window['device']?.platform) {
Expand Down Expand Up @@ -412,7 +405,7 @@ const AppStatusModal = ({permitVis, setPermitVis, dialogStyle, settingsScope}) =
<Modal visible={permitVis} onDismiss={() => setPermitVis(false)} transparent={true}>
<Dialog visible={permitVis}
onDismiss={() => setPermitVis(false)}
style={dialogStyle}>
style={settingStyles.dialog(colors.elevation.level3)}>
<Dialog.Title>{t('consent.permissions')}</Dialog.Title>
<Dialog.Content style={{maxHeight: windowHeight/1.5, paddingBottom: 0}}>
<ScrollView persistentScrollbar={true}>
Expand Down
Loading