-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
News aggregator module #345
Open
stefanp0pa
wants to merge
141
commits into
null_safety
Choose a base branch
from
stefp0pa/licenta-null_safety
base: null_safety
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+8,662
−1,252
Open
Changes from 1 commit
Commits
Show all changes
141 commits
Select commit
Hold shift + click to select a range
4223e5f
Create UI prototype for selecting data sources
IoanaAlexandru 73b469e
Create UI prototype for selecting data sources
IoanaAlexandru ddac723
Added source editing page, a field in user for filtering the informat…
AdrianMargineanu e060ea2
Edit the quarry from the firebase to filter the information.
AdrianMargineanu 5f5ddfa
Merge remote-tracking branch 'origin/select_sources' into select_sources
AdrianMargineanu c4b1dc7
Create UI prototype for selecting data sources
IoanaAlexandru 0bb872a
Added source editing page, a field in user for filtering the informat…
AdrianMargineanu 6963757
Edit the quarry from the firebase to filter the information.
AdrianMargineanu f2f2852
Merge branch 'master' into select_sources
IoanaAlexandru 27c63c7
Fix broken merge and update packages.
IoanaAlexandru a1258c6
Fix bug when user has no sources selected.
IoanaAlexandru ad6ae43
Merge remote-tracking branch 'origin/select_sources' into select_sources
AdrianMargineanu dd76c01
Disable the checkbox of the official info field
AdrianMargineanu e80f78e
Merge branch 'master' into select_sources
AdrianMargineanu 98a287d
Remove the hardcoded text from tha page
AdrianMargineanu ed736d4
If the user is anonymous get all websites.
AdrianMargineanu 1616310
Modify the condition of automation opening of source page
AdrianMargineanu fb13c4e
Correct deprecated methods
AdrianMargineanu 8cbd334
Grammar fixes of the strings
AdrianMargineanu 512e4fd
Move the source_page in settings
AdrianMargineanu 03bd793
Correct the mock of the tests
AdrianMargineanu 192c860
Make source selection page show only once per app launch.
IoanaAlexandru 425a2a6
Merge branch 'master' into select_sources
IoanaAlexandru 096494b
Fix broken merge conflict.
IoanaAlexandru 596a48b
Add information sources page link to settings.
IoanaAlexandru e991417
Improve settings page.
IoanaAlexandru c945c7f
Migrate the database to the filter system
AdrianMargineanu 07f7d20
Migrate faq to sources
AdrianMargineanu f515016
Merge branch 'master' into select_sources
AdrianMargineanu 13b261d
Merged dev with select_sources
AdrianMargineanu e487c7a
Replace all material icons with their outlined counterpart.
IoanaAlexandru 78312a0
Use feather icons.
IoanaAlexandru 447350c
Improve padding.
IoanaAlexandru abad93a
Merge branch 'master' into IoanaAlexandru/improve_ui
IoanaAlexandru e6d292e
Fix failing test.
IoanaAlexandru 931ecf4
Replace all FlatButtons with TextButtons.
IoanaAlexandru 7086982
Fix unused package warning.
IoanaAlexandru ac8e6df
Improve settings page.
IoanaAlexandru 2663d75
More settings page improvements.
IoanaAlexandru b66d254
Fix failing tests.
IoanaAlexandru b8a5e1f
Merge branch 'IoanaAlexandru/improve_ui' into select_sources
IoanaAlexandru 7a311ac
Format files.
IoanaAlexandru 7b1459f
Merge branch 'IoanaAlexandru/improve_ui' into select_sources
IoanaAlexandru e3e6438
Fix linter warning.
IoanaAlexandru c7620bd
Remove methods not useful in the prod
AdrianMargineanu d972734
Merge branch 'master' into select_sources
AdrianMargineanu 8c54a20
Add a condition if the sources are null
AdrianMargineanu 5fe4c1a
Merge branch 'master' into select_sources
AdrianMargineanu 5aef7f2
Merge branch 'master' into select_sources
AdrianMargineanu f314f80
Fix the compilation errors after the merge
AdrianMargineanu 7dd3b44
Remove the used imports.
AdrianMargineanu 51c0292
Merge branch 'master' into select_sources
AdrianMargineanu 4e161ce
Merge branch 'master' into select_sources
IoanaAlexandru d2ef2f2
Fix tests.
IoanaAlexandru 14b9190
Merge branch 'master' into select_sources
AdrianMargineanu be60201
Solve conflicts
AdrianMargineanu 13f0e41
Fix feedback tests
AdrianMargineanu 63e8610
Code refactor. Build bump
AdrianMargineanu 7e5e6b1
Change to form context to current
AdrianMargineanu 1624132
Update contributor for Stefan Popa (#328)
stefanp0pa f990853
Propose iOS run with different configurations (#332)
stefanp0pa f055a84
Initial file setup for the news feature
stefanp0pa ec7fbd2
Hide cards when no-items are present (#339)
stefanp0pa 0a38072
Start designing the news item page
stefanp0pa 6636f5e
Fooling around with the Markdown widget
stefanp0pa d40e259
More work on the individual news item details page
stefanp0pa 2833d83
Merge branch 'master' into select_sources
stefanp0pa f713582
Applied most of RC, problem with whereIn condition in question_provider
stefanp0pa 73454f4
Connect source selection page to the settings
stefanp0pa cfa3358
Removed unnecessary print
stefanp0pa e486f98
Solved last comments in pr
AdrianMargineanu 5820e74
Add the error dialog if user has no student source in the events table
AdrianMargineanu fd97294
Solved failed intl string generation
stefanp0pa 6d8d3aa
Add string in all files
stefanp0pa 3320feb
Applied a part of the newest RCs by Ioana
stefanp0pa 284ba99
Rename the old question provider into FaqQuestionProvider
stefanp0pa 6162c65
Used ProxyProvider for the FaqQuestionProvider
stefanp0pa 5ad6301
Applied ProxyProvider for WebsiteProvider, do not know how to test
stefanp0pa 2c5ccf3
Replaced the warningEventsAreAddedByStudents string
stefanp0pa 8bc874d
Reorganize the news details page
stefanp0pa b02a048
Adding timestamp to news feed details
stefanp0pa 823a28a
Almost implement the bookmark functionality, I cannot get past the db…
stefanp0pa ff91044
When user did not select sources, default to all sources
stefanp0pa f245e83
Add filterBySource utility function in faq and website providers
stefanp0pa d3c32ea
Address DangerBot warning
stefanp0pa e917be5
Apply DangerBot suggestions
stefanp0pa c0e964e
Apply rewording RCs
stefanp0pa 5821ebf
Apply getter for sources
stefanp0pa c17148d
Apply RC
stefanp0pa aa65bd1
Merge select_sources branch into stefp0pa-licenta-null_safety
stefanp0pa 462f16b
Fix merge issues from merging select_sources
stefanp0pa e5d2f0b
Merge branch 'null_safety' into stefp0pa/licenta-null_safety
stefanp0pa 5679094
Fix bookmark on backend
stefanp0pa 938906e
Fix FutureBuilder in news details page
stefanp0pa edbcb7d
Initial setup for the Roles Request form page
stefanp0pa 426532e
Implement method for retrieving the favorite items
stefanp0pa 63a9927
Roles feature, initial setup
stefanp0pa c8fbbee
Create top tab view for each news feed category and create correspond…
stefanp0pa 571b93e
Style list news items
stefanp0pa ab16f00
Implement a new layout style for the news items in the main list
stefanp0pa da79cac
Refactor code for the main news list, remove code smells
stefanp0pa 18bca4d
Add create post page, modify rules in Firebase
stefanp0pa b6209ae
Style a little the compose post page
stefanp0pa b5259e7
Add preview screen for news before posting them
stefanp0pa 54127ee
Add refresh action on pull-to-refresh gesture
stefanp0pa d09f0f9
Add dropdown filter for roles but did not style it on request roles page
stefanp0pa 884c9ce
Design roles request form and post request
stefanp0pa 55dd6bb
Add consistency between admin pages
stefanp0pa 44a7f2d
Check if request was made for a specific role but did not take any ac…
stefanp0pa 677479b
Initial setup for dynamic links but not working
stefanp0pa fadcfda
Handle role requests, not fully tested
stefanp0pa c8f8cfc
Test the role requests, fix small bugs
stefanp0pa da6c9be
Initial deep linking setup using uni_links
stefanp0pa 099736e
Post news with relevance and role details attached
stefanp0pa 00ebec6
Some progress on the dynamic links
stefanp0pa a9992b7
5c61fa1
Test more the dynamic link functionality, implement share news
stefanp0pa 460e823
Integrate but not tested the send mail when request approve
stefanp0pa b55ef97
Added scraper
stefanp0pa 6c3a5b2
Make notifications work at bare minimum
stefanp0pa 73dfd73
Push current cloud messaging configuration
stefanp0pa b7c3484
Implement scraping - messaging - notification pipeline with cloud fun…
stefanp0pa f1b49c8
Switch for showing notifications or not on the sources page
stefanp0pa afc2360
Update to enable news notifications setting
stefanp0pa 061f445
Handle different login types on the main news feed page
stefanp0pa 97df0fb
Fix bugs and remodel the news collection
stefanp0pa 7bb625e
Improve querying mechanism for news and implement relevance filter
stefanp0pa ef9ae12
Filter news items by source category
stefanp0pa b0aa5ff
Refactor preview functionality
stefanp0pa c44c0e3
Refactor the news feed page and add more scrapers
stefanp0pa 6174509
More design fixes, added delete functionality for personal posts
stefanp0pa b3a18c9
Add a decent summarise function for posts on the main news feed page
stefanp0pa ff60c00
Convert scrapers to scheduled functions
stefanp0pa 2c3ada2
Moving notifications on the main settings page
stefanp0pa 21d8b40
Update schedule period to once per day for web scrapers
stefanp0pa 821480d
Fix settings page
stefanp0pa cd78052
Fix more bugs and improve UX
stefanp0pa 57ab384
Fix emailing
stefanp0pa c3152b2
Show no items message on the admin panel screens
stefanp0pa 774a370
Apply improvement suggestions
stefanp0pa 729cff4
Latest changes before bachelor submission
stefanp0pa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Create top tab view for each news feed category and create correspond…
…ing widgets
commit c8fbbee2aa062fa2deb76c0ca68ade5ccb025275
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:intl/intl.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
import '../../../generated/l10n.dart'; | ||
import '../../../widgets/error_page.dart'; | ||
import '../../../widgets/scaffold.dart'; | ||
import '../model/news_feed_item.dart'; | ||
import '../service/news_provider.dart'; | ||
import 'news_item_details_page.dart'; | ||
|
||
class NewsFeedFavoritePage extends StatefulWidget { | ||
const NewsFeedFavoritePage({final Key key}) : super(key: key); | ||
|
||
@override | ||
_NewsFeedFavoritePageState createState() => _NewsFeedFavoritePageState(); | ||
} | ||
|
||
class _NewsFeedFavoritePageState extends State<NewsFeedFavoritePage> { | ||
String _formatDate(final String date) { | ||
final DateTime dateTime = DateTime.parse(date); | ||
return DateFormat('yyyy-MM-dd').format(dateTime); | ||
} | ||
|
||
@override | ||
Widget build(final BuildContext context) { | ||
final newsFeedProvider = Provider.of<NewsProvider>(context); | ||
|
||
return FutureBuilder( | ||
future: newsFeedProvider.fetchFavoriteNewsFeedItems(), | ||
builder: (final _, final snapshot) { | ||
if (snapshot.connectionState != ConnectionState.done) { | ||
return const Center(child: CircularProgressIndicator()); | ||
} | ||
|
||
final List<NewsFeedItem> newsFeedItems = snapshot.data; | ||
if (newsFeedItems == null) { | ||
return ErrorPage( | ||
errorMessage: S.current.warningUnableToReachNewsFeed, | ||
info: [TextSpan(text: S.current.warningInternetConnection)], | ||
actionText: S.current.actionRefresh, | ||
actionOnTap: () => setState(() {}), | ||
); | ||
} else if (newsFeedItems.isEmpty) { | ||
return ErrorPage( | ||
imgPath: 'assets/illustrations/undraw_empty.png', | ||
errorMessage: S.current.warningNoNews, | ||
); | ||
} | ||
|
||
return ListView( | ||
children: ListTile.divideTiles( | ||
context: context, | ||
tiles: newsFeedItems | ||
.map( | ||
(final item) => ListTile( | ||
title: Text(item.title), | ||
subtitle: Text(_formatDate(item.createdAt)), | ||
trailing: const Icon(Icons.arrow_forward_ios_outlined), | ||
onTap: () => Navigator.push( | ||
context, | ||
MaterialPageRoute<Map<dynamic, dynamic>>( | ||
builder: (final context) => | ||
NewsItemDetailsPage(newsItemGuid: item.itemGuid), | ||
), | ||
), | ||
dense: true, | ||
), | ||
) | ||
.toList(), | ||
).toList()); | ||
}, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:intl/intl.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
import '../../../generated/l10n.dart'; | ||
import '../../../widgets/error_page.dart'; | ||
import '../../../widgets/scaffold.dart'; | ||
import '../model/news_feed_item.dart'; | ||
import '../service/news_provider.dart'; | ||
import 'news_item_details_page.dart'; | ||
|
||
class NewsFeedPersonalPage extends StatefulWidget { | ||
const NewsFeedPersonalPage({final Key key}) : super(key: key); | ||
|
||
@override | ||
_NewsFeedPersonalPageState createState() => _NewsFeedPersonalPageState(); | ||
} | ||
|
||
class _NewsFeedPersonalPageState extends State<NewsFeedPersonalPage> { | ||
String _formatDate(final String date) { | ||
final DateTime dateTime = DateTime.parse(date); | ||
return DateFormat('yyyy-MM-dd').format(dateTime); | ||
} | ||
|
||
@override | ||
Widget build(final BuildContext context) { | ||
final newsFeedProvider = Provider.of<NewsProvider>(context); | ||
|
||
return FutureBuilder( | ||
future: newsFeedProvider.fetchPersonalNewsFeedItem(), | ||
builder: (final _, final snapshot) { | ||
if (snapshot.connectionState != ConnectionState.done) { | ||
return const Center(child: CircularProgressIndicator()); | ||
} | ||
|
||
final List<NewsFeedItem> newsFeedItems = snapshot.data; | ||
if (newsFeedItems == null) { | ||
return ErrorPage( | ||
errorMessage: S.current.warningUnableToReachNewsFeed, | ||
info: [TextSpan(text: S.current.warningInternetConnection)], | ||
actionText: S.current.actionRefresh, | ||
actionOnTap: () => setState(() {}), | ||
); | ||
} else if (newsFeedItems.isEmpty) { | ||
return ErrorPage( | ||
imgPath: 'assets/illustrations/undraw_empty.png', | ||
errorMessage: S.current.warningNoNews, | ||
); | ||
} | ||
|
||
return ListView( | ||
children: ListTile.divideTiles( | ||
context: context, | ||
tiles: newsFeedItems | ||
.map( | ||
(final item) => ListTile( | ||
title: Text(item.title), | ||
subtitle: Text(_formatDate(item.createdAt)), | ||
trailing: const Icon(Icons.arrow_forward_ios_outlined), | ||
onTap: () => Navigator.push( | ||
context, | ||
MaterialPageRoute<Map<dynamic, dynamic>>( | ||
builder: (final context) => | ||
NewsItemDetailsPage(newsItemGuid: item.itemGuid), | ||
), | ||
), | ||
dense: true, | ||
), | ||
) | ||
.toList(), | ||
).toList()); | ||
}, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
import '../../../authentication/service/auth_provider.dart'; | ||
import '../../../generated/l10n.dart'; | ||
import '../../../widgets/scaffold.dart'; | ||
import '../../settings/view/source_page.dart'; | ||
import 'news_feed_favorite_page.dart'; | ||
import 'news_feed_page.dart'; | ||
import 'news_feed_personal_page.dart'; | ||
|
||
class NewsNavigationBar extends StatefulWidget { | ||
const NewsNavigationBar({this.tabIndex = 0}); | ||
|
||
static const String routeName = '/news_feed'; | ||
final int tabIndex; | ||
|
||
@override | ||
_NewsNavigationBarState createState() => _NewsNavigationBarState(); | ||
} | ||
|
||
class _NewsNavigationBarState extends State<NewsNavigationBar> | ||
with TickerProviderStateMixin { | ||
int currentTab = 0; | ||
List<Widget> tabs; | ||
TabController tabController; | ||
final PageStorageBucket bucket = PageStorageBucket(); | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
tabController = TabController(vsync: this, length: 3); | ||
tabController.addListener(() { | ||
if (!tabController.indexIsChanging) { | ||
setState(() { | ||
currentTab = tabController.index; | ||
}); | ||
} | ||
}); | ||
tabs = [ | ||
const NewsFeedPage(key: PageStorageKey('NewsFeed')), | ||
const NewsFeedFavoritePage(key: PageStorageKey('NeqSnawsFeedFavorite')), | ||
const NewsFeedPersonalPage(key: PageStorageKey('NewsFeedPersonal')), | ||
]; | ||
|
||
// Show "Select sources" page if user has no preference set | ||
final authProvider = Provider.of<AuthProvider>(context, listen: false); | ||
if (!authProvider.isAnonymous) { | ||
authProvider.currentUser.then((final user) { | ||
if (user?.sources?.isEmpty ?? true) { | ||
Navigator.of(context).push(MaterialPageRoute<SourcePage>( | ||
builder: (final context) => SourcePage())); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
@override | ||
void dispose() { | ||
tabController.dispose(); | ||
super.dispose(); | ||
} | ||
|
||
@override | ||
Widget build(final BuildContext context) { | ||
return DefaultTabController( | ||
length: tabs.length, | ||
initialIndex: widget.tabIndex, | ||
child: AppScaffold( | ||
title: const Text('News feed'), | ||
body: PageStorage( | ||
child: TabBarView(controller: tabController, children: tabs), | ||
bucket: bucket, | ||
), | ||
appBarBottom: newsNavigationBar(context), | ||
), | ||
); | ||
} | ||
|
||
Widget newsNavigationBar(final BuildContext context) => TabBar( | ||
controller: tabController, | ||
tabs: [ | ||
const Tab(text: 'News'), | ||
const Tab(text: 'Favorites'), | ||
const Tab(text: 'Personal'), | ||
], | ||
labelColor: Colors.white, | ||
unselectedLabelColor: Theme.of(context).unselectedWidgetColor, | ||
indicatorColor: Colors.white, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.