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