An (almost) fully fledged mobile paperless client.
@@ -42,26 +42,25 @@
## Important Notice
-This project is under **very active** development. Breaking changes are expected and therefore a clean install is recommended for each update! The newest version (2.2.0+28, available in Open Beta on Google Play) is **not** yet compatible with Paperless-ngx 1.14.0 and later!
+This project is under **very active** development. Breaking changes are expected and therefore a clean install is recommended for each update!
## About The Project
-With this app you can conveniently add, manage or simply find documents stored in your paperless server without any comproimises. This project started as a small fun side project to learn more about the Flutter framework and because existing solutions didn't fulfill my needs, but it has grown much faster with far more features than I originally anticipated.
+Paperless Mobile brings paperless-ngx to your smartphone without any compromises. While you can use paperless-ngx from a mobile browser, managing your documents this way is often a tedious and slow process. The app integrates a custom scanner, biometric authentication and many more conveniences to help you make the transition from a paper-based to a fully digital office experience.
-
-### :rocket: Features
-:heavy_check_mark: **View** your documents at a glance, in a compact list or a more detailed grid view
-:heavy_check_mark: **Add**, **delete** or **edit** your documents
-:heavy_check_mark: **Share**, **download** and **preview** PDF files
-:heavy_check_mark: **Manage** and assign correspondents, document types, tags and storage paths
-:heavy_check_mark: **Scan** and upload documents to paperless with preset correspondent, document type, tags and creation date
+### :rocket: Highlights
+:heavy_check_mark: **View** your documents at a glance
+:heavy_check_mark: **Add**, **delete** or **edit** documents
+:heavy_check_mark: **Share**, **download** and **preview** files
+:heavy_check_mark: **Manage** and assign labels
+:heavy_check_mark: **Scan** and upload documents to paperless
:heavy_check_mark: **Upload existing documents** from other apps via Paperless Mobile
-:heavy_check_mark: See all new documents in a dedicated **inbox**
+:heavy_check_mark: Easily process and manage new documents in the dedicated **inbox**
:heavy_check_mark: **Search** for documents using a wide range of filter criteria
-:heavy_check_mark: **Secure** your data with **biometric authentication** across sessions
+:heavy_check_mark: **Secure** your data with a **biometric factor**
:heavy_check_mark: Support for **TLS mutual authentication** (client certificates)
:heavy_check_mark: **Modern, intuitive UI** built according to the Material Design 3 specification
-:heavy_check_mark: Available in english and german language (more to come!)
+:heavy_check_mark: Available in English, German, Polish, French, Catalan, Czech and Turkish language with more to come
### Built With
@@ -70,13 +69,12 @@ With this app you can conveniently add, manage or simply find documents stored i
## Getting Started
-
To get a local copy up and running follow these simple steps.
### Prerequisites
* Install an IDE of your choice (e.g. VSCode with the Dart/Flutter extensions)
* Install the flutter SDK (https://docs.flutter.dev/get-started/install) _or_ use the flutter git submodule pinned in this project by running `git submodule update --init` inside the project root directory.
-*
+
### Install dependencies and generate files
1. First, clone the repository:
```sh
@@ -150,16 +148,19 @@ flutter install --use-application-binary=build/pp/outputs/flutter-apk/astubenbord
-- Czech language by svetlemodry
-- Turkish language by imsakg
+- German and English language translated by astubenbord
+- Czech language translated by svetlemodry
+- Turkish language translated by imsakg
+- Polish language translated by losiu97
+- French language translated by JigSawFr, SpicyWasab and nathanaelhoun
+- Catalan language translated by rubenix
## Roadmap
- [ ] Fully custom document scanner optimized for common white A4 documents and optimized for the use with Paperless
- [ ] Add more languages
-- [ ] Support for IOS and publish to AppStore
-- [ ] Automatic releases and CI/CD with fastlane
+- [x] Support for IOS and publish to AppStore
+- [x] Automatic releases and CI/CD with fastlane
- [ ] Templates for recurring scans (e.g. monthly payrolls with same title, dates at end of month, fixed correspondent and document type)
See the [open issues](https://github.com/astubenbord/paperless-mobile/issues) for a full list of issues and [open feature requests](https://github.com/astubenbord/paperless-mobile/discussions/categories/feature-requests) for requested features.
@@ -174,7 +175,7 @@ Don't forget to give the project a star! Thanks again!
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
-3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
+3. Commit your Changes (`git commit -m 'feat: Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
@@ -183,7 +184,7 @@ Don't forget to give the project a star! Thanks again!
Distributed under the GNU General Public License v3.0. See `LICENSE.txt` for more information.
## Donations
-I do this in my free time, so if you like the project, consider buying me a coffee! Any donation is much appreciated :)
+I do this in my free time, so if you like the project, consider buying me a coffee! Any donation is much appreciated :^)
[](https://www.buymeacoffee.com/astubenbord)
@@ -214,4 +215,6 @@ Made with [contrib.rocks](https://contrib.rocks).
## Troubleshooting
#### Suggestions are not selectable in any of the label form fields
-This is a known issue and it has to do with accessibility features of Android. Password managers such as Bitwarden often caused this issue. Luckily, this can be resolved by turning off the accessibility features in these apps. This could also be observed with apps that are allowed to display over other apps, such as emulations of the dynamic island on android.
\ No newline at end of file
+This is a known issue and it has to do with accessibility features of Android. Password managers such as Bitwarden often caused this issue. Luckily, this can be resolved by turning off the accessibility features in these apps. This could also be observed with apps that are allowed to display over other apps, such as emulations of the dynamic island on android.
+## I cannot log in since the update to paperless-ngx 1.14.0 (and above).
+The app has to somehow get information about it's user from the paperless API. Therefore, the `Users -> View` and the `UISettings -> View` permissions are required for each user trying to log into the app. Otherwise, the app has no way of obtaining your user id and other information required for the usage of most features.
\ No newline at end of file
diff --git a/lib/features/documents/view/pages/documents_page.dart b/lib/features/documents/view/pages/documents_page.dart
index 18ed339..0673ae6 100644
--- a/lib/features/documents/view/pages/documents_page.dart
+++ b/lib/features/documents/view/pages/documents_page.dart
@@ -22,7 +22,6 @@ import 'package:paperless_mobile/features/saved_view/view/saved_view_list.dart';
import 'package:paperless_mobile/features/tasks/cubit/task_status_cubit.dart';
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
import 'package:paperless_mobile/helpers/message_helpers.dart';
-import 'package:sliver_tools/sliver_tools.dart';
class DocumentFilterIntent {
final DocumentFilter? filter;
@@ -34,7 +33,6 @@ class DocumentFilterIntent {
});
}
-//TODO: Refactor this
class DocumentsPage extends StatefulWidget {
const DocumentsPage({Key? key}) : super(key: key);
@@ -120,30 +118,60 @@ class _DocumentsPageState extends State
builder: (context, state) {
final appliedFiltersCount = state.filter.appliedFiltersCount;
final show = state.selection.isEmpty;
+ final canReset = state.filter.appliedFiltersCount > 0;
return AnimatedScale(
scale: show ? 1 : 0,
duration: const Duration(milliseconds: 200),
curve: Curves.easeIn,
- child: b.Badge(
- position: b.BadgePosition.topEnd(top: -12, end: -6),
- showBadge: appliedFiltersCount > 0,
- badgeContent: Text(
- '$appliedFiltersCount',
- style: const TextStyle(
- color: Colors.white,
- ),
- ),
- animationType: b.BadgeAnimationType.fade,
- badgeColor: Colors.red,
- child: _currentTab == 0
- ? FloatingActionButton(
- child: const Icon(Icons.filter_alt_outlined),
- onPressed: _openDocumentFilter,
- )
- : FloatingActionButton(
- child: const Icon(Icons.add),
- onPressed: () => _onCreateSavedView(state.filter),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.end,
+ children: [
+ if (canReset)
+ Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: FloatingActionButton.small(
+ key: UniqueKey(),
+ backgroundColor: Theme.of(context)
+ .colorScheme
+ .onPrimaryContainer,
+ onPressed: () {
+ context.read().updateFilter();
+ },
+ child: Icon(
+ Icons.refresh,
+ color: Theme.of(context)
+ .colorScheme
+ .primaryContainer,
+ ),
),
+ ),
+ b.Badge(
+ position: b.BadgePosition.topEnd(top: -12, end: -6),
+ showBadge: appliedFiltersCount > 0,
+ badgeContent: Text(
+ '$appliedFiltersCount',
+ style: const TextStyle(
+ color: Colors.white,
+ ),
+ ),
+ animationType: b.BadgeAnimationType.fade,
+ badgeColor: Colors.red,
+ child: AnimatedSwitcher(
+ duration: const Duration(milliseconds: 250),
+ child: (_currentTab == 0)
+ ? FloatingActionButton(
+ child:
+ const Icon(Icons.filter_alt_outlined),
+ onPressed: _openDocumentFilter,
+ )
+ : FloatingActionButton(
+ child: const Icon(Icons.add),
+ onPressed: () =>
+ _onCreateSavedView(state.filter),
+ ),
+ ),
+ ),
+ ],
),
);
},
diff --git a/lib/features/documents/view/widgets/adaptive_documents_view.dart b/lib/features/documents/view/widgets/adaptive_documents_view.dart
index 47f9110..4c861e8 100644
--- a/lib/features/documents/view/widgets/adaptive_documents_view.dart
+++ b/lib/features/documents/view/widgets/adaptive_documents_view.dart
@@ -159,7 +159,7 @@ class SliverAdaptiveDocumentsView extends AdaptiveDocumentsView {
crossAxisCount: 2,
mainAxisSpacing: 4,
crossAxisSpacing: 4,
- childAspectRatio: 1 / 2,
+ mainAxisExtent: 356,
),
itemCount: documents.length,
itemBuilder: (context, index) {
diff --git a/lib/features/documents/view/widgets/items/document_detailed_item.dart b/lib/features/documents/view/widgets/items/document_detailed_item.dart
index 70c211c..3f214ae 100644
--- a/lib/features/documents/view/widgets/items/document_detailed_item.dart
+++ b/lib/features/documents/view/widgets/items/document_detailed_item.dart
@@ -141,10 +141,10 @@ class DocumentDetailedItem extends DocumentItem {
],
).paddedLTRB(8, 0, 8, 4),
TagsWidget(
- isMultiLine: false,
tags: document.tags
.map((e) => context.watch().state.tags[e]!)
.toList(),
+ onTagSelected: onTagSelected,
).padded(),
if (highlights != null)
Html(
diff --git a/lib/features/documents/view/widgets/items/document_grid_item.dart b/lib/features/documents/view/widgets/items/document_grid_item.dart
index 4f5c549..9333610 100644
--- a/lib/features/documents/view/widgets/items/document_grid_item.dart
+++ b/lib/features/documents/view/widgets/items/document_grid_item.dart
@@ -1,11 +1,11 @@
import 'package:flutter/material.dart';
+import 'package:intl/intl.dart';
import 'package:paperless_mobile/core/repository/label_repository.dart';
import 'package:paperless_mobile/features/documents/view/widgets/document_preview.dart';
import 'package:paperless_mobile/features/documents/view/widgets/items/document_item.dart';
import 'package:paperless_mobile/features/labels/correspondent/view/widgets/correspondent_widget.dart';
import 'package:paperless_mobile/features/labels/document_type/view/widgets/document_type_widget.dart';
import 'package:paperless_mobile/features/labels/tags/view/widgets/tags_widget.dart';
-import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
class DocumentGridItem extends DocumentItem {
@@ -42,10 +42,46 @@ class DocumentGridItem extends DocumentItem {
children: [
AspectRatio(
aspectRatio: 1,
- child: DocumentPreview(
- document: document,
- borderRadius: 12.0,
- enableHero: enableHeroAnimation,
+ child: Stack(
+ children: [
+ Positioned.fill(
+ child: DocumentPreview(
+ document: document,
+ borderRadius: 12.0,
+ enableHero: enableHeroAnimation,
+ ),
+ ),
+ Align(
+ alignment: Alignment.bottomLeft,
+ child: SizedBox(
+ height: 48,
+ child: NotificationListener(
+ // Prevents ancestor notification listeners to be notified when this widget scrolls
+ onNotification: (notification) => true,
+ child: CustomScrollView(
+ scrollDirection: Axis.horizontal,
+ slivers: [
+ const SliverToBoxAdapter(
+ child: SizedBox(width: 8),
+ ),
+ TagsWidget.sliver(
+ tags: document.tags
+ .map((e) => context
+ .watch()
+ .state
+ .tags[e]!)
+ .toList(),
+ onTagSelected: onTagSelected,
+ ),
+ const SliverToBoxAdapter(
+ child: SizedBox(width: 8),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ ],
),
),
Expanded(
@@ -59,27 +95,23 @@ class DocumentGridItem extends DocumentItem {
.watch()
.state
.correspondents[document.correspondent],
+ onSelected: onCorrespondentSelected,
),
DocumentTypeWidget(
documentType: context
.watch()
.state
.documentTypes[document.documentType],
+ onSelected: onDocumentTypeSelected,
),
- Text(
- document.title,
- maxLines: document.tags.isEmpty ? 3 : 2,
- overflow: TextOverflow.ellipsis,
- style: Theme.of(context).textTheme.titleMedium,
- ),
- const Spacer(),
- TagsWidget(
- tags: document.tags
- .map((e) =>
- context.watch().state.tags[e]!)
- .toList(),
- isMultiLine: false,
- onTagSelected: onTagSelected,
+ Padding(
+ padding: const EdgeInsets.only(bottom: 8.0),
+ child: Text(
+ document.title,
+ maxLines: 3,
+ overflow: TextOverflow.ellipsis,
+ style: Theme.of(context).textTheme.titleMedium,
+ ),
),
const Spacer(),
Text(
diff --git a/lib/features/documents/view/widgets/items/document_list_item.dart b/lib/features/documents/view/widgets/items/document_list_item.dart
index e187b14..1736eaf 100644
--- a/lib/features/documents/view/widgets/items/document_list_item.dart
+++ b/lib/features/documents/view/widgets/items/document_list_item.dart
@@ -68,7 +68,6 @@ class DocumentListItem extends DocumentItem {
.where((e) => labels.tags.containsKey(e))
.map((e) => labels.tags[e]!)
.toList(),
- isMultiLine: false,
onTagSelected: (id) => onTagSelected?.call(id),
),
),
diff --git a/lib/features/inbox/view/widgets/inbox_item.dart b/lib/features/inbox/view/widgets/inbox_item.dart
index e4faac2..a538b41 100644
--- a/lib/features/inbox/view/widgets/inbox_item.dart
+++ b/lib/features/inbox/view/widgets/inbox_item.dart
@@ -213,13 +213,11 @@ class _InboxItemState extends State {
TagsWidget(
tags: widget.document.tags
.map((e) => state.labels.tags[e])
- .whereNot((element) => element == null)
+ .whereNot((e) => e == null)
.toList()
.cast(),
- isMultiLine: false,
isClickable: false,
showShortNames: true,
- dense: true,
).paddedOnly(left: 8, bottom: 8),
],
),
diff --git a/lib/features/labels/tags/view/widgets/tags_widget.dart b/lib/features/labels/tags/view/widgets/tags_widget.dart
index 609b59b..1711b64 100644
--- a/lib/features/labels/tags/view/widgets/tags_widget.dart
+++ b/lib/features/labels/tags/view/widgets/tags_widget.dart
@@ -4,51 +4,95 @@ import 'package:paperless_mobile/features/labels/tags/view/widgets/tag_widget.da
class TagsWidget extends StatelessWidget {
final List tags;
- final bool isMultiLine;
final void Function(int tagId)? onTagSelected;
final bool isClickable;
final bool showShortNames;
final bool dense;
const TagsWidget({
- Key? key,
+ super.key,
required this.tags,
- this.isMultiLine = true,
- this.isClickable = true,
this.onTagSelected,
+ this.isClickable = true,
this.showShortNames = false,
this.dense = true,
- }) : super(key: key);
+ });
+
+ List get _children {
+ return [
+ for (var tag in tags)
+ TagWidget(
+ tag: tag,
+ isClickable: isClickable,
+ onSelected: () => onTagSelected?.call(tag.id!),
+ showShortName: showShortNames,
+ dense: dense,
+ )
+ ];
+ }
+
+ const factory TagsWidget.multiLine({
+ Key? key,
+ required List tags,
+ required void Function(int tagId)? onTagSelected,
+ required bool isClickable,
+ required bool showShortNames,
+ required bool dense,
+ }) = _MultiLineTagsWidget;
+
+ const factory TagsWidget.sliver({
+ Key? key,
+ required List tags,
+ void Function(int tagId)? onTagSelected,
+ bool isClickable,
+ bool showShortNames,
+ bool dense,
+ }) = _SliverTagsWidget;
@override
Widget build(BuildContext context) {
- return Builder(
- builder: (context) {
- final children = tags
- .map(
- (tag) => TagWidget(
- tag: tag,
- isClickable: isClickable,
- onSelected: () => onTagSelected?.call(tag.id!),
- showShortName: showShortNames,
- dense: dense,
- ),
- )
- .toList();
- if (isMultiLine) {
- return Wrap(
- runAlignment: WrapAlignment.start,
- children: children,
- runSpacing: 4,
- spacing: 4,
- );
- } else {
- return SingleChildScrollView(
- scrollDirection: Axis.horizontal,
- child: Row(children: children),
- );
- }
- },
+ return SingleChildScrollView(
+ scrollDirection: Axis.horizontal,
+ child: Row(children: _children),
+ );
+ }
+}
+
+class _MultiLineTagsWidget extends TagsWidget {
+ const _MultiLineTagsWidget({
+ super.key,
+ required super.tags,
+ super.onTagSelected,
+ super.isClickable,
+ super.showShortNames,
+ super.dense,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ return Wrap(
+ runAlignment: WrapAlignment.start,
+ children: _children,
+ runSpacing: 4,
+ spacing: 4,
+ );
+ }
+}
+
+class _SliverTagsWidget extends TagsWidget {
+ const _SliverTagsWidget({
+ super.key,
+ required super.tags,
+ super.isClickable,
+ super.showShortNames,
+ super.dense,
+ super.onTagSelected,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ return SliverList.list(
+ children: _children,
);
}
}
diff --git a/lib/features/login/view/login_page.dart b/lib/features/login/view/login_page.dart
index 969ab34..cb8abe3 100644
--- a/lib/features/login/view/login_page.dart
+++ b/lib/features/login/view/login_page.dart
@@ -126,6 +126,7 @@ class _LoginPageState extends State {
}
Future _login() async {
+
FocusScope.of(context).unfocus();
if (_formKey.currentState?.saveAndValidate() ?? false) {
final form = _formKey.currentState!.value;
diff --git a/lib/features/login/view/widgets/form_fields/obscured_input_text_form_field.dart b/lib/features/login/view/widgets/form_fields/obscured_input_text_form_field.dart
index 26d57a2..2db3b0f 100644
--- a/lib/features/login/view/widgets/form_fields/obscured_input_text_form_field.dart
+++ b/lib/features/login/view/widgets/form_fields/obscured_input_text_form_field.dart
@@ -6,6 +6,9 @@ class ObscuredInputTextFormField extends StatefulWidget {
final void Function(String?) onChanged;
final FormFieldValidator? validator;
final bool enabled;
+ final FocusNode? focusNode;
+
+ final ValueChanged? onFieldSubmitted;
const ObscuredInputTextFormField({
super.key,
@@ -14,6 +17,8 @@ class ObscuredInputTextFormField extends StatefulWidget {
this.validator,
this.initialValue,
this.enabled = true,
+ this.focusNode,
+ this.onFieldSubmitted,
});
@override
@@ -24,7 +29,13 @@ class ObscuredInputTextFormField extends StatefulWidget {
class _ObscuredInputTextFormFieldState
extends State {
bool _showPassword = false;
- final FocusNode _passwordFocusNode = FocusNode();
+ late final FocusNode _passwordFocusNode;
+
+ @override
+ void initState() {
+ super.initState();
+ _passwordFocusNode = widget.focusNode ?? FocusNode();
+ }
@override
void dispose() {
@@ -37,6 +48,7 @@ class _ObscuredInputTextFormFieldState
return TextFormField(
enabled: widget.enabled,
autovalidateMode: AutovalidateMode.onUserInteraction,
+ onFieldSubmitted: widget.onFieldSubmitted,
validator: widget.validator,
initialValue: widget.initialValue,
focusNode: _passwordFocusNode,
diff --git a/lib/features/login/view/widgets/form_fields/user_credentials_form_field.dart b/lib/features/login/view/widgets/form_fields/user_credentials_form_field.dart
index 4f89ef2..deb24c1 100644
--- a/lib/features/login/view/widgets/form_fields/user_credentials_form_field.dart
+++ b/lib/features/login/view/widgets/form_fields/user_credentials_form_field.dart
@@ -9,8 +9,11 @@ import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
class UserCredentialsFormField extends StatefulWidget {
static const fkCredentials = 'credentials';
+ final void Function() onFieldsSubmitted;
+
const UserCredentialsFormField({
Key? key,
+ required this.onFieldsSubmitted,
}) : super(key: key);
@override
@@ -19,6 +22,9 @@ class UserCredentialsFormField extends StatefulWidget {
}
class _UserCredentialsFormFieldState extends State {
+ final _usernameFocusNode = FocusNode();
+ final _passwordFocusNode = FocusNode();
+
@override
Widget build(BuildContext context) {
return FormBuilderField(
@@ -28,9 +34,13 @@ class _UserCredentialsFormFieldState extends State {
children: [
TextFormField(
key: const ValueKey('login-username'),
- textCapitalization: TextCapitalization.words,
+ focusNode: _usernameFocusNode,
+ textCapitalization: TextCapitalization.none,
+ textInputAction: TextInputAction.next,
+ onFieldSubmitted: (value) {
+ _passwordFocusNode.requestFocus();
+ },
autovalidateMode: AutovalidateMode.onUserInteraction,
- // USERNAME
autocorrect: false,
onChanged: (username) => field.didChange(
field.value?.copyWith(username: username) ??
@@ -49,11 +59,15 @@ class _UserCredentialsFormFieldState extends State {
),
ObscuredInputTextFormField(
key: const ValueKey('login-password'),
+ focusNode: _passwordFocusNode,
label: S.of(context)!.password,
onChanged: (password) => field.didChange(
field.value?.copyWith(password: password) ??
LoginFormCredentials(password: password),
),
+ onFieldSubmitted: (_) {
+ widget.onFieldsSubmitted();
+ },
validator: (value) {
if (value?.trim().isEmpty ?? true) {
return S.of(context)!.passwordMustNotBeEmpty;
diff --git a/lib/features/login/view/widgets/login_pages/server_login_page.dart b/lib/features/login/view/widgets/login_pages/server_login_page.dart
index 479bca7..df64d69 100644
--- a/lib/features/login/view/widgets/login_pages/server_login_page.dart
+++ b/lib/features/login/view/widgets/login_pages/server_login_page.dart
@@ -9,6 +9,7 @@ class ServerLoginPage extends StatefulWidget {
final String submitText;
final Future Function() onSubmit;
final GlobalKey formBuilderKey;
+
const ServerLoginPage({
super.key,
required this.onSubmit,
@@ -41,8 +42,21 @@ class _ServerLoginPageState extends State {
),
body: ListView(
children: [
- Text(S.of(context)!.signInToServer(serverAddress)).padded(),
- const UserCredentialsFormField(),
+ Text(
+ S.of(context)!.signInToServer(serverAddress) + ":",
+ style: Theme.of(context).textTheme.labelLarge,
+ ).padded(16),
+ UserCredentialsFormField(
+ onFieldsSubmitted: widget.onSubmit,
+ ),
+ Text(
+ S.of(context)!.loginRequiredPermissionsHint,
+ style: Theme.of(context).textTheme.bodySmall?.apply(
+ color: Theme.of(context)
+ .colorScheme
+ .onBackground
+ .withOpacity(0.6)),
+ ).padded(16),
],
),
bottomNavigationBar: BottomAppBar(
diff --git a/lib/l10n/intl_ca.arb b/lib/l10n/intl_ca.arb
index ced470a..d38de26 100644
--- a/lib/l10n/intl_ca.arb
+++ b/lib/l10n/intl_ca.arb
@@ -825,36 +825,40 @@
"description": "title of the alert dialog when exporting scans to pdf"
},
"allScansWillBeMerged": "Els escanejos s'uniran en un únic document PDF.",
- "behavior": "Behavior",
+ "behavior": "Comportament",
"@behavior": {
"description": "Title of the settings concerning app beahvior"
},
- "theme": "Theme",
+ "theme": "Tema",
"@theme": {
"description": "Title of the theme mode setting"
},
- "clearCache": "Clear cache",
+ "clearCache": "Esborra cache",
"@clearCache": {
"description": "Title of the clear cache setting"
},
- "freeBytes": "Free {bytes}",
+ "freeBytes": "Lliure {bytes}",
"@freeBytes": {
"description": "Text shown for clear storage settings"
},
- "calculatingDots": "Calculating...",
+ "calculatingDots": "Calculant...",
"@calculatingDots": {
"description": "Text shown when the byte size is still being calculated"
},
- "freedDiskSpace": "Successfully freed {bytes} of disk space.",
+ "freedDiskSpace": "Alliberats {bytes} d'espai de disc.",
"@freedDiskSpace": {
"description": "Message shown after clearing storage"
},
- "uploadScansAsPdf": "Upload scans as PDF",
+ "uploadScansAsPdf": "Puja escanejos com a PDF",
"@uploadScansAsPdf": {
"description": "Title of the setting which toggles whether scans are always uploaded as pdf"
},
- "convertSinglePageScanToPdf": "Always convert single page scans to PDF before uploading",
+ "convertSinglePageScanToPdf": "Coverteix únics escanejos a PDF abans de pujar",
"@convertSinglePageScanToPdf": {
"description": "description of the upload scans as pdf setting"
+ },
+ "loginRequiredPermissionsHint": "Using Paperless Mobile requires a minimum set of user permissions since paperless-ngx 1.14.0 and higher. Therefore, please make sure that the user to be logged in has the permission to view other users (User → View) and the settings (UISettings → View). If you do not have these permissions, please contact an administrator of your paperless-ngx server.",
+ "@loginRequiredPermissionsHint": {
+ "description": "Hint shown on the login page informing the user of the required permissions to use the app."
}
}
\ No newline at end of file
diff --git a/lib/l10n/intl_cs.arb b/lib/l10n/intl_cs.arb
index 90bd99f..394defd 100644
--- a/lib/l10n/intl_cs.arb
+++ b/lib/l10n/intl_cs.arb
@@ -856,5 +856,9 @@
"convertSinglePageScanToPdf": "Always convert single page scans to PDF before uploading",
"@convertSinglePageScanToPdf": {
"description": "description of the upload scans as pdf setting"
+ },
+ "loginRequiredPermissionsHint": "Using Paperless Mobile requires a minimum set of user permissions since paperless-ngx 1.14.0 and higher. Therefore, please make sure that the user to be logged in has the permission to view other users (User → View) and the settings (UISettings → View). If you do not have these permissions, please contact an administrator of your paperless-ngx server.",
+ "@loginRequiredPermissionsHint": {
+ "description": "Hint shown on the login page informing the user of the required permissions to use the app."
}
}
\ No newline at end of file
diff --git a/lib/l10n/intl_de.arb b/lib/l10n/intl_de.arb
index ebe7c53..68744b4 100644
--- a/lib/l10n/intl_de.arb
+++ b/lib/l10n/intl_de.arb
@@ -856,5 +856,9 @@
"convertSinglePageScanToPdf": "Einseitige Scans vor dem Hochladen immer in PDF umwandeln",
"@convertSinglePageScanToPdf": {
"description": "description of the upload scans as pdf setting"
+ },
+ "loginRequiredPermissionsHint": "Die Verwendung von Paperless Mobile erfordert seit paperless-ngx 1.14.0 und höher ein Mindestmaß an Benutzerberechtigungen. Stelle deshalb bitte sicher, dass der anzumeldende Benutzer die Berechtigung hat, andere Benutzer (User → View) und die Einstellungen (UISettings → View) einzusehen. Falls du nicht über diese Berechtigungen verfügst, wende dich bitte an einen Administrator deines paperless-ngx Servers.",
+ "@loginRequiredPermissionsHint": {
+ "description": "Hint shown on the login page informing the user of the required permissions to use the app."
}
}
\ No newline at end of file
diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb
index 58a2572..b9620ca 100644
--- a/lib/l10n/intl_en.arb
+++ b/lib/l10n/intl_en.arb
@@ -856,5 +856,9 @@
"convertSinglePageScanToPdf": "Always convert single page scans to PDF before uploading",
"@convertSinglePageScanToPdf": {
"description": "description of the upload scans as pdf setting"
+ },
+ "loginRequiredPermissionsHint": "Using Paperless Mobile requires a minimum set of user permissions since paperless-ngx 1.14.0 and higher. Therefore, please make sure that the user to be logged in has the permission to view other users (User → View) and the settings (UISettings → View). If you do not have these permissions, please contact an administrator of your paperless-ngx server.",
+ "@loginRequiredPermissionsHint": {
+ "description": "Hint shown on the login page informing the user of the required permissions to use the app."
}
}
\ No newline at end of file
diff --git a/lib/l10n/intl_fr.arb b/lib/l10n/intl_fr.arb
index c184164..403f810 100644
--- a/lib/l10n/intl_fr.arb
+++ b/lib/l10n/intl_fr.arb
@@ -856,5 +856,9 @@
"convertSinglePageScanToPdf": "Always convert single page scans to PDF before uploading",
"@convertSinglePageScanToPdf": {
"description": "description of the upload scans as pdf setting"
+ },
+ "loginRequiredPermissionsHint": "Using Paperless Mobile requires a minimum set of user permissions since paperless-ngx 1.14.0 and higher. Therefore, please make sure that the user to be logged in has the permission to view other users (User → View) and the settings (UISettings → View). If you do not have these permissions, please contact an administrator of your paperless-ngx server.",
+ "@loginRequiredPermissionsHint": {
+ "description": "Hint shown on the login page informing the user of the required permissions to use the app."
}
}
\ No newline at end of file
diff --git a/lib/l10n/intl_pl.arb b/lib/l10n/intl_pl.arb
index 5da20b2..db13285 100644
--- a/lib/l10n/intl_pl.arb
+++ b/lib/l10n/intl_pl.arb
@@ -856,5 +856,9 @@
"convertSinglePageScanToPdf": "Always convert single page scans to PDF before uploading",
"@convertSinglePageScanToPdf": {
"description": "description of the upload scans as pdf setting"
+ },
+ "loginRequiredPermissionsHint": "Using Paperless Mobile requires a minimum set of user permissions since paperless-ngx 1.14.0 and higher. Therefore, please make sure that the user to be logged in has the permission to view other users (User → View) and the settings (UISettings → View). If you do not have these permissions, please contact an administrator of your paperless-ngx server.",
+ "@loginRequiredPermissionsHint": {
+ "description": "Hint shown on the login page informing the user of the required permissions to use the app."
}
}
\ No newline at end of file
diff --git a/lib/l10n/intl_ru.arb b/lib/l10n/intl_ru.arb
index 071742e..2abc032 100644
--- a/lib/l10n/intl_ru.arb
+++ b/lib/l10n/intl_ru.arb
@@ -856,5 +856,9 @@
"convertSinglePageScanToPdf": "Always convert single page scans to PDF before uploading",
"@convertSinglePageScanToPdf": {
"description": "description of the upload scans as pdf setting"
+ },
+ "loginRequiredPermissionsHint": "Using Paperless Mobile requires a minimum set of user permissions since paperless-ngx 1.14.0 and higher. Therefore, please make sure that the user to be logged in has the permission to view other users (User → View) and the settings (UISettings → View). If you do not have these permissions, please contact an administrator of your paperless-ngx server.",
+ "@loginRequiredPermissionsHint": {
+ "description": "Hint shown on the login page informing the user of the required permissions to use the app."
}
}
\ No newline at end of file
diff --git a/lib/l10n/intl_tr.arb b/lib/l10n/intl_tr.arb
index 32c8108..183a5a1 100644
--- a/lib/l10n/intl_tr.arb
+++ b/lib/l10n/intl_tr.arb
@@ -856,5 +856,9 @@
"convertSinglePageScanToPdf": "Always convert single page scans to PDF before uploading",
"@convertSinglePageScanToPdf": {
"description": "description of the upload scans as pdf setting"
+ },
+ "loginRequiredPermissionsHint": "Using Paperless Mobile requires a minimum set of user permissions since paperless-ngx 1.14.0 and higher. Therefore, please make sure that the user to be logged in has the permission to view other users (User → View) and the settings (UISettings → View). If you do not have these permissions, please contact an administrator of your paperless-ngx server.",
+ "@loginRequiredPermissionsHint": {
+ "description": "Hint shown on the login page informing the user of the required permissions to use the app."
}
}
\ No newline at end of file
diff --git a/lib/main.dart b/lib/main.dart
index 81e395d..a9b131f 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -26,7 +26,6 @@ import 'package:paperless_mobile/core/database/tables/local_user_app_state.dart'
import 'package:paperless_mobile/core/exception/server_message_exception.dart';
import 'package:paperless_mobile/core/factory/paperless_api_factory.dart';
import 'package:paperless_mobile/core/factory/paperless_api_factory_impl.dart';
-import 'package:paperless_mobile/core/interceptor/dio_http_error_interceptor.dart';
import 'package:paperless_mobile/core/interceptor/language_header.interceptor.dart';
import 'package:paperless_mobile/core/notifier/document_changed_notifier.dart';
import 'package:paperless_mobile/core/security/session_manager.dart';
diff --git a/packages/paperless_api/lib/config/hive/hive_type_ids.dart b/packages/paperless_api/lib/config/hive/hive_type_ids.dart
index a931473..59b11b5 100644
--- a/packages/paperless_api/lib/config/hive/hive_type_ids.dart
+++ b/packages/paperless_api/lib/config/hive/hive_type_ids.dart
@@ -1,5 +1,6 @@
import 'package:hive/hive.dart';
import 'package:paperless_api/paperless_api.dart';
+import 'package:paperless_api/src/models/query_parameters/date_range_queries/date_range_unit.dart';
class PaperlessApiHiveTypeIds {
PaperlessApiHiveTypeIds._();
diff --git a/packages/paperless_api/lib/src/models/document_filter.dart b/packages/paperless_api/lib/src/models/document_filter.dart
index 6da3db9..ca2becd 100644
--- a/packages/paperless_api/lib/src/models/document_filter.dart
+++ b/packages/paperless_api/lib/src/models/document_filter.dart
@@ -3,6 +3,8 @@ import 'package:equatable/equatable.dart';
import 'package:hive/hive.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:paperless_api/paperless_api.dart';
+import 'package:paperless_api/src/models/query_parameters/date_range_queries/date_range_query.dart';
+import 'package:paperless_api/src/models/query_parameters/date_range_queries/date_range_query_field.dart';
part 'document_filter.g.dart';
@@ -187,16 +189,45 @@ class DocumentFilter extends Equatable {
}
int get appliedFiltersCount => [
- documentType != initial.documentType,
- correspondent != initial.correspondent,
- storagePath != initial.storagePath,
- tags != initial.tags,
- added != initial.added,
- created != initial.created,
- modified != initial.modified,
- asnQuery != initial.asnQuery,
- ((query.queryText ?? '') != (initial.query.queryText ?? '')),
- ].fold(0, (previousValue, element) => previousValue += element ? 1 : 0);
+ documentType.maybeWhen(
+ unset: () => 0,
+ orElse: () => 1,
+ ),
+ correspondent.maybeWhen(
+ unset: () => 0,
+ orElse: () => 1,
+ ),
+ storagePath.maybeWhen(
+ unset: () => 0,
+ orElse: () => 1,
+ ),
+ tags.maybeWhen(
+ ids: (include, exclude) => include.length + exclude.length,
+ anyAssigned: (tagIds) => tagIds.length,
+ notAssigned: () => 1,
+ orElse: () => 0,
+ ),
+ switch (added) {
+ RelativeDateRangeQuery() => 1,
+ AbsoluteDateRangeQuery() => 1,
+ UnsetDateRangeQuery() => 0,
+ },
+ switch (created) {
+ RelativeDateRangeQuery() => 1,
+ AbsoluteDateRangeQuery() => 1,
+ UnsetDateRangeQuery() => 0,
+ },
+ switch (modified) {
+ RelativeDateRangeQuery() => 1,
+ AbsoluteDateRangeQuery() => 1,
+ UnsetDateRangeQuery() => 0,
+ },
+ asnQuery.maybeWhen(
+ unset: () => 0,
+ orElse: () => 1,
+ ),
+ (query.queryText?.isNotEmpty ?? false) ? 1 : 0,
+ ].fold(0, (previousValue, element) => previousValue + element);
@override
List