mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 10:08:00 -06:00
feat: Allow empty document titles, fix saved view routes not being accessible
This commit is contained in:
@@ -20,7 +20,7 @@ class DeleteDocumentConfirmationDialog extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
document.title ?? document.originalFileName ?? '-',
|
||||
document.title.isEmpty ? '(no title)' : document.title,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
|
||||
@@ -111,7 +111,7 @@ class DocumentDetailedItem extends DocumentItem {
|
||||
],
|
||||
).paddedLTRB(8, 8, 8, 4),
|
||||
Text(
|
||||
document.title ?? '-',
|
||||
document.title.isEmpty ? '-' : document.title,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
||||
@@ -113,7 +113,7 @@ class DocumentGridItem extends DocumentItem {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8.0),
|
||||
child: Text(
|
||||
document.title ?? '-',
|
||||
document.title.isEmpty ? '-' : document.title,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
|
||||
@@ -58,7 +58,7 @@ class DocumentListItem extends DocumentItem {
|
||||
],
|
||||
),
|
||||
Text(
|
||||
document.title ?? '-',
|
||||
document.title.isEmpty ? '-' : document.title,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/routes/typed/branches/saved_views_route.dart';
|
||||
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||
|
||||
class SavedViewChip extends StatefulWidget {
|
||||
final SavedView view;
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:paperless_mobile/features/saved_view/cubit/saved_view_cubit.dart
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
import 'package:paperless_mobile/helpers/connectivity_aware_action_wrapper.dart';
|
||||
import 'package:paperless_mobile/routes/typed/branches/saved_views_route.dart';
|
||||
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||
|
||||
class SavedViewsWidget extends StatefulWidget {
|
||||
final void Function(SavedView view) onViewSelected;
|
||||
@@ -184,7 +185,8 @@ class _SavedViewsWidgetState extends State<SavedViewsWidget>
|
||||
child: ConnectivityAwareActionWrapper(
|
||||
child: TextButton.icon(
|
||||
onPressed: () {
|
||||
CreateSavedViewRoute(widget.filter).push(context);
|
||||
CreateSavedViewRoute($extra: widget.filter)
|
||||
.push(context);
|
||||
},
|
||||
icon: const Icon(Icons.add),
|
||||
label: Text(S.of(context)!.newView),
|
||||
|
||||
@@ -44,7 +44,7 @@ class BulkDeleteConfirmationDialog extends StatelessWidget {
|
||||
return ListTile(
|
||||
dense: true,
|
||||
title: Text(
|
||||
doc.title ?? doc.originalFileName ?? '-',
|
||||
doc.title.isEmpty ? '-' : doc.title,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
|
||||
Reference in New Issue
Block a user