Skip to content

Commit

Permalink
Bugfix: Identity Registrar UI adjustments
Browse files Browse the repository at this point in the history
The main goal of this bugfix was to adjust IdentityRegistrarPage and VerificationRequestsPage for better user experience. Among IR page changed button order of existing IR records, changed form of "Add/Register record" and "Edit" by removing memo TextField, also blocked key editing in existing record. In VerificationRequestsPage added approve and reject buttons in every element of list to make easier and faster actions on requests. Also edited details of record by adding address copying and moving buttons from bottom of drawer to below tip label.

List of changes:
- modified kira_outlined_button.dart to enable specifying color for text and border
- added approve and reject buttons in VerificationRequestPage on both desktop and mobile for each list item
- added copy button and address details in IRVerificationRequestDrawerPage to make it more generic like in ValidatorsDrawerPage
- blocked "key" TextField from editing in ir_msg_register_record_form.dart
- changed buttons order in ir_record_tile_mobile.dart from “Edit”, “Verify”, “Delete” to “Verify”, “Edit”, “Delete”
- changed "Approve" and "Reject" buttons position in ir_verification_request_drawer_page.dart from bottom of drawer to below of tip label
- changed TextField in ir_msg_request_verification_form.dart from "Send to" to "Verify by"
- removed memo from ir_msg_register_record_form.dart both in "Add/Register" and "Edit" record form
  • Loading branch information
aknowak01 committed Mar 22, 2024
1 parent 82987b9 commit ff18b8f
Show file tree
Hide file tree
Showing 21 changed files with 197 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,21 @@ class TxProcessCubit<T extends AMsgFormModel> extends Cubit<ATxProcessState> {
);
if (formEnabledBool) {
emit(txProcessLoadedState);
} else {
return;
}

SignedTxModel signedTxModel = await _buildSignedTransaction(feeTokenAmountModel);
if (isClosed == false) {
emit(TxProcessConfirmState(
txProcessLoadedState: txProcessLoadedState,
signedTxModel: await _buildSignedTransaction(feeTokenAmountModel),
signedTxModel: signedTxModel,
));
}
} catch (e) {
AppLogger().log(message: 'Failed to load transaction fee: $e');
emit(const TxProcessErrorState());
if (isClosed == false) {
AppLogger().log(message: 'Failed to load transaction fee: $e');
emit(const TxProcessErrorState());
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ class MessageLookup extends MessageLookupByLibrary {
"irUsername": MessageLookupByLibrary.simpleMessage("Username"),
"irVerificationRequests":
MessageLookupByLibrary.simpleMessage("Verification Requests"),
"irVerificationRequestsActions": MessageLookupByLibrary.simpleMessage("Actions"),
"irVerificationRequestsApprove":
MessageLookupByLibrary.simpleMessage("Approve"),
"irVerificationRequestsApprovedRecord":
Expand Down Expand Up @@ -490,6 +491,7 @@ class MessageLookup extends MessageLookupByLibrary {
"txHintUnstakeBy": MessageLookupByLibrary.simpleMessage("Unstake by"),
"txHintUnstakeFrom":
MessageLookupByLibrary.simpleMessage("Unstake from"),
"txHintVerifyBy": MessageLookupByLibrary.simpleMessage("Verify by"),
"txIsBeingBroadcast": MessageLookupByLibrary.simpleMessage(
"Your transaction is being broadcast"),
"txListAmount": MessageLookupByLibrary.simpleMessage("Amount"),
Expand Down
37 changes: 26 additions & 11 deletions lib/generated/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/infra/services/api_kira/identity_records_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class IdentityRecordsService implements _IIdentityRecordsService {
requestData: walletAddress.bech32Address,
forceRequestBool: forceRequestBool,
));
List<PendingVerification> pendingVerifications = await _getAllPendingVerificationsByRequester(walletAddress);
List<PendingVerification> pendingVerifications = await _getAllPendingVerificationsByRequester(walletAddress, forceRequestBool: forceRequestBool);

try {
QueryIdentityRecordsByAddressResp queryIdentityRecordsByAddressResp = QueryIdentityRecordsByAddressResp.fromJson(response.data as Map<String, dynamic>);
Expand Down
2 changes: 2 additions & 0 deletions lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"irRecordStatusPending": "Pending",

"irVerificationRequests": "Verification Requests",
"irVerificationRequestsActions": "Actions",
"irVerificationRequestsVerifyRecord": "Verify record",
"irVerificationRequestsVerifyRecords": "Verify records",
"irVerificationRequestsCreationDate": "Creation date",
Expand Down Expand Up @@ -298,6 +299,7 @@
"txHintMemo": "Memo",
"txHintUnstakeFrom": "Unstake from",
"txHintUnstakeBy": "Unstake by",
"txHintVerifyBy": "Verify by",
"txNoticeFee": "Transaction fee {widgetFeeTokenAmountModel}",
"@txNoticeFee": {
"placeholders": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import 'package:miro/shared/models/identity_registrar/ir_user_profile_model.dart
import 'package:miro/shared/router/kira_router.dart';
import 'package:miro/shared/router/router.gr.dart';
import 'package:miro/views/layout/drawer/drawer_subtitle.dart';
import 'package:miro/views/widgets/buttons/kira_elevated_button.dart';
import 'package:miro/views/widgets/generic/account/account_tile.dart';
import 'package:miro/views/widgets/buttons/kira_outlined_button.dart';
import 'package:miro/views/widgets/generic/account_tile_copy_wrapper.dart';
import 'package:miro/views/widgets/generic/expandable_text.dart';
import 'package:miro/views/widgets/generic/prefixed_widget.dart';
import 'package:miro/views/widgets/generic/responsive/responsive_value.dart';
Expand Down Expand Up @@ -44,15 +44,8 @@ class _IRVerificationRequestDrawerPage extends State<IRVerificationRequestDrawer
? S.of(context).irVerificationRequestsVerifyRecords
: S.of(context).irVerificationRequestsVerifyRecord,
),
const SizedBox(height: 32),
AccountTile(
size: 52,
avatarUrl: requesterIrUserProfileModel.avatarUrl,
username: requesterIrUserProfileModel.username,
walletAddress: requesterIrUserProfileModel.walletAddress,
usernameTextStyle: textTheme.bodyLarge!.copyWith(color: DesignColors.white1),
addressTextStyle: textTheme.bodyMedium!.copyWith(color: DesignColors.white2),
),
const SizedBox(height: 24),
AccountTileCopyWrapper.fromIRUserProfileModel(requesterIrUserProfileModel),
const SizedBox(height: 8),
const Divider(color: DesignColors.grey2),
const SizedBox(height: 16),
Expand All @@ -72,6 +65,28 @@ class _IRVerificationRequestDrawerPage extends State<IRVerificationRequestDrawer
),
),
const SizedBox(height: 16),
Row(
children: <Widget>[
Expanded(
child: KiraOutlinedButton(
height: 40,
onPressed: _pressApproveButton,
title: S.of(context).irVerificationRequestsApprove,
textColor: DesignColors.greenStatus1,
),
),
const SizedBox(width: 16),
Expanded(
child: KiraOutlinedButton(
height: 40,
onPressed: _pressRejectButton,
title: S.of(context).irVerificationRequestsReject,
textColor: DesignColors.redStatus1,
),
),
],
),
const SizedBox(height: 16),
PrefixedWidget(
prefix:
'${widget.irInboundVerificationRequestModel.records.length > 1 ? S.of(context).irVerificationRequestsRecordsToVerify : S.of(context).irVerificationRequestsRecordToVerify}:',
Expand Down Expand Up @@ -128,29 +143,6 @@ class _IRVerificationRequestDrawerPage extends State<IRVerificationRequestDrawer
),
),
const SizedBox(height: 16),
Row(
children: <Widget>[
Expanded(
child: KiraElevatedButton(
height: 40,
onPressed: _pressApproveButton,
icon: const Icon(Icons.check, size: 20, color: DesignColors.greenStatus1),
title: S.of(context).irVerificationRequestsApprove,
foregroundColor: DesignColors.greenStatus1,
),
),
const SizedBox(width: 16),
Expanded(
child: KiraElevatedButton(
height: 40,
onPressed: _pressRejectButton,
icon: const Icon(Icons.close, size: 20, color: DesignColors.redStatus1),
title: S.of(context).irVerificationRequestsReject,
foregroundColor: DesignColors.redStatus1,
),
),
],
)
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import 'package:miro/shared/models/identity_registrar/ir_record_model.dart';
import 'package:miro/shared/models/wallet/wallet_address.dart';
import 'package:miro/shared/router/kira_router.dart';
import 'package:miro/shared/router/router.gr.dart';
import 'package:miro/views/pages/menu/my_account_page/identity_registrar/ir_custom_entry_button.dart';
import 'package:miro/views/pages/menu/my_account_page/identity_registrar/ir_custom_record_button.dart';
import 'package:miro/views/pages/menu/my_account_page/identity_registrar/ir_record_tile/desktop/ir_record_tile_desktop_layout.dart';
import 'package:miro/views/pages/menu/my_account_page/identity_registrar/ir_record_tile/ir_record_tile.dart';
import 'package:miro/views/widgets/generic/responsive/responsive_widget.dart';
Expand Down Expand Up @@ -128,7 +128,7 @@ class _IdentityRegistrarPage extends State<IdentityRegistrarPage> {
),
);
}).toList(),
IRCustomEntryButton(onTap: () => _pressCustomEntryButton(identityRegistrarCubit)),
IRCustomRecordButton(onTap: () => _pressCustomRecordButton(identityRegistrarCubit)),
],
),
),
Expand All @@ -139,12 +139,12 @@ class _IdentityRegistrarPage extends State<IdentityRegistrarPage> {
);
}

Future<void> _pressCustomEntryButton(IdentityRegistrarCubit identityRegistrarCubit) async {
Future<void> _pressCustomRecordButton(IdentityRegistrarCubit identityRegistrarCubit) async {
await KiraRouter.of(context).push<void>(TransactionsWrapperRoute(
children: <PageRouteInfo>[
IRTxRegisterRecordRoute(irRecordModel: null, irKeyEditableBool: true),
],
));
await identityRegistrarCubit.refresh();
await identityRegistrarCubit.refresh(forceRequestBool: true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import 'package:miro/generated/l10n.dart';
import 'package:miro/views/widgets/buttons/kira_text_button.dart';
import 'package:miro/views/widgets/generic/responsive/responsive_value.dart';

class IRCustomEntryButton extends StatelessWidget {
class IRCustomRecordButton extends StatelessWidget {
final VoidCallback onTap;

const IRCustomEntryButton({
const IRCustomRecordButton({
required this.onTap,
Key? key,
}) : super(key: key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class _IdentityRecordTile extends State<IRRecordTile> {
children: <PageRouteInfo>[
IRTxRegisterRecordRoute(
irRecordModel: widget.irRecordModel,
irKeyEditableBool: widget.irRecordModel?.key.isNotEmpty == true,
irKeyEditableBool: false,
irValueMaxLength: widget.irRecordFieldConfigModel.valueMaxLength,
)
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,32 +75,32 @@ class IRRecordTileMobile extends StatelessWidget {
onPressed: onShowDrawerPressed,
),
],
const SizedBox(height: 16),
const SizedBox(height: 14),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
if (loadingBool == false && recordExistsBool) ...<Widget>[
Expanded(
child: KiraOutlinedButton(
height: 40,
title: S.of(context).irRecordEdit,
onPressed: onEditPressed,
title: S.of(context).irRecordVerify,
onPressed: onVerifyPressed,
),
),
const SizedBox(width: 15),
const SizedBox(width: 14),
Expanded(
child: KiraOutlinedButton(
height: 40,
title: S.of(context).irRecordDelete,
onPressed: onDeletePressed,
title: S.of(context).irRecordEdit,
onPressed: onEditPressed,
),
),
const SizedBox(width: 15),
const SizedBox(width: 14),
Expanded(
child: KiraOutlinedButton(
height: 40,
title: S.of(context).irRecordVerify,
onPressed: onVerifyPressed,
title: S.of(context).irRecordDelete,
onPressed: onDeletePressed,
),
),
] else if (loadingBool == false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class _StakingListItemMobile extends State<StakingListItemMobile> {
StakingDrawerPage(validatorStakingModel: widget.validatorStakingModel),
),
),
const SizedBox(height: 18),
const SizedBox(height: 14),
SizedBox(
height: 40,
child: Row(
Expand All @@ -103,7 +103,7 @@ class _StakingListItemMobile extends State<StakingListItemMobile> {
onPressed: _handleStakeButtonPressed,
),
),
const SizedBox(width: 12),
const SizedBox(width: 14),
Expanded(
child: KiraOutlinedButton(
title: S.of(context).stakingTxUnstake,
Expand Down
Loading

0 comments on commit ff18b8f

Please sign in to comment.