Add information for uploading asset and error indication with error message for each failed upload. (#315)

* Added info box

* Fixed upload endpoint doesn't report error status code

* Added chip to show update error

* Added chip to show failed upload

* Add duplication check for upload

* Better duplication-checking placement

* Remove check for duplicated asset

* Added failed backup status route

* added page

* Display error card with thumbnail

* Improved styling

* Set thumbnail with better quality

* Remove force upload error
This commit is contained in:
Alex
2022-07-06 16:12:55 -05:00
committed by GitHub
parent 357f7d1c31
commit 58ec7553ea
19 changed files with 706 additions and 87 deletions

View File

@@ -0,0 +1,48 @@
import 'dart:convert';
class CheckDuplicateAssetResponse {
final bool isExist;
CheckDuplicateAssetResponse({
required this.isExist,
});
CheckDuplicateAssetResponse copyWith({
bool? isExist,
}) {
return CheckDuplicateAssetResponse(
isExist: isExist ?? this.isExist,
);
}
Map<String, dynamic> toMap() {
final result = <String, dynamic>{};
result.addAll({'isExist': isExist});
return result;
}
factory CheckDuplicateAssetResponse.fromMap(Map<String, dynamic> map) {
return CheckDuplicateAssetResponse(
isExist: map['isExist'] ?? false,
);
}
String toJson() => json.encode(toMap());
factory CheckDuplicateAssetResponse.fromJson(String source) =>
CheckDuplicateAssetResponse.fromMap(json.decode(source));
@override
String toString() => 'CheckDuplicateAssetResponse(isExist: $isExist)';
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is CheckDuplicateAssetResponse && other.isExist == isExist;
}
@override
int get hashCode => isExist.hashCode;
}