feat: Make label fields less restrictive, improve change detection in document edit page

This commit is contained in:
Anton Stubenbord
2023-10-10 15:27:58 +02:00
parent 0b4b7f6871
commit 379b71008a
25 changed files with 597 additions and 391 deletions

View File

@@ -1,3 +1,4 @@
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:paperless_api/src/converters/local_date_time_json_converter.dart';
import 'package:paperless_api/src/models/document_model.dart';
@@ -6,7 +7,7 @@ part 'field_suggestions.g.dart';
@LocalDateTimeJsonConverter()
@JsonSerializable(fieldRename: FieldRename.snake)
class FieldSuggestions {
class FieldSuggestions with EquatableMixin {
final int? documentId;
final Iterable<int> correspondents;
final Iterable<int> tags;
@@ -95,4 +96,13 @@ class FieldSuggestions {
_$FieldSuggestionsFromJson(json);
Map<String, dynamic> toJson() => _$FieldSuggestionsToJson(this);
@override
List<Object?> get props => [
documentId,
correspondents,
tags,
documentTypes,
dates,
];
}

View File

@@ -203,7 +203,7 @@ class StoragePath extends Label {
const StoragePath({
super.id,
required super.name,
required this.path,
this.path = '',
super.slug,
super.match,
super.matchingAlgorithm,