feat(mobile): shared-links (#4490)

* add shared links page

* feat(mobile): shared link items

* feat(mobile): create / edit shared links page

* server: add changeExpiryTime to SharedLinkEditDto

* fix(mobile): edit expiry to never

* mobile: add icon when shares list is empty

* mobile: create new share from album / timeline

* mobile: add translation texts

* mobile: minor ui fixes

* fix: handle serverURL with /api path

* mobile: show share link on successful creation

* mobile: shared links list - 2 column layout

* mobile: use sharedlink pod class instead of dto

* mobile: show error on link creation

* mobile: show share icon only when remote assets are in selection

* mobile: use server endpoint instead of server url

* styling

* styling

---------

Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
shenlong 2023-10-22 15:05:10 +00:00 committed by GitHub
parent cf08ac7538
commit 8dcc01b2be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 1450 additions and 84 deletions

View file

@ -15,6 +15,7 @@ class SharedLinkEditDto {
SharedLinkEditDto({
this.allowDownload,
this.allowUpload,
this.changeExpiryTime,
this.description,
this.expiresAt,
this.showMetadata,
@ -36,6 +37,15 @@ class SharedLinkEditDto {
///
bool? allowUpload;
/// Few clients cannot send null to set the expiryTime to never. Setting this flag and not sending expiryAt is considered as null instead. Clients that can send null values can ignore this.
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? changeExpiryTime;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
@ -58,6 +68,7 @@ class SharedLinkEditDto {
bool operator ==(Object other) => identical(this, other) || other is SharedLinkEditDto &&
other.allowDownload == allowDownload &&
other.allowUpload == allowUpload &&
other.changeExpiryTime == changeExpiryTime &&
other.description == description &&
other.expiresAt == expiresAt &&
other.showMetadata == showMetadata;
@ -67,12 +78,13 @@ class SharedLinkEditDto {
// ignore: unnecessary_parenthesis
(allowDownload == null ? 0 : allowDownload!.hashCode) +
(allowUpload == null ? 0 : allowUpload!.hashCode) +
(changeExpiryTime == null ? 0 : changeExpiryTime!.hashCode) +
(description == null ? 0 : description!.hashCode) +
(expiresAt == null ? 0 : expiresAt!.hashCode) +
(showMetadata == null ? 0 : showMetadata!.hashCode);
@override
String toString() => 'SharedLinkEditDto[allowDownload=$allowDownload, allowUpload=$allowUpload, description=$description, expiresAt=$expiresAt, showMetadata=$showMetadata]';
String toString() => 'SharedLinkEditDto[allowDownload=$allowDownload, allowUpload=$allowUpload, changeExpiryTime=$changeExpiryTime, description=$description, expiresAt=$expiresAt, showMetadata=$showMetadata]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -86,6 +98,11 @@ class SharedLinkEditDto {
} else {
// json[r'allowUpload'] = null;
}
if (this.changeExpiryTime != null) {
json[r'changeExpiryTime'] = this.changeExpiryTime;
} else {
// json[r'changeExpiryTime'] = null;
}
if (this.description != null) {
json[r'description'] = this.description;
} else {
@ -114,6 +131,7 @@ class SharedLinkEditDto {
return SharedLinkEditDto(
allowDownload: mapValueOfType<bool>(json, r'allowDownload'),
allowUpload: mapValueOfType<bool>(json, r'allowUpload'),
changeExpiryTime: mapValueOfType<bool>(json, r'changeExpiryTime'),
description: mapValueOfType<String>(json, r'description'),
expiresAt: mapDateTime(json, r'expiresAt', ''),
showMetadata: mapValueOfType<bool>(json, r'showMetadata'),