Skip to content

Commit

Permalink
Merge pull request #2273 from instructure/resolve-conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
hermannakos authored Dec 6, 2023
2 parents 9142c3b + 4f6fc46 commit b194d38
Show file tree
Hide file tree
Showing 115 changed files with 2,246 additions and 3,879 deletions.
2 changes: 1 addition & 1 deletion android-vault
2 changes: 1 addition & 1 deletion apps/flutter_parent/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ dependencies {
testImplementation 'junit:junit:4.12'

androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "com.squareup.okhttp3:okhttp:4.9.1"
implementation 'org.jsoup:jsoup:1.11.3'
implementation 'com.google.gms:google-services:4.3.14'
Expand Down
7 changes: 7 additions & 0 deletions apps/flutter_parent/assets/html/html_wrapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
height: auto;
margin: 0;
padding: 0;
background-color: {BACKGROUND};
color: {COLOR};
}

img {
Expand Down Expand Up @@ -65,6 +67,7 @@

a {
word-wrap: break-word;
color: {LINK_COLOR}
}

.lti_button {
Expand All @@ -81,6 +84,10 @@
font-size: 13px;
margin: auto;
}

a:visited {
color: {VISITED_LINK_COLOR}
}
</style>
<body>
<div id="content">
Expand Down
85 changes: 84 additions & 1 deletion apps/flutter_parent/lib/l10n/res/intl_id.arb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@@last_modified": "2022-10-28T11:03:07.232972",
"@@last_modified": "2023-08-25T11:04:20.901151",
"alertsLabel": "Peringatan",
"@alertsLabel": {
"description": "The label for the Alerts tab",
Expand Down Expand Up @@ -182,6 +182,19 @@
"points": {}
}
},
"calendarDaySemanticsLabel": "{eventCount,plural, =1{{date}, {eventCount} acara}other{{date}, {eventCount} acara}}",
"@calendarDaySemanticsLabel": {
"description": "Screen reader label used for calendar day, reads the date and count of events",
"type": "text",
"placeholders_order": [
"date",
"eventCount"
],
"placeholders": {
"date": {},
"eventCount": {}
}
},
"No Events Today!": "Tidak Ada Acara Hari Ini!",
"@No Events Today!": {
"description": "Title displayed when there are no calendar events for the current day",
Expand Down Expand Up @@ -2666,5 +2679,75 @@
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"Acceptable Use Policy": "Kebijakan Penggunaan yang Dapat Diterima",
"@Acceptable Use Policy": {
"description": "title for the acceptable use policy screen",
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"Submit": "Serahkan",
"@Submit": {
"description": "submit button title for acceptable use policy screen",
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"Either you're a new user or the Acceptable Use Policy has changed since you last agreed to it. Please agree to the Acceptable Use Policy before you continue.": "Anda pengguna baru atau Kebijakan Penggunaan yang Dapat Diterima telah berubah sejak Anda terakhir kali menyetujuinya. Silakan setujui Kebijakan Penggunaan yang Dapat Diterima sebelum Anda melanjutkan.",
"@Either you're a new user or the Acceptable Use Policy has changed since you last agreed to it. Please agree to the Acceptable Use Policy before you continue.": {
"description": "acceptable use policy screen description",
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"I agree to the Acceptable Use Policy.": "Saya menyetujui Kebijakan Penggunaan yang Dapat Diterima.",
"@I agree to the Acceptable Use Policy.": {
"description": "acceptable use policy switch title",
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"About": "Tentang",
"@About": {
"description": "Title for about menu item in settings",
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"App": "App",
"@App": {
"description": "Title for App field on about page",
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"Login ID": "ID Login",
"@Login ID": {
"description": "Title for Login ID field on about page",
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"Email": "Email",
"@Email": {
"description": "Title for Email field on about page",
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"Version": "Versi",
"@Version": {
"description": "Title for Version field on about page",
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"Instructure logo": "Logo Instructure",
"@Instructure logo": {
"description": "Semantics label for the Instructure logo on the about page",
"type": "text",
"placeholders_order": [],
"placeholders": {}
}
}
1 change: 0 additions & 1 deletion apps/flutter_parent/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import 'package:flutter_parent/utils/notification_util.dart';
import 'package:flutter_parent/utils/old_app_migration.dart';
import 'package:flutter_parent/utils/remote_config_utils.dart';
import 'package:flutter_parent/utils/service_locator.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:flutter_downloader/flutter_downloader.dart';

void main() async {
Expand Down
2 changes: 1 addition & 1 deletion apps/flutter_parent/lib/models/course_grade.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class CourseGrade {
/// If the course contains no valid current grade or score, this flag will be true. This is usually represented in the
/// UI with "N/A".
bool noCurrentGrade() =>
_getCurrentScore() == null && (currentGrade() == null || currentGrade()!.contains('N/A') || currentGrade()!.isEmpty);
currentScore() == null && (currentGrade() == null || currentGrade()!.contains('N/A') || currentGrade()!.isEmpty);

bool _hasActiveGradingPeriod() =>
!_forceAllPeriods &&
Expand Down
8 changes: 5 additions & 3 deletions apps/flutter_parent/lib/screens/help/terms_of_use_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ class _TermsOfUseScreenState extends State<TermsOfUseScreen> {

// Content
return WebView(
darkMode: ParentTheme.of(context)?.isWebViewDarkMode,
onWebViewCreated: (controller) {
controller.loadHtml(snapshot.data!.content!, horizontalPadding: 16);
},
controller.loadHtml(snapshot.data!.content!,
horizontalPadding: 16,
darkMode:
ParentTheme.of(context)?.isWebViewDarkMode ?? false);
},
navigationDelegate: _handleNavigation
);
},
Expand Down
12 changes: 5 additions & 7 deletions apps/flutter_parent/lib/screens/web_login/web_login_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ class _WebLoginScreenState extends State<WebLoginScreen> {
navigationDelegate: (request) =>
_navigate(context, request, verifyResult),
javascriptMode: JavascriptMode.unrestricted,
darkMode: ParentTheme.of(context)?.isWebViewDarkMode,
userAgent: ApiPrefs.getUserAgent(),
onPageFinished: (url) => _pageFinished(url, verifyResult),
onPageStarted: (url) => _pageStarted(url),
Expand Down Expand Up @@ -243,16 +242,15 @@ class _WebLoginScreenState extends State<WebLoginScreen> {
/// Load the authenticated url with any necessary cookies
void _loadAuthUrl() async {
_showLoadingState();
CookieManager().clearCookies();
final cookieManager = CookieManager();
cookieManager.clearCookies();

if (widget.loginFlow == LoginFlow.siteAdmin) {
await _controller?.setAcceptThirdPartyCookies(true);
if (_domain.contains('.instructure.com')) {
String cookie = 'canvas_sa_delegated=1;domain=.instructure.com;path=/;';
await _controller?.setCookie(_domain, cookie);
await _controller?.setCookie('.instructure.com', cookie);
cookieManager.setCookie(WebViewCookie(name: 'canvas_sa_delegated', value: '1', domain: _domain));
cookieManager.setCookie(WebViewCookie(name: 'canvas_sa_delegated', value: '1', domain: '.instructure.com'));
} else {
await _controller?.setCookie(_domain, 'canvas_sa_delegated=1');
cookieManager.setCookie(WebViewCookie(name: 'canvas_sa_delegated', value: '1', domain: _domain));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,15 @@ class _ResizingWebViewState extends State<_ResizingWebView> with WidgetsBindingO
if (_content != widgetContent) {
_height = widget.initialHeight;
_content = widgetContent!;
_controller?.loadHtml(_content, horizontalPadding: widget.horizontalPadding);
_controller?.loadHtml(_content,
horizontalPadding: widget.horizontalPadding,
darkMode: ParentTheme.of(context)?.isWebViewDarkMode ?? false);
}

Widget child = WebView(
javascriptMode: JavascriptMode.unrestricted,
onPageFinished: _handlePageLoaded,
onWebViewCreated: _handleWebViewCreated,
darkMode: ParentTheme.of(context)?.isWebViewDarkMode == true,
navigationDelegate: _handleNavigation,
gestureRecognizers: _webViewGestures(),
javascriptChannels: _webViewChannels(),
Expand All @@ -260,7 +261,10 @@ class _ResizingWebViewState extends State<_ResizingWebView> with WidgetsBindingO
}

void _handleWebViewCreated(WebViewController webViewController) async {
webViewController.loadHtml(_content, baseUrl: ApiPrefs.getDomain(), horizontalPadding: widget.horizontalPadding);
webViewController.loadHtml(_content,
baseUrl: ApiPrefs.getDomain(),
horizontalPadding: widget.horizontalPadding,
darkMode: ParentTheme.of(context)?.isWebViewDarkMode ?? false);
_controller = webViewController;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class _SimpleWebViewScreenState extends State<SimpleWebViewScreen> {
body: WebView(
javascriptMode: JavascriptMode.unrestricted,
userAgent: ApiPrefs.getUserAgent(),
darkMode: ParentTheme.of(context)?.isWebViewDarkMode,
gestureRecognizers: Set()..add(Factory<WebViewGestureRecognizer>(() => WebViewGestureRecognizer())),
navigationDelegate: _handleNavigation,
onWebViewCreated: (controller) {
Expand Down
9 changes: 7 additions & 2 deletions apps/flutter_parent/lib/utils/web_view_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,20 @@ extension WebViewUtils on WebViewController {
String? html, {
String? baseUrl,
Map<String, String>? headers,
double horizontalPadding = 0})
double horizontalPadding = 0,
bool darkMode = false})
async {
String fileText = await rootBundle.loadString('assets/html/html_wrapper.html');
html = _applyWorkAroundForDoubleSlashesAsUrlSource(html);
html = _addProtocolToLinks(html);
html = _checkForMathTags(html);
html = fileText.replaceAll('{CANVAS_CONTENT}', html);
html = html.replaceAll('{BACKGROUND}', darkMode ? '#000000' : '#ffffff');
html = html.replaceAll('{COLOR}', darkMode ? '#ffffff' : '#000000');
html = html.replaceAll('{LINK_COLOR}', darkMode ? '#1283C4' : '#0374B5');
html = html.replaceAll('{VISITED_LINK_COLOR}', darkMode ? '#C74BAF' : '#BF32A4');
html = html.replaceAll('{PADDING}', horizontalPadding.toString());
this.loadData(baseUrl, html, 'text/html', 'utf-8');
this.loadHtmlString(html, baseUrl: baseUrl);
}

/**
Expand Down
25 changes: 0 additions & 25 deletions apps/flutter_parent/plugins/webview_flutter/LICENSE

This file was deleted.

41 changes: 0 additions & 41 deletions apps/flutter_parent/plugins/webview_flutter/android/build.gradle

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit b194d38

Please sign in to comment.