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

More profile migrations #994

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
2cab1ed
switched collect and sync lists over to react
Jun 13, 2023
ba5406e
inserted a placeholding div control-list-item
Jun 14, 2023
2ad296c
patch from Jack
Jun 14, 2023
dc1d661
Merge branch 'e-mission:framework_migration_prep' into framework_migr…
Abby-Wheelis Jun 15, 2023
89fadc7
added keys to rows
Jun 16, 2023
c40c9bb
removal of non-relevant code
Jun 16, 2023
af44bf0
replacing hard coded strings
Jun 16, 2023
f558103
start at storing data in better place
Jun 16, 2023
e8bb3d6
spelling
Jun 16, 2023
d8a12aa
starting to work with other rows of profile
Jun 16, 2023
5b20f9f
setting up issue in using key as parameter
Jun 16, 2023
0a629fa
fixing strings
Abby-Wheelis Jun 17, 2023
5db9dd8
text working on sample list item
Jun 20, 2023
337816c
carry data storage change through
Abby-Wheelis Jun 22, 2023
aa547f8
polishing up - removing print statements, altering log
Jun 22, 2023
11de879
update comments, eliminate changes not a part of this PR
Jun 22, 2023
399ea7a
Merge branch 'e-mission:master' into More-Profile-Migrations
Abby-Wheelis Jun 22, 2023
2ddfab5
action parameters for setting rows - some work
Jun 22, 2023
0e2a8f6
Merge branch 'framework_migration_prep' into More-Profile-Migrations
Jun 22, 2023
90eda2b
comments and spacing
Jun 22, 2023
f1373ec
more row migrations
Jun 22, 2023
10f571c
rough draft - two rows unconverted
Jun 23, 2023
0f239b0
fixing strings - i18n
Jun 23, 2023
8a5e546
enabling icons - copy Jack's related commit
Jun 23, 2023
ffab0df
got icons in
Jun 23, 2023
cad1034
tidy code - still ways to go
Jun 23, 2023
b6b1fc6
combine logout and copy (eliminate copy)
Jun 23, 2023
e8b7b19
convert to use of IconButtons
Jun 26, 2023
ebeca54
introduce toggle switches
Jun 26, 2023
813c4f5
experiment with list accordian
Jun 26, 2023
4553eb7
use of .map for creating the collapsing list!
Jun 26, 2023
2934b51
both drop-downs converted to ExpandMenu components
Jun 26, 2023
ddff054
profile settings component draft
Jun 27, 2023
803f782
profile settings in general settings
Jun 27, 2023
757936c
first set settings now in ProfileSettingsComponent
Jun 27, 2023
b4c70b3
different method of passing info to Profile Settings
Jun 27, 2023
df5da35
introduce Demographics Setting Row
Jun 27, 2023
a9043a2
rough sketch everything in ProfileSettings
Jun 28, 2023
e0f9983
more of migration to ProfileSettings component
Jun 28, 2023
7bc97b7
adding a value in the scope for the accuracy setting
Jun 28, 2023
f125321
Merge branch 'framework_migration_prep' into framework_migration_prep
Abby-Wheelis Jun 28, 2023
a3097ac
adding additional argument to angularize call
Jun 28, 2023
aa027ad
cleaned up irrelivant codes and comments
Jun 28, 2023
ffd2bc2
fixing merge conflicts
Jun 28, 2023
cf2871e
Merge pull request #1 from Abby-Wheelis/framework_migration_prep
Abby-Wheelis Jun 28, 2023
b612292
Revert "fixing merge conflicts"
Jun 28, 2023
51c0697
extra param in call to angularize func
Jun 28, 2023
60eb532
optional chaining with settings object
Jun 28, 2023
12f462c
styling for Setting Row
Jun 28, 2023
af58485
working with data flow - settings object
Jun 28, 2023
e106102
styling ExpandMenu
Jun 29, 2023
44bc1be
comment out old code
Jun 29, 2023
3eae605
work with the toggle
Jun 29, 2023
83443ed
begin general-settings to ProfileSettings move
Jun 29, 2023
ff4e490
made rows taller - more white space
Jun 29, 2023
2bf64d2
low accuracy toggle functions not working
Jun 29, 2023
20d29f4
make userData conditional
Jun 29, 2023
bfc6355
dialog menus - replacing action sheets
Jul 5, 2023
dfda0f1
migrating action sheets
Jul 5, 2023
ac73e43
action sheet migrations -- unresolved error
Jul 5, 2023
f2467fa
switched portal out for modal
Jul 6, 2023
f685472
address errors in accuracy toggle
Jul 6, 2023
532f56a
organizing code
Jul 6, 2023
7237343
make whole row clickable
Jul 6, 2023
ca4bd2d
migrate share method
Jul 6, 2023
e6ed67a
working on platform detection
Jul 6, 2023
eb3de5d
introduction of useEffect for keeping up with switches
Jul 6, 2023
3e1940b
Merge pull request #2 from e-mission/framework_migration_prep
Abby-Wheelis Jul 6, 2023
6e3562e
Merge branch 'framework_migration_prep' into More-Profile-Migrations
Jul 6, 2023
161a63c
Merge remote-tracking branch 'upstream/framework_migration_prep' into…
Jul 7, 2023
4a5f24a
Merge remote-tracking branch 'upstream/framework_migration_prep' into…
Jul 11, 2023
d2966a1
patch back over to reliance on ProfileSettings rather than html
Jul 12, 2023
ab1e6a4
conditional showing of log uploads
Jul 12, 2023
3b123e8
formatting modals with elevation
Jul 12, 2023
0bdd36c
migrated show OpCode!
Jul 12, 2023
e8faa6f
create alertbar to use instead of ionic popups
Jul 12, 2023
810a293
SettingRow: prevent duplicate action() call
JGreenlee Jul 14, 2023
ba0c101
ProfileSettings: track collectSettings w/ useState
JGreenlee Jul 14, 2023
8d76706
general-settings: remove $scope.settings.collect
JGreenlee Jul 14, 2023
bfac9c8
profile settings: tweak styling
JGreenlee Jul 14, 2023
32b4254
ProfileSettings: rename variable 'mainControlEl'
JGreenlee Jul 14, 2023
19fa99f
remove unused props from <profile-settings>
JGreenlee Jul 14, 2023
c75d732
fix userData dropdown
Jul 14, 2023
f7da968
remove unused imports
Jul 14, 2023
26fc5c3
fix qrSharing
Jul 14, 2023
d9afec8
removal of converted code
Jul 14, 2023
3f86035
formatting opcode popup
Jul 14, 2023
5ae257b
convert forceState
Jul 14, 2023
1b05012
formatting popups
Jul 14, 2023
78620af
formatting
Jul 14, 2023
3bfa277
migrate notificationSettings
Jul 17, 2023
3d2c9a9
add react native paper dates for reminder time
Jul 17, 2023
ac2d936
formatting TimePickerModal
Jul 17, 2023
9a639ca
cleaning up code
Jul 17, 2023
04d39b6
Merge pull request #5 from Abby-Wheelis/profile-migration-fixes
Abby-Wheelis Jul 17, 2023
43a7ef8
remove old time picker
Jul 18, 2023
cae522a
formatting profile
Jul 18, 2023
4c9f22e
remove no longer needed angularize calls
Jul 18, 2023
ab00bb7
update styles for titles
Jul 18, 2023
d415679
remove unused modules
Jul 19, 2023
0bcd303
fix notification schedule
Jul 19, 2023
6764359
leverage promise on initial load
Jul 19, 2023
017e703
make ReminderTime conditionally visible
Jul 20, 2023
2aee6ae
conditionally show schedule
Jul 20, 2023
7d51924
refactor fetching notifs to ensure scheduled first
Jul 20, 2023
c2c44ff
cleaning up code
Jul 20, 2023
fdf8907
remove .then()
Jul 20, 2023
3907088
Merge remote-tracking branch 'upstream/framework_migration_prep' into…
Aug 2, 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
26 changes: 26 additions & 0 deletions www/js/control/AlertBar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";
import { Modal, Snackbar} from 'react-native-paper';
import { useTranslation } from "react-i18next";

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

return (
<Modal visible={visible} onDismiss={() => setVisible(false)}>
<Snackbar
visible={visible}
onDismiss={onDismissSnackBar}
action={{
label: t("join.close"),
onPress: () => {
onDismissSnackBar()
},
}}>
{t(messageKey)}
</Snackbar>
</Modal>
);
};

export default AlertBar;
13 changes: 2 additions & 11 deletions www/js/control/ControlDataTable.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import React from "react";
import { DataTable } from 'react-native-paper';
import { angularize } from "../angular-react-helper";
import { array } from "prop-types";

// Note the camelCase to dash-case conventions when translating to .html files!
// val with explicit call toString() to resolve bool values not showing
const ControlDataTable = ({ controlData }) => {
// console.log("Printing data trying to tabulate", controlData);
console.log("Printing data trying to tabulate", controlData);
return (
//rows require unique keys!
<DataTable style={styles.table}>
Expand All @@ -28,11 +25,5 @@ const styles = {
borderLeftColor: 'rgba(0,0,0,0.25)',
}
}
ControlDataTable.propTypes = {
controlData: array
}

// need call to angularize to let the React and Angular co-mingle
//second argument is "module path" - can access later as ControlDataTable.module
angularize(ControlDataTable, 'ControlDataTable', 'emission.main.control.dataTable');

export default ControlDataTable;
29 changes: 29 additions & 0 deletions www/js/control/DemographicsSettingRow.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from "react";
import { getAngularService } from "../angular-react-helper";
import SettingRow from "./SettingRow";

const DemographicsSettingRow = ({ }) => {

const EnketoDemographicsService = getAngularService('EnketoDemographicsService');
const EnketoSurveyLaunch = getAngularService('EnketoSurveyLaunch');
const $rootScope = getAngularService('$rootScope');

// copied from /js/survey/enketo/enketo-demographics.js
function openPopover() {
return EnketoDemographicsService.loadPriorDemographicSurvey().then((lastSurvey) => {
return EnketoSurveyLaunch
.launch($rootScope, 'UserProfileSurvey', {
prefilledSurveyResponse: lastSurvey?.data?.xmlResponse,
showBackButton: true, showFormFooterJumpNav: true
})
.then(result => {
console.log("demographic survey result ", result);
});
});
}

return <SettingRow action={openPopover} iconName="account"
textKey="control.edit-demographics" isToggle={false} />
};

export default DemographicsSettingRow;
33 changes: 33 additions & 0 deletions www/js/control/ExpandMenu.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from "react";
import { StyleSheet } from 'react-native';
import { List, useTheme } from 'react-native-paper';
import { useTranslation } from "react-i18next";
import { styles as rowStyles } from "./SettingRow";

const ExpansionSection = (props) => {
const { t } = useTranslation(); //this accesses the translations
const { colors } = useTheme(); // use this to get the theme colors instead of hardcoded #hex colors
const [expanded, setExpanded] = React.useState(false);

const handlePress = () => setExpanded(!expanded);

return (
<List.Accordion
style={styles.section(colors.surface)}
title={t(props.sectionTitle)}
titleStyle={rowStyles.title}
expanded={expanded}
onPress={handlePress}>
{props.children}
</List.Accordion>
);
};
const styles = StyleSheet.create({
section: (surfaceColor) => ({
justifyContent: 'space-between',
backgroundColor: surfaceColor,
margin: 1,
}),
});

export default ExpansionSection;
49 changes: 49 additions & 0 deletions www/js/control/PopOpCode.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React from "react";
import { Modal, StyleSheet } from 'react-native';
import { Button, Text, IconButton, Dialog, useTheme } from 'react-native-paper';
import { useTranslation } from "react-i18next";
import QrCode from "../components/QrCode";

const PopOpCode = ({visibilityValue, tokenURL, action, setVis}) => {
const { t } = useTranslation();
const { colors } = useTheme();

return (
<Modal visible={visibilityValue} onDismiss={() => setVis(false)}
transparent={true}>
<Dialog visible={visibilityValue}
onDismiss={() => setVis(false)}
style={styles.dialog(colors.elevation.level3)}>
<Dialog.Title>{t("general-settings.qrcode")}</Dialog.Title>
<Dialog.Content style={styles.content}>
<QrCode value={tokenURL}></QrCode>
<Text>{t("general-settings.qrcode-share-title")}</Text>
<IconButton icon="share" onPress={() => action()} style={styles.button}/>
Abby-Wheelis marked this conversation as resolved.
Show resolved Hide resolved
</Dialog.Content>
<Dialog.Actions>
<Button onPress={() => setVis(false)}>{t('general-settings.cancel')}</Button>
</Dialog.Actions>
</Dialog>
</Modal>
)
}
const styles = StyleSheet.create({
dialog: (surfaceColor) => ({
backgroundColor: surfaceColor,
margin: 1,
}),
title:
{
alignItems: 'center',
justifyContent: 'center',
},
content: {
alignItems: 'center',
justifyContent: 'center',
},
button: {
margin: 'auto',
}
});

export default PopOpCode;
Loading