Skip to content

Commit

Permalink
Merge pull request #1029 from Abby-Wheelis/unblock-routing
Browse files Browse the repository at this point in the history
Profile changes to unblock routing
  • Loading branch information
shankari authored Sep 25, 2023
2 parents 80b4794 + 2876872 commit e93059f
Show file tree
Hide file tree
Showing 19 changed files with 931 additions and 484 deletions.
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}) => {
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

0 comments on commit e93059f

Please sign in to comment.