-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor sync the auth feature with the backend and client update #23
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
Merged
fulleni
merged 6 commits into
main
from
refactor_sync_the_auth_feature_with_the_backend_and_client_update
Jul 5, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2971183
feat(authentication): pass isDashboardLogin flag in auth bloc
fulleni 71876ca
chore(pubspec): update resolved references for dependencies
fulleni 32c33b8
feat(authentication): add specific error handling for dashboard login
fulleni 80c1ed5
refactor(app): update AppBloc to handle user roles list
fulleni 7fd9f18
refactor(app): update AppBloc to handle user roles list
fulleni 91ca0b3
refactor(app): update AppBloc to handle user roles list
fulleni 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
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -283,7 +283,7 @@ class _AppConfigurationPageState extends State<AppConfigurationPage> { | |
), | ||
children: [ | ||
_UserPreferenceLimitsForm( | ||
userRole: UserRole.guestUser, | ||
userRole: UserRoles.guestUser, | ||
appConfig: appConfig, | ||
onConfigChanged: (newConfig) { | ||
context.read<AppConfigurationBloc>().add( | ||
|
@@ -303,7 +303,7 @@ class _AppConfigurationPageState extends State<AppConfigurationPage> { | |
), | ||
children: [ | ||
_UserPreferenceLimitsForm( | ||
userRole: UserRole.standardUser, | ||
userRole: UserRoles.standardUser, | ||
appConfig: appConfig, | ||
onConfigChanged: (newConfig) { | ||
context.read<AppConfigurationBloc>().add( | ||
|
@@ -323,7 +323,7 @@ class _AppConfigurationPageState extends State<AppConfigurationPage> { | |
), | ||
children: [ | ||
_UserPreferenceLimitsForm( | ||
userRole: UserRole.premiumUser, | ||
userRole: UserRoles.premiumUser, | ||
appConfig: appConfig, | ||
onConfigChanged: (newConfig) { | ||
context.read<AppConfigurationBloc>().add( | ||
|
@@ -359,7 +359,7 @@ class _AppConfigurationPageState extends State<AppConfigurationPage> { | |
), | ||
children: [ | ||
_AdConfigForm( | ||
userRole: UserRole.guestUser, | ||
userRole: UserRoles.guestUser, | ||
appConfig: appConfig, | ||
onConfigChanged: (newConfig) { | ||
context.read<AppConfigurationBloc>().add( | ||
|
@@ -379,7 +379,7 @@ class _AppConfigurationPageState extends State<AppConfigurationPage> { | |
), | ||
children: [ | ||
_AdConfigForm( | ||
userRole: UserRole.standardUser, | ||
userRole: UserRoles.standardUser, | ||
appConfig: appConfig, | ||
onConfigChanged: (newConfig) { | ||
context.read<AppConfigurationBloc>().add( | ||
|
@@ -399,7 +399,7 @@ class _AppConfigurationPageState extends State<AppConfigurationPage> { | |
), | ||
children: [ | ||
_AdConfigForm( | ||
userRole: UserRole.premiumUser, | ||
userRole: UserRoles.premiumUser, | ||
appConfig: appConfig, | ||
onConfigChanged: (newConfig) { | ||
context.read<AppConfigurationBloc>().add( | ||
|
@@ -438,7 +438,7 @@ class _AppConfigurationPageState extends State<AppConfigurationPage> { | |
), | ||
children: [ | ||
_AccountActionConfigForm( | ||
userRole: UserRole.guestUser, | ||
userRole: UserRoles.guestUser, | ||
appConfig: appConfig, | ||
onConfigChanged: (newConfig) { | ||
context.read<AppConfigurationBloc>().add( | ||
|
@@ -458,7 +458,7 @@ class _AppConfigurationPageState extends State<AppConfigurationPage> { | |
), | ||
children: [ | ||
_AccountActionConfigForm( | ||
userRole: UserRole.standardUser, | ||
userRole: UserRoles.standardUser, | ||
appConfig: appConfig, | ||
onConfigChanged: (newConfig) { | ||
context.read<AppConfigurationBloc>().add( | ||
|
@@ -779,7 +779,7 @@ class _UserPreferenceLimitsForm extends StatefulWidget { | |
required this.buildIntField, | ||
}); | ||
|
||
final UserRole userRole; | ||
final String userRole; | ||
final AppConfig appConfig; | ||
final ValueChanged<AppConfig> onConfigChanged; | ||
final Widget Function( | ||
|
@@ -936,7 +936,7 @@ class _UserPreferenceLimitsFormState extends State<_UserPreferenceLimitsForm> { | |
final userPreferenceLimits = widget.appConfig.userPreferenceLimits; | ||
|
||
switch (widget.userRole) { | ||
case UserRole.guestUser: | ||
case UserRoles.guestUser: | ||
return Column( | ||
children: [ | ||
widget.buildIntField( | ||
|
@@ -975,7 +975,7 @@ class _UserPreferenceLimitsFormState extends State<_UserPreferenceLimitsForm> { | |
), | ||
], | ||
); | ||
case UserRole.standardUser: | ||
case UserRoles.standardUser: | ||
return Column( | ||
children: [ | ||
widget.buildIntField( | ||
|
@@ -1015,7 +1015,7 @@ class _UserPreferenceLimitsFormState extends State<_UserPreferenceLimitsForm> { | |
), | ||
], | ||
); | ||
case UserRole.premiumUser: | ||
case UserRoles.premiumUser: | ||
return Column( | ||
children: [ | ||
widget.buildIntField( | ||
|
@@ -1055,10 +1055,12 @@ class _UserPreferenceLimitsFormState extends State<_UserPreferenceLimitsForm> { | |
), | ||
], | ||
); | ||
case UserRole.admin: | ||
case UserRoles.admin: | ||
// Admin role might not have specific limits here, or could be | ||
// a separate configuration. For now, return empty. | ||
return const SizedBox.shrink(); | ||
default: | ||
return const SizedBox.shrink(); | ||
Comment on lines
+1062
to
+1063
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
} | ||
} | ||
|
@@ -1071,7 +1073,7 @@ class _AdConfigForm extends StatefulWidget { | |
required this.buildIntField, | ||
}); | ||
|
||
final UserRole userRole; | ||
final String userRole; | ||
final AppConfig appConfig; | ||
final ValueChanged<AppConfig> onConfigChanged; | ||
final Widget Function( | ||
|
@@ -1271,7 +1273,7 @@ class _AdConfigFormState extends State<_AdConfigForm> { | |
final adConfig = widget.appConfig.adConfig; | ||
|
||
switch (widget.userRole) { | ||
case UserRole.guestUser: | ||
case UserRoles.guestUser: | ||
return Column( | ||
children: [ | ||
widget.buildIntField( | ||
|
@@ -1329,7 +1331,7 @@ class _AdConfigFormState extends State<_AdConfigForm> { | |
), | ||
], | ||
); | ||
case UserRole.standardUser: | ||
case UserRoles.standardUser: | ||
return Column( | ||
children: [ | ||
widget.buildIntField( | ||
|
@@ -1391,7 +1393,7 @@ class _AdConfigFormState extends State<_AdConfigForm> { | |
), | ||
], | ||
); | ||
case UserRole.premiumUser: | ||
case UserRoles.premiumUser: | ||
return Column( | ||
children: [ | ||
widget.buildIntField( | ||
|
@@ -1450,7 +1452,9 @@ class _AdConfigFormState extends State<_AdConfigForm> { | |
), | ||
], | ||
); | ||
case UserRole.admin: | ||
case UserRoles.admin: | ||
return const SizedBox.shrink(); | ||
default: | ||
return const SizedBox.shrink(); | ||
Comment on lines
+1457
to
1458
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
} | ||
|
@@ -1464,7 +1468,7 @@ class _AccountActionConfigForm extends StatefulWidget { | |
required this.buildIntField, | ||
}); | ||
|
||
final UserRole userRole; | ||
final String userRole; | ||
final AppConfig appConfig; | ||
final ValueChanged<AppConfig> onConfigChanged; | ||
final Widget Function( | ||
|
@@ -1553,7 +1557,7 @@ class _AccountActionConfigFormState extends State<_AccountActionConfigForm> { | |
final accountActionConfig = widget.appConfig.accountActionConfig; | ||
|
||
switch (widget.userRole) { | ||
case UserRole.guestUser: | ||
case UserRoles.guestUser: | ||
return Column( | ||
children: [ | ||
widget.buildIntField( | ||
|
@@ -1576,7 +1580,7 @@ class _AccountActionConfigFormState extends State<_AccountActionConfigForm> { | |
), | ||
], | ||
); | ||
case UserRole.standardUser: | ||
case UserRoles.standardUser: | ||
return Column( | ||
children: [ | ||
widget.buildIntField( | ||
|
@@ -1599,8 +1603,10 @@ class _AccountActionConfigFormState extends State<_AccountActionConfigForm> { | |
), | ||
], | ||
); | ||
case UserRole.premiumUser: | ||
case UserRole.admin: | ||
case UserRoles.premiumUser: | ||
case UserRoles.admin: | ||
return const SizedBox.shrink(); | ||
default: | ||
return const SizedBox.shrink(); | ||
Comment on lines
+1609
to
1610
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
} | ||
|
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
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.
Consider using a dedicated logging package instead of
print()
for more robust error handling. A logging package allows for log levels, structured formatting, and routing logs to different destinations, which is beneficial for debugging and monitoring in production environments.