Skip to content

Commit

Permalink
Admin UI: Encountering infinite loading when entering non-existent id…
Browse files Browse the repository at this point in the history
…entity/client/tier ids in URL (#834)

* feat: add error screen

* chore: add translations

* fix: revert changes

* chore: make use of errors

* chore: add attribute

* chore: disable or enable button depending on the text

* chore: adapt to the official design

* refactor: rename translation

* chore: make it non-nullable

* chore: remove duplicate files

* chore: change color

* fix: use result to avoid try/catch block

* chore: remove unused translation

* fix: go to the proper return route

* chore: remove unnecessary if statement

* chore: use pushReplacement and simplify

* chore: change attribute

* chore: simplify remove unnecessary use of variable

* chore: make one line

* chore: remove unnecessary setting of a color field

---------

Co-authored-by: Nikola Dmitrasinovic <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Nikola Dmitrasinovic <[email protected]>
  • Loading branch information
4 people authored Sep 20, 2024
1 parent c01f1b5 commit 5ee1801
Show file tree
Hide file tree
Showing 13 changed files with 116 additions and 417 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public async Task<IActionResult> GetDeletionProcessesAsSupport([FromRoute] strin

[HttpGet("{identityAddress}/DeletionProcesses/AuditLogs")]
[ProducesResponseType(typeof(GetDeletionProcessesAuditLogsResponse), StatusCodes.Status200OK)]
[ProducesError(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> GetDeletionProcessesAuditLogs([FromRoute] string identityAddress, CancellationToken cancellationToken)
{
var response = await _mediator.Send(new GetDeletionProcessesAuditLogsQuery(identityAddress), cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:admin_api_sdk/admin_api_sdk.dart';
import 'package:admin_api_types/admin_api_types.dart';
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import 'package:go_router/go_router.dart';
import 'package:intl/intl.dart';

import '/core/core.dart';
Expand Down Expand Up @@ -81,12 +82,15 @@ class _ClientDetailsState extends State<ClientDetails> {

Future<void> _reloadClient() async {
final clientDetails = await GetIt.I.get<AdminApiClient>().clients.getClient(widget.clientId);
if (mounted) {
setState(() {
_clientDetails = clientDetails.data;
_selectedTier = _clientDetails!.defaultTier;
});
}

if (!mounted) return;

if (clientDetails.hasError) return context.pushReplacement('/error', extra: clientDetails.error.message);

setState(() {
_clientDetails = clientDetails.data;
_selectedTier = _clientDetails!.defaultTier;
});
}

Future<void> _reloadTiers() async {
Expand Down

This file was deleted.

Loading

0 comments on commit 5ee1801

Please sign in to comment.