Add chip in edit header
This commit is contained in:
parent
1bd6625362
commit
bb2741d0eb
|
|
@ -121,6 +121,11 @@ abstract class PrefState implements Built<PrefState, PrefStateBuilder> {
|
|||
return false;
|
||||
}
|
||||
|
||||
if ([EntityType.product, EntityType.payment, EntityType.project]
|
||||
.contains(entityType)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !(useSidebarEditor[entityType.baseType] ?? false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import 'package:invoiceninja_flutter/data/models/entities.dart';
|
|||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||
import 'package:invoiceninja_flutter/redux/settings/settings_actions.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/entities/entity_status_chip.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/forms/save_cancel_buttons.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/icon_message.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/menu_drawer_vm.dart';
|
||||
|
|
@ -117,7 +118,20 @@ class EditScaffold extends StatelessWidget {
|
|||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
automaticallyImplyLeading: isMobile(context),
|
||||
title: Text(title),
|
||||
title: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(title),
|
||||
if (entity != null &&
|
||||
entity.isOld &&
|
||||
isDesktop(context) &&
|
||||
state.prefState.isEditorFullScreen(entity.entityType)) ...[
|
||||
SizedBox(width: 16),
|
||||
EntityStatusChip(
|
||||
entity: state.getEntity(entity.entityType, entity.id)),
|
||||
],
|
||||
],
|
||||
),
|
||||
actions: <Widget>[
|
||||
SaveCancelButtons(
|
||||
isEnabled: isEnabled && onSavePressed != null,
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ class _CompanyGatewayEditState extends State<CompanyGatewayEdit>
|
|||
.isEnabled);
|
||||
|
||||
return EditScaffold(
|
||||
entity: companyGateway,
|
||||
title: viewModel.companyGateway.isNew
|
||||
? localization.newCompanyGateway
|
||||
: origCompanyGateway.listDisplayName,
|
||||
|
|
|
|||
|
|
@ -219,6 +219,7 @@ class _DesignEditState extends State<DesignEdit>
|
|||
final design = viewModel.design;
|
||||
|
||||
return EditScaffold(
|
||||
entity: design,
|
||||
isFullscreen: true,
|
||||
title: design.isNew ? localization.newDesign : localization.editDesign,
|
||||
onCancelPressed: (context) => viewModel.onCancelPressed(context),
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ class _ExpenseCategoryEditState extends State<ExpenseCategoryEdit> {
|
|||
final expenseCategory = viewModel.expenseCategory;
|
||||
|
||||
return EditScaffold(
|
||||
entity: expenseCategory,
|
||||
title: expenseCategory.isNew
|
||||
? localization.newExpenseCategory
|
||||
: localization.editExpenseCategory,
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ class _GroupEditState extends State<GroupEdit> {
|
|||
final group = viewModel.group;
|
||||
|
||||
return EditScaffold(
|
||||
entity: group,
|
||||
onCancelPressed: (context) => viewModel.onCancelPressed(context),
|
||||
title: group.isNew ? localization.newGroup : localization.editGroup,
|
||||
onSavePressed: (context) {
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ class _PaymentTermEditState extends State<PaymentTermEdit> {
|
|||
final localization = AppLocalization.of(context);
|
||||
|
||||
return EditScaffold(
|
||||
entity: viewModel.paymentTerm,
|
||||
title: viewModel.paymentTerm.isNew
|
||||
? localization.newPaymentTerm
|
||||
: localization.editPaymentTerm,
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ class _RecurringInvoiceEditState extends State<RecurringInvoiceEdit>
|
|||
final isFullscreen = prefState.isEditorFullScreen(EntityType.invoice);
|
||||
|
||||
return EditScaffold(
|
||||
entity: invoice,
|
||||
isFullscreen: isFullscreen,
|
||||
title: recurringInvoice.isNew
|
||||
? localization.newRecurringInvoice
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@ class _SubscriptionEditState extends State<SubscriptionEdit>
|
|||
final value = _postPurchaseHeaderValueController.text.trim();
|
||||
|
||||
return EditScaffold(
|
||||
entity: subscription,
|
||||
title: subscription.isNew
|
||||
? localization.newSubscription
|
||||
: localization.editSubscription,
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ class _TaskStatusEditState extends State<TaskStatusEdit> {
|
|||
final taskStatus = viewModel.taskStatus;
|
||||
|
||||
return EditScaffold(
|
||||
entity: taskStatus,
|
||||
title: taskStatus.isNew
|
||||
? localization.newTaskStatus
|
||||
: localization.editTaskStatus,
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ class _TaxRateEditState extends State<TaxRateEdit> {
|
|||
final localization = AppLocalization.of(context);
|
||||
|
||||
return EditScaffold(
|
||||
entity: viewModel.taxRate,
|
||||
title: viewModel.taxRate.isNew
|
||||
? localization.newTaxRate
|
||||
: localization.editTaxRate,
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ class _TokenEditState extends State<TokenEdit> {
|
|||
final token = viewModel.token;
|
||||
|
||||
return EditScaffold(
|
||||
entity: token,
|
||||
title: token.isNew ? localization.newToken : localization.editToken,
|
||||
onCancelPressed: (context) => viewModel.onCancelPressed(context),
|
||||
onSavePressed: (context) {
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ class _WebhookEditState extends State<WebhookEdit> {
|
|||
final value = _headerValueController.text.trim();
|
||||
|
||||
return EditScaffold(
|
||||
entity: webhook,
|
||||
title: webhook.isNew ? localization.newWebhook : localization.editWebhook,
|
||||
onCancelPressed: (context) => viewModel.onCancelPressed(context),
|
||||
onSavePressed: (context) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue