Add desktop state/status filters
This commit is contained in:
parent
de51f328b8
commit
bbf83c8324
|
|
@ -45,6 +45,9 @@ class GroupSettingsScreen extends StatelessWidget {
|
||||||
onFilterChanged: (value) {
|
onFilterChanged: (value) {
|
||||||
store.dispatch(FilterGroups(value));
|
store.dispatch(FilterGroups(value));
|
||||||
},
|
},
|
||||||
|
onSelectedState: (EntityState state, value) {
|
||||||
|
store.dispatch(FilterGroupsByState(state));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onCheckboxPressed: () {
|
onCheckboxPressed: () {
|
||||||
if (store.state.groupListState.isInMultiselect()) {
|
if (store.state.groupListState.isInMultiselect()) {
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,9 @@ class PaymentTermScreen extends StatelessWidget {
|
||||||
onFilterChanged: (value) {
|
onFilterChanged: (value) {
|
||||||
store.dispatch(FilterPaymentTerms(value));
|
store.dispatch(FilterPaymentTerms(value));
|
||||||
},
|
},
|
||||||
|
onSelectedState: (EntityState state, value) {
|
||||||
|
store.dispatch(FilterPaymentTermsByState(state));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onCheckboxPressed: () {
|
onCheckboxPressed: () {
|
||||||
if (store.state.paymentTermListState.isInMultiselect()) {
|
if (store.state.paymentTermListState.isInMultiselect()) {
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,33 @@ class QuoteScreen extends StatelessWidget {
|
||||||
final company = store.state.company;
|
final company = store.state.company;
|
||||||
final userCompany = store.state.userCompany;
|
final userCompany = store.state.userCompany;
|
||||||
final localization = AppLocalization.of(context);
|
final localization = AppLocalization.of(context);
|
||||||
|
final statuses = [
|
||||||
|
InvoiceStatusEntity().rebuild(
|
||||||
|
(b) => b
|
||||||
|
..id = kQuoteStatusDraft
|
||||||
|
..name = localization.draft,
|
||||||
|
),
|
||||||
|
InvoiceStatusEntity().rebuild(
|
||||||
|
(b) => b
|
||||||
|
..id = kQuoteStatusSent
|
||||||
|
..name = localization.sent,
|
||||||
|
),
|
||||||
|
InvoiceStatusEntity().rebuild(
|
||||||
|
(b) => b
|
||||||
|
..id = kQuoteStatusViewed
|
||||||
|
..name = localization.viewed,
|
||||||
|
),
|
||||||
|
InvoiceStatusEntity().rebuild(
|
||||||
|
(b) => b
|
||||||
|
..id = kQuoteStatusApproved
|
||||||
|
..name = localization.approved,
|
||||||
|
),
|
||||||
|
InvoiceStatusEntity().rebuild(
|
||||||
|
(b) => b
|
||||||
|
..id = kQuoteStatusExpired
|
||||||
|
..name = localization.expired,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
return ListScaffold(
|
return ListScaffold(
|
||||||
entityType: EntityType.quote,
|
entityType: EntityType.quote,
|
||||||
|
|
@ -48,6 +75,13 @@ class QuoteScreen extends StatelessWidget {
|
||||||
onFilterChanged: (value) {
|
onFilterChanged: (value) {
|
||||||
store.dispatch(FilterQuotes(value));
|
store.dispatch(FilterQuotes(value));
|
||||||
},
|
},
|
||||||
|
onSelectedState: (EntityState state, value) {
|
||||||
|
store.dispatch(FilterQuotesByState(state));
|
||||||
|
},
|
||||||
|
onSelectedStatus: (EntityStatus status, value) {
|
||||||
|
store.dispatch(FilterQuotesByStatus(status));
|
||||||
|
},
|
||||||
|
statuses: statuses,
|
||||||
),
|
),
|
||||||
onCheckboxPressed: () {
|
onCheckboxPressed: () {
|
||||||
if (store.state.quoteListState.isInMultiselect()) {
|
if (store.state.quoteListState.isInMultiselect()) {
|
||||||
|
|
@ -90,33 +124,7 @@ class QuoteScreen extends StatelessWidget {
|
||||||
onSelectedStatus: (EntityStatus status, value) {
|
onSelectedStatus: (EntityStatus status, value) {
|
||||||
store.dispatch(FilterQuotesByStatus(status));
|
store.dispatch(FilterQuotesByStatus(status));
|
||||||
},
|
},
|
||||||
statuses: [
|
statuses: statuses,
|
||||||
InvoiceStatusEntity().rebuild(
|
|
||||||
(b) => b
|
|
||||||
..id = kQuoteStatusDraft
|
|
||||||
..name = localization.draft,
|
|
||||||
),
|
|
||||||
InvoiceStatusEntity().rebuild(
|
|
||||||
(b) => b
|
|
||||||
..id = kQuoteStatusSent
|
|
||||||
..name = localization.sent,
|
|
||||||
),
|
|
||||||
InvoiceStatusEntity().rebuild(
|
|
||||||
(b) => b
|
|
||||||
..id = kQuoteStatusViewed
|
|
||||||
..name = localization.viewed,
|
|
||||||
),
|
|
||||||
InvoiceStatusEntity().rebuild(
|
|
||||||
(b) => b
|
|
||||||
..id = kQuoteStatusApproved
|
|
||||||
..name = localization.approved,
|
|
||||||
),
|
|
||||||
InvoiceStatusEntity().rebuild(
|
|
||||||
(b) => b
|
|
||||||
..id = kQuoteStatusExpired
|
|
||||||
..name = localization.expired,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
onCheckboxPressed: () {
|
onCheckboxPressed: () {
|
||||||
if (store.state.quoteListState.isInMultiselect()) {
|
if (store.state.quoteListState.isInMultiselect()) {
|
||||||
store.dispatch(ClearQuoteMultiselect());
|
store.dispatch(ClearQuoteMultiselect());
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,9 @@ class RecurringExpenseScreen extends StatelessWidget {
|
||||||
onFilterChanged: (value) {
|
onFilterChanged: (value) {
|
||||||
store.dispatch(FilterRecurringExpenses(value));
|
store.dispatch(FilterRecurringExpenses(value));
|
||||||
},
|
},
|
||||||
|
onSelectedState: (EntityState state, value) {
|
||||||
|
store.dispatch(FilterRecurringExpensesByState(state));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onCheckboxPressed: () {
|
onCheckboxPressed: () {
|
||||||
if (store.state.recurringExpenseListState.isInMultiselect()) {
|
if (store.state.recurringExpenseListState.isInMultiselect()) {
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,34 @@ class RecurringInvoiceScreen extends StatelessWidget {
|
||||||
final userCompany = state.userCompany;
|
final userCompany = state.userCompany;
|
||||||
final localization = AppLocalization.of(context);
|
final localization = AppLocalization.of(context);
|
||||||
|
|
||||||
|
final statuses = [
|
||||||
|
InvoiceStatusEntity().rebuild(
|
||||||
|
(b) => b
|
||||||
|
..id = kRecurringInvoiceStatusDraft
|
||||||
|
..name = localization.draft,
|
||||||
|
),
|
||||||
|
InvoiceStatusEntity().rebuild(
|
||||||
|
(b) => b
|
||||||
|
..id = kRecurringInvoiceStatusPending
|
||||||
|
..name = localization.pending,
|
||||||
|
),
|
||||||
|
InvoiceStatusEntity().rebuild(
|
||||||
|
(b) => b
|
||||||
|
..id = kRecurringInvoiceStatusActive
|
||||||
|
..name = localization.active,
|
||||||
|
),
|
||||||
|
InvoiceStatusEntity().rebuild(
|
||||||
|
(b) => b
|
||||||
|
..id = kRecurringInvoiceStatusPaused
|
||||||
|
..name = localization.paused,
|
||||||
|
),
|
||||||
|
InvoiceStatusEntity().rebuild(
|
||||||
|
(b) => b
|
||||||
|
..id = kRecurringInvoiceStatusCompleted
|
||||||
|
..name = localization.completed,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
return ListScaffold(
|
return ListScaffold(
|
||||||
entityType: EntityType.recurringInvoice,
|
entityType: EntityType.recurringInvoice,
|
||||||
onHamburgerLongPress: () =>
|
onHamburgerLongPress: () =>
|
||||||
|
|
@ -50,6 +78,13 @@ class RecurringInvoiceScreen extends StatelessWidget {
|
||||||
onFilterChanged: (value) {
|
onFilterChanged: (value) {
|
||||||
store.dispatch(FilterRecurringInvoices(value));
|
store.dispatch(FilterRecurringInvoices(value));
|
||||||
},
|
},
|
||||||
|
onSelectedStatus: (EntityStatus status, value) {
|
||||||
|
store.dispatch(FilterRecurringInvoicesByStatus(status));
|
||||||
|
},
|
||||||
|
onSelectedState: (EntityState state, value) {
|
||||||
|
store.dispatch(FilterRecurringInvoicesByState(state));
|
||||||
|
},
|
||||||
|
statuses: statuses,
|
||||||
),
|
),
|
||||||
onCheckboxPressed: () {
|
onCheckboxPressed: () {
|
||||||
if (store.state.recurringInvoiceListState.isInMultiselect()) {
|
if (store.state.recurringInvoiceListState.isInMultiselect()) {
|
||||||
|
|
@ -85,33 +120,7 @@ class RecurringInvoiceScreen extends StatelessWidget {
|
||||||
store.dispatch(StartRecurringInvoiceMultiselect());
|
store.dispatch(StartRecurringInvoiceMultiselect());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
statuses: [
|
statuses: statuses,
|
||||||
InvoiceStatusEntity().rebuild(
|
|
||||||
(b) => b
|
|
||||||
..id = kRecurringInvoiceStatusDraft
|
|
||||||
..name = localization.draft,
|
|
||||||
),
|
|
||||||
InvoiceStatusEntity().rebuild(
|
|
||||||
(b) => b
|
|
||||||
..id = kRecurringInvoiceStatusPending
|
|
||||||
..name = localization.pending,
|
|
||||||
),
|
|
||||||
InvoiceStatusEntity().rebuild(
|
|
||||||
(b) => b
|
|
||||||
..id = kRecurringInvoiceStatusActive
|
|
||||||
..name = localization.active,
|
|
||||||
),
|
|
||||||
InvoiceStatusEntity().rebuild(
|
|
||||||
(b) => b
|
|
||||||
..id = kRecurringInvoiceStatusPaused
|
|
||||||
..name = localization.paused,
|
|
||||||
),
|
|
||||||
InvoiceStatusEntity().rebuild(
|
|
||||||
(b) => b
|
|
||||||
..id = kRecurringInvoiceStatusCompleted
|
|
||||||
..name = localization.completed,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
customValues1: company.getCustomFieldValues(CustomFieldType.invoice1,
|
customValues1: company.getCustomFieldValues(CustomFieldType.invoice1,
|
||||||
excludeBlank: true),
|
excludeBlank: true),
|
||||||
customValues2: company.getCustomFieldValues(CustomFieldType.invoice2,
|
customValues2: company.getCustomFieldValues(CustomFieldType.invoice2,
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,9 @@ class SubscriptionScreen extends StatelessWidget {
|
||||||
onFilterChanged: (value) {
|
onFilterChanged: (value) {
|
||||||
store.dispatch(FilterSubscriptions(value));
|
store.dispatch(FilterSubscriptions(value));
|
||||||
},
|
},
|
||||||
|
onSelectedState: (EntityState state, value) {
|
||||||
|
store.dispatch(FilterSubscriptionsByState(state));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onCheckboxPressed: () {
|
onCheckboxPressed: () {
|
||||||
if (store.state.subscriptionListState.isInMultiselect()) {
|
if (store.state.subscriptionListState.isInMultiselect()) {
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,18 @@ class TaskScreen extends StatelessWidget {
|
||||||
final company = store.state.company;
|
final company = store.state.company;
|
||||||
final userCompany = store.state.userCompany;
|
final userCompany = store.state.userCompany;
|
||||||
final localization = AppLocalization.of(context);
|
final localization = AppLocalization.of(context);
|
||||||
|
final statuses = [
|
||||||
|
if (!state.prefState.showKanban)
|
||||||
|
TaskStatusEntity().rebuild((b) => b
|
||||||
|
..id = kTaskStatusInvoiced
|
||||||
|
..name = localization.invoiced),
|
||||||
|
TaskStatusEntity().rebuild((b) => b
|
||||||
|
..id = kTaskStatusLogged
|
||||||
|
..name = localization.logged),
|
||||||
|
TaskStatusEntity().rebuild((b) => b
|
||||||
|
..id = kTaskStatusRunning
|
||||||
|
..name = localization.running),
|
||||||
|
];
|
||||||
|
|
||||||
return ListScaffold(
|
return ListScaffold(
|
||||||
entityType: EntityType.task,
|
entityType: EntityType.task,
|
||||||
|
|
@ -52,6 +64,13 @@ class TaskScreen extends StatelessWidget {
|
||||||
onFilterChanged: (value) {
|
onFilterChanged: (value) {
|
||||||
store.dispatch(FilterTasks(value));
|
store.dispatch(FilterTasks(value));
|
||||||
},
|
},
|
||||||
|
statuses: statuses,
|
||||||
|
onSelectedState: (EntityState state, value) {
|
||||||
|
store.dispatch(FilterTasksByState(state));
|
||||||
|
},
|
||||||
|
onSelectedStatus: (EntityStatus status, value) {
|
||||||
|
store.dispatch(FilterTasksByStatus(status));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onCheckboxPressed: () {
|
onCheckboxPressed: () {
|
||||||
if (store.state.taskListState.isInMultiselect()) {
|
if (store.state.taskListState.isInMultiselect()) {
|
||||||
|
|
@ -120,18 +139,7 @@ class TaskScreen extends StatelessWidget {
|
||||||
TaskFields.duration,
|
TaskFields.duration,
|
||||||
TaskFields.updatedAt,
|
TaskFields.updatedAt,
|
||||||
],
|
],
|
||||||
statuses: [
|
statuses: statuses,
|
||||||
if (!state.prefState.showKanban)
|
|
||||||
TaskStatusEntity().rebuild((b) => b
|
|
||||||
..id = kTaskStatusInvoiced
|
|
||||||
..name = localization.invoiced),
|
|
||||||
TaskStatusEntity().rebuild((b) => b
|
|
||||||
..id = kTaskStatusLogged
|
|
||||||
..name = localization.logged),
|
|
||||||
TaskStatusEntity().rebuild((b) => b
|
|
||||||
..id = kTaskStatusRunning
|
|
||||||
..name = localization.running),
|
|
||||||
],
|
|
||||||
onSelectedState: (EntityState state, value) {
|
onSelectedState: (EntityState state, value) {
|
||||||
store.dispatch(FilterTasksByState(state));
|
store.dispatch(FilterTasksByState(state));
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,9 @@ class TaskStatusScreen extends StatelessWidget {
|
||||||
onFilterChanged: (value) {
|
onFilterChanged: (value) {
|
||||||
store.dispatch(FilterTaskStatuses(value));
|
store.dispatch(FilterTaskStatuses(value));
|
||||||
},
|
},
|
||||||
|
onSelectedState: (EntityState state, value) {
|
||||||
|
store.dispatch(FilterTaskStatusesByState(state));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onCheckboxPressed: () {
|
onCheckboxPressed: () {
|
||||||
if (store.state.taskStatusListState.isInMultiselect()) {
|
if (store.state.taskStatusListState.isInMultiselect()) {
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,9 @@ class TaxRateSettingsScreen extends StatelessWidget {
|
||||||
onFilterChanged: (value) {
|
onFilterChanged: (value) {
|
||||||
store.dispatch(FilterTaxRates(value));
|
store.dispatch(FilterTaxRates(value));
|
||||||
},
|
},
|
||||||
|
onSelectedState: (EntityState state, value) {
|
||||||
|
store.dispatch(FilterTaxRatesByState(state));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onCheckboxPressed: () {
|
onCheckboxPressed: () {
|
||||||
if (store.state.taxRateListState.isInMultiselect()) {
|
if (store.state.taxRateListState.isInMultiselect()) {
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,9 @@ class TokenScreen extends StatelessWidget {
|
||||||
onFilterChanged: (value) {
|
onFilterChanged: (value) {
|
||||||
store.dispatch(FilterTokens(value));
|
store.dispatch(FilterTokens(value));
|
||||||
},
|
},
|
||||||
|
onSelectedState: (EntityState state, value) {
|
||||||
|
store.dispatch(FilterTokensByState(state));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onCheckboxPressed: () {
|
onCheckboxPressed: () {
|
||||||
if (store.state.tokenListState.isInMultiselect()) {
|
if (store.state.tokenListState.isInMultiselect()) {
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,9 @@ class UserScreen extends StatelessWidget {
|
||||||
onFilterChanged: (value) {
|
onFilterChanged: (value) {
|
||||||
store.dispatch(FilterUsers(value));
|
store.dispatch(FilterUsers(value));
|
||||||
},
|
},
|
||||||
|
onSelectedState: (EntityState state, value) {
|
||||||
|
store.dispatch(FilterUsersByState(state));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onCheckboxPressed: () {
|
onCheckboxPressed: () {
|
||||||
if (store.state.userListState.isInMultiselect()) {
|
if (store.state.userListState.isInMultiselect()) {
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,9 @@ class VendorScreen extends StatelessWidget {
|
||||||
onFilterChanged: (value) {
|
onFilterChanged: (value) {
|
||||||
store.dispatch(FilterVendors(value));
|
store.dispatch(FilterVendors(value));
|
||||||
},
|
},
|
||||||
|
onSelectedState: (EntityState state, value) {
|
||||||
|
store.dispatch(FilterVendorsByState(state));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onCheckboxPressed: () {
|
onCheckboxPressed: () {
|
||||||
if (store.state.vendorListState.isInMultiselect()) {
|
if (store.state.vendorListState.isInMultiselect()) {
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,9 @@ class WebhookScreen extends StatelessWidget {
|
||||||
onFilterChanged: (value) {
|
onFilterChanged: (value) {
|
||||||
store.dispatch(FilterWebhooks(value));
|
store.dispatch(FilterWebhooks(value));
|
||||||
},
|
},
|
||||||
|
onSelectedState: (EntityState state, value) {
|
||||||
|
store.dispatch(FilterWebhooksByState(state));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onCheckboxPressed: () {
|
onCheckboxPressed: () {
|
||||||
if (store.state.webhookListState.isInMultiselect()) {
|
if (store.state.webhookListState.isInMultiselect()) {
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,9 @@ class StubScreen extends StatelessWidget {
|
||||||
onFilterChanged: (value) {
|
onFilterChanged: (value) {
|
||||||
store.dispatch(FilterStubs(value));
|
store.dispatch(FilterStubs(value));
|
||||||
},
|
},
|
||||||
|
onSelectedState: (EntityState state, value) {
|
||||||
|
store.dispatch(FilterStubsByState(state));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onCheckboxPressed: () {
|
onCheckboxPressed: () {
|
||||||
if (store.state.stubListState.isInMultiselect()) {
|
if (store.state.stubListState.isInMultiselect()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue