Skip to content

Commit

Permalink
feat(cat-voices): discovery page mve3 (#1281)
Browse files Browse the repository at this point in the history
* Feat: update testplan template (#1243)

* chore: update testplan

* fix

* fix

* fix

* fix

* fix: testplan template (#1245)

* feat(cat-gateway): Finliaze CIP36 Endpoint Cleanup (#1241)

* fix: api endpoint draft

Signed-off-by: bkioshn <[email protected]>

* fix: api health endpoint v1

Signed-off-by: bkioshn <[email protected]>

* fix: remove bad request from errorResponses

Signed-off-by: bkioshn <[email protected]>

* fix: add bad req to get /registration

Signed-off-by: bkioshn <[email protected]>

* fix: error logging

Signed-off-by: bkioshn <[email protected]>

* fix: remove validation error

Signed-off-by: bkioshn <[email protected]>

* fix: registration get error name

Signed-off-by: bkioshn <[email protected]>

* chore:format

Signed-off-by: bkioshn <[email protected]>

* fix: get json schema from openapi spec

Signed-off-by: bkioshn <[email protected]>

* fix: move schema utils

Signed-off-by: bkioshn <[email protected]>

* fix: optional field

Signed-off-by: bkioshn <[email protected]>

* fix: config key

Signed-off-by: bkioshn <[email protected]>

* fix: cat-gateway code gen

Signed-off-by: bkioshn <[email protected]>

* fix: api name in cat-voice

Signed-off-by: bkioshn <[email protected]>

* fix: cat-voice format

Signed-off-by: bkioshn <[email protected]>

* chore: fix spacing

Signed-off-by: bkioshn <[email protected]>

* chore: fix spacing

Signed-off-by: bkioshn <[email protected]>

* chore: change tag config description

* test: add test for default validator

* fix: add spectral ruleset

Signed-off-by: bkioshn <[email protected]>

* fix(cat-gateway): Sort the spelling words, and use latest deny.toml

* fix(cat-gateway): Fix broken pre-push justfile target

* docs(cat-gateway): cleanup

* docs(cat-gateway): Fix API Groups and document them better

* docs(cat-gateway): Add documentation to the health/inspection endpoint

* docs(cat-gateway): Add descriptions for cardano/cip36/latest_registration/stake_addr

* docs(cat-gateway): Document stake key hash and vote key endpoints for cardano

* docs(cat-gateway): add documentation to config/frontend

* docs(cat-gateway): Add api docs for frontend schema

* docs(cat-gateway): Move legacy registration endpoints into the Legacy TAG.

* docs(cat-gateway): Remaining documentable entities documented

* fix: update openapi linter

Signed-off-by: bkioshn <[email protected]>

* docs(cat-gateway): Add more constraints to parameters and json bodies

* fix: openapi lint FUNCTION name

Signed-off-by: bkioshn <[email protected]>

* fix: CIP36 example and description

Signed-off-by: bkioshn <[email protected]>

* fix(cat-gateway): cleanup error handling, and add a global 429 response to all endpoints.

* fix: config endpoint example, desc, and return

Signed-off-by: bkioshn <[email protected]>

* chore: remove todo

Signed-off-by: bkioshn <[email protected]>

* fix: move config object

Signed-off-by: bkioshn <[email protected]>

* fix: move cip36 object

Signed-off-by: bkioshn <[email protected]>

* docs(cat-gateway): Add missing headers to responses

* docs(cat-gateway): Cleanup the rest of the documentation in the api

* fix(cat-gateway): Fix OpenAPI linting and add autogenerated api file for dart.

* refactor(cat-gateway): Better generalize the OpenAPI simple string type creation macro.

* fix(cat-gateway): Add APIKey and CatToken auth to some endpoints.  Add 401 and 403 common responses.

* fix(cat-gateway): Add universal 422 response to all endpoints, and try and make all endpoint validation use it.

* fix: add cardano stake address type

Signed-off-by: bkioshn <[email protected]>

* fix(cat-gateway): stake address type

Signed-off-by: bkioshn <[email protected]>

* fix(cat-gateway): Refactor the RBAC Token auth, so it's easier to maintain.

* fix(cat-gateway): stake address name

Signed-off-by: bkioshn <[email protected]>

* fix(cat-gateway): Add no auth and no-auth+rbac auth schemes

* fix(cat-gateway): format + stake addr example

Signed-off-by: bkioshn <[email protected]>

* fix(cat-gateway): code format

* fix(cat-gateway): openapi spectral example rules

Signed-off-by: bkioshn <[email protected]>

* fix(cat-gateway): Move legacy registration endpoint under Legacy Tag

* fix(cat-gateway): Add Auth to all endpoints

* fix(docs): Remove obsolete lint config file

* fix(cat-gateway): Make config.toml match upstream

* docs(docs): update project dictionary

* feat(cat-gateway): add target to make it quick to check openapi lints locally

* fix(cat-gateway): Remove reference to hermes

* fix(cat-gateway): Add auth to rbac endpoints

* docs(cat-gateway): Add full docs for v1/votes/plan/account-votes

* docs(cat-gateway): Add example for ip address query argument

* fix(cat-gateway): Define and abstract Ed25519 Public Keys as hex encoded parameters

* fix(cat-gateway): Make sure string api types do not directly expose the internal string

* fix(cat-gateway): Make conversion from a Ed25519 pub key hex value to a Verifyingkey infallible

* fix(cat-gateway): Fix native asset response types

* docs(cat-gateway): fix comments

* fix(cat-gateway): Autogenerate flutter files

* fix(cat-gateway): Exclude legacy endpoints from needing api examples

* fix(cat-gateway): WIP improving cip36 endpoint docs

* fix(docs): Make targets to re-check the generated schema easy.

* fix: spectral ruleset for linting query params description

* feat: parameter rule

* fix: debug function

* docs(cat-gateway): Make schema lint accept description inside a schema in a query parameter

* fix(cat-gateway): remove debug logic from api docs lint

* fix(cat-gateway): Don't put expanded program into git

* Make error response comments consistent

* test(cat-gateway): Add local operation to easily expand macros in the service code

* fix(cat-gateway): CIP36 Structured endpoint

* fix: speling

* fix(rust): cleanup/normalize nonce validation

* fix(rust): code format

* Update catalyst-gateway/bin/src/service/common/types/cardano/cip19_shelley_address.rs

Co-authored-by: bkioshn <[email protected]>

* Update catalyst-gateway/bin/src/service/common/types/cardano/cip19_shelley_address.rs

Co-authored-by: bkioshn <[email protected]>

---------

Signed-off-by: bkioshn <[email protected]>
Co-authored-by: bkioshn <[email protected]>
Co-authored-by: bkioshn <[email protected]>
Co-authored-by: Dominik Toton <[email protected]>
Co-authored-by: Apisit Ritreungroj <[email protected]>

* feat: update segment names

* feat: add new discovery page

* feat: add empty state for proposals

* fix: rename

* feat: add proposals cubit

* feat: add tests

* chore: spelling

* chore: cleanup

* chore: cleanup

* chore: revert unwanted changes

* chore: revert merge conflicts

* fix: formatting

---------

Signed-off-by: bkioshn <[email protected]>
Co-authored-by: Stefano Cunego <[email protected]>
Co-authored-by: Steven Johnson <[email protected]>
Co-authored-by: bkioshn <[email protected]>
Co-authored-by: bkioshn <[email protected]>
Co-authored-by: Apisit Ritreungroj <[email protected]>
  • Loading branch information
6 people authored Nov 27, 2024
1 parent 720522d commit 4c1b56b
Show file tree
Hide file tree
Showing 39 changed files with 1,864 additions and 138 deletions.
1 change: 1 addition & 0 deletions .config/dictionaries/project.dic
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ unawaited
unchunk
Unlogged
unmanaged
Unmarks
Unstaked
upskilling
UTXO
Expand Down
5 changes: 4 additions & 1 deletion catalyst_voices/apps/voices/lib/app/view/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ class _AppState extends State<App> {
create: (_) => Dependencies.instance.get<LoginBloc>(),
),
BlocProvider<SessionCubit>(
create: (_) => Dependencies.instance.get(),
create: (_) => Dependencies.instance.get<SessionCubit>(),
),
BlocProvider<ProposalsCubit>(
create: (_) => Dependencies.instance.get<ProposalsCubit>(),
),
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ abstract class DateFormatter {
/// - Yesterday
/// - 2 days ago
/// - Other cases: yMMMMd date format.
static String formatRecentDate(VoicesLocalizations l10n, DateTime dateTime) {
final now = DateTimeExt.now();
static String formatRecentDate(
VoicesLocalizations l10n,
DateTime dateTime, {
DateTime? from,
}) {
from ??= DateTimeExt.now();

final today = DateTime(now.year, now.month, now.day, 12);
final today = DateTime(from.year, from.month, from.day, 12);
if (dateTime.isSameDateAs(today)) return l10n.today;

final tomorrow = today.plusDays(1);
Expand Down
8 changes: 7 additions & 1 deletion catalyst_voices/apps/voices/lib/dependency/dependencies.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ final class Dependencies extends DependencyProvider {
registrationService: get<RegistrationService>(),
progressNotifier: get<RegistrationProgressNotifier>(),
);
});
})
..registerLazySingleton<ProposalsCubit>(
() => ProposalsCubit(proposalRepository: get<ProposalRepository>()),
);
}

void _registerRepositories() {
Expand All @@ -62,6 +65,9 @@ final class Dependencies extends DependencyProvider {
)
..registerLazySingleton<TransactionConfigRepository>(
TransactionConfigRepository.new,
)
..registerLazySingleton<ProposalRepository>(
ProposalRepository.new,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class _UnlockPassword extends StatelessWidget {
Widget build(BuildContext context) {
return VoicesPasswordTextField(
controller: controller,
autofocus: true,
decoration: VoicesTextFieldDecoration(
labelText: context.l10n.unlockDialogHint,
errorText: error?.message(context),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@ import 'package:flutter_bloc/flutter_bloc.dart';

// Note. This widget will be removed so its not localized
class CurrentUserStatusText extends StatelessWidget {
const CurrentUserStatusText({
super.key,
});
const CurrentUserStatusText({super.key});

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final sessionBloc = context.watch<SessionCubit>();

final stateDesc = switch (sessionBloc.state) {
VisitorSessionState() => 'visitor',
GuestSessionState() => 'guest',
ActiveAccountSessionState() => 'user',
VisitorSessionState() => 'Visitor / no key',
GuestSessionState() => 'Guest / locked',
ActiveAccountSessionState() => 'Actor / unlocked',
};

return Text(
Expand Down
Loading

0 comments on commit 4c1b56b

Please sign in to comment.