feat: Update translations, add pdf view to document edit page

This commit is contained in:
Anton Stubenbord
2023-10-24 15:37:43 +02:00
parent 652abb6945
commit cb4839f5a3
40 changed files with 804 additions and 609 deletions

View File

@@ -38,6 +38,8 @@ class DioHttpErrorInterceptor extends Interceptor {
const PaperlessApiException(ErrorCode.missingClientCertificate),
),
);
} else {
handler.reject(err);
}
}
}

View File

@@ -27,14 +27,15 @@ class DocumentChangedNotifier {
Object subscriber, {
DocumentChangedCallback? onUpdated,
DocumentChangedCallback? onDeleted,
Iterable<int>? ids,
}) {
_subscribers.putIfAbsent(
subscriber,
() => [
_updated.listen((value) {
_updated.where((doc) => ids?.contains(doc.id) ?? true).listen((value) {
onUpdated?.call(value);
}),
_deleted.listen((value) {
_deleted.where((doc) => ids?.contains(doc.id) ?? true).listen((value) {
onDeleted?.call(value);
}),
],

View File

@@ -53,6 +53,7 @@ class FormBuilderLocalizedDatePicker extends StatefulWidget {
final DateTime? initialValue;
final DateTime firstDate;
final DateTime lastDate;
final FocusNode? focusNode;
/// If set to true, the field will not throw any validation errors when empty.
final bool allowUnset;
@@ -67,6 +68,7 @@ class FormBuilderLocalizedDatePicker extends StatefulWidget {
required this.labelText,
this.prefixIcon,
this.allowUnset = false,
this.focusNode,
});
@override
@@ -100,8 +102,11 @@ class _FormBuilderLocalizedDatePickerState
final initialText = widget.initialValue != null
? DateFormat(formatString).format(widget.initialValue!)
: null;
final defaultFocusNode = FocusNode(debugLabel: formatString);
final focusNode =
i == 0 ? (widget.focusNode ?? defaultFocusNode) : defaultFocusNode;
final controls = _NeighbourAwareDateInputSegmentControls(
node: FocusNode(debugLabel: formatString),
node: focusNode,
controller: TextEditingController(text: initialText),
format: formatString,
position: i,