impreoved commands logging
Some checks failed
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
Some checks failed
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'package:pshared/provider/organizations.dart';
|
||||
|
||||
import 'package:pweb/app/router/pages.dart';
|
||||
import 'package:pweb/app/router/page_params.dart';
|
||||
import 'package:pweb/pages/2fa/page.dart';
|
||||
@@ -38,7 +34,6 @@ GoRouter createRouter() => GoRouter(
|
||||
builder: (context, _) => TwoFactorCodePage(
|
||||
onVerificationSuccess: () {
|
||||
// trigger organization load
|
||||
context.read<OrganizationsProvider>().load();
|
||||
context.goNamed(Pages.dashboard.name);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -25,7 +25,7 @@ import 'package:pweb/providers/two_factor.dart';
|
||||
import 'package:pweb/providers/upload_history.dart';
|
||||
import 'package:pweb/providers/wallets.dart';
|
||||
import 'package:pweb/providers/wallet_transactions.dart';
|
||||
import 'package:pweb/services/amplitude.dart';
|
||||
// import 'package:pweb/services/amplitude.dart';
|
||||
import 'package:pweb/services/operations.dart';
|
||||
import 'package:pweb/services/payments/payment_methods.dart';
|
||||
import 'package:pweb/services/payments/upload_history.dart';
|
||||
@@ -44,7 +44,10 @@ void _setupLogging() {
|
||||
|
||||
void main() async {
|
||||
await Constants.initialize();
|
||||
await AmplitudeService.initialize();
|
||||
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
// await AmplitudeService.initialize();
|
||||
|
||||
|
||||
_setupLogging();
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:pweb/pages/dashboard/buttons/buttons.dart';
|
||||
import 'package:pweb/pages/dashboard/payouts/multiple/title.dart';
|
||||
import 'package:pweb/pages/dashboard/payouts/multiple/widget.dart';
|
||||
import 'package:pweb/pages/dashboard/payouts/single/widget.dart';
|
||||
import 'package:pweb/pages/loader.dart';
|
||||
|
||||
import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
@@ -44,8 +45,8 @@ class _DashboardPageState extends State<DashboardPage> {
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SafeArea(
|
||||
Widget build(BuildContext context) => PageViewLoader(
|
||||
child: SafeArea(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
@@ -87,6 +88,6 @@ class _DashboardPageState extends State<DashboardPage> {
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:pweb/pages/loaders/account.dart';
|
||||
import 'package:pweb/pages/loaders/organization.dart';
|
||||
import 'package:pweb/pages/loaders/permissions.dart';
|
||||
|
||||
|
||||
@@ -11,8 +12,10 @@ class PageViewLoader extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => AccountLoader(
|
||||
child: PermissionsLoader(
|
||||
child: child,
|
||||
child: OrganizationLoader(
|
||||
child: PermissionsLoader(
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
15
frontend/pweb/lib/utils/logout.dart
Normal file
15
frontend/pweb/lib/utils/logout.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:pshared/provider/account.dart';
|
||||
import 'package:pshared/provider/permissions.dart';
|
||||
|
||||
import 'package:pweb/app/router/pages.dart';
|
||||
|
||||
|
||||
void logoutUtil(BuildContext context) {
|
||||
context.read<AccountProvider>().logout();
|
||||
context.read<PermissionsProvider>().reset();
|
||||
navigateAndReplace(context, Pages.login);
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:pshared/models/resources.dart';
|
||||
|
||||
import 'package:pshared/provider/account.dart';
|
||||
import 'package:pshared/models/resources.dart';
|
||||
import 'package:pshared/provider/permissions.dart';
|
||||
|
||||
import 'package:pweb/pages/address_book/form/page.dart';
|
||||
import 'package:pweb/pages/address_book/page/page.dart';
|
||||
import 'package:pweb/pages/loader.dart';
|
||||
import 'package:pweb/pages/payment_methods/page.dart';
|
||||
import 'package:pweb/pages/payout_page/page.dart';
|
||||
import 'package:pweb/pages/payout_page/wallet/edit/page.dart';
|
||||
@@ -15,7 +15,7 @@ import 'package:pweb/pages/report/page.dart';
|
||||
import 'package:pweb/pages/settings/profile/page.dart';
|
||||
import 'package:pweb/pages/dashboard/dashboard.dart';
|
||||
import 'package:pweb/providers/page_selector.dart';
|
||||
import 'package:pweb/app/router/pages.dart';
|
||||
import 'package:pweb/utils/logout.dart';
|
||||
import 'package:pweb/widgets/appbar/app_bar.dart';
|
||||
import 'package:pweb/widgets/sidebar/destinations.dart';
|
||||
import 'package:pweb/widgets/sidebar/sidebar.dart';
|
||||
@@ -26,114 +26,114 @@ import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
class PageSelector extends StatelessWidget {
|
||||
const PageSelector({super.key});
|
||||
|
||||
void _logout(BuildContext context) {
|
||||
context.read<AccountProvider>().logout();
|
||||
navigateAndReplace(context, Pages.login);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final provider = context.watch<PageSelectorProvider>();
|
||||
final permissions = context.watch<PermissionsProvider>();
|
||||
final loc = AppLocalizations.of(context)!;
|
||||
Widget build(BuildContext context) => PageViewLoader(
|
||||
child: Builder(builder: (BuildContext context) {
|
||||
final permissions = context.watch<PermissionsProvider>();
|
||||
if (!permissions.isReady) return Center(child: CircularProgressIndicator());
|
||||
|
||||
final bool restrictedAccess = !permissions.canRead(ResourceType.chainWallets);
|
||||
final allowedDestinations = restrictedAccess
|
||||
? <PayoutDestination>{
|
||||
PayoutDestination.settings,
|
||||
PayoutDestination.methods,
|
||||
PayoutDestination.editwallet,
|
||||
}
|
||||
: PayoutDestination.values.toSet();
|
||||
final provider = context.watch<PageSelectorProvider>();
|
||||
|
||||
final selected = allowedDestinations.contains(provider.selected)
|
||||
? provider.selected
|
||||
: (restrictedAccess ? PayoutDestination.settings : PayoutDestination.dashboard);
|
||||
final loc = AppLocalizations.of(context)!;
|
||||
|
||||
if (selected != provider.selected) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) => provider.selectPage(selected));
|
||||
}
|
||||
final bool restrictedAccess = !permissions.canRead(ResourceType.chainWallets);
|
||||
final allowedDestinations = restrictedAccess
|
||||
? <PayoutDestination>{
|
||||
PayoutDestination.settings,
|
||||
PayoutDestination.methods,
|
||||
PayoutDestination.editwallet,
|
||||
}
|
||||
: PayoutDestination.values.toSet();
|
||||
|
||||
Widget content;
|
||||
switch (selected) {
|
||||
case PayoutDestination.dashboard:
|
||||
content = DashboardPage(
|
||||
onRecipientSelected: (recipient) => provider.selectRecipient(recipient),
|
||||
onGoToPaymentWithoutRecipient: provider.startPaymentWithoutRecipient,
|
||||
);
|
||||
break;
|
||||
final selected = allowedDestinations.contains(provider.selected)
|
||||
? provider.selected
|
||||
: (restrictedAccess ? PayoutDestination.settings : PayoutDestination.dashboard);
|
||||
|
||||
case PayoutDestination.recipients:
|
||||
content = RecipientAddressBookPage(
|
||||
onRecipientSelected: (recipient) =>
|
||||
provider.selectRecipient(recipient, fromList: true),
|
||||
onAddRecipient: provider.goToAddRecipient,
|
||||
onEditRecipient: provider.editRecipient,
|
||||
);
|
||||
break;
|
||||
if (selected != provider.selected) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) => provider.selectPage(selected));
|
||||
}
|
||||
|
||||
case PayoutDestination.addrecipient:
|
||||
final recipient = provider.recipientProvider?.selectedRecipient;
|
||||
content = AdressBookRecipientForm(
|
||||
recipient: recipient,
|
||||
onSaved: (_) => provider.selectPage(PayoutDestination.recipients),
|
||||
);
|
||||
break;
|
||||
Widget content;
|
||||
switch (selected) {
|
||||
case PayoutDestination.dashboard:
|
||||
content = DashboardPage(
|
||||
onRecipientSelected: (recipient) => provider.selectRecipient(recipient),
|
||||
onGoToPaymentWithoutRecipient: provider.startPaymentWithoutRecipient,
|
||||
);
|
||||
break;
|
||||
|
||||
case PayoutDestination.payment:
|
||||
content = PaymentPage(
|
||||
onBack: (_) => provider.goBackFromPayment(),
|
||||
);
|
||||
break;
|
||||
case PayoutDestination.recipients:
|
||||
content = RecipientAddressBookPage(
|
||||
onRecipientSelected: (recipient) =>
|
||||
provider.selectRecipient(recipient, fromList: true),
|
||||
onAddRecipient: provider.goToAddRecipient,
|
||||
onEditRecipient: provider.editRecipient,
|
||||
);
|
||||
break;
|
||||
|
||||
case PayoutDestination.settings:
|
||||
content = ProfileSettingsPage();
|
||||
break;
|
||||
case PayoutDestination.addrecipient:
|
||||
final recipient = provider.recipientProvider?.selectedRecipient;
|
||||
content = AdressBookRecipientForm(
|
||||
recipient: recipient,
|
||||
onSaved: (_) => provider.selectPage(PayoutDestination.recipients),
|
||||
);
|
||||
break;
|
||||
|
||||
case PayoutDestination.reports:
|
||||
content = OperationHistoryPage();
|
||||
break;
|
||||
case PayoutDestination.payment:
|
||||
content = PaymentPage(
|
||||
onBack: (_) => provider.goBackFromPayment(),
|
||||
);
|
||||
break;
|
||||
|
||||
case PayoutDestination.methods:
|
||||
content = PaymentConfigPage(
|
||||
onWalletTap: provider.selectWallet,
|
||||
);
|
||||
break;
|
||||
case PayoutDestination.settings:
|
||||
content = ProfileSettingsPage();
|
||||
break;
|
||||
|
||||
case PayoutDestination.editwallet:
|
||||
final wallet = provider.walletsProvider?.selectedWallet;
|
||||
content = wallet != null
|
||||
? WalletEditPage(
|
||||
onBack: provider.goBackFromWalletEdit,
|
||||
)
|
||||
: Center(child: Text(loc.noWalletSelected));
|
||||
break;
|
||||
case PayoutDestination.reports:
|
||||
content = OperationHistoryPage();
|
||||
break;
|
||||
|
||||
default:
|
||||
content = Text(selected.name);
|
||||
}
|
||||
case PayoutDestination.methods:
|
||||
content = PaymentConfigPage(
|
||||
onWalletTap: provider.selectWallet,
|
||||
);
|
||||
break;
|
||||
|
||||
return Scaffold(
|
||||
appBar: PayoutAppBar(
|
||||
title: Text(selected.localizedLabel(context)),
|
||||
onAddFundsPressed: () {},
|
||||
onLogout: () => _logout(context),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.only(left: 200, top: 40, right: 200),
|
||||
child: Row(
|
||||
spacing: 40,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
PayoutSidebar(
|
||||
selected: selected,
|
||||
onSelected: provider.selectPage,
|
||||
onLogout: () => _logout(context),
|
||||
),
|
||||
Expanded(child: content),
|
||||
],
|
||||
case PayoutDestination.editwallet:
|
||||
final wallet = provider.walletsProvider?.selectedWallet;
|
||||
content = wallet != null
|
||||
? WalletEditPage(
|
||||
onBack: provider.goBackFromWalletEdit,
|
||||
)
|
||||
: Center(child: Text(loc.noWalletSelected));
|
||||
break;
|
||||
|
||||
default:
|
||||
content = Text(selected.name);
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
appBar: PayoutAppBar(
|
||||
title: Text(selected.localizedLabel(context)),
|
||||
onAddFundsPressed: () {},
|
||||
onLogout: () => logoutUtil(context),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.only(left: 200, top: 40, right: 200),
|
||||
child: Row(
|
||||
spacing: 40,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
PayoutSidebar(
|
||||
selected: selected,
|
||||
onSelected: provider.selectPage,
|
||||
onLogout: () => logoutUtil(context),
|
||||
),
|
||||
Expanded(child: content),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ flutter_intl:
|
||||
enabled: true
|
||||
localizations_delegates:
|
||||
- flutter_localizations
|
||||
- app_localizations
|
||||
- app_localizations
|
||||
|
||||
flutter_launcher_icons:
|
||||
image_path: "resources/logo.png"
|
||||
|
||||
Reference in New Issue
Block a user