Skip to content

Commit

Permalink
Merge pull request #1007 from JGreenlee/more-jul-2023-fixes
Browse files Browse the repository at this point in the history
🐛 More Jul 2023 Fixes
  • Loading branch information
shankari authored Aug 2, 2023
2 parents a34cc8a + 2baaef6 commit b2d0a21
Show file tree
Hide file tree
Showing 19 changed files with 36 additions and 2,019 deletions.
2 changes: 1 addition & 1 deletion survey-resources/data-json/demo-survey-v2.json

Large diffs are not rendered by default.

Binary file modified survey-resources/data-xls/demo-survey-v2.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion survey-resources/data-xml/demo-survey-v2.xml

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions www/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@
/* nvd3 styles */
@import 'nvd3/build/nv.d3.css';

/* Annoyingly, React Native Web applies `white-space: nowrap`
on Text elements and doesn't give us a way to change it in the style prop,
effectively preventing multiline text.
This is a workaround to override that style. */
div[class*='css-text'] {
white-space: normal;
}

.fill-container {
display: block;
position: relative;
Expand Down Expand Up @@ -502,7 +494,7 @@ ion-nav-view {
}
/* this controls bacground color of dashboard and profile - label screen now styled in react*/
.pane {
background-color: #e4e9ed !important;
background-color: #edf1f6 !important;
}
.tabs-custom > .tabs,
.tabs.tabs-custom {
Expand Down
6 changes: 5 additions & 1 deletion www/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@

"intro": {
"appstatus": {
"fix": "Fix",
"refresh":"Refresh",
"overall-description": "This app works in the background to automatically build a travel diary for you. Make sure that all the settings below are green so that the app can work properly!",
"overall-loc-name": "Location",
"overall-loc-description": "We use the background location permission to track your location in the background, even when the app is closed. Reading background locations removes the need to turn tracking on and off, making the app easier to use and preventing battery drain.",
Expand Down Expand Up @@ -422,6 +424,7 @@
"samsung": "Disable 'Medium power saving mode'"
},
"consent":{
"permissions" : "Permissions",
"button-accept": "I accept",
"button-decline": "I refuse"
},
Expand Down Expand Up @@ -478,7 +481,8 @@
"all-green-status": "Make sure that all status checks are green",
"dont-force-kill": "Do not force kill the app",
"background-restrictions": "On Samsung and Huwaei phones, make sure that background restrictions are turned off",
"close": "Close"
"close": "Close",
"tips-title": "Tip(s) for correct operation:"
},
"config": {
"unable-read-saved-config": "Unable to read saved config",
Expand Down
4 changes: 2 additions & 2 deletions www/js/appTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const AppTheme = {
onPrimaryContainer: '#001e30', // lch(10% 50 250)
secondary: '#f2795c', // lch(65% 60 40)
secondaryContainer: '#ffb39e', // lch(80% 45 40)
background: '#f2f2f2', // lch(95% 0 0)
background: '#edf1f6', // lch(95% 3 250) - background of label screen, other screens still have this as CSS .pane
surface: '#fafdff', // lch(99% 30 250)
surfaceVariant: '#e4e9ed', // lch(92% 30 250) -- blueish gray used as background on label screen (was same as level 4)
surfaceVariant: '#e0f0ff', // lch(94% 50 250) - background of DataTable
elevation: {
level0: 'transparent',
level1: '#fafdff', // lch(99% 30 250)
Expand Down
2 changes: 1 addition & 1 deletion www/js/diary/LabelListScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const LabelListScreen = () => {
<Appbar.Action icon="refresh" size={32} onPress={() => refresh()}
style={{marginLeft: 'auto'}} />
</Appbar.Header>
<View style={{ flex: 1, backgroundColor: colors.surfaceVariant }}>
<View style={{ flex: 1, backgroundColor: colors.background }}>
<TimelineScrollList
listEntries={displayedEntries}
queriedRange={queriedRange}
Expand Down
4 changes: 2 additions & 2 deletions www/js/diary/LabelTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ const LabelTab = () => {
labelsResultMap = manualResultMap;
notesResultMap = enbsResultMap;
console.log("After reading in the label controller, manualResultMap " + JSON.stringify(manualResultMap), manualResultMap);
setPipelineRange(pipelineRange);
}
setPipelineRange(pipelineRange);
});
}

// once pipelineRange is set, load the most recent week of data
useEffect(() => {
if (pipelineRange) {
if (pipelineRange && pipelineRange.end_ts) {
loadAnotherWeek('past');
}
}, [pipelineRange]);
Expand Down
6 changes: 5 additions & 1 deletion www/js/diary/list/TimelineScrollList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,15 @@ const TimelineScrollList = ({ listEntries, queriedRange, pipelineRange, loadMore
</Banner>
);

if (!pipelineRange) { // nothing has been processed for this user yet
if (pipelineRange && !pipelineRange.end_ts && !listEntries?.length) {
/* Condition: pipelineRange has been fetched but has no defined end, meaning nothing has been
processed for this OPCode yet, and there are no unprocessed trips either. Show 'no travel'. */
return noTravelBanner;
} else if (isLoading=='replace') {
/* Condition: we're loading an entirely new batch of trips, so show a big spinner */
return bigSpinner;
} else if (listEntries && listEntries.length == 0) {
/* Condition: we've loaded all travel and set `listEntries`, but it's empty. Show 'no travel'. */
return noTravelBanner;
} else {
return (
Expand Down
4 changes: 2 additions & 2 deletions www/js/diary/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,14 @@ angular.module('emission.main.diary.services', ['emission.plugin.logger',
distance: dists.reduce((a, b) => a + b, 0),
duration: endPoint.data.ts - startPoint.data.ts,
end_fmt_time: endMoment.format(),
end_local_dt: moment2localdate(endMoment),
end_local_dt: moment2localdate(endMoment, endPoint.metadata.time_zone),
end_ts: endPoint.data.ts,
expectation: {to_label: true},
inferred_labels: [],
locations: locations,
source: "unprocessed",
start_fmt_time: startMoment.format(),
start_local_dt: moment2localdate(startMoment),
start_local_dt: moment2localdate(startMoment, startPoint.metadata.time_zone),
start_ts: startPoint.data.ts,
user_input: {},
}
Expand Down
1 change: 1 addition & 0 deletions www/js/intro.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ angular.module('emission.intro', ['emission.splash.startprefs',
} else {
CommHelper.registerUser(function(successResult) {
$scope.currentToken = token;
$scope.qrToken = "emission://login_token?token=" + token;
$scope.next();
}, function(errorResult) {
$scope.alertError('User registration error', errorResult);
Expand Down
2 changes: 1 addition & 1 deletion www/js/survey/enketo/enketo-demographics.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ angular.module('emission.survey.enketo.demographics',
console.log("demographic survey result ", result);
}).catch(e => console.trace(e));
}
}, 10); // wait for 10 ms to load to ensure that the form is in place
}, 50); // wait for 50 ms to load to ensure that the form is in place
}

$scope.initForm = function() {
Expand Down
2 changes: 1 addition & 1 deletion www/json/demo-survey-v2.json

Large diffs are not rendered by default.

Loading

0 comments on commit b2d0a21

Please sign in to comment.