fix: replace first and last name with single field (#4915)

This commit is contained in:
Brian Austin
2023-11-11 20:03:32 -05:00
committed by GitHub
parent 413ab2c538
commit 7fca0d8da5
98 changed files with 567 additions and 1147 deletions

View File

@@ -48,8 +48,7 @@ class Activity {
: ActivityType.like,
user = User(
email: dto.user.email,
firstName: dto.user.firstName,
lastName: dto.user.lastName,
name: dto.user.name,
profileImagePath: dto.user.profileImagePath,
id: dto.user.id,
// Placeholder values

View File

@@ -61,7 +61,7 @@ class ActivitiesPage extends HookConsumerWidget {
mainAxisSize: leftAlign ? MainAxisSize.min : MainAxisSize.max,
children: [
Text(
"${activity.user.firstName} ${activity.user.lastName}",
activity.user.name,
style: textStyle,
overflow: TextOverflow.ellipsis,
),

View File

@@ -124,7 +124,7 @@ class AlbumOptionsPage extends HookConsumerWidget {
)
: const SizedBox(),
title: Text(
album.owner.value?.firstName ?? "",
album.owner.value?.name ?? "",
style: const TextStyle(
fontWeight: FontWeight.bold,
),
@@ -155,7 +155,7 @@ class AlbumOptionsPage extends HookConsumerWidget {
radius: 22,
),
title: Text(
user.firstName,
user.name,
style: const TextStyle(
fontWeight: FontWeight.bold,
),

View File

@@ -3,8 +3,7 @@ class AuthenticationState {
final String userId;
final String userEmail;
final bool isAuthenticated;
final String firstName;
final String lastName;
final String name;
final bool isAdmin;
final bool shouldChangePassword;
final String profileImagePath;
@@ -13,8 +12,7 @@ class AuthenticationState {
required this.userId,
required this.userEmail,
required this.isAuthenticated,
required this.firstName,
required this.lastName,
required this.name,
required this.isAdmin,
required this.shouldChangePassword,
required this.profileImagePath,
@@ -25,8 +23,7 @@ class AuthenticationState {
String? userId,
String? userEmail,
bool? isAuthenticated,
String? firstName,
String? lastName,
String? name,
bool? isAdmin,
bool? shouldChangePassword,
String? profileImagePath,
@@ -36,8 +33,7 @@ class AuthenticationState {
userId: userId ?? this.userId,
userEmail: userEmail ?? this.userEmail,
isAuthenticated: isAuthenticated ?? this.isAuthenticated,
firstName: firstName ?? this.firstName,
lastName: lastName ?? this.lastName,
name: name ?? this.name,
isAdmin: isAdmin ?? this.isAdmin,
shouldChangePassword: shouldChangePassword ?? this.shouldChangePassword,
profileImagePath: profileImagePath ?? this.profileImagePath,
@@ -46,7 +42,7 @@ class AuthenticationState {
@override
String toString() {
return 'AuthenticationState(deviceId: $deviceId, userId: $userId, userEmail: $userEmail, isAuthenticated: $isAuthenticated, firstName: $firstName, lastName: $lastName, isAdmin: $isAdmin, shouldChangePassword: $shouldChangePassword, profileImagePath: $profileImagePath)';
return 'AuthenticationState(deviceId: $deviceId, userId: $userId, userEmail: $userEmail, isAuthenticated: $isAuthenticated, name: $name, isAdmin: $isAdmin, shouldChangePassword: $shouldChangePassword, profileImagePath: $profileImagePath)';
}
@override
@@ -58,8 +54,7 @@ class AuthenticationState {
other.userId == userId &&
other.userEmail == userEmail &&
other.isAuthenticated == isAuthenticated &&
other.firstName == firstName &&
other.lastName == lastName &&
other.name == name &&
other.isAdmin == isAdmin &&
other.shouldChangePassword == shouldChangePassword &&
other.profileImagePath == profileImagePath;
@@ -71,8 +66,7 @@ class AuthenticationState {
userId.hashCode ^
userEmail.hashCode ^
isAuthenticated.hashCode ^
firstName.hashCode ^
lastName.hashCode ^
name.hashCode ^
isAdmin.hashCode ^
shouldChangePassword.hashCode ^
profileImagePath.hashCode;

View File

@@ -26,8 +26,7 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
deviceId: "",
userId: "",
userEmail: "",
firstName: '',
lastName: '',
name: '',
profileImagePath: '',
isAdmin: false,
shouldChangePassword: false,
@@ -117,8 +116,7 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
deviceId: "",
userId: "",
userEmail: "",
firstName: '',
lastName: '',
name: '',
profileImagePath: '',
isAdmin: false,
shouldChangePassword: false,
@@ -208,8 +206,7 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
isAuthenticated: true,
userId: user.id,
userEmail: user.email,
firstName: user.firstName,
lastName: user.lastName,
name: user.name,
profileImagePath: user.profileImagePath,
isAdmin: user.isAdmin,
shouldChangePassword: shouldChangePassword,

View File

@@ -46,8 +46,7 @@ class ChangePasswordForm extends HookConsumerWidget {
child: Text(
'change_password_form_description'.tr(
namedArgs: {
'firstName': authState.firstName,
'lastName': authState.lastName,
'name': authState.name,
},
),
style: TextStyle(

View File

@@ -24,7 +24,7 @@ class PartnerList extends HookConsumerWidget {
contentPadding: const EdgeInsets.symmetric(horizontal: 12.0),
leading: userAvatar(context, p, radius: 30),
title: Text(
"${p.firstName} ${p.lastName}'s photos",
"${p.name}'s photos",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,

View File

@@ -25,7 +25,7 @@ class PartnerDetailPage extends HookConsumerWidget {
return Scaffold(
appBar: AppBar(
title: Text("${partner.firstName} ${partner.lastName}"),
title: Text(partner.name),
elevation: 0,
centerTitle: false,
),
@@ -34,7 +34,7 @@ class PartnerDetailPage extends HookConsumerWidget {
? Padding(
padding: const EdgeInsets.all(16),
child: Text(
"It seems ${partner.firstName} does not have any photos...\n"
"It seems ${partner.name} does not have any photos...\n"
"Or your server version does not match the app version."),
)
: ImmichAssetGrid(

View File

@@ -41,7 +41,7 @@ class PartnerPage extends HookConsumerWidget {
padding: const EdgeInsets.only(right: 8),
child: userAvatar(context, u),
),
Text("${u.firstName} ${u.lastName}"),
Text(u.name),
],
),
),
@@ -71,7 +71,7 @@ class PartnerPage extends HookConsumerWidget {
return ConfirmDialog(
title: "partner_page_stop_sharing_title",
content:
"partner_page_stop_sharing_content".tr(args: [u.firstName]),
"partner_page_stop_sharing_content".tr(args: [u.name]),
onOk: () => ref.read(partnerServiceProvider).removePartner(u),
);
},