Dashboard bug fixes
This commit is contained in:
parent
06218d6fab
commit
3c8d738d28
|
|
@ -29,8 +29,8 @@ android {
|
||||||
applicationId "com.invoiceninja.flutter"
|
applicationId "com.invoiceninja.flutter"
|
||||||
minSdkVersion 18
|
minSdkVersion 18
|
||||||
targetSdkVersion 27
|
targetSdkVersion 27
|
||||||
versionCode 34
|
versionCode 35
|
||||||
versionName "0.1.34"
|
versionName "0.1.35"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.1.34</string>
|
<string>0.1.35</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>34</string>
|
<string>35</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,5 @@ class Config {
|
||||||
static const String LOGIN_SECRET = 'secret';
|
static const String LOGIN_SECRET = 'secret';
|
||||||
static const String API_SECRET = 'secret';
|
static const String API_SECRET = 'secret';
|
||||||
static const String SENTRY_DNS = '';
|
static const String SENTRY_DNS = '';
|
||||||
|
static const String PLATFORM = '';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
// This version must be updated in tandem with the pubspec version.
|
// This version must be updated in tandem with the pubspec version.
|
||||||
const String kAppVersion = '0.1.34';
|
const String kAppVersion = '0.1.35';
|
||||||
const String kAppUrl = 'https://app.invoiceninja.com';
|
const String kAppUrl = 'https://app.invoiceninja.com';
|
||||||
|
|
||||||
const String kAppleStoreUrl =
|
const String kAppleStoreUrl =
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ void main() async {
|
||||||
dsn: Config.SENTRY_DNS,
|
dsn: Config.SENTRY_DNS,
|
||||||
environmentAttributes: Event(
|
environmentAttributes: Event(
|
||||||
release: kAppVersion,
|
release: kAppVersion,
|
||||||
|
environment: Config.PLATFORM,
|
||||||
));
|
));
|
||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
final enableDarkMode = prefs.getBool(kSharedPrefEnableDarkMode) ?? false;
|
final enableDarkMode = prefs.getBool(kSharedPrefEnableDarkMode) ?? false;
|
||||||
|
|
|
||||||
|
|
@ -286,11 +286,11 @@ Middleware<AppState> _createDataLoaded() {
|
||||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
prefs.setString(getKeychainTokenKey(i), company.token);
|
prefs.setString(getKeychainTokenKey(i), company.token);
|
||||||
|
|
||||||
store.dispatch(SelectCompany(i + 1));
|
store.dispatch(SelectCompany(i + 1, company));
|
||||||
store.dispatch(LoadCompanySuccess(company));
|
store.dispatch(LoadCompanySuccess(company));
|
||||||
}
|
}
|
||||||
|
|
||||||
store.dispatch(SelectCompany(1));
|
store.dispatch(SelectCompany(1, data.accounts[0]));
|
||||||
store.dispatch(UserLoginSuccess());
|
store.dispatch(UserLoginSuccess());
|
||||||
|
|
||||||
action.completer.complete(null);
|
action.completer.complete(null);
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,7 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
|
||||||
String toString() {
|
String toString() {
|
||||||
//return 'Is Loading: ${this.isLoading}, Invoice: ${this.invoiceUIState.selected}';
|
//return 'Is Loading: ${this.isLoading}, Invoice: ${this.invoiceUIState.selected}';
|
||||||
//return 'Date Formats: ${staticState.dateFormatMap}';
|
//return 'Date Formats: ${staticState.dateFormatMap}';
|
||||||
return 'Route: ${uiState.currentRoute}';
|
return 'Company Currency Id: ${selectedCompany.currencyId}, Dashboard Currency Id: ${uiState.dashboardUIState.currencyId}';
|
||||||
|
//return 'Route: ${uiState.currentRoute}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
|
|
||||||
class SelectCompany {
|
class SelectCompany {
|
||||||
SelectCompany(this.companyIndex);
|
SelectCompany(this.companyIndex, this.company);
|
||||||
|
|
||||||
final int companyIndex;
|
final int companyIndex;
|
||||||
|
final CompanyEntity company;
|
||||||
}
|
}
|
||||||
|
|
||||||
class LoadCompanySuccess {
|
class LoadCompanySuccess {
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,9 @@ CompanyState companyReducer(CompanyState state, dynamic action) {
|
||||||
..productState.replace(productsReducer(state.productState, action))
|
..productState.replace(productsReducer(state.productState, action))
|
||||||
..invoiceState.replace(invoicesReducer(state.invoiceState, action))
|
..invoiceState.replace(invoicesReducer(state.invoiceState, action))
|
||||||
// STARTER: reducer - do not remove comment
|
// STARTER: reducer - do not remove comment
|
||||||
..taskState.replace(tasksReducer(state.taskState, action))
|
..taskState.replace(tasksReducer(state.taskState, action))
|
||||||
|
..projectState.replace(projectsReducer(state.projectState, action))
|
||||||
..projectState.replace(projectsReducer(state.projectState, action))
|
..paymentState.replace(paymentsReducer(state.paymentState, action))
|
||||||
|
|
||||||
..paymentState.replace(paymentsReducer(state.paymentState, action))
|
|
||||||
|
|
||||||
..quoteState.replace(quotesReducer(state.quoteState, action)));
|
..quoteState.replace(quotesReducer(state.quoteState, action)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:invoiceninja_flutter/redux/company/company_actions.dart';
|
||||||
import 'package:redux/redux.dart';
|
import 'package:redux/redux.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/dashboard/dashboard_actions.dart';
|
import 'package:invoiceninja_flutter/redux/dashboard/dashboard_actions.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/dashboard/dashboard_state.dart';
|
import 'package:invoiceninja_flutter/redux/dashboard/dashboard_state.dart';
|
||||||
|
|
@ -31,6 +32,8 @@ DashboardUIState dashboardUIReducer(DashboardUIState state, dynamic action) {
|
||||||
} else if (action.currencyId != null) {
|
} else if (action.currencyId != null) {
|
||||||
return state.rebuild((b) => b..currencyId = action.currencyId);
|
return state.rebuild((b) => b..currencyId = action.currencyId);
|
||||||
}
|
}
|
||||||
|
} else if (action is SelectCompany) {
|
||||||
|
return state.rebuild((b) => b..currencyId = action.company.currencyId);
|
||||||
}
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ abstract class DashboardState
|
||||||
|
|
||||||
abstract class DashboardUIState
|
abstract class DashboardUIState
|
||||||
implements Built<DashboardUIState, DashboardUIStateBuilder> {
|
implements Built<DashboardUIState, DashboardUIStateBuilder> {
|
||||||
factory DashboardUIState(CompanyEntity company) {
|
factory DashboardUIState() {
|
||||||
return _$DashboardUIState._(
|
return _$DashboardUIState._(
|
||||||
dateRange: DateRange.last30Days,
|
dateRange: DateRange.last30Days,
|
||||||
customStartDate: '',
|
customStartDate: '',
|
||||||
|
|
@ -53,7 +53,7 @@ abstract class DashboardUIState
|
||||||
compareCustomStartDate: '',
|
compareCustomStartDate: '',
|
||||||
compareCustomEndDate: convertDateTimeToSqlDate(),
|
compareCustomEndDate: convertDateTimeToSqlDate(),
|
||||||
offset: 0,
|
offset: 0,
|
||||||
currencyId: company.currencyId,
|
currencyId: 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import 'package:built_value/built_value.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
import 'package:built_collection/built_collection.dart';
|
import 'package:built_collection/built_collection.dart';
|
||||||
import 'package:invoiceninja_flutter/constants.dart';
|
import 'package:invoiceninja_flutter/constants.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/company_model.dart';
|
|
||||||
import 'package:invoiceninja_flutter/data/models/payment_model.dart';
|
import 'package:invoiceninja_flutter/data/models/payment_model.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/ui/entity_ui_state.dart';
|
import 'package:invoiceninja_flutter/redux/ui/entity_ui_state.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/ui/list_ui_state.dart';
|
import 'package:invoiceninja_flutter/redux/ui/list_ui_state.dart';
|
||||||
|
|
@ -45,10 +44,10 @@ abstract class PaymentState
|
||||||
abstract class PaymentUIState extends Object
|
abstract class PaymentUIState extends Object
|
||||||
with EntityUIState
|
with EntityUIState
|
||||||
implements Built<PaymentUIState, PaymentUIStateBuilder> {
|
implements Built<PaymentUIState, PaymentUIStateBuilder> {
|
||||||
factory PaymentUIState(CompanyEntity company) {
|
factory PaymentUIState() {
|
||||||
return _$PaymentUIState._(
|
return _$PaymentUIState._(
|
||||||
listUIState: ListUIState(PaymentFields.paymentDate, sortAscending: false),
|
listUIState: ListUIState(PaymentFields.paymentDate, sortAscending: false),
|
||||||
editing: PaymentEntity(company: company),
|
editing: PaymentEntity(),
|
||||||
selectedId: 0,
|
selectedId: 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,14 +28,14 @@ abstract class UIState implements Built<UIState, UIStateBuilder> {
|
||||||
requireAuthentication: requireAuthentication ?? false,
|
requireAuthentication: requireAuthentication ?? false,
|
||||||
emailPayment: false,
|
emailPayment: false,
|
||||||
autoStartTasks: false,
|
autoStartTasks: false,
|
||||||
dashboardUIState: DashboardUIState(company),
|
dashboardUIState: DashboardUIState(),
|
||||||
productUIState: ProductUIState(),
|
productUIState: ProductUIState(),
|
||||||
clientUIState: ClientUIState(),
|
clientUIState: ClientUIState(),
|
||||||
invoiceUIState: InvoiceUIState(),
|
invoiceUIState: InvoiceUIState(),
|
||||||
// STARTER: constructor - do not remove comment
|
// STARTER: constructor - do not remove comment
|
||||||
taskUIState: TaskUIState(),
|
taskUIState: TaskUIState(),
|
||||||
projectUIState: ProjectUIState(),
|
projectUIState: ProjectUIState(),
|
||||||
paymentUIState: PaymentUIState(company),
|
paymentUIState: PaymentUIState(),
|
||||||
quoteUIState: QuoteUIState(),
|
quoteUIState: QuoteUIState(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,8 @@ class AppDrawer extends StatelessWidget {
|
||||||
))
|
))
|
||||||
.toList(),
|
.toList(),
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
viewModel.onCompanyChanged(context, value);
|
viewModel.onCompanyChanged(
|
||||||
|
context, value, viewModel.companies[int.parse(value) - 1]);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class AppDrawerVM {
|
||||||
final CompanyEntity selectedCompany;
|
final CompanyEntity selectedCompany;
|
||||||
final UserEntity user;
|
final UserEntity user;
|
||||||
final String selectedCompanyIndex;
|
final String selectedCompanyIndex;
|
||||||
final Function(BuildContext context, String) onCompanyChanged;
|
final Function(BuildContext context, String, CompanyEntity) onCompanyChanged;
|
||||||
final bool isLoading;
|
final bool isLoading;
|
||||||
|
|
||||||
static AppDrawerVM fromStore(Store<AppState> store) {
|
static AppDrawerVM fromStore(Store<AppState> store) {
|
||||||
|
|
@ -49,8 +49,8 @@ class AppDrawerVM {
|
||||||
user: state.user,
|
user: state.user,
|
||||||
selectedCompany: state.selectedCompany,
|
selectedCompany: state.selectedCompany,
|
||||||
selectedCompanyIndex: state.uiState.selectedCompanyIndex.toString(),
|
selectedCompanyIndex: state.uiState.selectedCompanyIndex.toString(),
|
||||||
onCompanyChanged: (BuildContext context, String companyIndex) {
|
onCompanyChanged: (BuildContext context, String companyIndex, CompanyEntity company) {
|
||||||
store.dispatch(SelectCompany(int.parse(companyIndex)));
|
store.dispatch(SelectCompany(int.parse(companyIndex), company));
|
||||||
AppBuilder.of(context).rebuild();
|
AppBuilder.of(context).rebuild();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
name: invoiceninja_flutter
|
name: invoiceninja_flutter
|
||||||
description: Mobile app for Invoice Ninja
|
description: Mobile app for Invoice Ninja
|
||||||
version: 0.1.34
|
version: 0.1.35
|
||||||
author: Hillel Coren
|
author: Hillel Coren
|
||||||
homepage: https://www.invoiceninja.com
|
homepage: https://www.invoiceninja.com
|
||||||
documentation: http://docs.invoiceninja.com
|
documentation: http://docs.invoiceninja.com
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue