Bug: archive group from group view screen/shows blank group
This commit is contained in:
parent
d82ed2fdc1
commit
9ebaf1ce92
|
|
@ -254,7 +254,7 @@ abstract class BaseEntity implements SelectableEntity {
|
|||
|
||||
String get entityKey => '__${entityType}__${id}__';
|
||||
|
||||
bool get isNew => id == null || (int.tryParse(id) ?? 0) < 0;
|
||||
bool get isNew => (id ?? '').isEmpty || (int.tryParse(id) ?? 0) < 0;
|
||||
|
||||
bool get isOld => !isNew;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/help_text.dart';
|
||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||
|
||||
class BlankScreen extends StatelessWidget {
|
||||
const BlankScreen([this.message]);
|
||||
|
||||
final String message;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
automaticallyImplyLeading: isMobile(context),
|
||||
),
|
||||
body: Container(
|
||||
color: Theme.of(context).cardColor,
|
||||
child: HelpText(message ?? ''),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -10,9 +10,13 @@ class EntityStateTitle extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final localization = AppLocalization.of(context);
|
||||
final titleText = localization.lookup('${entity.entityType}') +
|
||||
' › ' +
|
||||
entity.listDisplayName;
|
||||
|
||||
String titleText = '';
|
||||
if (entity.isOld) {
|
||||
titleText = localization.lookup('${entity.entityType}') +
|
||||
' › ' +
|
||||
entity.listDisplayName;
|
||||
}
|
||||
|
||||
return Text(
|
||||
titleText,
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ import 'package:invoiceninja_flutter/redux/dashboard/dashboard_actions.dart';
|
|||
import 'package:invoiceninja_flutter/redux/reports/reports_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/settings/settings_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/ui/pref_state.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/blank_screen.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/change_layout_banner.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/history_drawer_vm.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/menu_drawer_vm.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/help_text.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/screen_imports.dart';
|
||||
import 'package:invoiceninja_flutter/ui/credit/credit_email_vm.dart';
|
||||
import 'package:invoiceninja_flutter/ui/credit/credit_screen.dart';
|
||||
|
|
@ -36,7 +36,6 @@ import 'package:invoiceninja_flutter/ui/webhook/edit/webhook_edit_vm.dart';
|
|||
import 'package:invoiceninja_flutter/ui/webhook/view/webhook_view_vm.dart';
|
||||
import 'package:invoiceninja_flutter/ui/webhook/webhook_screen_vm.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/app_border.dart';
|
||||
import 'package:redux/redux.dart';
|
||||
|
||||
|
|
@ -629,26 +628,6 @@ class EntityScreens extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
|
||||
class BlankScreen extends StatelessWidget {
|
||||
const BlankScreen([this.message]);
|
||||
|
||||
final String message;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
automaticallyImplyLeading: isMobile(context),
|
||||
),
|
||||
body: Container(
|
||||
color: Theme.of(context).cardColor,
|
||||
child: HelpText(message ?? ''),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _EntityFilter extends StatelessWidget {
|
||||
const _EntityFilter({@required this.show});
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
|||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||
import 'package:invoiceninja_flutter/redux/ui/ui_actions.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/actions_menu_button.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/blank_screen.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/entities/entity_state_title.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||
|
|
@ -37,12 +38,17 @@ class ViewScaffold extends StatelessWidget {
|
|||
final userCompany = state.userCompany;
|
||||
final isSettings = entity.entityType.isSetting;
|
||||
|
||||
String title = (entity.listDisplayName ?? '').isEmpty
|
||||
? localization.pending
|
||||
: entity.listDisplayName;
|
||||
String title;
|
||||
if (entity.isNew) {
|
||||
title = '';
|
||||
} else {
|
||||
title = (entity.listDisplayName ?? '').isEmpty
|
||||
? localization.pending
|
||||
: entity.listDisplayName;
|
||||
|
||||
if (!(isFilter ?? false)) {
|
||||
title = localization.lookup('${entity.entityType}') + ' › ' + title;
|
||||
if (!(isFilter ?? false)) {
|
||||
title = localization.lookup('${entity.entityType}') + ' › ' + title;
|
||||
}
|
||||
}
|
||||
|
||||
Widget leading;
|
||||
|
|
@ -107,7 +113,7 @@ class ViewScaffold extends StatelessWidget {
|
|||
),
|
||||
],
|
||||
),
|
||||
body: body,
|
||||
body: entity.isNew ? BlankScreen(localization.noRecordSelected) : body,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue