Skip to content

Commit

Permalink
Merge pull request #131 from CityOfLosAngeles/update-dev
Browse files Browse the repository at this point in the history
Sandbox updates
  • Loading branch information
cbhernan authored Sep 18, 2024
2 parents c0c1a98 + 2262734 commit 982cdea
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 112 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dart_analyzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
# SHA for v2.10.0
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
flutter-version: '3.13.2'
flutter-version: '3.22.2'
channel: 'stable'
cache: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
# https://github.com/marketplace/actions/flutter-action
- name: Setup Flutter
# SHA for v2.10.0
# SHA for v2.16.0
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
flutter-version: '3.22.2'
Expand Down
4 changes: 2 additions & 2 deletions functions/auth0/api/auth0.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ export const authMethods = onRequest(async (req, res) => {

const request = await axios.request(config);

const applications = await getConnectedServices(userId);
// const applications = await getConnectedServices(userId);

const response = {
mfaMethods: request.data,
services: applications.filter((e) => e !== null)
// services: applications.filter((e) => e !== null)
}

res.status(200).send(response);
Expand Down
154 changes: 77 additions & 77 deletions lib/views/screens/advanced_security_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -353,83 +353,83 @@ class _AdvancedSecurityState extends State<AdvancedSecurityScreen> {
)
]
),
const SizedBox(height: 25),
Semantics(
header: true,
child: const Text(
'Your Connected Services',
textAlign: TextAlign.left,
style: headerStyle
)
),
const SizedBox(height: 10),
_connectedServices.isEmpty ?
const Text('No connected services')
:
ListView.builder(
shrinkWrap: true,
padding: const EdgeInsets.all(0),
itemCount: _connectedServices.length,
itemBuilder: (final BuildContext context, final int index) {
final service = _connectedServices[index];
return ListTile(
contentPadding: const EdgeInsets.all(0),
leading: service.icon.isNotEmpty ? ClipRRect(
borderRadius: BorderRadius.circular(100),
child: Image.network(
semanticLabel: '${service.name} logo',
service.icon,
width: 50,
height: 50,
),
) : null,
title: Text(service.name),
subtitle: Text(service.scope.join(', ').toString()),
trailing: TextButton(
key: Key('disconnect_${service.grantId}'),
onPressed: () => showDialog<int>(
context: context,
builder: (final BuildContext context) => AlertDialog(
title: Text('Revoke consent for ${service.name}?'),
content: Container(
width: MediaQuery.of(context).size.width * 0.4,
child: SingleChildScrollView(
child: ListBody(
children: <Widget>[
// ignore: avoid_escaping_inner_quotes
// ignore: lines_longer_than_80_chars
Text('Your Angeleno Account information will no longer be shared with ${service.name}.', style: const TextStyle(fontWeight: FontWeight.bold)),
const SizedBox(height: 10),
// ignore: lines_longer_than_80_chars
Text('The information you already shared with ${service.name} will not be deleted. If you want to delete the information you shared with ${service.name}, you will need to contact ${service.name}.'),
const SizedBox(height: 10),
// ignore: lines_longer_than_80_chars
Text('To access ${service.name} again in the future, you will need to give your consent to share your Angeleno Account information again. You can give consent again by going to the ${service.name} site and logging in.')
],
)
)
),
actions: <Widget>[
TextButton(
child: const Text('Cancel'),
onPressed: () {
Navigator.pop(context);
},
),
TextButton(
child: const Text('Ok'),
onPressed: () {
removeConnection(service.grantId);
},
)
],
)
),
child: const Text('Disconnect')
),
);
}
)
// const SizedBox(height: 25),
// Semantics(
// header: true,
// child: const Text(
// 'Your Connected Services',
// textAlign: TextAlign.left,
// style: headerStyle
// )
// ),
// const SizedBox(height: 10),
// _connectedServices.isEmpty ?
// const Text('No connected services')
// :
// ListView.builder(
// shrinkWrap: true,
// padding: const EdgeInsets.all(0),
// itemCount: _connectedServices.length,
// itemBuilder: (final BuildContext context, final int index) {
// final service = _connectedServices[index];
// return ListTile(
// contentPadding: const EdgeInsets.all(0),
// leading: service.icon.isNotEmpty ? ClipRRect(
// borderRadius: BorderRadius.circular(100),
// child: Image.network(
// semanticLabel: '${service.name} logo',
// service.icon,
// width: 50,
// height: 50,
// ),
// ) : null,
// title: Text(service.name),
// subtitle: Text(service.scope.join(', ').toString()),
// trailing: TextButton(
// key: Key('disconnect_${service.grantId}'),
// onPressed: () => showDialog<int>(
// context: context,
// builder: (final BuildContext context) => AlertDialog(
// title: Text('Revoke consent for ${service.name}?'),
// content: Container(
// width: MediaQuery.of(context).size.width * 0.4,
// child: SingleChildScrollView(
// child: ListBody(
// children: <Widget>[
// // ignore: avoid_escaping_inner_quotes
// // ignore: lines_longer_than_80_chars
// Text('Your Angeleno Account information will no longer be shared with ${service.name}.', style: const TextStyle(fontWeight: FontWeight.bold)),
// const SizedBox(height: 10),
// // ignore: lines_longer_than_80_chars
// Text('The information you already shared with ${service.name} will not be deleted. If you want to delete the information you shared with ${service.name}, you will need to contact ${service.name}.'),
// const SizedBox(height: 10),
// // ignore: lines_longer_than_80_chars
// Text('To access ${service.name} again in the future, you will need to give your consent to share your Angeleno Account information again. You can give consent again by going to the ${service.name} site and logging in.')
// ],
// )
// )
// ),
// actions: <Widget>[
// TextButton(
// child: const Text('Cancel'),
// onPressed: () {
// Navigator.pop(context);
// },
// ),
// TextButton(
// child: const Text('Ok'),
// onPressed: () {
// removeConnection(service.grantId);
// },
// )
// ],
// )
// ),
// child: const Text('Disconnect')
// ),
// );
// }
// )
],
)
)
Expand Down
48 changes: 35 additions & 13 deletions lib/views/screens/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class _MyHomePageState extends State<MyHomePage> {
late User user;
late OverlayProvider overlayProvider;
int _selectedIndex = 0;
final currentYear = DateTime.now().year;

@override
void initState() {
Expand Down Expand Up @@ -214,18 +213,41 @@ class _MyHomePageState extends State<MyHomePage> {
],
),
bottomNavigationBar: Container(
padding: const EdgeInsets.all(16.0),
child: Wrap(
alignment: WrapAlignment.center,
children: [
Text(
'© Copyright $currentYear City of Los Angeles. '
'All rights reserved. Disclaimer | Privacy Policy',
textDirection: TextDirection.ltr,
textAlign: TextAlign.center,
)
],
)
padding: const EdgeInsets.all(16.0),
child: Wrap(
alignment: WrapAlignment.center,
crossAxisAlignment: WrapCrossAlignment.center,
children: [
const Text(
'City of Los Angeles. '
),
TextButton(
style: TextButton.styleFrom(
padding: EdgeInsets.zero,
overlayColor: Colors.transparent
),
onPressed: () async {
await launchUrl(
Uri.parse('https://disclaimer.lacity.org/disclaimer.htm')
);
},
child: const Text('Disclaimer')
),
const Text(' | '),
TextButton(
style: TextButton.styleFrom(
padding: EdgeInsets.zero,
overlayColor: Colors.transparent
),
onPressed: () async {
await launchUrl(
Uri.parse('https://disclaimer.lacity.org/privacy.htm')
);
},
child: const Text('Privacy Policy')
),
],
)
)
),
);
Expand Down
36 changes: 18 additions & 18 deletions test/advanced_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -290,23 +290,23 @@ void main() {
expect(find.byKey(const Key('enableSMS')), findsOneWidget);
expect(find.byKey(const Key('disableVoice')), findsOneWidget);

await tester.tap(find.byKey(const Key('disconnect_123')));
await tester.pumpAndSettle();

expect(find.byType(AlertDialog), findsOneWidget);

await tester.tap(find.text('Cancel'));
await tester.pumpAndSettle();

expect(find.byType(AlertDialog), findsNothing);

await tester.tap(find.byKey(const Key('disconnect_123')));
await tester.pumpAndSettle();

await tester.tap(find.text('Ok'));
await tester.pumpAndSettle();

expect(find.byType(SnackBar), findsOneWidget);
expect(find.byKey(const Key('disconnect_123')), findsNothing);
// await tester.tap(find.byKey(const Key('disconnect_123')));
// await tester.pumpAndSettle();
//
// expect(find.byType(AlertDialog), findsOneWidget);
//
// await tester.tap(find.text('Cancel'));
// await tester.pumpAndSettle();
//
// expect(find.byType(AlertDialog), findsNothing);
//
// await tester.tap(find.byKey(const Key('disconnect_123')));
// await tester.pumpAndSettle();
//
// await tester.tap(find.text('Ok'));
// await tester.pumpAndSettle();
//
// expect(find.byType(SnackBar), findsOneWidget);
// expect(find.byKey(const Key('disconnect_123')), findsNothing);
});
}

0 comments on commit 982cdea

Please sign in to comment.