Settings
This commit is contained in:
parent
086c0d1f9d
commit
e71b09816b
|
|
@ -148,14 +148,6 @@ abstract class UserEntity extends Object
|
||||||
if (includeEdit && userCompany.canEditEntity(this)) {
|
if (includeEdit && userCompany.canEditEntity(this)) {
|
||||||
actions.add(EntityAction.edit);
|
actions.add(EntityAction.edit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userCompany.canEditEntity(this)) {
|
|
||||||
actions.add(EntityAction.settings);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (userCompany.canCreate(EntityType.client)) {
|
|
||||||
actions.add(EntityAction.newClient);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actions.isNotEmpty) {
|
if (actions.isNotEmpty) {
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ class _UserEditState extends State<UserEdit> {
|
||||||
|
|
||||||
_controllers.forEach((controller) => controller.removeListener(_onChanged));
|
_controllers.forEach((controller) => controller.removeListener(_onChanged));
|
||||||
|
|
||||||
final user = widget.viewModel.state.user;
|
final user = widget.viewModel.user;
|
||||||
_firstNameController.text = user.firstName;
|
_firstNameController.text = user.firstName;
|
||||||
_lastNameController.text = user.lastName;
|
_lastNameController.text = user.lastName;
|
||||||
_emailController.text = user.email;
|
_emailController.text = user.email;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ class UserScreen extends StatelessWidget {
|
||||||
@required this.viewModel,
|
@required this.viewModel,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
static const String route = '/$kSettings';
|
static const String route = '/$kSettings/$kSettingsUserManagement';
|
||||||
|
|
||||||
final UserScreenVM viewModel;
|
final UserScreenVM viewModel;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import 'package:invoiceninja_flutter/ui/app/actions_menu_button.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/user/view/user_view_vm.dart';
|
import 'package:invoiceninja_flutter/ui/user/view/user_view_vm.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/form_card.dart';
|
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';
|
||||||
|
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||||
|
|
||||||
class UserView extends StatefulWidget {
|
class UserView extends StatefulWidget {
|
||||||
const UserView({
|
const UserView({
|
||||||
|
|
@ -27,6 +28,12 @@ class _UserViewState extends State<UserView> {
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
leading: !isMobile(context)
|
||||||
|
? IconButton(
|
||||||
|
icon: Icon(Icons.arrow_back),
|
||||||
|
onPressed: viewModel.onBackPressed,
|
||||||
|
)
|
||||||
|
: null,
|
||||||
title: EntityStateTitle(entity: user),
|
title: EntityStateTitle(entity: user),
|
||||||
actions: [
|
actions: [
|
||||||
userCompany.canEditEntity(user)
|
userCompany.canEditEntity(user)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue