Skip to content

Commit ce8bdc3

Browse files
dt-iohkLynxLynxxdamian-molinski
authored
feat(cat-voices): Merge f15/cat-app into main (voting space enabled) (#3492)
* chore: remove hardcoded values of f14 and fund14 (#3443) * feat(cat-voices): tracking registration status (#3449) * feat: add account_registration_status to account model + poller * feat: check registration status before refreshing account public profile * checking account indexed status * typos * fix: test * refactor RegistrationStatusPoller so its using Streams * fix: typos * feat(cat-voices): Improvements to import proposals, handling malformed proposals (#3448) * feat: don't import invalid refs and skip malformed proposals * chore: remove unused code * feat: use active campaign observer * chore: fix test * chore: review update * chore: remove not needed emit * chore: return correct new ref * fix: test * chore: change log from info to warning * feat(cat-voices): email already used warning (#3452) * feat: implement registration signal handling for used email * chore: do not report wallet accountChange error to sentry * feat(cat-voices): Multi currency support (#3454) * feat: multi currency support * fix: spelling * fix: revert unwanted changes * refactor: cleanup code * refactor: cleanup tests * refactor: cleanup * feat: update currency formatting * refactor: cleanup formatting * chore(cat-voices): update gateway open api specs (#3461) * chore: update gateway openAPI specs * chore: remove openAPI specs generation from earthly target * fix: failing tests * chore: cleanup earthly targer * chore(cat-voices): cleanup UI (#3469) * fix: document validation takes into account actions and comments too * hard remove voting related content * chore: clean up * fix(cat-voices): disable failing earthly targets (#3482) * feat(cat-voices): multicurrency support and money formatting changes (#3473) * feat: use currency from the schema * feat: allow custom currency codes * refactor: allow description to be nullable * chore: update gateway openAPI specs * chore: remove openAPI specs generation from earthly target * fix: failing tests * feat: add fallback for integer schema * feat: fallback double widget * feat: make debug fallback more visible * feat: allow to only enter decimal text * feat: handle multiple of validation * refactor: cleanup * feat: add support for different formats and currencies related to money in proposals * feat: allow to query currency by iso code * feat: parse document currency format dynamically * feat: convert more raw values into money instances * feat: show allowed money range as money * fix: validation * feat: show multiple of as money * fix: text reverting decimal separators * feat: respect schema's multiple of * docs: document currency format docs * feat: parse money from string * feat: convert money to use BigInts * feat: update decimal input formatter to not exceed safe range of int / double * fix: don't allow decimals in legacy ada format * fix: node id differentiate * fix: nodeId should not consider parent to be a child of itself * feat: format money with code * feat: formatting of different currencies * refactor: code cleanup * fix: spelling * fix: tests * fix: tests * feat: display exact amount for registration fee as wallets do * chore: cleanup * chore: code review changes * refactor: use wildcard function --------- Co-authored-by: Damian Molinski <[email protected]> Co-authored-by: Damian Moliński <[email protected]> * chore(cat-voices): comments category_id (#3468) * include category_id in CommentDocument metadata * chore: spelling * analyzer * feat(cat-voices): documents campaign isolation (#3462) * chore: move const content into fund specific files + fix tests * empty f15 campaign * feat: campaign filters * fix: filter type * feat: workspace multi campaign * fix: viewing older proposals * static all campaigns * fix: more flexible create new proposal dialog * feat: simplify campaign filtering * watch user proposals count for active campaign * campaign change documents clear * fix: analyzer * fix: tests * chore: cleanup * explicit categoryId query type * chore: move active campaign pointers to one file * feat: use category.in filter parameter * fix: failing tests * feat: add ProposalsFilters.forActiveCampaign constructor * final list of all campaigns * chore: refactor creating money logic * fix: gitignore * refactor: amount function * Revert "chore(cat-voices): cleanup UI (#3469)" This reverts commit 8058e1b. * Revert "chore: adding voting page guard (#3437)" This reverts commit 0dd9d2c. * feat(cat-voices): Currency formatting adjustments (#3496) * feat: display money as decimal * feat: display money as decimals * feat: allow only dot as decimal separator * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * Revert "fix(cat-voices): disable failing earthly targets (#3482)" This reverts commit 2762cd6. * fix: rename method * fix: missing param * chore(cat-voices): update index endpoint parameter (#3501) * chore: update index endpoint parameter * add parameters field to index response dto * fix: index endpoint parameters (#3514) * feat(cat-voices): respect title in agreement confirmation widget (#3500) * refactor(cat-voices): unify range classes (#3513) * refactor: unify ranges * refactor: tests * style: spelling * fix: tests * style: spelling * feat(cat-voices): add placeholder to multi currency formatted amount (#3518) * feat(cat-voices): F15 copy text and ID refs (#3516) * feat: f15 documents refs * feat: categories copy text * feat: category dos and donts * feat: update f15 campaign id * feat: update category ref id in url * chore: clean l10n * chore: raw strings * feat: short description * chore: remove one element * fix: review * feat: support for active fund number in urls (#3526) * feat: change max number of final proposals (#3530) --------- Co-authored-by: Ryszard Schossler <[email protected]> Co-authored-by: Damian Moliński <[email protected]> Co-authored-by: Damian Molinski <[email protected]>
1 parent afad5b8 commit ce8bdc3

File tree

206 files changed

+12504
-1664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+12504
-1664
lines changed

.config/dictionaries/project.dic

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ gethostname
142142
Gitbook
143143
gmtime
144144
gradlew
145+
hackathon
145146
Hackathons
146147
headful
147148
headlessui
@@ -209,6 +210,7 @@ libxkbcommon
209210
libxshmfence
210211
Lifetimeable
211212
lintfix
213+
litepaper
212214
localizable
213215
loguru
214216
lovelace
@@ -350,6 +352,7 @@ tablestats
350352
tabview
351353
tacho
352354
tailscale
355+
telehealth
353356
testcov
354357
testdocs
355358
testid
@@ -383,6 +386,7 @@ Unstaked
383386
Upsert
384387
Upserts
385388
upskilling
389+
USDM
386390
UTXO
387391
Utxos
388392
uuidv

catalyst_voices/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ docs/
1717
**/generated/*
1818
**/openapi/**
1919

20-
# Un-ignore vit and cat-reviews openapi spec as they're not generated
20+
# Un-ignore vit, cat-reviews and cat-gateway openapi spec as they're not generated
2121
!**/openapi/vit.json
2222
!**/openapi/cat-reviews.json
23+
!**/openapi/cat-gateway.json
2324

2425
# Un-ignore generated files in public packages
2526
!**/packages/libs/**/*.g.dart

catalyst_voices/Earthfile

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,9 @@ code-generator:
3232

3333
LET gen_code_path = lib/generated/api
3434
LET local_gen_code_path = packages/internal/catalyst_voices_repositories/lib/generated/api/
35-
LET openapi_spec_path = packages/internal/catalyst_voices_repositories/openapi/cat-gateway.json
3635

3736
WORKDIR packages/internal/catalyst_voices_repositories
3837

39-
COPY catalyst-gateway+build/doc/cat-gateway-api.json openapi/cat-gateway.json
40-
4138
WORKDIR /frontend
4239

4340
RUN melos l10n
@@ -67,13 +64,6 @@ code-generator:
6764

6865
WORKDIR packages/internal/catalyst_voices_repositories
6966

70-
# Saves locally openapi json specs. Useful for local diagnostic.
71-
IF [ $save_locally = true ]
72-
SAVE ARTIFACT openapi/cat-gateway.json AS LOCAL $openapi_spec_path
73-
ELSE
74-
SAVE ARTIFACT openapi/cat-gateway.json
75-
END
76-
7767
# Saves generated OpenApi Services
7868
IF [ $save_locally = true ]
7969
SAVE ARTIFACT "$gen_code_path/*" AS LOCAL $local_gen_code_path

catalyst_voices/apps/voices/lib/common/constants/constants.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ abstract class VoicesConstants {
88

99
/// External urls
1010
static const supportedWalletsUrl = '$_docs/current-fund/voter-registration/supported-wallets';
11-
static const f14ProposalSubmissionNoticeUrl =
12-
'$_docs/current-fund/fund-basics/fund14-proposal-submission-notice';
1311
static const tosUrl =
1412
'$_docs/current-fund/fund-basics/project-catalyst-terms-and-conditions/project-catalyst-platform-terms-of-use';
1513
static const conditionsUrl =
@@ -46,9 +44,8 @@ abstract class VoicesConstants {
4644
static const campaignTimeline = '$_docs/current-fund/fund-basics/fund-timeline';
4745
static const milestoneGuideline =
4846
'$_docs/current-fund/project-onboarding/milestone-based-proposals';
49-
static const projectCatalystFund14Url = '$_projectCatalyst/funds/14';
5047

51-
VoicesConstants._();
48+
const VoicesConstants._();
5249

5350
static String cardanoScanStakeAddressUrl(ShelleyAddress stakeAddress) {
5451
switch (stakeAddress.network) {
@@ -58,4 +55,9 @@ abstract class VoicesConstants {
5855
return 'https://preprod.cardanoscan.io/stakekey/${stakeAddress.toBech32()}';
5956
}
6057
}
58+
59+
static String fundProposalSubmissionNoticeUrl(int fundNumber) =>
60+
'$_docs/current-fund/fund-basics/fund$fundNumber-proposal-submission-notice';
61+
62+
static String projectCatalystFundUrl(int fundNumber) => '$_projectCatalyst/funds/$fundNumber';
6163
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import 'package:catalyst_voices_blocs/catalyst_voices_blocs.dart';
2+
import 'package:flutter/material.dart';
3+
4+
extension ActiveFundNumberSelectorExt on BuildContext {
5+
int get activeCampaignFundNumber {
6+
return select<CampaignPhaseAwareCubit, int>((cubit) => cubit.state.fundNumber);
7+
}
8+
}

catalyst_voices/apps/voices/lib/dependency/dependencies.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ final class Dependencies extends DependencyProvider {
353353
return UserService(
354354
get<UserRepository>(),
355355
get<UserObserver>(),
356+
get<RegistrationStatusPoller>(),
356357
);
357358
},
358359
dispose: (service) => unawaited(service.dispose()),
@@ -480,14 +481,23 @@ final class Dependencies extends DependencyProvider {
480481
},
481482
dispose: (storage) async => storage.dispose(),
482483
);
484+
registerLazySingleton<AppMetaStorage>(
485+
() {
486+
return AppMetaStorageLocalStorage(
487+
sharedPreferences: get<SharedPreferencesAsync>(),
488+
);
489+
},
490+
);
483491
}
484492

485493
void _registerUtils() {
486494
registerLazySingleton<SyncManager>(
487495
() {
488496
return SyncManager(
497+
get<AppMetaStorage>(),
489498
get<SyncStatsStorage>(),
490499
get<DocumentsService>(),
500+
get<CampaignService>(),
491501
);
492502
},
493503
dispose: (manager) async => manager.dispose(),
@@ -511,6 +521,11 @@ final class Dependencies extends DependencyProvider {
511521
);
512522
registerLazySingleton<CastedVotesObserver>(CastedVotesObserverImpl.new);
513523
registerLazySingleton<VotingBallotBuilder>(VotingBallotLocalBuilder.new);
524+
525+
// Not a singleton
526+
registerFactory<RegistrationStatusPoller>(
527+
() => RegistrationStatusPoller(get<UserRepository>()),
528+
);
514529
registerLazySingleton<DeviceInfoPlugin>(DeviceInfoPlugin.new);
515530
registerLazySingleton<PermissionHandler>(
516531
() => PermissionHandlerImpl(

catalyst_voices/apps/voices/lib/pages/campaign/stage/campaign_background.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import 'dart:math';
22

33
import 'package:catalyst_voices/widgets/painter/bubble_painter.dart';
4+
import 'package:catalyst_voices_assets/catalyst_voices_assets.dart';
5+
import 'package:catalyst_voices_brands/catalyst_voices_brands.dart';
46
import 'package:flutter/material.dart';
57

68
class CampaignBackground extends StatelessWidget {
@@ -16,6 +18,7 @@ class CampaignBackground extends StatelessWidget {
1618
children: [
1719
const _Background(),
1820
const _BubbleShapes(),
21+
const _Logo(),
1922
child,
2023
],
2124
),
@@ -119,3 +122,20 @@ class _BubbleShapes extends StatelessWidget {
119122
];
120123
}
121124
}
125+
126+
class _Logo extends StatelessWidget {
127+
const _Logo();
128+
129+
@override
130+
Widget build(BuildContext context) {
131+
return Positioned(
132+
left: 60,
133+
top: 40,
134+
child: Theme.of(context).brandAssets.brand
135+
.logo(context)
136+
.buildPicture(
137+
height: 35,
138+
),
139+
);
140+
}
141+
}

catalyst_voices/apps/voices/lib/pages/category/category_page.dart

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:catalyst_voices/pages/campaign_phase_aware/proposal_submission_p
55
import 'package:catalyst_voices/pages/category/card_information.dart';
66
import 'package:catalyst_voices/pages/category/category_detail_view.dart';
77
import 'package:catalyst_voices/pages/category/draggable_sheet_category_information.dart';
8+
import 'package:catalyst_voices/routes/routing/spaces_route.dart';
89
import 'package:catalyst_voices/widgets/common/infrastructure/voices_wide_screen_constrained.dart';
910
import 'package:catalyst_voices/widgets/indicators/voices_error_indicator.dart';
1011
import 'package:catalyst_voices_blocs/catalyst_voices_blocs.dart';
@@ -177,6 +178,8 @@ class _CategoryDetailLoadingOrDataSelector extends StatelessWidget {
177178
}
178179

179180
class _CategoryPageState extends State<CategoryPage> {
181+
StreamSubscription<DocumentRef?>? _categoryRefSub;
182+
180183
@override
181184
Widget build(BuildContext context) {
182185
return ProposalSubmissionPhaseAware(
@@ -202,12 +205,38 @@ class _CategoryPageState extends State<CategoryPage> {
202205
}
203206
}
204207

208+
@override
209+
void dispose() {
210+
unawaited(_categoryRefSub?.cancel());
211+
_categoryRefSub = null;
212+
super.dispose();
213+
}
214+
205215
@override
206216
void initState() {
207217
super.initState();
208218
unawaited(context.read<CategoryDetailCubit>().getCategories());
209219
unawaited(
210220
context.read<CategoryDetailCubit>().getCategoryDetail(widget.categoryId),
211221
);
222+
_listenForProposalRef(context.read<CategoryDetailCubit>());
223+
}
224+
225+
void _listenForProposalRef(CategoryDetailCubit cubit) {
226+
// listen for updates
227+
_categoryRefSub = cubit.stream
228+
.map((event) => event.category?.id)
229+
.distinct()
230+
.listen(_onCategoryRefChanged);
231+
}
232+
233+
void _onCategoryRefChanged(DocumentRef? categoryRef) {
234+
if (categoryRef == null || categoryRef is! SignedDocumentRef) {
235+
return;
236+
}
237+
238+
Router.neglect(context, () {
239+
CategoryDetailRoute.fromRef(categoryRef: categoryRef).replace(context);
240+
});
212241
}
213242
}

catalyst_voices/apps/voices/lib/pages/dev_tools/cards/config_card.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import 'package:catalyst_voices/pages/dev_tools/cards/info_card.dart';
33
import 'package:catalyst_voices/pages/dev_tools/widgets/value_text.dart';
44
import 'package:catalyst_voices_blocs/catalyst_voices_blocs.dart';
55
import 'package:catalyst_voices_models/catalyst_voices_models.dart';
6-
import 'package:catalyst_voices_shared/catalyst_voices_shared.dart';
76
import 'package:flutter/material.dart';
87

98
class ConfigCard extends StatelessWidget {
@@ -65,7 +64,7 @@ extension on TransactionBuilderConfig {
6564
},
6665
'maxTxSize': maxTxSize,
6766
'maxValueSize': maxValueSize,
68-
'coinsPerUtxoByte': CryptocurrencyFormatter.formatExactAmount(coinsPerUtxoByte),
67+
'coinsPerUtxoByte': coinsPerUtxoByte.value,
6968
'selectionStrategy': selectionStrategy.runtimeType.toString(),
7069
};
7170
}

catalyst_voices/apps/voices/lib/pages/discovery/sections/stay_involved.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'dart:async';
22

33
import 'package:catalyst_voices/common/constants/constants.dart';
4+
import 'package:catalyst_voices/common/ext/active_fund_number_selector_ext.dart';
45
import 'package:catalyst_voices/common/ext/build_context_ext.dart';
56
import 'package:catalyst_voices/pages/discovery/sections/session_account_catalyst_id.dart';
67
import 'package:catalyst_voices/share/share_manager.dart';
@@ -297,7 +298,7 @@ class _VoterCard extends StatelessWidget {
297298
Widget build(BuildContext context) {
298299
return _StayInvolvedCard(
299300
icon: VoicesAssets.icons.vote,
300-
title: context.l10n.registerToVoteFund14,
301+
title: context.l10n.registerToVoteFund(context.activeCampaignFundNumber),
301302
description: context.l10n.stayInvolvedContributorDescription,
302303
actions: Column(
303304
crossAxisAlignment: CrossAxisAlignment.start,

0 commit comments

Comments
 (0)