Settings
This commit is contained in:
parent
08009c190f
commit
a35638226b
|
|
@ -41,8 +41,9 @@ class GroupFields {
|
||||||
abstract class GroupEntity extends Object
|
abstract class GroupEntity extends Object
|
||||||
with BaseEntity, SelectableEntity
|
with BaseEntity, SelectableEntity
|
||||||
implements Built<GroupEntity, GroupEntityBuilder> {
|
implements Built<GroupEntity, GroupEntityBuilder> {
|
||||||
factory GroupEntity() {
|
factory GroupEntity({String id}) {
|
||||||
return _$GroupEntity._(
|
return _$GroupEntity._(
|
||||||
|
id: id ?? BaseEntity.nextId,
|
||||||
name: '',
|
name: '',
|
||||||
settings: SettingsEntity(),
|
settings: SettingsEntity(),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import 'dart:async';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/client_model.dart';
|
import 'package:invoiceninja_flutter/data/models/client_model.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/company_model.dart';
|
import 'package:invoiceninja_flutter/data/models/company_model.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/group_model.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
||||||
|
|
||||||
class ViewSettings implements PersistUI {
|
class ViewSettings implements PersistUI {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import 'dart:io';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/group_model.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/resources/cached_image.dart';
|
import 'package:invoiceninja_flutter/ui/app/resources/cached_image.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/upgrade_dialog.dart';
|
import 'package:invoiceninja_flutter/ui/app/upgrade_dialog.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/pdf.dart';
|
import 'package:invoiceninja_flutter/utils/pdf.dart';
|
||||||
|
|
@ -24,10 +25,10 @@ import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/payment/payment_actions.dart';
|
import 'package:invoiceninja_flutter/redux/payment/payment_actions.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/quote/quote_actions.dart';
|
import 'package:invoiceninja_flutter/redux/quote/quote_actions.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
// STARTER: import - do not remove comment
|
// STARTER: import - do not remove comment
|
||||||
import 'package:invoiceninja_flutter/redux/group/group_actions.dart';
|
import 'package:invoiceninja_flutter/redux/group/group_actions.dart';
|
||||||
|
|
||||||
|
|
||||||
class AppDrawer extends StatelessWidget {
|
class AppDrawer extends StatelessWidget {
|
||||||
const AppDrawer({
|
const AppDrawer({
|
||||||
Key key,
|
Key key,
|
||||||
|
|
@ -324,14 +325,14 @@ company: company,
|
||||||
entityType: EntityType.group,
|
entityType: EntityType.group,
|
||||||
icon: getEntityIcon(EntityType.group),
|
icon: getEntityIcon(EntityType.group),
|
||||||
title: localization.groups,
|
title: localization.groups,
|
||||||
onTap: () => store.dispatch(ViewGroupList(context)),
|
onTap: () =>
|
||||||
|
store.dispatch(ViewGroupList(context: context)),
|
||||||
onCreateTap: () {
|
onCreateTap: () {
|
||||||
navigator.pop();
|
navigator.pop();
|
||||||
store.dispatch(EditGroup(
|
store.dispatch(EditGroup(
|
||||||
group: GroupEntity(), context: context));
|
group: GroupEntity(), context: context));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
DrawerTile(
|
DrawerTile(
|
||||||
company: company,
|
company: company,
|
||||||
icon: FontAwesomeIcons.cog,
|
icon: FontAwesomeIcons.cog,
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ class SettingsScreens extends StatelessWidget {
|
||||||
NotificationsSettingsScreen(),
|
NotificationsSettingsScreen(),
|
||||||
ImportExportScreen(),
|
ImportExportScreen(),
|
||||||
DeviceSettingsScreen(),
|
DeviceSettingsScreen(),
|
||||||
GroupSettingsScreen(),
|
//GroupSettingsScreen(),
|
||||||
InvoiceSettingsScreen(),
|
InvoiceSettingsScreen(),
|
||||||
InvoiceDesignScreen(),
|
InvoiceDesignScreen(),
|
||||||
ClientPortalScreen(),
|
ClientPortalScreen(),
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_redux/flutter_redux.dart';
|
import 'package:flutter_redux/flutter_redux.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/group_model.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/app_scaffold.dart';
|
import 'package:invoiceninja_flutter/ui/app/app_scaffold.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/dashboard/dashboard_actions.dart';
|
import 'package:invoiceninja_flutter/redux/dashboard/dashboard_actions.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/list_filter.dart';
|
import 'package:invoiceninja_flutter/ui/app/list_filter.dart';
|
||||||
|
|
@ -20,6 +21,7 @@ class GroupScreen extends StatelessWidget {
|
||||||
final store = StoreProvider.of<AppState>(context);
|
final store = StoreProvider.of<AppState>(context);
|
||||||
final state = store.state;
|
final state = store.state;
|
||||||
final company = state.selectedCompany;
|
final company = state.selectedCompany;
|
||||||
|
final user = state.user;
|
||||||
final localization = AppLocalization.of(context);
|
final localization = AppLocalization.of(context);
|
||||||
|
|
||||||
return AppScaffold(
|
return AppScaffold(
|
||||||
|
|
@ -51,13 +53,13 @@ class GroupScreen extends StatelessWidget {
|
||||||
onSelectedCustom2: (value) =>
|
onSelectedCustom2: (value) =>
|
||||||
store.dispatch(FilterGroupsByCustom2(value)),
|
store.dispatch(FilterGroupsByCustom2(value)),
|
||||||
sortFields: [
|
sortFields: [
|
||||||
GroupFields.updatedAt,
|
GroupFields.name,
|
||||||
],
|
],
|
||||||
onSelectedState: (EntityState state, value) {
|
onSelectedState: (EntityState state, value) {
|
||||||
store.dispatch(FilterGroupsByState(state));
|
store.dispatch(FilterGroupsByState(state));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: user.canCreate(EntityType.group)
|
floatingActionButton: state.userCompany.canCreate(EntityType.group)
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
heroTag: 'group_fab',
|
heroTag: 'group_fab',
|
||||||
backgroundColor: Theme.of(context).primaryColorDark,
|
backgroundColor: Theme.of(context).primaryColorDark,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import 'package:invoiceninja_flutter/ui/app/form_card.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/entities/entity_state_title.dart';
|
import 'package:invoiceninja_flutter/ui/app/entities/entity_state_title.dart';
|
||||||
|
|
||||||
class GroupView extends StatefulWidget {
|
class GroupView extends StatefulWidget {
|
||||||
|
|
||||||
const GroupView({
|
const GroupView({
|
||||||
Key key,
|
Key key,
|
||||||
@required this.viewModel,
|
@required this.viewModel,
|
||||||
|
|
@ -37,18 +36,15 @@ class _GroupViewState extends State<GroupView> {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ActionMenuButton(
|
ActionMenuButton(
|
||||||
user: viewModel.company.user,
|
|
||||||
isSaving: viewModel.isSaving,
|
isSaving: viewModel.isSaving,
|
||||||
entity: group,
|
entity: group,
|
||||||
onSelected: viewModel.onEntityAction,
|
onSelected: viewModel.onEntityAction,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: FormCard(
|
body: FormCard(children: [
|
||||||
children: [
|
|
||||||
// STARTER: widgets - do not remove comment
|
// STARTER: widgets - do not remove comment
|
||||||
]
|
]),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ abstract class LocaleCodeAware {
|
||||||
mixin LocalizationsProvider on LocaleCodeAware {
|
mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
static final Map<String, Map<String, String>> _localizedValues = {
|
static final Map<String, Map<String, String>> _localizedValues = {
|
||||||
'en': {
|
'en': {
|
||||||
|
'groups': 'Groups',
|
||||||
'new_group': 'New Group',
|
'new_group': 'New Group',
|
||||||
'edit_group': 'Edit Group',
|
'edit_group': 'Edit Group',
|
||||||
'created_group': 'Successfully created group',
|
'created_group': 'Successfully created group',
|
||||||
|
|
@ -14709,6 +14710,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
|
|
||||||
String get editGroup => _localizedValues[localeCode]['edit_group'];
|
String get editGroup => _localizedValues[localeCode]['edit_group'];
|
||||||
|
|
||||||
|
String get groups => _localizedValues[localeCode]['groups'];
|
||||||
|
|
||||||
String lookup(String key) {
|
String lookup(String key) {
|
||||||
final lookupKey = toSnakeCase(key);
|
final lookupKey = toSnakeCase(key);
|
||||||
return _localizedValues[localeCode][lookupKey] ??
|
return _localizedValues[localeCode][lookupKey] ??
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import 'package:built_collection/built_collection.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
||||||
import 'package:flutter_redux/flutter_redux.dart';
|
import 'package:flutter_redux/flutter_redux.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/stub_model.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/completers.dart';
|
import 'package:invoiceninja_flutter/utils/completers.dart';
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_redux/flutter_redux.dart';
|
import 'package:flutter_redux/flutter_redux.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/app_scaffold.dart';
|
import 'package:invoiceninja_flutter/ui/app/app_scaffold.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/dashboard/dashboard_actions.dart';
|
import 'package:invoiceninja_flutter/redux/dashboard/dashboard_actions.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/stub_model.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/list_filter.dart';
|
import 'package:invoiceninja_flutter/ui/app/list_filter.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/list_filter_button.dart';
|
import 'package:invoiceninja_flutter/ui/app/list_filter_button.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue