Skip to content

Commit

Permalink
Merge pull request #63 from rokwire/release/v2.2.18+318
Browse files Browse the repository at this point in the history
Release/v2.2.18+318
  • Loading branch information
sandeep-ps authored Sep 4, 2020
2 parents b0696d4 + ec4dcd6 commit 9a55dbc
Show file tree
Hide file tree
Showing 29 changed files with 902 additions and 276 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [2.2.18+318] - 2020-09-04
### Fixed
- Phone verification / Shibboleth login fails after multiple logins. [#29] (https://github.com/rokwire/illinois-app/issues/29)
- Fix events filtering.[#49](https://github.com/rokwire/illinois-app/issues/49)
- Make events date format consistent.[#33](https://github.com/rokwire/illinois-app/issues/33)

## [2.2.17] - 2020-09-03
### Changed
- Show debug panel only for debug managers.[#51](https://github.com/rokwire/illinois-app/issues/51)
- Update es and zh strings.[#55](https://github.com/rokwire/illinois-app/issues/55)

## [2.2.16] - 2020-09-02
### Removed Save buttons from Profile Informations panels

## [2.2.15] - 2020-09-01
### Exposed Strings for localisation

## [2.2.14] - 2020-08-31

### Improved VO features [#24]

## [2.2.13] - 2020-08-28

### Fixed
Expand Down
10 changes: 5 additions & 5 deletions assets/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,11 @@

"privacy_new":{
"description":[
{"level":1, "key": "com.illinois.description.1", "text": "You may not be able to use all features, but you are anonymous and we don't ask for anything or store any data. Anonymous data will be collected and used to optimize app performance."},
{"level":2, "key": "com.illinois.description.1", "text": "See what's happening around you. We use Wifi and Bluetooth location services to improve your experience, but we never store that data."},
{"level":3, "key": "com.illinois.description.2", "text": "You can personalize and customize the app. Wifi and Bluetooth location data is stored over time to make recommendations and improve your overall app experience."},
{"level":4, "key": "com.illinois.description.3", "text": "Let the app work for you. \nYou can access your iCard, save credit cards to make future purchases easier, access health information, and get notifications based on your specific interests."},
{"level":5, "key": "com.illinois.description.4", "text": "Access all features, get connected to campus, and let the app suggest tailored experiences that you and your friends all enjoy."}
{"level":1, "key": "privacy.category.description.1", "text": "You may not be able to use all features, but you are anonymous and we don't ask for anything or store any data. Anonymous data will be collected and used to optimize app performance."},
{"level":2, "key": "privacy.category.description.2", "text": "See what's happening around you. We use Wifi and Bluetooth location services to improve your experience, but we never store that data."},
{"level":3, "key": "privacy.category.description.3", "text": "You can personalize and customize the app. Wifi and Bluetooth location data is stored over time to make recommendations and improve your overall app experience."},
{"level":4, "key": "privacy.category.description.4", "text": "Let the app work for you. \nYou can access your iCard, save credit cards to make future purchases easier, access health information, and get notifications based on your specific interests."},
{"level":5, "key": "privacy.category.description.5", "text": "Access all features, get connected to campus, and let the app suggest tailored experiences that you and your friends all enjoy."}
],
"categories":[
{
Expand Down
199 changes: 197 additions & 2 deletions assets/strings.en.json

Large diffs are not rendered by default.

212 changes: 204 additions & 8 deletions assets/strings.es.json

Large diffs are not rendered by default.

215 changes: 205 additions & 10 deletions assets/strings.zh.json

Large diffs are not rendered by default.

Binary file added images/2.0x/group-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/3.0x/group-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/group-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion lib/model/Event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Event with Explore implements Favorite {
List<Event> recurringEvents;

bool isSuperEvent;
bool isVirtual;
List<Map<String, dynamic>> subEventsMap;
String track;
List<Event> _subEvents;
Expand Down Expand Up @@ -141,6 +142,7 @@ class Event with Explore implements Favorite {
isSuperEvent = json['isSuperEvent'] ?? false;
this.subEventsMap = subEventsMap;
track = json['track'];
isVirtual = json['isVirtual'];
}

void _initFromOther(Event other) {
Expand Down Expand Up @@ -181,6 +183,7 @@ class Event with Explore implements Favorite {
isSuperEvent = other?.isSuperEvent;
subEventsMap = other?.subEventsMap;
track = other?.track;
isVirtual = other?.isVirtual;
}

factory Event.fromJson(Map<String, dynamic> json) {
Expand Down Expand Up @@ -235,7 +238,8 @@ class Event with Explore implements Favorite {
"converge_url": convergeUrl,
"isSuperEvent": isSuperEvent,
"subEvents": subEventsMap,
"track": track
"track": track,
'isVirtual': isVirtual,
};
}

Expand Down
4 changes: 3 additions & 1 deletion lib/model/PrivacyData.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ class PrivacyData{

class PrivacyCategory{
String title;
String titleKey;
Map<String, dynamic> description;
List<PrivacyEntry> entries;
List<PrivacyEntry2> entries2;

PrivacyCategory({this.title,this.description,this.entries, this.entries2});
PrivacyCategory({this.title, this.titleKey, this.description,this.entries, this.entries2});

factory PrivacyCategory.fromJson(Map<String, dynamic> json) {
List<dynamic> entriesJson = json['entries'];
Expand All @@ -104,6 +105,7 @@ class PrivacyCategory{

return PrivacyCategory(
title:PrivacyData().getLocalizedString(json["title"]),
titleKey:PrivacyData().getLocalizedString(json["title_key"]),
description:json['description'],
entries: entries,
entries2: entries2
Expand Down
17 changes: 16 additions & 1 deletion lib/model/UserData.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class UserData {


final String uuid;
final bool overThirteen;
bool overThirteen;

static const analyticsUuid = 'UUIDxxxxxx';

Expand Down Expand Up @@ -56,6 +56,21 @@ class UserData {
) : null;
}

void loadFromUserData(UserData data){
overThirteen = data.overThirteen;
privacySettings = data.privacySettings;
roles = data.roles;
interests = data.interests;
favorites = data.favorites;
positiveTags = data.positiveTags;
negativeTags = data.negativeTags;
fcmTokens = data.fcmTokens;
registeredVoter = data.registeredVoter;
votePlace = data.votePlace;
voterByMail = data.voterByMail;
voted = data.voted;
}

toJson() {
return {
"uuid": uuid,
Expand Down
3 changes: 0 additions & 3 deletions lib/service/AppDateTime.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,6 @@ class AppDateTime with Service {
displayDay += " ${Localization().getStringEx('model.explore.time.at', 'at')}";
}
}
else if ((1 < timeDaysDiff) && (timeDaysDiff < 7)) {
displayDay = formatDateTime(dateTimeToCompare, format: "EEEE", ignoreTimeZone: true, showTzSuffix: false);
}
else {
displayDay = formatDateTime(dateTimeToCompare, format: "MMM dd", ignoreTimeZone: true, showTzSuffix: false);
}
Expand Down
4 changes: 4 additions & 0 deletions lib/service/Auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ class Auth with Service implements NotificationsListener {
return authInfo?.userGroupMembership?.contains('urn:mace:uiuc.edu:urbana:authman:app-rokwire-service-policy-rokwire stadium poll manager') ?? false;
}

bool get isDebugManager {
return authInfo?.userGroupMembership?.contains('urn:mace:uiuc.edu:urbana:authman:app-rokwire-service-policy-rokwire debug') ?? false;
}

bool isMemberOf(String groupName) {
return authInfo?.userGroupMembership?.contains(groupName) ?? false;
}
Expand Down
15 changes: 12 additions & 3 deletions lib/service/ExploreService.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,21 @@ class ExploreService /* with Service */ {

ExploreService._internal();

Future<List<Explore>> loadEvents({String searchText, Core.LocationData locationData, Set<String> categories, DateTime startDate, DateTime endDate, Set<
String> tags, bool excludeRecurring = true, int recurrenceId, int limit = 0}) async {
Future<List<Explore>> loadEvents({String searchText, Core.LocationData locationData, Set<String> categories, DateTime startDate, DateTime startDateLimit,
DateTime endDate, Set<String> tags, bool excludeRecurring = true, int recurrenceId, int limit = 0}) async {
if(_enabled) {
if (startDate == null) {
startDate = DateTime.now();
}
http.Response response;
DateTime startDateInGmt = AppDateTime().getUtcTimeFromDeviceTime(startDate);
DateTime startDateLimitInGmt = AppDateTime().getUtcTimeFromDeviceTime(startDateLimit);
DateTime endDateInGmt = AppDateTime().getUtcTimeFromDeviceTime(endDate);
String queryParameters = _buildEventsQueryParameters(
searchText,
locationData,
startDateInGmt,
startDateLimitInGmt,
endDateInGmt,
categories,
tags,
Expand Down Expand Up @@ -265,7 +267,7 @@ class ExploreService /* with Service */ {
}

String _buildEventsQueryParameters(String searchText, Core.LocationData locationData,
DateTime startDate, DateTime endDate, Set<String> categories, Set<String> tags,
DateTime startDate, DateTime startDateLimit, DateTime endDate, Set<String> categories, Set<String> tags,
int recurrenceId, int limit) {

String queryParameters = "";
Expand All @@ -290,6 +292,13 @@ class ExploreService /* with Service */ {
queryParameters += 'startDate=$startDateFormatted&';
}

///StartDateLimit
if (startDateLimit != null) {
String startDateLimitFormatted = AppDateTime().formatDateTime(
startDateLimit, ignoreTimeZone: true);
queryParameters += 'startDateLimit=$startDateLimitFormatted&';
}

///End Date
if (endDate != null) {
String endDateFormatted = AppDateTime().formatDateTime(
Expand Down
10 changes: 0 additions & 10 deletions lib/service/Storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,6 @@ class Storage with Service {
_setStringWithName(phoneNumberKey, phoneNumber);
}

static const String localUserUuidKey = 'user_local_uuid';

String get localUserUuid {
return _getStringWithName(localUserUuidKey);
}

set localUserUuid(String value) {
_setStringWithName(localUserUuidKey, value);
}

/////////////
// UserPII

Expand Down
44 changes: 18 additions & 26 deletions lib/service/User.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class User with Service implements NotificationsListener {
AppLivecycle.notifyStateChanged,
FirebaseMessaging.notifyToken,
User.notifyPrivacyLevelChanged,
Auth.notifyLoggedOut,
]);
}

Expand Down Expand Up @@ -103,6 +104,9 @@ class User with Service implements NotificationsListener {
else if(name == AppLivecycle.notifyStateChanged && param == AppLifecycleState.resumed){
//_loadUser();
}
else if(name == Auth.notifyLoggedOut){
_recreateUser(); // Always create userData on logout. // https://github.com/rokwire/illinois-app/issues/29
}
}

// User
Expand All @@ -119,10 +123,14 @@ class User with Service implements NotificationsListener {
return UserData.analyticsUuid;
}

Future<void> _createUser() async {
Future<void> _createUser() async {
UserData userData = await _requestCreateUser();
applyUserData(userData);
Storage().localUserUuid = userData?.uuid;
}

Future<void> _recreateUser() async {
UserData userData = await _requestCreateUser();
applyUserData(userData, migrateData: true);
}

Future<void> _loadUser() async {
Expand Down Expand Up @@ -223,37 +231,16 @@ class User with Service implements NotificationsListener {
_clearStoredUserData();
_notifyUserDeleted();

try {
_userData = await requestUser(Storage().localUserUuid);
} on UserNotFoundException catch (_) {
_userData = await _requestCreateUser();
if (_userData?.uuid != null) {
Storage().localUserUuid = _userData?.uuid;
}
}
_userData = await _requestCreateUser();

if (_userData != null) {
Storage().userData = _userData;
_notifyUserUpdated();
}
}

}

void initLocalUser() {
String localUserUuid = Storage().localUserUuid;
String currentUserUuid = _userData?.uuid;
if ((localUserUuid != null) && (currentUserUuid == null) || (currentUserUuid != localUserUuid)) {
requestUser(localUserUuid).then((UserData userData){
if (userData != null) {
applyUserData(userData);
}
//clearStoredPiiAccount();
}).catchError((_){
});
}
}

void applyUserData(UserData userData, { bool applyCachedSettings = false }) {
void applyUserData(UserData userData, { bool applyCachedSettings = false, bool migrateData = false }) {

// 1. We might need to remove FCM token from current user
String applyUserUuid = userData?.uuid;
Expand All @@ -272,6 +259,11 @@ class User with Service implements NotificationsListener {
applyUserUpdated = _updateUserSettingsFromStorage(userData) || applyUserUpdated;
}

if(migrateData && _userData != null){
userData.loadFromUserData(_userData);
applyCachedSettings = true;
}

_userData = userData;
Storage().userData = _userData;
Storage().userRoles = userData?.roles;
Expand Down
9 changes: 5 additions & 4 deletions lib/ui/dining/FoodFiltersPanel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class _FoodFiltersPanelState extends State<FoodFiltersPanel> {
),
),
),
_buildSaveButton()
// _buildSaveButton()
],
),
backgroundColor: Styles().colors.background,
Expand Down Expand Up @@ -202,7 +202,7 @@ class _FoodFiltersPanelState extends State<FoodFiltersPanel> {
else{
_selectedTypesPrefs.add(foodOption);
}

DiningService().setIncludedFoodTypesPrefs(_selectedTypesPrefs.toList());

setState((){});
}
Expand All @@ -215,6 +215,7 @@ class _FoodFiltersPanelState extends State<FoodFiltersPanel> {
else{
_selectedIngredientsPrefs.add(foodOption);
}
DiningService().setExcludedFoodIngredientsPrefs(_selectedIngredientsPrefs.toList());

setState((){});
}
Expand All @@ -225,8 +226,8 @@ class _FoodFiltersPanelState extends State<FoodFiltersPanel> {
Padding(
padding: EdgeInsets.symmetric( vertical: 20,horizontal: 16),
child: RoundedButton(
label: Localization().getStringEx("panel.profile_info.button.save.title", "Save Changes"),
hint: Localization().getStringEx("panel.profile_info.button.save.hint", ""),
label: Localization().getStringEx("panel.food_filters.button.save.title", "Save Changes"),
hint: Localization().getStringEx("panel.food_filters.button.save.hint", ""),
enabled: _canSave,
fontFamily: Styles().fontFamilies.bold,
backgroundColor: Styles().colors.white,
Expand Down
8 changes: 5 additions & 3 deletions lib/ui/events/CompositeEventsDetailPanel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ class _CompositeEventsDetailPanelState extends State<CompositeEventsDetailPanel>

Widget _exploreLocationDetail() {
String locationText = ExploreHelper.getLongDisplayLocation(widget.parentEvent, _locationData);
if ((locationText != null) && locationText.isNotEmpty) {
if (!(widget?.parentEvent?.isVirtual ?? false) && widget?.parentEvent?.location != null && (locationText != null) && locationText.isNotEmpty) {
return GestureDetector(
onTap: _onLocationDetailTapped,
child: Semantics(
Expand Down Expand Up @@ -549,8 +549,10 @@ class _CompositeEventsDetailPanelState extends State<CompositeEventsDetailPanel>
}

void _onLocationDetailTapped(){
Analytics.instance.logSelect(target: "Location Detail");
NativeCommunicator().launchExploreMapDirections(target: widget.parentEvent);
if(widget?.parentEvent?.location?.latitude != null && widget?.parentEvent?.location?.longitude != null) {
Analytics.instance.logSelect(target: "Location Detail");
NativeCommunicator().launchExploreMapDirections(target: widget.parentEvent);
}
}

void _onTapHeaderStar() {
Expand Down
8 changes: 5 additions & 3 deletions lib/ui/explore/ExploreEventDetailPanel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class _EventDetailPanelState extends State<ExploreEventDetailPanel>

Widget _exploreLocationDetail() {
String locationText = ExploreHelper.getLongDisplayLocation(widget.event, _locationData);
if ((locationText != null) && locationText.isNotEmpty) {
if (!(widget?.event?.isVirtual ?? false) && widget?.event?.location != null && (locationText != null) && locationText.isNotEmpty) {
return GestureDetector(
onTap: _onLocationDetailTapped,
child: Semantics(
Expand Down Expand Up @@ -623,8 +623,10 @@ class _EventDetailPanelState extends State<ExploreEventDetailPanel>
}

void _onLocationDetailTapped() {
Analytics.instance.logSelect(target: "Location Detail");
NativeCommunicator().launchExploreMapDirections(target: widget.event);
if(widget?.event?.location?.latitude != null && widget?.event?.location?.longitude != null) {
Analytics.instance.logSelect(target: "Location Detail");
NativeCommunicator().launchExploreMapDirections(target: widget.event);
}
}

void _onTapModify() {
Expand Down
Loading

0 comments on commit 9a55dbc

Please sign in to comment.