This commit is contained in:
Hillel Coren 2021-04-15 12:02:35 +03:00
parent 330c853521
commit fe73e49461
14 changed files with 28 additions and 127 deletions

View File

@ -40,7 +40,6 @@ class EntityType extends EnumClass {
static const EntityType design = _$design;
// STARTER: entity type - do not remove comment
static const EntityType subscription = _$subscription;
static const EntityType kanban = _$kanban;
static const EntityType webhook = _$webhook;
static const EntityType token = _$token;
static const EntityType paymentTerm = _$paymentTerm;

View File

@ -20,7 +20,6 @@ import 'package:invoiceninja_flutter/redux/document/document_middleware.dart';
import 'package:invoiceninja_flutter/redux/expense/expense_middleware.dart';
import 'package:invoiceninja_flutter/redux/group/group_middleware.dart';
import 'package:invoiceninja_flutter/redux/invoice/invoice_middleware.dart';
import 'package:invoiceninja_flutter/redux/kanban/kanban_middleware.dart';
import 'package:invoiceninja_flutter/redux/payment/payment_middleware.dart';
import 'package:invoiceninja_flutter/redux/product/product_middleware.dart';
import 'package:invoiceninja_flutter/redux/project/project_middleware.dart';
@ -69,7 +68,6 @@ void main({bool isTesting = false}) async {
..addAll(createStoreQuotesMiddleware())
..addAll(createStoreSettingsMiddleware())
..addAll(createStoreReportsMiddleware())
..addAll(createStoreKabanMiddleware())
// STARTER: middleware - do not remove comment
..addAll(createStoreSubscriptionsMiddleware())
..addAll(createStoreTaskStatusesMiddleware())

View File

@ -33,7 +33,6 @@ import 'package:invoiceninja_flutter/ui/design/design_screen_vm.dart';
import 'package:invoiceninja_flutter/ui/design/edit/design_edit_vm.dart';
import 'package:invoiceninja_flutter/ui/design/view/design_view_vm.dart';
import 'package:invoiceninja_flutter/ui/invoice/invoice_pdf_vm.dart';
import 'package:invoiceninja_flutter/ui/kanban_screen_vm.dart';
import 'package:invoiceninja_flutter/ui/payment/refund/payment_refund_vm.dart';
import 'package:invoiceninja_flutter/ui/payment_term/edit/payment_term_edit_vm.dart';
import 'package:invoiceninja_flutter/ui/payment_term/payment_term_screen.dart';
@ -306,8 +305,6 @@ class InvoiceNinjaAppState extends State<InvoiceNinjaApp> {
appLayout: state.prefState.appLayout,
child: DashboardScreenBuilder(),
),
KanbanScreenBuilder.route: (context) =>
KanbanScreenBuilder(),
ProductScreen.route: (context) => ProductScreenBuilder(),
ProductViewScreen.route: (context) => ProductViewScreen(),
ProductEditScreen.route: (context) => ProductEditScreen(),

View File

@ -19,7 +19,6 @@ import 'package:invoiceninja_flutter/redux/document/document_actions.dart';
import 'package:invoiceninja_flutter/redux/expense/expense_actions.dart';
import 'package:invoiceninja_flutter/redux/group/group_actions.dart';
import 'package:invoiceninja_flutter/redux/invoice/invoice_actions.dart';
import 'package:invoiceninja_flutter/redux/kanban/kanban_actions.dart';
import 'package:invoiceninja_flutter/redux/payment/payment_actions.dart';
import 'package:invoiceninja_flutter/redux/product/product_actions.dart';
import 'package:invoiceninja_flutter/redux/project/project_actions.dart';
@ -291,9 +290,6 @@ void viewEntitiesByType({
case EntityType.reports:
action = ViewReports(navigator: navigator);
break;
case EntityType.kanban:
action = ViewKanban(navigator: navigator);
break;
case EntityType.settings:
action = ViewSettings(
navigator: navigator,

View File

@ -1,11 +0,0 @@
import 'package:flutter/material.dart';
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
class ViewKanban extends AbstractNavigatorAction implements PersistUI {
ViewKanban({
@required NavigatorState navigator,
this.force = false,
}) : super(navigator: navigator);
final bool force;
}

View File

@ -1,38 +0,0 @@
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
import 'package:invoiceninja_flutter/redux/kanban/kanban_actions.dart';
import 'package:invoiceninja_flutter/redux/ui/ui_actions.dart';
import 'package:invoiceninja_flutter/ui/kanban_screen_vm.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
import 'package:redux/redux.dart';
import 'package:flutter/material.dart';
List<Middleware<AppState>> createStoreKabanMiddleware() {
final viewKanban = _viewKanban();
return [
TypedMiddleware<AppState, ViewKanban>(viewKanban),
];
}
Middleware<AppState> _viewKanban() {
return (Store<AppState> store, dynamic dynamicAction, NextDispatcher next) {
final action = dynamicAction as ViewKanban;
checkForChanges(
store: store,
context: action.context,
force: action.force,
callback: () {
const route = KanbanScreenBuilder.route;
next(action);
store.dispatch(UpdateCurrentRoute(route));
if (isMobile(action.context)) {
Navigator.of(action.context).pushNamed(route);
}
});
};
}

View File

@ -10,7 +10,6 @@ import 'package:invoiceninja_flutter/redux/dashboard/dashboard_actions.dart';
import 'package:invoiceninja_flutter/redux/expense/expense_actions.dart';
import 'package:invoiceninja_flutter/redux/group/group_actions.dart';
import 'package:invoiceninja_flutter/redux/invoice/invoice_actions.dart';
import 'package:invoiceninja_flutter/redux/kanban/kanban_actions.dart';
import 'package:invoiceninja_flutter/redux/payment/payment_actions.dart';
import 'package:invoiceninja_flutter/redux/product/product_actions.dart';
import 'package:invoiceninja_flutter/redux/project/project_actions.dart';
@ -235,8 +234,6 @@ Reducer<BuiltList<HistoryRecord>> historyReducer = combineReducers([
TypedReducer<BuiltList<HistoryRecord>, ViewReports>((historyList, action) =>
_addToHistory(
historyList, HistoryRecord(entityType: EntityType.reports))),
TypedReducer<BuiltList<HistoryRecord>, ViewKanban>((historyList, action) =>
_addToHistory(historyList, HistoryRecord(entityType: EntityType.kanban))),
TypedReducer<BuiltList<HistoryRecord>, ViewSettings>((historyList, action) =>
_addToHistory(
historyList,

View File

@ -7,7 +7,6 @@ import 'package:invoiceninja_flutter/data/models/entities.dart';
import 'package:invoiceninja_flutter/data/models/models.dart';
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
import 'package:invoiceninja_flutter/redux/dashboard/dashboard_actions.dart';
import 'package:invoiceninja_flutter/redux/kanban/kanban_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';
@ -112,7 +111,6 @@ class _HistoryListTileState extends State<HistoryListTile> {
if ([
EntityType.dashboard,
EntityType.reports,
EntityType.kanban,
EntityType.settings,
].contains(history.entityType)) {
title = Text(localization.lookup(history.entityType.toString()));
@ -207,9 +205,6 @@ class _HistoryListTileState extends State<HistoryListTile> {
case EntityType.reports:
store.dispatch(ViewReports(navigator: Navigator.of(context)));
break;
case EntityType.kanban:
store.dispatch(ViewKanban(navigator: Navigator.of(context)));
break;
case EntityType.settings:
store.dispatch(ViewSettings(
navigator: Navigator.of(context), section: history.id));

View File

@ -32,7 +32,6 @@ import 'package:invoiceninja_flutter/ui/expense_category/edit/expense_category_e
import 'package:invoiceninja_flutter/ui/expense_category/expense_category_screen_vm.dart';
import 'package:invoiceninja_flutter/ui/expense_category/view/expense_category_view_vm.dart';
import 'package:invoiceninja_flutter/ui/invoice/invoice_pdf_vm.dart';
import 'package:invoiceninja_flutter/ui/kanban_screen_vm.dart';
import 'package:invoiceninja_flutter/ui/payment_term/edit/payment_term_edit_vm.dart';
import 'package:invoiceninja_flutter/ui/payment_term/payment_term_screen_vm.dart';
import 'package:invoiceninja_flutter/ui/payment_term/view/payment_term_view_vm.dart';
@ -118,9 +117,6 @@ class MainScreen extends StatelessWidget {
],
);
break;
case KanbanScreenBuilder.route:
screen = KanbanScreenBuilder();
break;
case ClientScreen.route:
screen = EntityScreens(
entityType: EntityType.client,

View File

@ -387,16 +387,6 @@ class MenuDrawer extends StatelessWidget {
iconTooltip: localization.newExpense,
),
// STARTER: menu - do not remove comment
if (!kReleaseMode &&
company.isModuleEnabled(EntityType.task))
DrawerTile(
company: company,
icon: getEntityIcon(EntityType.kanban),
title: localization.kanban,
onTap: () => viewEntitiesByType(
appContext: context.getAppContext(),
entityType: EntityType.kanban),
),
DrawerTile(
company: company,
icon: getEntityIcon(EntityType.reports),
@ -404,9 +394,6 @@ class MenuDrawer extends StatelessWidget {
onTap: () => viewEntitiesByType(
appContext: context.getAppContext(),
entityType: EntityType.reports),
onLongPress: () => viewEntitiesByType(
appContext: context.getAppContext(),
entityType: EntityType.kanban),
),
DrawerTile(
company: company,

View File

@ -9,13 +9,13 @@ import 'package:invoiceninja_flutter/ui/app/forms/decorated_form_field.dart';
import 'package:invoiceninja_flutter/ui/app/history_drawer_vm.dart';
import 'package:invoiceninja_flutter/ui/app/list_filter.dart';
import 'package:invoiceninja_flutter/ui/app/menu_drawer_vm.dart';
import 'package:invoiceninja_flutter/ui/kanban_screen_vm.dart';
import 'package:invoiceninja_flutter/ui/task/kanban_view_vm.dart';
import 'package:invoiceninja_flutter/utils/localization.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
import 'package:timeago/timeago.dart' as timeago;
class KanbanScreen extends StatefulWidget {
const KanbanScreen({
class KanbanView extends StatefulWidget {
const KanbanView({
Key key,
@required this.viewModel,
}) : super(key: key);
@ -23,10 +23,10 @@ class KanbanScreen extends StatefulWidget {
final KanbanVM viewModel;
@override
_KanbanScreenState createState() => _KanbanScreenState();
_KanbanViewState createState() => _KanbanViewState();
}
class _KanbanScreenState extends State<KanbanScreen> {
class _KanbanViewState extends State<KanbanView> {
final _boardViewController = new BoardViewController();
List<TaskStatusEntity> _statuses = [];
@ -166,35 +166,12 @@ class _KanbanScreenState extends State<KanbanScreen> {
);
}).toList();
return Scaffold(
drawer: isMobile(context) || state.prefState.isMenuFloated
? MenuDrawerBuilder()
: null,
endDrawer: isMobile(context) || state.prefState.isHistoryFloated
? HistoryDrawerBuilder()
: null,
appBar: AppBar(
centerTitle: false,
leading: isMobile(context) || state.prefState.isMenuFloated
? null
: SizedBox(),
title: ListFilter(
key: ValueKey('__cleared_at_${state.uiState.filterClearedAt}__'),
entityType: EntityType.kanban,
entityIds: [],
filter: state.uiState.filter,
onFilterChanged: (value) {
//store.dispatch(FilterCompany(value));
},
),
),
body: Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: BoardView(
boardViewController: _boardViewController,
lists: boardList,
dragDelay: 1,
),
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: BoardView(
boardViewController: _boardViewController,
lists: boardList,
dragDelay: 1,
),
);
}

View File

@ -5,20 +5,19 @@ import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
import 'package:invoiceninja_flutter/redux/task/task_actions.dart';
import 'package:invoiceninja_flutter/redux/task_status/task_status_actions.dart';
import 'package:invoiceninja_flutter/ui/kanban_screen.dart';
import 'package:invoiceninja_flutter/ui/task/kanban_view.dart';
import 'package:invoiceninja_flutter/utils/completers.dart';
import 'package:invoiceninja_flutter/utils/localization.dart';
import 'package:redux/redux.dart';
class KanbanScreenBuilder extends StatefulWidget {
const KanbanScreenBuilder({Key key}) : super(key: key);
static const String route = '/kanban';
class KanbanViewBuilder extends StatefulWidget {
const KanbanViewBuilder({Key key}) : super(key: key);
@override
_KanbanScreenBuilderState createState() => _KanbanScreenBuilderState();
_KanbanViewBuilderState createState() => _KanbanViewBuilderState();
}
class _KanbanScreenBuilderState extends State<KanbanScreenBuilder> {
class _KanbanViewBuilderState extends State<KanbanViewBuilder> {
@override
Widget build(BuildContext context) {
return StoreConnector<AppState, KanbanVM>(
@ -26,7 +25,7 @@ class _KanbanScreenBuilderState extends State<KanbanScreenBuilder> {
builder: (context, viewModel) {
final state = viewModel.state;
final company = state.company;
return KanbanScreen(
return KanbanView(
viewModel: viewModel,
key: ValueKey(
'__${company.id}_${state.userCompanyState.lastUpdated}_'),

View File

@ -4,6 +4,7 @@ import 'package:invoiceninja_flutter/constants.dart';
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
import 'package:invoiceninja_flutter/ui/app/list_scaffold.dart';
import 'package:invoiceninja_flutter/ui/app/list_filter.dart';
import 'package:invoiceninja_flutter/ui/task/kanban_view_vm.dart';
import 'package:invoiceninja_flutter/ui/task/task_presenter.dart';
import 'package:invoiceninja_flutter/ui/task/task_screen_vm.dart';
import 'package:invoiceninja_flutter/utils/localization.dart';
@ -12,6 +13,7 @@ import 'package:invoiceninja_flutter/data/models/models.dart';
import 'package:invoiceninja_flutter/ui/task/task_list_vm.dart';
import 'package:invoiceninja_flutter/redux/task/task_actions.dart';
import 'package:invoiceninja_flutter/ui/app/app_bottom_bar.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
class TaskScreen extends StatelessWidget {
const TaskScreen({
@ -42,7 +44,16 @@ class TaskScreen extends StatelessWidget {
store.dispatch(FilterTasks(value));
},
),
appBarActions: [
IconButton(
icon: Icon(MdiIcons.trello),
onPressed: () {
//
},
)
],
body: TaskListBuilder(),
//body: KanbanViewBuilder(),
bottomNavigationBar: AppBottomBar(
entityType: EntityType.task,
tableColumns: TaskPresenter.getAllTableFields(userCompany),

View File

@ -121,8 +121,6 @@ IconData getEntityIcon(EntityType entityType) {
return MdiIcons.label;
case EntityType.subscription:
return MdiIcons.shopping;
case EntityType.kanban:
return MdiIcons.trello;
default:
return MdiIcons.crosshairsQuestion;
}