This commit is contained in:
Hillel Coren 2019-11-20 21:53:33 +02:00
parent 1b9f66d162
commit 701a93fc1d
22 changed files with 169 additions and 110 deletions

View File

@ -93,7 +93,7 @@ class AuthRepository {
{String url, dynamic data, String token, String secret}) async {
final includes = [
'account',
'user',
'user.company_user',
'token',
'company.users.company_user',
'company.tax_rates',

View File

@ -382,7 +382,7 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
@override
String toString() {
//return 'Custom fields [UI]: ${uiState.settingsUIState.userCompany.company.customFields}, [DB] ${selectedCompany.customFields}';
//return 'Custom fields [UI]: ${uiState.settingsUIState.company.customFields}, [DB] ${selectedCompany.customFields}';
//return 'Permissions: ${uiState.userUIState.editing.userCompany.permissions}';
//return 'Layout: ${uiState.layout}, menu: ${uiState.menuSidebarMode}, history: ${uiState.historySidebarMode}';
//return 'Sidebars - isMenuVisible: ${uiState.isMenuVisible}, isHistoryVisible: ${uiState.isHistoryVisible}';

View File

@ -107,23 +107,27 @@ abstract class UserCompanyState
abstract class SettingsUIState extends Object
implements Built<SettingsUIState, SettingsUIStateBuilder> {
factory SettingsUIState(
{UserCompanyEntity userCompany,
{CompanyEntity company,
ClientEntity client,
GroupEntity group,
UserCompanyEntity origUserCompany,
UserEntity user,
CompanyEntity origCompany,
ClientEntity origClient,
GroupEntity origGroup,
UserEntity origUser,
String section}) {
return _$SettingsUIState._(
userCompany: userCompany ?? UserCompanyEntity(),
company: company ?? CompanyEntity(),
client: client ?? ClientEntity(),
group: group ?? GroupEntity(),
user: user ?? UserEntity(),
entityType: client != null
? EntityType.client
: group != null ? EntityType.group : EntityType.company,
origClient: origClient ?? ClientEntity(),
origGroup: origGroup ?? GroupEntity(),
origUserCompany: origUserCompany ?? UserCompanyEntity(),
origCompany: origCompany ?? CompanyEntity(),
origUser: origUser ?? UserEntity(),
isChanged: false,
updatedAt: 0,
filterClearedAt: 0,
@ -133,9 +137,9 @@ abstract class SettingsUIState extends Object
SettingsUIState._();
UserCompanyEntity get userCompany;
CompanyEntity get company;
UserCompanyEntity get origUserCompany;
CompanyEntity get origCompany;
ClientEntity get client;
@ -145,6 +149,10 @@ abstract class SettingsUIState extends Object
GroupEntity get origGroup;
UserEntity get user;
UserEntity get origUser;
EntityType get entityType;
bool get isChanged;
@ -162,12 +170,11 @@ abstract class SettingsUIState extends Object
SettingsEntity get settings {
if (entityType == EntityType.client && client != null) {
return userCompany
.company.settings; // TODO fix this, change to client.settings
return company.settings; // TODO fix this, change to client.settings
} else if (entityType == EntityType.group && group != null) {
return group.settings;
} else {
return userCompany.company.settings;
return company.settings;
}
}

View File

@ -173,12 +173,12 @@ class _$SettingsUIStateSerializer
Iterable<Object> serialize(Serializers serializers, SettingsUIState object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object>[
'userCompany',
serializers.serialize(object.userCompany,
specifiedType: const FullType(UserCompanyEntity)),
'origUserCompany',
serializers.serialize(object.origUserCompany,
specifiedType: const FullType(UserCompanyEntity)),
'company',
serializers.serialize(object.company,
specifiedType: const FullType(CompanyEntity)),
'origCompany',
serializers.serialize(object.origCompany,
specifiedType: const FullType(CompanyEntity)),
'client',
serializers.serialize(object.client,
specifiedType: const FullType(ClientEntity)),
@ -191,6 +191,12 @@ class _$SettingsUIStateSerializer
'origGroup',
serializers.serialize(object.origGroup,
specifiedType: const FullType(GroupEntity)),
'user',
serializers.serialize(object.user,
specifiedType: const FullType(UserEntity)),
'origUser',
serializers.serialize(object.origUser,
specifiedType: const FullType(UserEntity)),
'entityType',
serializers.serialize(object.entityType,
specifiedType: const FullType(EntityType)),
@ -228,15 +234,13 @@ class _$SettingsUIStateSerializer
iterator.moveNext();
final dynamic value = iterator.current;
switch (key) {
case 'userCompany':
result.userCompany.replace(serializers.deserialize(value,
specifiedType: const FullType(UserCompanyEntity))
as UserCompanyEntity);
case 'company':
result.company.replace(serializers.deserialize(value,
specifiedType: const FullType(CompanyEntity)) as CompanyEntity);
break;
case 'origUserCompany':
result.origUserCompany.replace(serializers.deserialize(value,
specifiedType: const FullType(UserCompanyEntity))
as UserCompanyEntity);
case 'origCompany':
result.origCompany.replace(serializers.deserialize(value,
specifiedType: const FullType(CompanyEntity)) as CompanyEntity);
break;
case 'client':
result.client.replace(serializers.deserialize(value,
@ -254,6 +258,14 @@ class _$SettingsUIStateSerializer
result.origGroup.replace(serializers.deserialize(value,
specifiedType: const FullType(GroupEntity)) as GroupEntity);
break;
case 'user':
result.user.replace(serializers.deserialize(value,
specifiedType: const FullType(UserEntity)) as UserEntity);
break;
case 'origUser':
result.origUser.replace(serializers.deserialize(value,
specifiedType: const FullType(UserEntity)) as UserEntity);
break;
case 'entityType':
result.entityType = serializers.deserialize(value,
specifiedType: const FullType(EntityType)) as EntityType;
@ -688,9 +700,9 @@ class UserCompanyStateBuilder
class _$SettingsUIState extends SettingsUIState {
@override
final UserCompanyEntity userCompany;
final CompanyEntity company;
@override
final UserCompanyEntity origUserCompany;
final CompanyEntity origCompany;
@override
final ClientEntity client;
@override
@ -700,6 +712,10 @@ class _$SettingsUIState extends SettingsUIState {
@override
final GroupEntity origGroup;
@override
final UserEntity user;
@override
final UserEntity origUser;
@override
final EntityType entityType;
@override
final bool isChanged;
@ -716,12 +732,14 @@ class _$SettingsUIState extends SettingsUIState {
(new SettingsUIStateBuilder()..update(updates)).build();
_$SettingsUIState._(
{this.userCompany,
this.origUserCompany,
{this.company,
this.origCompany,
this.client,
this.origClient,
this.group,
this.origGroup,
this.user,
this.origUser,
this.entityType,
this.isChanged,
this.updatedAt,
@ -729,11 +747,11 @@ class _$SettingsUIState extends SettingsUIState {
this.filter,
this.filterClearedAt})
: super._() {
if (userCompany == null) {
throw new BuiltValueNullFieldError('SettingsUIState', 'userCompany');
if (company == null) {
throw new BuiltValueNullFieldError('SettingsUIState', 'company');
}
if (origUserCompany == null) {
throw new BuiltValueNullFieldError('SettingsUIState', 'origUserCompany');
if (origCompany == null) {
throw new BuiltValueNullFieldError('SettingsUIState', 'origCompany');
}
if (client == null) {
throw new BuiltValueNullFieldError('SettingsUIState', 'client');
@ -747,6 +765,12 @@ class _$SettingsUIState extends SettingsUIState {
if (origGroup == null) {
throw new BuiltValueNullFieldError('SettingsUIState', 'origGroup');
}
if (user == null) {
throw new BuiltValueNullFieldError('SettingsUIState', 'user');
}
if (origUser == null) {
throw new BuiltValueNullFieldError('SettingsUIState', 'origUser');
}
if (entityType == null) {
throw new BuiltValueNullFieldError('SettingsUIState', 'entityType');
}
@ -776,12 +800,14 @@ class _$SettingsUIState extends SettingsUIState {
bool operator ==(Object other) {
if (identical(other, this)) return true;
return other is SettingsUIState &&
userCompany == other.userCompany &&
origUserCompany == other.origUserCompany &&
company == other.company &&
origCompany == other.origCompany &&
client == other.client &&
origClient == other.origClient &&
group == other.group &&
origGroup == other.origGroup &&
user == other.user &&
origUser == other.origUser &&
entityType == other.entityType &&
isChanged == other.isChanged &&
updatedAt == other.updatedAt &&
@ -802,12 +828,18 @@ class _$SettingsUIState extends SettingsUIState {
$jc(
$jc(
$jc(
$jc($jc(0, userCompany.hashCode),
origUserCompany.hashCode),
client.hashCode),
origClient.hashCode),
group.hashCode),
origGroup.hashCode),
$jc(
$jc(
$jc(
$jc(0,
company.hashCode),
origCompany.hashCode),
client.hashCode),
origClient.hashCode),
group.hashCode),
origGroup.hashCode),
user.hashCode),
origUser.hashCode),
entityType.hashCode),
isChanged.hashCode),
updatedAt.hashCode),
@ -819,12 +851,14 @@ class _$SettingsUIState extends SettingsUIState {
@override
String toString() {
return (newBuiltValueToStringHelper('SettingsUIState')
..add('userCompany', userCompany)
..add('origUserCompany', origUserCompany)
..add('company', company)
..add('origCompany', origCompany)
..add('client', client)
..add('origClient', origClient)
..add('group', group)
..add('origGroup', origGroup)
..add('user', user)
..add('origUser', origUser)
..add('entityType', entityType)
..add('isChanged', isChanged)
..add('updatedAt', updatedAt)
@ -839,17 +873,16 @@ class SettingsUIStateBuilder
implements Builder<SettingsUIState, SettingsUIStateBuilder> {
_$SettingsUIState _$v;
UserCompanyEntityBuilder _userCompany;
UserCompanyEntityBuilder get userCompany =>
_$this._userCompany ??= new UserCompanyEntityBuilder();
set userCompany(UserCompanyEntityBuilder userCompany) =>
_$this._userCompany = userCompany;
CompanyEntityBuilder _company;
CompanyEntityBuilder get company =>
_$this._company ??= new CompanyEntityBuilder();
set company(CompanyEntityBuilder company) => _$this._company = company;
UserCompanyEntityBuilder _origUserCompany;
UserCompanyEntityBuilder get origUserCompany =>
_$this._origUserCompany ??= new UserCompanyEntityBuilder();
set origUserCompany(UserCompanyEntityBuilder origUserCompany) =>
_$this._origUserCompany = origUserCompany;
CompanyEntityBuilder _origCompany;
CompanyEntityBuilder get origCompany =>
_$this._origCompany ??= new CompanyEntityBuilder();
set origCompany(CompanyEntityBuilder origCompany) =>
_$this._origCompany = origCompany;
ClientEntityBuilder _client;
ClientEntityBuilder get client =>
@ -871,6 +904,15 @@ class SettingsUIStateBuilder
_$this._origGroup ??= new GroupEntityBuilder();
set origGroup(GroupEntityBuilder origGroup) => _$this._origGroup = origGroup;
UserEntityBuilder _user;
UserEntityBuilder get user => _$this._user ??= new UserEntityBuilder();
set user(UserEntityBuilder user) => _$this._user = user;
UserEntityBuilder _origUser;
UserEntityBuilder get origUser =>
_$this._origUser ??= new UserEntityBuilder();
set origUser(UserEntityBuilder origUser) => _$this._origUser = origUser;
EntityType _entityType;
EntityType get entityType => _$this._entityType;
set entityType(EntityType entityType) => _$this._entityType = entityType;
@ -900,12 +942,14 @@ class SettingsUIStateBuilder
SettingsUIStateBuilder get _$this {
if (_$v != null) {
_userCompany = _$v.userCompany?.toBuilder();
_origUserCompany = _$v.origUserCompany?.toBuilder();
_company = _$v.company?.toBuilder();
_origCompany = _$v.origCompany?.toBuilder();
_client = _$v.client?.toBuilder();
_origClient = _$v.origClient?.toBuilder();
_group = _$v.group?.toBuilder();
_origGroup = _$v.origGroup?.toBuilder();
_user = _$v.user?.toBuilder();
_origUser = _$v.origUser?.toBuilder();
_entityType = _$v.entityType;
_isChanged = _$v.isChanged;
_updatedAt = _$v.updatedAt;
@ -936,12 +980,14 @@ class SettingsUIStateBuilder
try {
_$result = _$v ??
new _$SettingsUIState._(
userCompany: userCompany.build(),
origUserCompany: origUserCompany.build(),
company: company.build(),
origCompany: origCompany.build(),
client: client.build(),
origClient: origClient.build(),
group: group.build(),
origGroup: origGroup.build(),
user: user.build(),
origUser: origUser.build(),
entityType: entityType,
isChanged: isChanged,
updatedAt: updatedAt,
@ -951,10 +997,10 @@ class SettingsUIStateBuilder
} catch (_) {
String _$failedField;
try {
_$failedField = 'userCompany';
userCompany.build();
_$failedField = 'origUserCompany';
origUserCompany.build();
_$failedField = 'company';
company.build();
_$failedField = 'origCompany';
origCompany.build();
_$failedField = 'client';
client.build();
_$failedField = 'origClient';
@ -963,6 +1009,10 @@ class SettingsUIStateBuilder
group.build();
_$failedField = 'origGroup';
origGroup.build();
_$failedField = 'user';
user.build();
_$failedField = 'origUser';
origUser.build();
} catch (e) {
throw new BuiltValueNestedFieldError(
'SettingsUIState', _$failedField, e.toString());

View File

@ -11,16 +11,18 @@ import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
class ViewSettings extends AbstractNavigatorAction implements PersistUI {
ViewSettings({
@required NavigatorState navigator,
this.userCompany,
this.company,
this.group,
this.client,
this.user,
this.force = false,
this.section,
}) : super(navigator: navigator);
final UserCompanyEntity userCompany;
final CompanyEntity company;
final GroupEntity group;
final ClientEntity client;
final UserEntity user;
final bool force;
final String section;
}

View File

@ -171,17 +171,10 @@ Reducer<int> selectedCompanyIndexReducer = combineReducers([
]);
Reducer<SettingsUIState> settingsUIReducer = combineReducers([
TypedReducer<SettingsUIState, ClearSettingsFilter>((state, action) {
return state.rebuild((b) => b
..updatedAt = DateTime.now().millisecondsSinceEpoch
..userCompany.replace(state.origUserCompany)
..entityType = EntityType.company
..isChanged = false);
}),
TypedReducer<SettingsUIState, ViewSettings>((state, action) {
return state.rebuild((b) => b
..userCompany.replace(action.userCompany ?? state.userCompany)
..origUserCompany.replace(action.userCompany ?? state.origUserCompany)
..company.replace(action.company ?? state.company)
..origCompany.replace(action.company ?? state.origCompany)
..group.replace(action.group ?? state.group)
..origGroup.replace(action.group ?? state.origGroup)
..client.replace(action.client ?? state.client)
@ -195,14 +188,14 @@ Reducer<SettingsUIState> settingsUIReducer = combineReducers([
}),
TypedReducer<SettingsUIState, UpdateCompany>((state, action) {
return state.rebuild((b) => b
..userCompany.company.replace(action.company)
..company.replace(action.company)
..isChanged = true);
}),
TypedReducer<SettingsUIState, UpdateSettings>((state, action) {
switch (state.entityType) {
case EntityType.client:
return state.rebuild((b) => b
//..client.settings.replace(action.settings)
..client.settings.replace(action.settings)
..isChanged = true);
case EntityType.group:
return state.rebuild((b) => b
@ -210,18 +203,18 @@ Reducer<SettingsUIState> settingsUIReducer = combineReducers([
..isChanged = true);
default:
return state.rebuild((b) => b
..userCompany.company.settings.replace(action.settings)
..company.settings.replace(action.settings)
..isChanged = true);
}
}),
TypedReducer<SettingsUIState, UpdateSettingsUser>((state, action) {
return state.rebuild((b) => b
..userCompany.user.replace(action.user)
..user.replace(action.user)
..isChanged = true);
}),
TypedReducer<SettingsUIState, ResetSettings>((state, action) {
return state.rebuild((b) => b
..userCompany.replace(state.origUserCompany)
..company.replace(state.origCompany)
..group.replace(state.origGroup)
..client.replace(state.origClient)
..isChanged = false
@ -229,7 +222,7 @@ Reducer<SettingsUIState> settingsUIReducer = combineReducers([
}),
TypedReducer<SettingsUIState, SaveCompanySuccess>((state, action) {
return state.rebuild((b) => b
..userCompany.company.replace(action.company)
..company.replace(action.company)
..isChanged = false);
}),
TypedReducer<SettingsUIState, SaveGroupSuccess>((state, action) {
@ -249,6 +242,13 @@ Reducer<SettingsUIState> settingsUIReducer = combineReducers([
? DateTime.now().millisecondsSinceEpoch
: state.filterClearedAt);
}),
TypedReducer<SettingsUIState, ClearSettingsFilter>((state, action) {
return state.rebuild((b) => b
..updatedAt = DateTime.now().millisecondsSinceEpoch
..company.replace(state.company)
..entityType = EntityType.company
..isChanged = false);
}),
]);
CompanyPrefState companyPrefReducer(CompanyPrefState state, dynamic action) {

View File

@ -226,14 +226,14 @@ Reducer<SettingsUIState> settingsUIReducer = combineReducers([
TypedReducer<SettingsUIState, ClearSettingsFilter>((state, action) {
return state.rebuild((b) => b
..updatedAt = DateTime.now().millisecondsSinceEpoch
..userCompany.replace(state.origUserCompany)
..company.replace(state.origCompany)
..entityType = EntityType.company
..isChanged = false);
}),
TypedReducer<SettingsUIState, ViewSettings>((state, action) {
return state.rebuild((b) => b
..userCompany.replace(action.userCompany ?? state.userCompany)
..origUserCompany.replace(action.userCompany ?? state.origUserCompany)
..company.replace(action.company ?? state.company)
..origCompany.replace(action.company ?? state.origCompany)
..group.replace(action.group ?? state.group)
..origGroup.replace(action.group ?? state.origGroup)
..client.replace(action.client ?? state.client)
@ -247,7 +247,7 @@ Reducer<SettingsUIState> settingsUIReducer = combineReducers([
}),
TypedReducer<SettingsUIState, UpdateCompany>((state, action) {
return state.rebuild((b) => b
..userCompany.company.replace(action.company)
..company.replace(action.company)
..isChanged = true);
}),
TypedReducer<SettingsUIState, UpdateSettings>((state, action) {
@ -262,18 +262,18 @@ Reducer<SettingsUIState> settingsUIReducer = combineReducers([
..isChanged = true);
default:
return state.rebuild((b) => b
..userCompany.company.settings.replace(action.settings)
..company.settings.replace(action.settings)
..isChanged = true);
}
}),
TypedReducer<SettingsUIState, UpdateSettingsUser>((state, action) {
return state.rebuild((b) => b
..userCompany.user.replace(action.user)
..user.replace(action.user)
..isChanged = true);
}),
TypedReducer<SettingsUIState, ResetSettings>((state, action) {
return state.rebuild((b) => b
..userCompany.replace(state.origUserCompany)
..company.replace(state.origCompany)
..group.replace(state.origGroup)
..client.replace(state.origClient)
..isChanged = false
@ -281,7 +281,7 @@ Reducer<SettingsUIState> settingsUIReducer = combineReducers([
}),
TypedReducer<SettingsUIState, SaveCompanySuccess>((state, action) {
return state.rebuild((b) => b
..userCompany.company.replace(action.company)
..company.replace(action.company)
..isChanged = false);
}),
TypedReducer<SettingsUIState, SaveGroupSuccess>((state, action) {

View File

@ -213,7 +213,7 @@ class MenuDrawer extends StatelessWidget {
onTap: () {
store.dispatch(ViewSettings(
navigator: Navigator.of(context),
userCompany: state.userCompany));
company: state.company));
},
),
],

View File

@ -70,7 +70,7 @@ class CompanyGatewayScreenVM {
context, AppLocalization.of(context).savedSettings);
store.dispatch(SaveCompanyRequest(
completer: completer,
company: settingsUIState.userCompany.company));
company: settingsUIState.company));
break;
case EntityType.group:
final completer = snackBarCompleter<GroupEntity>(

View File

@ -50,7 +50,7 @@ class ClientPortalVM {
return ClientPortalVM(
state: state,
settings: state.uiState.settingsUIState.settings,
company: state.uiState.settingsUIState.userCompany.company,
company: state.uiState.settingsUIState.company,
onSettingsChanged: (settings) =>
store.dispatch(UpdateSettings(settings: settings)),
onCompanyChanged: (company) =>
@ -63,7 +63,7 @@ class ClientPortalVM {
context, AppLocalization.of(context).savedSettings);
store.dispatch(SaveCompanyRequest(
completer: completer,
company: settingsUIState.userCompany.company));
company: settingsUIState.company));
break;
case EntityType.group:
final completer = snackBarCompleter<GroupEntity>(

View File

@ -50,7 +50,7 @@ class CompanyDetailsVM {
return CompanyDetailsVM(
state: state,
settings: state.uiState.settingsUIState.settings,
company: state.uiState.settingsUIState.userCompany.company,
company: state.uiState.settingsUIState.company,
onSettingsChanged: (settings) =>
store.dispatch(UpdateSettings(settings: settings)),
onCompanyChanged: (company) =>
@ -63,7 +63,7 @@ class CompanyDetailsVM {
context, AppLocalization.of(context).savedSettings);
store.dispatch(SaveCompanyRequest(
completer: completer,
company: settingsUIState.userCompany.company));
company: settingsUIState.company));
break;
case EntityType.group:
final completer = snackBarCompleter<GroupEntity>(

View File

@ -46,7 +46,7 @@ class CustomFieldsVM {
return CustomFieldsVM(
state: state,
company: state.uiState.settingsUIState.userCompany.company,
company: state.uiState.settingsUIState.company,
onCompanyChanged: (company) =>
store.dispatch(UpdateCompany(company: company)),
onSavePressed: (context) {
@ -57,7 +57,7 @@ class CustomFieldsVM {
context, AppLocalization.of(context).savedSettings);
store.dispatch(SaveCompanyRequest(
completer: completer,
company: settingsUIState.userCompany.company));
company: settingsUIState.company));
break;
case EntityType.group:
final completer = snackBarCompleter<GroupEntity>(

View File

@ -59,7 +59,7 @@ class EmailSettingsVM {
context, AppLocalization.of(context).savedSettings);
store.dispatch(SaveCompanyRequest(
completer: completer,
company: settingsUIState.userCompany.company));
company: settingsUIState.company));
break;
case EntityType.group:
final completer = snackBarCompleter<GroupEntity>(

View File

@ -49,7 +49,7 @@ class GeneratedNumbersVM {
return GeneratedNumbersVM(
state: state,
company: state.uiState.settingsUIState.userCompany.company,
company: state.uiState.settingsUIState.company,
settings: state.uiState.settingsUIState.settings,
onCompanyChanged: (company) =>
store.dispatch(UpdateCompany(company: company)),
@ -64,7 +64,7 @@ class GeneratedNumbersVM {
context, AppLocalization.of(context).savedSettings);
store.dispatch(SaveCompanyRequest(
completer: completer,
company: settingsUIState.userCompany.company));
company: settingsUIState.company));
break;
case EntityType.group:
final completer = snackBarCompleter<GroupEntity>(

View File

@ -49,7 +49,7 @@ class InvoiceDesignVM {
return InvoiceDesignVM(
state: state,
settings: state.uiState.settingsUIState.settings,
company: state.uiState.settingsUIState.userCompany.company,
company: state.uiState.settingsUIState.company,
onSettingsChanged: (settings) {
store.dispatch(UpdateSettings(settings: settings));
},
@ -61,7 +61,7 @@ class InvoiceDesignVM {
context, AppLocalization.of(context).savedSettings);
store.dispatch(SaveCompanyRequest(
completer: completer,
company: settingsUIState.userCompany.company));
company: settingsUIState.company));
break;
case EntityType.group:
final completer = snackBarCompleter<GroupEntity>(

View File

@ -50,7 +50,7 @@ class LocalizationSettingsVM {
return LocalizationSettingsVM(
state: state,
settings: state.uiState.settingsUIState.settings,
company: state.uiState.settingsUIState.userCompany.company,
company: state.uiState.settingsUIState.company,
onSettingsChanged: (settings) {
store.dispatch(UpdateSettings(settings: settings));
},
@ -64,7 +64,7 @@ class LocalizationSettingsVM {
context, AppLocalization.of(context).savedSettings);
store.dispatch(SaveCompanyRequest(
completer: completer,
company: settingsUIState.userCompany.company));
company: settingsUIState.company));
break;
case EntityType.group:
final completer = snackBarCompleter<GroupEntity>(

View File

@ -41,7 +41,7 @@ class ProductSettingsVM {
return ProductSettingsVM(
state: state,
company: state.uiState.settingsUIState.userCompany.company,
company: state.uiState.settingsUIState.company,
onCompanyChanged: (company) =>
store.dispatch(UpdateCompany(company: company)),
onSavePressed: (context) {
@ -50,7 +50,7 @@ class ProductSettingsVM {
context, AppLocalization.of(context).savedSettings);
store.dispatch(SaveCompanyRequest(
completer: completer,
company: settingsUIState.userCompany.company));
company: settingsUIState.company));
});
}

View File

@ -40,7 +40,7 @@ class SettingsListVM {
store.dispatch(ViewSettings(
navigator: Navigator.of(context),
section: section,
userCompany: state.userCompany));
company: state.company));
},
onClearSettingsFilterPressed: () =>
store.dispatch(ClearSettingsFilter()),

View File

@ -46,7 +46,7 @@ class TaxSettingsVM {
return TaxSettingsVM(
state: state,
settings: state.uiState.settingsUIState.settings,
company: state.uiState.settingsUIState.userCompany.company,
company: state.uiState.settingsUIState.company,
onSettingsChanged: (settings) {
store.dispatch(UpdateSettings(settings: settings));
},
@ -58,7 +58,7 @@ class TaxSettingsVM {
context, AppLocalization.of(context).savedSettings);
store.dispatch(SaveCompanyRequest(
completer: completer,
company: settingsUIState.userCompany.company));
company: settingsUIState.company));
},
onConfigureRatesPressed: (context) {
if (state.taxRateState.list.isEmpty) {

View File

@ -60,7 +60,7 @@ class TemplatesAndRemindersVM {
context, AppLocalization.of(context).savedSettings);
store.dispatch(SaveCompanyRequest(
completer: completer,
company: settingsUIState.userCompany.company));
company: settingsUIState.company));
break;
case EntityType.group:
final completer = snackBarCompleter<GroupEntity>(

View File

@ -40,14 +40,14 @@ class UserDetailsVM {
return UserDetailsVM(
state: state,
user: state.uiState.settingsUIState.userCompany.user,
user: state.uiState.settingsUIState.user,
onChanged: (user) => store.dispatch(UpdateSettingsUser(user: user)),
onSavePressed: (context) {
final completer = snackBarCompleter<Null>(
context, AppLocalization.of(context).savedSettings);
store.dispatch(SaveUserRequest(
completer: completer,
user: state.uiState.settingsUIState.userCompany.user));
user: state.uiState.settingsUIState.user));
});
}

View File

@ -59,7 +59,7 @@ class WorkflowSettingsVM {
context, AppLocalization.of(context).savedSettings);
store.dispatch(SaveCompanyRequest(
completer: completer,
company: settingsUIState.userCompany.company));
company: settingsUIState.company));
break;
case EntityType.group:
final completer = snackBarCompleter<GroupEntity>(