You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-08-10 23:22:22 +02:00
feat(server,web): make user deletion delay configurable (#7663)
* feat(server,web): make user deletion delay configurable * alphabetical order * add min for user.deleteDelay in SettingInputField * make config.user.deleteDelay SettingInputField min consistent format * fix e2e test * update description on user delete delay
This commit is contained in:
1
mobile/openapi/lib/api.dart
generated
1
mobile/openapi/lib/api.dart
generated
@@ -190,6 +190,7 @@ part 'model/system_config_template_storage_option_dto.dart';
|
||||
part 'model/system_config_theme_dto.dart';
|
||||
part 'model/system_config_thumbnail_dto.dart';
|
||||
part 'model/system_config_trash_dto.dart';
|
||||
part 'model/system_config_user_dto.dart';
|
||||
part 'model/tag_response_dto.dart';
|
||||
part 'model/tag_type_enum.dart';
|
||||
part 'model/thumbnail_format.dart';
|
||||
|
2
mobile/openapi/lib/api_client.dart
generated
2
mobile/openapi/lib/api_client.dart
generated
@@ -462,6 +462,8 @@ class ApiClient {
|
||||
return SystemConfigThumbnailDto.fromJson(value);
|
||||
case 'SystemConfigTrashDto':
|
||||
return SystemConfigTrashDto.fromJson(value);
|
||||
case 'SystemConfigUserDto':
|
||||
return SystemConfigUserDto.fromJson(value);
|
||||
case 'TagResponseDto':
|
||||
return TagResponseDto.fromJson(value);
|
||||
case 'TagTypeEnum':
|
||||
|
14
mobile/openapi/lib/model/server_config_dto.dart
generated
14
mobile/openapi/lib/model/server_config_dto.dart
generated
@@ -19,6 +19,7 @@ class ServerConfigDto {
|
||||
required this.loginPageMessage,
|
||||
required this.oauthButtonText,
|
||||
required this.trashDays,
|
||||
required this.userDeleteDelay,
|
||||
});
|
||||
|
||||
String externalDomain;
|
||||
@@ -33,6 +34,8 @@ class ServerConfigDto {
|
||||
|
||||
int trashDays;
|
||||
|
||||
int userDeleteDelay;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ServerConfigDto &&
|
||||
other.externalDomain == externalDomain &&
|
||||
@@ -40,7 +43,8 @@ class ServerConfigDto {
|
||||
other.isOnboarded == isOnboarded &&
|
||||
other.loginPageMessage == loginPageMessage &&
|
||||
other.oauthButtonText == oauthButtonText &&
|
||||
other.trashDays == trashDays;
|
||||
other.trashDays == trashDays &&
|
||||
other.userDeleteDelay == userDeleteDelay;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
@@ -50,10 +54,11 @@ class ServerConfigDto {
|
||||
(isOnboarded.hashCode) +
|
||||
(loginPageMessage.hashCode) +
|
||||
(oauthButtonText.hashCode) +
|
||||
(trashDays.hashCode);
|
||||
(trashDays.hashCode) +
|
||||
(userDeleteDelay.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'ServerConfigDto[externalDomain=$externalDomain, isInitialized=$isInitialized, isOnboarded=$isOnboarded, loginPageMessage=$loginPageMessage, oauthButtonText=$oauthButtonText, trashDays=$trashDays]';
|
||||
String toString() => 'ServerConfigDto[externalDomain=$externalDomain, isInitialized=$isInitialized, isOnboarded=$isOnboarded, loginPageMessage=$loginPageMessage, oauthButtonText=$oauthButtonText, trashDays=$trashDays, userDeleteDelay=$userDeleteDelay]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@@ -63,6 +68,7 @@ class ServerConfigDto {
|
||||
json[r'loginPageMessage'] = this.loginPageMessage;
|
||||
json[r'oauthButtonText'] = this.oauthButtonText;
|
||||
json[r'trashDays'] = this.trashDays;
|
||||
json[r'userDeleteDelay'] = this.userDeleteDelay;
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -80,6 +86,7 @@ class ServerConfigDto {
|
||||
loginPageMessage: mapValueOfType<String>(json, r'loginPageMessage')!,
|
||||
oauthButtonText: mapValueOfType<String>(json, r'oauthButtonText')!,
|
||||
trashDays: mapValueOfType<int>(json, r'trashDays')!,
|
||||
userDeleteDelay: mapValueOfType<int>(json, r'userDeleteDelay')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
@@ -133,6 +140,7 @@ class ServerConfigDto {
|
||||
'loginPageMessage',
|
||||
'oauthButtonText',
|
||||
'trashDays',
|
||||
'userDeleteDelay',
|
||||
};
|
||||
}
|
||||
|
||||
|
14
mobile/openapi/lib/model/system_config_dto.dart
generated
14
mobile/openapi/lib/model/system_config_dto.dart
generated
@@ -28,6 +28,7 @@ class SystemConfigDto {
|
||||
required this.theme,
|
||||
required this.thumbnail,
|
||||
required this.trash,
|
||||
required this.user,
|
||||
});
|
||||
|
||||
SystemConfigFFmpegDto ffmpeg;
|
||||
@@ -60,6 +61,8 @@ class SystemConfigDto {
|
||||
|
||||
SystemConfigTrashDto trash;
|
||||
|
||||
SystemConfigUserDto user;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is SystemConfigDto &&
|
||||
other.ffmpeg == ffmpeg &&
|
||||
@@ -76,7 +79,8 @@ class SystemConfigDto {
|
||||
other.storageTemplate == storageTemplate &&
|
||||
other.theme == theme &&
|
||||
other.thumbnail == thumbnail &&
|
||||
other.trash == trash;
|
||||
other.trash == trash &&
|
||||
other.user == user;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
@@ -95,10 +99,11 @@ class SystemConfigDto {
|
||||
(storageTemplate.hashCode) +
|
||||
(theme.hashCode) +
|
||||
(thumbnail.hashCode) +
|
||||
(trash.hashCode);
|
||||
(trash.hashCode) +
|
||||
(user.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'SystemConfigDto[ffmpeg=$ffmpeg, job=$job, library_=$library_, logging=$logging, machineLearning=$machineLearning, map=$map, newVersionCheck=$newVersionCheck, oauth=$oauth, passwordLogin=$passwordLogin, reverseGeocoding=$reverseGeocoding, server=$server, storageTemplate=$storageTemplate, theme=$theme, thumbnail=$thumbnail, trash=$trash]';
|
||||
String toString() => 'SystemConfigDto[ffmpeg=$ffmpeg, job=$job, library_=$library_, logging=$logging, machineLearning=$machineLearning, map=$map, newVersionCheck=$newVersionCheck, oauth=$oauth, passwordLogin=$passwordLogin, reverseGeocoding=$reverseGeocoding, server=$server, storageTemplate=$storageTemplate, theme=$theme, thumbnail=$thumbnail, trash=$trash, user=$user]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@@ -117,6 +122,7 @@ class SystemConfigDto {
|
||||
json[r'theme'] = this.theme;
|
||||
json[r'thumbnail'] = this.thumbnail;
|
||||
json[r'trash'] = this.trash;
|
||||
json[r'user'] = this.user;
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -143,6 +149,7 @@ class SystemConfigDto {
|
||||
theme: SystemConfigThemeDto.fromJson(json[r'theme'])!,
|
||||
thumbnail: SystemConfigThumbnailDto.fromJson(json[r'thumbnail'])!,
|
||||
trash: SystemConfigTrashDto.fromJson(json[r'trash'])!,
|
||||
user: SystemConfigUserDto.fromJson(json[r'user'])!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
@@ -205,6 +212,7 @@ class SystemConfigDto {
|
||||
'theme',
|
||||
'thumbnail',
|
||||
'trash',
|
||||
'user',
|
||||
};
|
||||
}
|
||||
|
||||
|
98
mobile/openapi/lib/model/system_config_user_dto.dart
generated
Normal file
98
mobile/openapi/lib/model/system_config_user_dto.dart
generated
Normal file
@@ -0,0 +1,98 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// ignore_for_file: unused_element, unused_import
|
||||
// ignore_for_file: always_put_required_named_parameters_first
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: lines_longer_than_80_chars
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class SystemConfigUserDto {
|
||||
/// Returns a new [SystemConfigUserDto] instance.
|
||||
SystemConfigUserDto({
|
||||
required this.deleteDelay,
|
||||
});
|
||||
|
||||
int deleteDelay;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is SystemConfigUserDto &&
|
||||
other.deleteDelay == deleteDelay;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(deleteDelay.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'SystemConfigUserDto[deleteDelay=$deleteDelay]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'deleteDelay'] = this.deleteDelay;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [SystemConfigUserDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static SystemConfigUserDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return SystemConfigUserDto(
|
||||
deleteDelay: mapValueOfType<int>(json, r'deleteDelay')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<SystemConfigUserDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <SystemConfigUserDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = SystemConfigUserDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, SystemConfigUserDto> mapFromJson(dynamic json) {
|
||||
final map = <String, SystemConfigUserDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = SystemConfigUserDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of SystemConfigUserDto-objects as value to a dart map
|
||||
static Map<String, List<SystemConfigUserDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<SystemConfigUserDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = SystemConfigUserDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'deleteDelay',
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user