Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Jul 1, 2024
2 parents 6f01996 + 7194f75 commit ed607eb
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/data/models/product_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ abstract class ProductEntity extends Object
actions.add(EntityAction.newInvoice);
}

if (userCompany!.canCreate(EntityType.quote) && !isDeleted!) {
if (userCompany.canCreate(EntityType.quote) && !isDeleted!) {
actions.add(EntityAction.newQuote);
}

Expand Down
2 changes: 2 additions & 0 deletions lib/redux/app/app_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ class DismissTwoYearReviewAppPermanently implements PersistUI, PersistPrefs {}

class DismissTaskExtensionBanner implements PersistUI, PersistPrefs {}

class DismissFlutterWebWarning implements PersistUI {}

class ViewMainScreen {
ViewMainScreen({this.addDelay = false});

Expand Down
8 changes: 8 additions & 0 deletions lib/redux/ui/ui_reducer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ UIState uiReducer(UIState state, dynamic action) {
..filter = filterReducer(state.filter, action)
..filterClearedAt = filterClearedAtReducer(state.filterClearedAt, action)
..lastActivityAt = lastActivityReducer(state.lastActivityAt, action)
..dismissedFlutterWebWarning = dismissedFlutterWebWarningReducer(
state.dismissedFlutterWebWarning, action)
..selectedCompanyIndex =
selectedCompanyIndexReducer(state.selectedCompanyIndex, action)
..previousRoute = state.currentRoute == currentRoute
Expand Down Expand Up @@ -192,6 +194,12 @@ Reducer<int> lastActivityReducer = combineReducers([
}),
]);

Reducer<bool> dismissedFlutterWebWarningReducer = combineReducers([
TypedReducer<bool, DismissFlutterWebWarning>((state, action) {
return true;
}),
]);

Reducer<String?> filterReducer = combineReducers([
TypedReducer<String?, FilterCompany>((filter, action) {
return action.filter;
Expand Down
4 changes: 4 additions & 0 deletions lib/redux/ui/ui_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ abstract class UIState implements Built<UIState, UIStateBuilder> {
lastActivityAt: 0,
currentRoute: currentRoute ?? LoginScreen.route,
previousRoute: '',
dismissedFlutterWebWarning: false,
previewStack: BuiltList<EntityType>(),
filterStack: BuiltList<BaseEntity>(),
dashboardUIState: DashboardUIState(),
Expand Down Expand Up @@ -126,6 +127,8 @@ abstract class UIState implements Built<UIState, UIStateBuilder> {

String get previousRoute;

bool get dismissedFlutterWebWarning;

EntityType? get loadingEntityType;

BuiltList<EntityType> get previewStack;
Expand Down Expand Up @@ -295,6 +298,7 @@ abstract class UIState implements Built<UIState, UIStateBuilder> {
// ignore: unused_element
static void _initializeBuilder(UIStateBuilder builder) => builder
..lastActivityAt = 0
..dismissedFlutterWebWarning = false
..filterStack.replace(BuiltList<BaseEntity>());

static Serializer<UIState> get serializer => _$uIStateSerializer;
Expand Down
25 changes: 25 additions & 0 deletions lib/redux/ui/ui_state.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions lib/ui/app/dialogs/health_check_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class _HealthCheckDialogState extends State<HealthCheckDialog> {
Widget build(BuildContext context) {
final store = StoreProvider.of<AppState>(context);
final state = store.state;
final account = state.account;
final localization = AppLocalization.of(context);
final webPhpVersion =
_parseVersion(_response?.phpVersion.currentPHPVersion ?? '');
Expand Down Expand Up @@ -173,15 +174,16 @@ class _HealthCheckDialogState extends State<HealthCheckDialog> {
),
*/
if (_response!.filePermissions != 'Ok' &&
!state.account.disableAutoUpdate)
!account.disableAutoUpdate &&
!account.isDocker)
_HealthListTile(
title: 'Invalid File Permissions',
isValid: false,
subtitle: _response!.filePermissions,
url: '$kDocsUrl/self-host-installation/#file-permissions',
),
/*
if (!state.account.isDocker) ...[
if (!account.isDocker) ...[
if (!_response.openBasedir)
_HealthListTile(
title: 'Open Basedir',
Expand All @@ -197,7 +199,7 @@ class _HealthCheckDialogState extends State<HealthCheckDialog> {
),
],
*/
if (!state.account.isDocker &&
if (!account.isDocker &&
phpMemoryLimitDouble! > 100 &&
phpMemoryLimitDouble < 1024)
_HealthListTile(
Expand Down
4 changes: 4 additions & 0 deletions lib/ui/app/important_message_banner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class _ImportantMessageBannerState extends State<ImportantMessageBanner> {

if (kIsWeb &&
!_dismissedMessage.containsKey(MESSAGE_TYPE_FLUTTER_WEB) &&
!state.uiState.dismissedFlutterWebWarning &&
!state.isDemo) {
message = localization.flutterWebWarning;
messageType = MESSAGE_TYPE_FLUTTER_WEB;
Expand Down Expand Up @@ -180,6 +181,9 @@ class _ImportantMessageBannerState extends State<ImportantMessageBanner> {
color: Colors.white,
onPressed: () {
setState(() => _dismissedMessage[messageType!] = true);
if (messageType == MESSAGE_TYPE_FLUTTER_WEB) {
store.dispatch(DismissFlutterWebWarning());
}
},
),
],
Expand Down

0 comments on commit ed607eb

Please sign in to comment.