Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
886fa68
feat(cat-voices): Add Dio client (#3570)
bstolinski Oct 22, 2025
d09cf74
feat(cat-voices): update signed document according to v0.0.4 specs (#…
dt-iohk Oct 23, 2025
615f6fd
feat(cat-voices): update signed document according to v0.0.4 spec - r…
dt-iohk Oct 23, 2025
b7267f6
feat(cat-voices): Remove Chopper and code generation scripts (#3573)
bstolinski Oct 23, 2025
0be246c
Merge branch 'main' into feat/sync-with-gateway-v2-endpoints-3362
dt-iohk Oct 23, 2025
67af07f
feat(cat-voices): Migrate document index to v2 endpoint (#3599)
bstolinski Oct 27, 2025
336b98e
feat(cat-voices): Migrate `rbac` endpoints to v2 (#3596)
bstolinski Oct 27, 2025
3cd2732
Merge branch 'main' into feat/sync-with-gateway-v2-endpoints-3362
dt-iohk Oct 29, 2025
fcc5adb
refactor(cat-voices): Centralize signed document metadata creation (#…
dt-iohk Oct 29, 2025
c593207
feat(cat-voices): Update stakeAssets endpoint to v2 (#3621)
bstolinski Oct 31, 2025
69e890b
Merge branch 'main' into feat/sync-with-gateway-v2-endpoints-3362
bstolinski Oct 31, 2025
34d1faa
Merge branch 'main' into feat/sync-with-gateway-v2-endpoints-3362
dt-iohk Nov 7, 2025
877128d
Merge branch 'main' into feat/sync-with-gateway-v2-endpoints-3362
damian-molinski Nov 10, 2025
48e1d74
Merge branch 'main' into feat/sync-with-gateway-v2-endpoints-3362
damian-molinski Nov 10, 2025
f3670e0
Merge branch 'main' into feat/sync-with-gateway-v2-endpoints-3362
dt-iohk Nov 12, 2025
8c6712a
chore(cat-voices): upgrade build runner (#3733)
bstolinski Nov 18, 2025
bd072eb
Merge main into feat/sync-with-gateway-v2-endpoints-3362
damian-molinski Nov 19, 2025
a60c036
feat(cat-voices): expose collaborators in metadata (#3750)
damian-molinski Nov 20, 2025
b495c5a
feat(cat-voices): dynamic templates refs (#3757)
damian-molinski Nov 21, 2025
f9a158b
Merge main into feat/sync-with-gateway-v2-endpoints-3362
damian-molinski Nov 21, 2025
8222c0a
Merge branch 'feat/sync-with-gateway-v2-endpoints-3362' of github.com…
damian-molinski Nov 21, 2025
2209545
fix: main merge
damian-molinski Nov 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .config/dictionaries/project.dic
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ ciphertext
ciphertexts
CIPs
CNFT
COAP
COCOAPODS
codegen
codepoints
Expand Down Expand Up @@ -173,6 +174,7 @@ iohk
IPFS
iphoneos
iphonesimulator
IPLD
jdbc
jetbrains
jlumbroso
Expand Down
9 changes: 2 additions & 7 deletions .earthlyignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@
# Generated files from code generation tools
**/*.g.dart
**/*.freezed.dart
**/*.chopper.dart
**/*.swagger.dart
**/*.openapi.dart
**/*.gen.dart
**/*.swagger.*.dart
**/*.drift.dart
**/openapi/processed/
**/catalyst_voices_localizations_*.dart
**/catalyst_voices_localizations.dart
**/generated/catalyst_voices_localizations_*.dart
**/generated/catalyst_voices_localizations.dart

# node related

Expand Down
9 changes: 2 additions & 7 deletions catalyst_voices/.earthlyignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@
# Generated files from code generation tools
**/*.g.dart
**/*.freezed.dart
**/*.chopper.dart
**/*.swagger.dart
**/*.openapi.dart
**/*.gen.dart
**/*.swagger.*.dart
**/*.drift.dart
**/openapi/processed/
**/catalyst_voices_localizations_*.dart
**/catalyst_voices_localizations.dart
**/generated/catalyst_voices_localizations_*.dart
**/generated/catalyst_voices_localizations.dart

# node related

Expand Down
15 changes: 0 additions & 15 deletions catalyst_voices/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,12 @@ docs/
# Generated files from code generation tools
*.g.dart
*.freezed.dart
*.chopper.dart
*.swagger.dart
*.openapi.dart
*.gen.dart
*.swagger.*.dart
*.drift.dart
**/generated/*
**/openapi/**

# Un-ignore vit, cat-reviews and cat-gateway openapi spec as they're not generated
!**/openapi/vit.json
!**/openapi/cat-reviews.json
!**/openapi/cat-status.json
!**/openapi/cat-gateway.json

# Un-ignore generated files in public packages
!**/packages/libs/**/*.g.dart
!**/packages/libs/**/*.freezed.dart
!**/packages/libs/**/*.chopper.dart
!**/packages/libs/**/*.swagger.dart
!**/packages/libs/**/*.openapi.dart
!**/packages/libs/**/*.gen.dart

# Localization (l10n) generated files
Expand Down
27 changes: 3 additions & 24 deletions catalyst_voices/Earthfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
VERSION 0.8

IMPORT ../ AS repo-ci
IMPORT ../catalyst-gateway AS catalyst-gateway
IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.6.3 AS flutter-ci

# repo-catalyst-voices - Creates artifacts of all configuration files,
Expand All @@ -22,37 +21,29 @@ builder:
DO flutter-ci+BOOTSTRAP

# Generates flutter code.
# Generates codes for Catalyst Gateway OpenAPI, Voices Localization and
# VoicesAssets and other packages that depend on code-generator.
# Generates codes for Voices Localization and VoicesAssets and other packages
# that depend on code-generator.
# It accepts [save_locally] ARG that when true place the artifacts in the
# proper folders
code-generator:
ARG save_locally=false
FROM +builder

LET gen_code_path = lib/generated/api
LET local_gen_code_path = packages/internal/catalyst_voices_repositories/lib/generated/api/

WORKDIR packages/internal/catalyst_voices_repositories

WORKDIR /frontend

RUN melos l10n
RUN melos build-runner
RUN melos build-runner-repository

IF [ $save_locally = true ]
# This step saves generated files other then OpenApi Services
# This step saves generated files
RUN find . \
\( -name "*.g.dart" \
-o -name "*.chopper.dart" \
-o -name "*.gen.dart" \
-o -name "catalyst_voices_localizations*.dart" \
-o -name "*.drift.dart" \)

FOR generated_file IN $(find . \
\( -name "*.g.dart" \
-o -name "*.chopper.dart" \
-o -name "*.gen.dart" \
-o -name "catalyst_voices_localizations*.dart" \
-o -name "*.drift.dart" \))
Expand All @@ -62,18 +53,6 @@ code-generator:
SAVE ARTIFACT .
END

WORKDIR packages/internal/catalyst_voices_repositories

# Saves generated OpenApi Services
IF [ $save_locally = true ]
SAVE ARTIFACT "$gen_code_path/*" AS LOCAL $local_gen_code_path
ELSE
SAVE ARTIFACT $gen_code_path
END

# restore current working directory to the root of the project
WORKDIR /frontend

# Runs code formatting checks.
check-code-formatting:
FROM +builder
Expand Down
1 change: 0 additions & 1 deletion catalyst_voices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ flutter run --dart-define=FEATURE_VOTING=false

This project utilizes automatic code generation for the following components:

* Catalyst Gateway OpenAPI
* Localization files
* Asset files
* Navigation route files
Expand Down
2 changes: 1 addition & 1 deletion catalyst_voices/apps/voices/lib/configs/bootstrap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ Future<void> _doBootstrapAndRun(
Future<AppConfig> _getAppConfig({
required AppEnvironmentType env,
}) async {
final api = ApiServices(env: env);
final api = ApiServices.dio(env: env);
final source = ApiConfigSource(api);
final service = ConfigService(ConfigRepository(source));
return service.getAppConfig(env: env);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ final class Dependencies extends DependencyProvider {
void _registerNetwork() {
registerLazySingleton<ApiServices>(
() {
return ApiServices(
return ApiServices.dio(
env: get<AppEnvironment>().type,
authTokenProvider: get<AuthTokenProvider>(),
httpClient: () => get<ReportingService>().buildHttpClient(),
interceptClient: get<ReportingService>().registerDio,
);
},
dispose: (api) => api.dispose(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ class CardInformation extends StatelessWidget {
padding: padding,
children: [
CategoryProposalsDetailsCard(
categoryId: category.id,
categoryRef: category.ref,
categoryName: category.formattedName,
categoryProposalsCount: category.proposalsCount,
),
const SizedBox(height: 16),
Offstage(
offstage: !isActiveProposer,
child: CreateProposalCard(
categoryId: category.id,
categoryRef: category.ref,
categoryName: category.formattedName,
categoryDos: category.dos,
categoryDonts: category.donts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CategoryCompactDetailView extends StatelessWidget {
_CategoryBrief(
categoryName: category.formattedName,
categoryDescription: category.description,
categoryRef: category.id,
categoryRef: category.ref,
),
FundsDetailCard(
allFunds: category.availableFunds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CategoryDetailView extends StatelessWidget {
_CategoryBrief(
categoryName: category.formattedName,
categoryDescription: category.description,
categoryRef: category.id,
categoryRef: category.ref,
image: category.image,
proposalCount: category.proposalsCount,
),
Expand Down
20 changes: 10 additions & 10 deletions catalyst_voices/apps/voices/lib/pages/category/category_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import 'package:flutter/material.dart';
import 'package:skeletonizer/skeletonizer.dart';

class CategoryPage extends StatefulWidget {
final SignedDocumentRef categoryId;
final SignedDocumentRef categoryRef;

const CategoryPage({super.key, required this.categoryId});
const CategoryPage({super.key, required this.categoryRef});

@override
State<CategoryPage> createState() => _CategoryPageState();
Expand Down Expand Up @@ -102,9 +102,9 @@ class _BodySmall extends StatelessWidget {
}

class _CategoryDetailErrorSelector extends StatelessWidget {
final SignedDocumentRef categoryId;
final SignedDocumentRef categoryRef;

const _CategoryDetailErrorSelector({required this.categoryId});
const _CategoryDetailErrorSelector({required this.categoryRef});

@override
Widget build(BuildContext context) {
Expand All @@ -128,7 +128,7 @@ class _CategoryDetailErrorSelector extends StatelessWidget {
? null
: () {
unawaited(
context.read<CategoryDetailCubit>().getCategoryDetail(categoryId),
context.read<CategoryDetailCubit>().getCategoryDetail(categoryRef),
);
},
),
Expand Down Expand Up @@ -187,7 +187,7 @@ class _CategoryPageState extends State<CategoryPage> {
children: [
const _CategoryDetailLoadingOrDataSelector(),
_CategoryDetailErrorSelector(
categoryId: widget.categoryId,
categoryRef: widget.categoryRef,
),
].constrainedDelegate(),
),
Expand All @@ -198,9 +198,9 @@ class _CategoryPageState extends State<CategoryPage> {
void didUpdateWidget(CategoryPage oldWidget) {
super.didUpdateWidget(oldWidget);

if (widget.categoryId != oldWidget.categoryId) {
if (widget.categoryRef != oldWidget.categoryRef) {
unawaited(
context.read<CategoryDetailCubit>().getCategoryDetail(widget.categoryId),
context.read<CategoryDetailCubit>().getCategoryDetail(widget.categoryRef),
);
}
}
Expand All @@ -217,15 +217,15 @@ class _CategoryPageState extends State<CategoryPage> {
super.initState();
unawaited(context.read<CategoryDetailCubit>().getCategories());
unawaited(
context.read<CategoryDetailCubit>().getCategoryDetail(widget.categoryId),
context.read<CategoryDetailCubit>().getCategoryDetail(widget.categoryRef),
);
_listenForProposalRef(context.read<CategoryDetailCubit>());
}

void _listenForProposalRef(CategoryDetailCubit cubit) {
// listen for updates
_categoryRefSub = cubit.stream
.map((event) => event.category?.id)
.map((event) => event.category?.ref)
.distinct()
.listen(_onCategoryRefChanged);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class ChangeCategoryButton extends StatelessWidget {
List<DropdownMenuViewModel<ProposalsCategoryFilter>>
>(
selector: (state) {
final selectedCategory = state.category?.id ?? '';
final selectedCategory = state.category?.ref ?? '';
return state.categories
.map(
(e) => DropdownMenuViewModel(
value: ProposalsRefCategoryFilter(ref: e.id),
value: ProposalsRefCategoryFilter(ref: e.ref),
name: e.formattedName,
isSelected: e.id == selectedCategory,
isSelected: e.ref == selectedCategory,
),
)
.toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';

class ProposalBuilderPage extends StatelessWidget {
final DocumentRef? proposalId;
final SignedDocumentRef? categoryId;
final SignedDocumentRef? categoryRef;

const ProposalBuilderPage({
super.key,
this.proposalId,
this.categoryId,
this.categoryRef,
});

@override
Expand All @@ -50,19 +50,19 @@ class ProposalBuilderPage extends StatelessWidget {
create: (context) => Dependencies.instance.get<ProposalBuilderBloc>(),
child: _ProposalBuilderBody(
proposalId: proposalId,
categoryId: categoryId,
categoryRef: categoryRef,
),
);
}
}

class _ProposalBuilderBody extends StatefulWidget {
final DocumentRef? proposalId;
final SignedDocumentRef? categoryId;
final SignedDocumentRef? categoryRef;

const _ProposalBuilderBody({
this.proposalId,
this.categoryId,
this.categoryRef,
});

@override
Expand Down Expand Up @@ -116,7 +116,7 @@ class _ProposalBuilderBodyState extends State<_ProposalBuilderBody>
void didUpdateWidget(_ProposalBuilderBody oldWidget) {
super.didUpdateWidget(oldWidget);

if (widget.proposalId != oldWidget.proposalId || widget.categoryId != oldWidget.categoryId) {
if (widget.proposalId != oldWidget.proposalId || widget.categoryRef != oldWidget.categoryRef) {
_loadProposal();
}
}
Expand Down Expand Up @@ -239,11 +239,11 @@ class _ProposalBuilderBodyState extends State<_ProposalBuilderBody>
bloc ??= context.read<ProposalBuilderBloc>();

final proposalId = widget.proposalId;
final categoryId = widget.categoryId;
final categoryRef = widget.categoryRef;
if (proposalId != null) {
bloc.add(LoadProposalEvent(proposalId: proposalId));
} else if (categoryId != null) {
bloc.add(LoadProposalCategoryEvent(categoryId: categoryId));
} else if (categoryRef != null) {
bloc.add(LoadProposalCategoryEvent(categoryRef: categoryRef));
} else {
bloc.add(const LoadDefaultProposalCategoryEvent());
}
Expand Down
Loading