Skip to content

Commit

Permalink
Merge pull request #617 from rokwire/release/v2.10.22+1022
Browse files Browse the repository at this point in the history
Release/v2.10.22+1022
  • Loading branch information
sandeep-ps authored Apr 29, 2021
2 parents 6e9325c + 7ba1a43 commit d7676d9
Show file tree
Hide file tree
Showing 13 changed files with 291 additions and 128 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [2.10.22] - 2021-04-27
### Fixed
- Fixed app misbehavior when system date time is much behind the current date time [#615](https://github.com/rokwire/safer-illinois-app/issues/615).

## [2.10.21] - 2021-04-26
### Added
- Check server time before displaying StatusCardPanel [#611](https://github.com/rokwire/safer-illinois-app/issues/611).

## [2.10.20] - 2021-04-23
### Changed
- Show current date time under Building Access Status [#604](https://github.com/rokwire/safer-illinois-app/issues/604).
- Remove Covid-19 section from Settings panel if the user is not logged in, improved control of progress indicator inside [#602](https://github.com/rokwire/safer-illinois-app/issues/602).
- Indicate that location text is clickable in TestLocations panel [#597](https://github.com/rokwire/safer-illinois-app/issues/597).

### Fixed
- Fixed mailto and tel URLs in Wellness Center Panel [#601](https://github.com/rokwire/safer-illinois-app/issues/601).

## [2.10.19] - 2021-04-21
Build number 1019 was taken by 2.9.22 release

## [2.10.18] - 2021-04-19
### Changed
- Update FlexUI content from app assets [#595](https://github.com/rokwire/safer-illinois-app/issues/595).
Expand Down
1 change: 1 addition & 0 deletions assets/flexUI.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"settings.connect" : { "loggedIn": false },
"settings.connected" : { "loggedIn": true },
"settings.account" : { "loggedIn": true },
"settings.covid19" : { "loggedIn": true },
"settings.connected.netid" : { "shibbolethLoggedIn": true },
"settings.connected.phone" : { "phoneLoggedIn": true },
"settings.connected.netid.info" : { "shibbolethLoggedIn": true },
Expand Down
6 changes: 4 additions & 2 deletions assets/strings.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
"panel.covid19_passport.label.access.granted": "GRANTED",
"panel.covid19_passport.label.access.denied": "DENIED",
"panel.covid19_passport.message.missing_id_info": "No Illini ID information found. You may have an expired i-card. Please contact the ID Center.",
"panel.covid19_passport.message.incorrect_time": "Your Date & Time is incorrect.",
"panel.covid19_passport.button.show_page_1.title": "Show page 1 of 2",
"panel.covid19_passport.button.show_page_1.hint": "",
"panel.covid19_passport.button.show_page_2.title": "Show page 2 of 2",
Expand Down Expand Up @@ -338,8 +339,9 @@

"panel.covid19_test_locations.header.title": "Test Locations",
"panel.covid19_test_locations.label.contact.title": "Contact",
"panel.covid19_test_locations.distance.text": "mi away get directions",
"panel.covid19_test_locations.distance.unknown": "unknown distance",
"panel.covid19_test_locations.distance.text": "mi away",
"panel.covid19_test_locations.distance.directions.text": "get directions",
"panel.covid19_test_locations.location.unknown": "unknown location",
"panel.covid19_test_locations.work_time.unknown": "Unknown working time",
"panel.covid19_test_locations.work_time.open_until": "Open until",
"panel.covid19_test_locations.work_time.closed_until": "Closed until",
Expand Down
6 changes: 4 additions & 2 deletions assets/strings.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
"panel.covid19_passport.label.access.granted": "CONCEDIDO",
"panel.covid19_passport.label.access.denied": "NEGADO",
"panel.covid19_passport.message.missing_id_info": "No se encontró información de identificación de Illini. Es posible que tenga una i-card vencida. Comuníquese con el Centro de identificación.",
"panel.covid19_passport.message.incorrect_time": "Tu fecha y hora son incorrectas.",
"panel.covid19_passport.button.show_page_1.title": "Mostrar página 1 de 2",
"panel.covid19_passport.button.show_page_1.hint": "",
"panel.covid19_passport.button.show_page_2.title": "Mostrar página 2 de 2",
Expand Down Expand Up @@ -338,8 +339,9 @@

"panel.covid19_test_locations.header.title": "Lugares de prueba",
"panel.covid19_test_locations.label.contact.title": "Contacto",
"panel.covid19_test_locations.distance.text": "mi distancia y obtener direcciones",
"panel.covid19_test_locations.distance.unknown": "distancia desconocida",
"panel.covid19_test_locations.distance.text": "mi distancia",
"panel.covid19_test_locations.distance.directions.text": "obtener las direcciones",
"panel.covid19_test_locations.location.unknown": "ubicación desconocida",
"panel.covid19_test_locations.work_time.unknown": "Tiempo de trabajo desconocido",
"panel.covid19_test_locations.work_time.open_until": "Abierto hasta",
"panel.covid19_test_locations.work_time.closed_until": "Cerrado hasta",
Expand Down
6 changes: 4 additions & 2 deletions assets/strings.zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
"panel.covid19_passport.label.access.granted": "授予",
"panel.covid19_passport.label.access.denied": "否认",
"panel.covid19_passport.message.missing_id_info": "找不到Illini ID信息. 您的I-Card可能已过期。请与ID中心联系.",
"panel.covid19_passport.message.incorrect_time": "您的日期和時間不正確。",
"panel.covid19_passport.button.show_page_1.title": "Show page 1 of 2",
"panel.covid19_passport.button.show_page_1.hint": "",
"panel.covid19_passport.button.show_page_2.title": "Show page 2 of 2",
Expand Down Expand Up @@ -338,8 +339,9 @@

"panel.covid19_test_locations.header.title": "测试位置",
"panel.covid19_test_locations.label.contact.title": "联系人",
"panel.covid19_test_locations.distance.text": "寻路",
"panel.covid19_test_locations.distance.unknown": "未知距离",
"panel.covid19_test_locations.distance.text": "英里遠",
"panel.covid19_test_locations.distance.directions.text": "獲取路線",
"panel.covid19_test_locations.location.unknown": "未知的位置",
"panel.covid19_test_locations.work_time.unknown": "未知工作时间",
"panel.covid19_test_locations.work_time.open_until": "打开到",
"panel.covid19_test_locations.work_time.closed_until": "关闭到",
Expand Down
2 changes: 0 additions & 2 deletions lib/service/Config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,7 @@ class Config with Service implements NotificationsListener {
String get rokmetroAuthUrl { return platformBuildingBlocks['rokmetro_auth_url']; } // "https://api-dev.rokwire.illinois.edu/authbb/77779"
String get sportsServiceUrl { return platformBuildingBlocks['sports_service_url']; } // "https://api-dev.rokwire.illinois.edu/sports-service";
String get healthUrl { return platformBuildingBlocks['health_url']; } // "https://api-dev.rokwire.illinois.edu/health"
String get talentChooserUrl { return platformBuildingBlocks['talent_chooser_url']; } // "https://api-dev.rokwire.illinois.edu/talent-chooser/api/ui-content"
String get transportationUrl { return platformBuildingBlocks["transportation_url"]; } // "https://api-dev.rokwire.illinois.edu/transportation"
String get locationsUrl { return platformBuildingBlocks["locations_url"]; } // "https://api-dev.rokwire.illinois.edu/location/api";
String get imagesServiceUrl { return platformBuildingBlocks['images_service_url']; } // "https://api-dev.rokwire.illinois.edu/images-service";

String get osfBaseUrl { return thirdPartyServices['osf_base_url']; } // "https://ssproxy.osfhealthcare.org/fhir-proxy"
Expand Down
20 changes: 19 additions & 1 deletion lib/service/Health.dart
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ class Health with Service implements NotificationsListener {
return (_refreshFuture != null);
}

bool get refreshingUser {
return (_refreshFuture != null) && (_refreshOptions?.user == true);
}

Future<void> refreshStatus() async {
return _refresh(_RefreshOptions.fromList([_RefreshOption.userInterval, _RefreshOption.history, _RefreshOption.rules, _RefreshOption.buildingAccessRules]));
}
Expand Down Expand Up @@ -396,7 +400,7 @@ class Health with Service implements NotificationsListener {
String url = "${Config().healthUrl}/covid19/login";
String post = AppJson.encode(user?.toJson());
Response response = await Network().post(url, body: post, auth: Network.RokmetroUserAuth);
if ((response != null) && (response.statusCode == 200)) {
if (response?.statusCode == 200) {
return true;
}
}
Expand Down Expand Up @@ -1644,6 +1648,20 @@ class Health with Service implements NotificationsListener {
return (HealthHistory.mostRecentVaccine(_history, vaccine: HealthHistoryBlob.VaccineEffective) != null);
}

// Current Server Time

Future<DateTime> getServerTimeUtc() async {
//TMP: return DateTime.now().toUtc();
String url = (Config().healthUrl != null) ? "${Config().healthUrl}/covid19/time" : null;
Response response = (url != null) ? await Network().get(url, auth: Network.AppAuth) : null;
String responseBody = (response?.statusCode == 200) ? response.body : null;
Map<String, dynamic> responseJson = (responseBody != null) ? AppJson.decodeMap(responseBody) : null;
String timeString = (responseJson != null) ? AppJson.stringValue(responseJson['time']) : null;
try { return (timeString != null) ? DateTime.parse(timeString) : null; }
catch (e) { print(e?.toString()); }
return null;
}

// Health Family Members

List<HealthFamilyMember> get familyMembers {
Expand Down
89 changes: 60 additions & 29 deletions lib/service/Network.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Network {
return (responseStream != null) ? Http.Response.fromStream(responseStream) : null;
}
} catch (e) {
Log.e(e.toString());
Log.d(e?.toString());
FirebaseCrashlytics().recordError(e, null);
}
return null;
Expand Down Expand Up @@ -142,20 +142,26 @@ class Network {
return response;
}
} catch (e) {
Log.e(e.toString());
Log.d(e?.toString());
FirebaseCrashlytics().recordError(e, null);
}
}
return null;
}

Future<Http.Response> get(url, { String body, Encoding encoding, Map<String, String> headers, int auth, Http.Client client, int timeout = 60, bool sendAnalytics = true, String analyticsUrl, bool analyticsAnonymous }) async {
Http.Response response = await _get(url, headers: headers, body: body, encoding: encoding, auth: auth, client: client, timeout: timeout);

if (_requiresTokenRefresh(response, auth)) {
if (await _refreshToken(auth) != null) {
response = await _get(url, headers: headers, body: body, encoding: encoding, auth: auth, client: client, timeout: timeout);
Http.Response response;
try {
response = await _get(url, headers: headers, body: body, encoding: encoding, auth: auth, client: client, timeout: timeout);

if (_requiresTokenRefresh(response, auth)) {
if (await _refreshToken(auth) != null) {
response = await _get(url, headers: headers, body: body, encoding: encoding, auth: auth, client: client, timeout: timeout);
}
}
} catch (e) {
Log.d(e?.toString());
FirebaseCrashlytics().recordError(e, null);
}

if (sendAnalytics) {
Expand All @@ -173,22 +179,29 @@ class Network {
Future<Http.Response> response = (url != null) ? Http.post(url, headers: _prepareHeaders(headers, auth, url), body: body, encoding: encoding) : null;
return ((response != null) && (timeout != null)) ? response.timeout(Duration(seconds: timeout), onTimeout: _responseTimeoutHandler) : response;
} catch (e) {
Log.e(e.toString());
Log.d(e?.toString());
FirebaseCrashlytics().recordError(e, null);
}
}
return null;
}

Future<Http.Response> post(url, { body, Encoding encoding, Map<String, String> headers, int auth, int timeout = 60, bool sendAnalytics = true, String analyticsUrl, bool analyticsAnonymous }) async{
Http.Response response = await _post(url, body: body, encoding: encoding, headers: headers, auth: auth, timeout: timeout);
Http.Response response;
try {
response = await _post(url, body: body, encoding: encoding, headers: headers, auth: auth, timeout: timeout);

if (_requiresTokenRefresh(response, auth)) {
if (await _refreshToken(auth) != null) {
response = await _post(url, body: body, encoding: encoding, headers: headers, auth: auth, timeout: timeout);
if (_requiresTokenRefresh(response, auth)) {
if (await _refreshToken(auth) != null) {
response = await _post(url, body: body, encoding: encoding, headers: headers, auth: auth, timeout: timeout);
}
}
} catch (e) {
Log.d(e?.toString());
FirebaseCrashlytics().recordError(e, null);
}


if (sendAnalytics) {
Analytics().logHttpResponse(response, requestMethod:'POST', requestUrl: analyticsUrl ?? url, anonymous: analyticsAnonymous);
}
Expand All @@ -210,20 +223,26 @@ class Network {
return ((response != null) && (timeout != null)) ? response.timeout(Duration(seconds: timeout), onTimeout: _responseTimeoutHandler) : response;

} catch (e) {
Log.e(e.toString());
Log.d(e?.toString());
FirebaseCrashlytics().recordError(e, null);
}
}
return null;
}

Future<Http.Response> put(url, { body, Encoding encoding, Map<String, String> headers, int auth, int timeout = 60, Http.Client client, bool sendAnalytics = true, String analyticsUrl, bool analyticsAnonymous }) async {
Http.Response response = await _put(url, body: body, encoding: encoding, headers: headers, auth: auth, timeout: timeout, client: client);
Http.Response response;
try {
response = await _put(url, body: body, encoding: encoding, headers: headers, auth: auth, timeout: timeout, client: client);

if (_requiresTokenRefresh(response, auth)) {
if (await _refreshToken(auth) != null) {
response = await _put(url, body: body, encoding: encoding, headers: headers, auth: auth, timeout: timeout, client: client);
if (_requiresTokenRefresh(response, auth)) {
if (await _refreshToken(auth) != null) {
response = await _put(url, body: body, encoding: encoding, headers: headers, auth: auth, timeout: timeout, client: client);
}
}
} catch (e) {
Log.d(e?.toString());
FirebaseCrashlytics().recordError(e, null);
}

if (sendAnalytics) {
Expand All @@ -241,20 +260,26 @@ class Network {
Future<Http.Response> response = (url != null) ? Http.patch(url, headers: _prepareHeaders(headers, auth, url), body: body, encoding: encoding) : null;
return ((response != null) && (timeout != null)) ? response.timeout(Duration(seconds: timeout), onTimeout: _responseTimeoutHandler) : response;
} catch (e) {
Log.e(e.toString());
Log.d(e?.toString());
FirebaseCrashlytics().recordError(e, null);
}
}
return null;
}

Future<Http.Response> patch(url, { body, Encoding encoding, Map<String, String> headers, int auth, int timeout = 60, bool sendAnalytics = true, String analyticsUrl, bool analyticsAnonymous }) async {
Http.Response response = await _patch(url, body: body, encoding: encoding, headers: headers, auth: auth, timeout: timeout);
Http.Response response;
try {
response = await _patch(url, body: body, encoding: encoding, headers: headers, auth: auth, timeout: timeout);

if (_requiresTokenRefresh(response, auth)) {
if (await _refreshToken(auth) != null) {
response = await _patch(url, body: body, encoding: encoding, headers: headers, auth: auth, timeout: timeout);
if (_requiresTokenRefresh(response, auth)) {
if (await _refreshToken(auth) != null) {
response = await _patch(url, body: body, encoding: encoding, headers: headers, auth: auth, timeout: timeout);
}
}
} catch (e) {
Log.d(e?.toString());
FirebaseCrashlytics().recordError(e, null);
}

if (sendAnalytics) {
Expand All @@ -272,20 +297,26 @@ class Network {
Future<Http.Response> response = (url != null) ? Http.delete(url, headers: _prepareHeaders(headers, auth, url)) : null;
return ((response != null) && (timeout != null)) ? response.timeout(Duration(seconds: timeout), onTimeout: _responseTimeoutHandler) : response;
} catch (e) {
Log.e(e.toString());
Log.d(e?.toString());
FirebaseCrashlytics().recordError(e, null);
}
}
return null;
}

Future<Http.Response> delete(url, { Map<String, String> headers, int auth, int timeout = 60, bool sendAnalytics = true, String analyticsUrl, bool analyticsAnonymous }) async {
Http.Response response = await _delete(url, headers: headers, auth: auth, timeout: timeout);
Http.Response response;
try {
response = await _delete(url, headers: headers, auth: auth, timeout: timeout);

if (_requiresTokenRefresh(response, auth)) {
if (await _refreshToken(auth) != null) {
response = await _delete(url, headers: headers, auth: auth, timeout: timeout);
if (_requiresTokenRefresh(response, auth)) {
if (await _refreshToken(auth) != null) {
response = await _delete(url, headers: headers, auth: auth, timeout: timeout);
}
}
} catch (e) {
Log.d(e?.toString());
FirebaseCrashlytics().recordError(e, null);
}

if (sendAnalytics) {
Expand All @@ -303,7 +334,7 @@ class Network {
Future<String> response = (url != null) ? Http.read(url, headers: _prepareHeaders(headers, auth, url)) : null;
return ((response != null) && (timeout != null)) ? response.timeout(Duration(seconds: timeout)) : response;
} catch (e) {
Log.e(e.toString());
Log.d(e?.toString());
FirebaseCrashlytics().recordError(e, null);
}
}
Expand All @@ -320,7 +351,7 @@ class Network {
Future<Uint8List> response = (url != null) ? Http.readBytes(url, headers: _prepareHeaders(headers, auth, url)) : null;
return ((response != null) && (timeout != null)) ? response.timeout(Duration(seconds: timeout), onTimeout: _responseBytesHandler) : response;
} catch (e) {
Log.e(e.toString());
Log.d(e?.toString());
FirebaseCrashlytics().recordError(e, null);
}
}
Expand Down
Loading

0 comments on commit d7676d9

Please sign in to comment.