From 8570925cf7f87a7585ef7d7108c4145b79a0e8f5 Mon Sep 17 00:00:00 2001 From: Ryszard Schossler Date: Tue, 14 Jan 2025 13:14:11 +0100 Subject: [PATCH 1/5] feat: creating plain text component for single and multiline --- .../simple_text_entry_widget.dart | 181 ++++++++++++++++++ .../widgets/text_field/voices_text_field.dart | 5 + .../tiles/document_builder_section_tile.dart | 15 +- 3 files changed, 198 insertions(+), 3 deletions(-) create mode 100644 catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart diff --git a/catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart b/catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart new file mode 100644 index 00000000000..cb144e95fe5 --- /dev/null +++ b/catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart @@ -0,0 +1,181 @@ +import 'package:catalyst_voices/common/ext/document_property_ext.dart'; +import 'package:catalyst_voices/widgets/widgets.dart'; +import 'package:catalyst_voices_assets/catalyst_voices_assets.dart'; +import 'package:catalyst_voices_models/catalyst_voices_models.dart'; +import 'package:catalyst_voices_view_models/catalyst_voices_view_models.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +class SimpleTextEntryWidget extends StatefulWidget { + final DocumentProperty property; + final bool isEditMode; + final ValueChanged onChanged; + + const SimpleTextEntryWidget({ + super.key, + required this.property, + required this.isEditMode, + required this.onChanged, + }); + + @override + State createState() => _SimpleTextEntryWidgetState(); +} + +class _SimpleTextEntryWidgetState extends State { + late final TextEditingController _controller; + late final FocusNode _focusNode; + + @override + void initState() { + super.initState(); + _controller = TextEditingController(text: widget.property.value); + _controller.addListener(_handleValueChange); + _focusNode = FocusNode(canRequestFocus: widget.isEditMode); + } + + @override + void didUpdateWidget(SimpleTextEntryWidget oldWidget) { + super.didUpdateWidget(oldWidget); + + if (oldWidget.isEditMode != widget.isEditMode) { + _handleEditModeChanged(); + if (!widget.isEditMode) { + _controller.text = widget.property.value ?? ''; + } + } + + if (widget.property.value != oldWidget.property.value) { + _controller.text = widget.property.value ?? ''; + } + } + + @override + void dispose() { + _controller.dispose(); + _focusNode.dispose(); + super.dispose(); + } + + String get _description => widget.property.formattedDescription; + int? get _maxLength => widget.property.schema.strLengthRange?.max; + int? get _maxLines => + widget.property.schema.definition is SingleLineTextEntryDefinition + ? 1 + : null; + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (_description.isNotEmpty) ...[ + Text( + _description, + style: Theme.of(context).textTheme.titleSmall, + ), + const SizedBox(height: 8), + ], + _SimpleDocumentTextField( + controller: _controller, + focusNode: _focusNode, + onFieldSubmitted: _notifyChangeListener, + validator: _validate, + enabled: widget.isEditMode, + maxLines: _maxLines, + maxLength: _maxLength, + ), + ], + ); + } + + void _handleEditModeChanged() { + _focusNode.canRequestFocus = widget.isEditMode; + + if (widget.isEditMode) { + _focusNode.requestFocus(); + } else { + _focusNode.unfocus(); + } + } + + void _handleValueChange() { + final controllerValue = _controller.text; + if (widget.property.value != controllerValue && + controllerValue.isNotEmpty) { + _notifyChangeListener(controllerValue); + } + } + + void _notifyChangeListener(String? value) { + final change = DocumentChange( + nodeId: widget.property.schema.nodeId, + value: value, + ); + + widget.onChanged(change); + } + + VoicesTextFieldValidationResult _validate(String? value) { + if (!widget.isEditMode) { + return const VoicesTextFieldValidationResult.none(); + } + final schema = widget.property.schema; + final result = schema.validatePropertyValue(value); + if (result.isValid) { + return const VoicesTextFieldValidationResult.none(); + } else { + final localized = LocalizedDocumentValidationResult.from(result); + return VoicesTextFieldValidationResult.error(localized.message(context)); + } + } +} + +class _SimpleDocumentTextField extends StatelessWidget { + final TextEditingController? controller; + final ValueChanged? onFieldSubmitted; + final VoicesTextFieldValidator? validator; + final FocusNode? focusNode; + final bool enabled; + final int? maxLines; + final int? maxLength; + + const _SimpleDocumentTextField({ + this.controller, + this.onFieldSubmitted, + this.validator, + this.focusNode, + this.enabled = false, + this.maxLines, + this.maxLength, + }); + + @override + Widget build(BuildContext context) { + return IntrinsicHeight( + child: Stack( + children: [ + VoicesTextField( + controller: controller, + focusNode: focusNode, + onFieldSubmitted: onFieldSubmitted, + validator: validator, + enabled: enabled, + resizable: false, + maxLengthEnforcement: MaxLengthEnforcement.none, + autovalidateMode: AutovalidateMode.disabled, + maxLines: maxLines, + maxLength: maxLength, + ), + if (maxLines == null) + Positioned( + bottom: maxLength != null ? 18 : 0, + right: 0, + child: VoicesAssets.images.dragger.buildIcon(size: 15), + ), + ], + ), + ); + } +} diff --git a/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart b/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart index 1af6a00b13b..304e44bde49 100644 --- a/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart +++ b/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart @@ -83,6 +83,9 @@ class VoicesTextField extends StatefulWidget { /// [AutovalidateMode] final AutovalidateMode? autovalidateMode; + /// [MaxLengthEnforcement] + final MaxLengthEnforcement? maxLengthEnforcement; + final ValueChanged? onStatusChanged; const VoicesTextField({ @@ -113,6 +116,7 @@ class VoicesTextField extends StatefulWidget { this.onSaved, this.inputFormatters, this.autovalidateMode, + this.maxLengthEnforcement, this.onStatusChanged, }); @@ -229,6 +233,7 @@ class _VoicesTextFieldState extends State { maxLines: widget.maxLines, minLines: widget.minLines, maxLength: widget.maxLength, + maxLengthEnforcement: widget.maxLengthEnforcement, readOnly: widget.readOnly, ignorePointers: widget.ignorePointers, enabled: widget.enabled, diff --git a/catalyst_voices/apps/voices/lib/widgets/tiles/document_builder_section_tile.dart b/catalyst_voices/apps/voices/lib/widgets/tiles/document_builder_section_tile.dart index 88f0465f37e..bd35a886867 100644 --- a/catalyst_voices/apps/voices/lib/widgets/tiles/document_builder_section_tile.dart +++ b/catalyst_voices/apps/voices/lib/widgets/tiles/document_builder_section_tile.dart @@ -1,5 +1,6 @@ import 'package:catalyst_voices/widgets/document_builder/agreement_confirmation_widget.dart'; import 'package:catalyst_voices/widgets/document_builder/document_token_value_widget.dart'; +import 'package:catalyst_voices/widgets/document_builder/simple_text_entry_widget.dart'; import 'package:catalyst_voices/widgets/document_builder/single_dropdown_selection_widget.dart'; import 'package:catalyst_voices/widgets/document_builder/single_grouped_tag_selector_widget.dart'; import 'package:catalyst_voices/widgets/document_builder/single_line_https_url_widget.dart.dart'; @@ -206,8 +207,7 @@ class _PropertyBuilder extends StatelessWidget { '${property.schema.definition} unsupported ' 'by $DocumentBuilderSectionTile', ); - case SingleLineTextEntryDefinition(): - case MultiLineTextEntryDefinition(): + case MultiLineTextEntryMarkdownDefinition(): case MultiSelectDefinition(): case SingleLineTextEntryListDefinition(): @@ -263,12 +263,21 @@ class _PropertyBuilder extends StatelessWidget { onChanged: onChanged, ); case TokenValueCardanoADADefinition(): + final castProperty = definition.castProperty(property); return DocumentTokenValueWidget( - property: definition.castProperty(property), + property: castProperty, currency: const Currency.ada(), isEditMode: isEditMode, onChanged: onChanged, ); + case SingleLineTextEntryDefinition(): + case MultiLineTextEntryDefinition(): + final castProperty = definition.castProperty(property); + return SimpleTextEntryWidget( + property: castProperty as DocumentProperty, + isEditMode: isEditMode, + onChanged: onChanged, + ); } } } From 73e9b659378d057d4db1fc828dcc1ce2f0971260 Mon Sep 17 00:00:00 2001 From: Ryszard Schossler Date: Tue, 14 Jan 2025 13:36:51 +0100 Subject: [PATCH 2/5] feat: changing textfield to text area when multiline definiton is set --- .../widgets/common/resizable_box_parent.dart | 9 +++- .../simple_text_entry_widget.dart | 47 +++++++------------ .../widgets/text_field/voices_text_field.dart | 2 + 3 files changed, 26 insertions(+), 32 deletions(-) diff --git a/catalyst_voices/apps/voices/lib/widgets/common/resizable_box_parent.dart b/catalyst_voices/apps/voices/lib/widgets/common/resizable_box_parent.dart index 68b620901ea..e72e8d6d45f 100644 --- a/catalyst_voices/apps/voices/lib/widgets/common/resizable_box_parent.dart +++ b/catalyst_voices/apps/voices/lib/widgets/common/resizable_box_parent.dart @@ -7,6 +7,7 @@ import 'package:flutter/widgets.dart'; class ResizableBoxParent extends StatelessWidget { final bool resizableVertically; final bool resizableHorizontally; + final bool maxLineSet; final Widget child; final double minWidth; final double minHeight; @@ -18,6 +19,7 @@ class ResizableBoxParent extends StatelessWidget { required this.child, this.minWidth = 40, this.minHeight = 40, + this.maxLineSet = false, }); @override @@ -34,6 +36,7 @@ class ResizableBoxParent extends StatelessWidget { minHeight: minHeight, resizableHorizontally: resizableHorizontally, resizableVertically: resizableVertically, + maxLineSet: maxLineSet, child: child, ); }, @@ -48,6 +51,7 @@ class _ResizableBox extends StatefulWidget { final double minHeight; final bool resizableVertically; final bool resizableHorizontally; + final bool maxLineSet; const _ResizableBox({ required this.constraints, @@ -56,6 +60,7 @@ class _ResizableBox extends StatefulWidget { required this.minHeight, required this.resizableVertically, required this.resizableHorizontally, + required this.maxLineSet, }); @override @@ -91,7 +96,9 @@ class _ResizableBoxState extends State<_ResizableBox> { child: widget.child, ), Positioned( - bottom: 0, + // when maxLine is set, icon is placed at the max line text + // and not at the corner of the text field + bottom: widget.maxLineSet ? 18 : 0, right: 0, child: MouseRegion( cursor: SystemMouseCursors.resizeDownRight, diff --git a/catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart b/catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart index cb144e95fe5..1bd557c0996 100644 --- a/catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart +++ b/catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart @@ -1,6 +1,5 @@ import 'package:catalyst_voices/common/ext/document_property_ext.dart'; import 'package:catalyst_voices/widgets/widgets.dart'; -import 'package:catalyst_voices_assets/catalyst_voices_assets.dart'; import 'package:catalyst_voices_models/catalyst_voices_models.dart'; import 'package:catalyst_voices_view_models/catalyst_voices_view_models.dart'; import 'package:flutter/material.dart'; @@ -59,10 +58,8 @@ class _SimpleTextEntryWidgetState extends State { String get _description => widget.property.formattedDescription; int? get _maxLength => widget.property.schema.strLengthRange?.max; - int? get _maxLines => - widget.property.schema.definition is SingleLineTextEntryDefinition - ? 1 - : null; + bool get _resizable => + widget.property.schema.definition is MultiLineTextEntryDefinition; @override Widget build(BuildContext context) { @@ -83,7 +80,7 @@ class _SimpleTextEntryWidgetState extends State { onFieldSubmitted: _notifyChangeListener, validator: _validate, enabled: widget.isEditMode, - maxLines: _maxLines, + resizable: _resizable, maxLength: _maxLength, ), ], @@ -138,7 +135,7 @@ class _SimpleDocumentTextField extends StatelessWidget { final VoicesTextFieldValidator? validator; final FocusNode? focusNode; final bool enabled; - final int? maxLines; + final bool resizable; final int? maxLength; const _SimpleDocumentTextField({ @@ -147,35 +144,23 @@ class _SimpleDocumentTextField extends StatelessWidget { this.validator, this.focusNode, this.enabled = false, - this.maxLines, + this.resizable = false, this.maxLength, }); @override Widget build(BuildContext context) { - return IntrinsicHeight( - child: Stack( - children: [ - VoicesTextField( - controller: controller, - focusNode: focusNode, - onFieldSubmitted: onFieldSubmitted, - validator: validator, - enabled: enabled, - resizable: false, - maxLengthEnforcement: MaxLengthEnforcement.none, - autovalidateMode: AutovalidateMode.disabled, - maxLines: maxLines, - maxLength: maxLength, - ), - if (maxLines == null) - Positioned( - bottom: maxLength != null ? 18 : 0, - right: 0, - child: VoicesAssets.images.dragger.buildIcon(size: 15), - ), - ], - ), + return VoicesTextField( + controller: controller, + focusNode: focusNode, + onFieldSubmitted: onFieldSubmitted, + validator: validator, + enabled: enabled, + resizable: resizable, + maxLengthEnforcement: MaxLengthEnforcement.none, + autovalidateMode: AutovalidateMode.disabled, + maxLines: resizable ? null : 1, + maxLength: maxLength, ); } } diff --git a/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart b/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart index 304e44bde49..900f1909409 100644 --- a/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart +++ b/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart @@ -213,6 +213,8 @@ class _VoicesTextFieldState extends State { ResizableBoxParent( resizableHorizontally: resizable, resizableVertically: resizable, + minHeight: widget.maxLines == null ? 65 : 48, + maxLineSet: widget.maxLines == null, child: TextFormField( textAlignVertical: TextAlignVertical.top, autofocus: widget.autofocus, From 4c1955ad96c9a7ee1d4cf1e7fa64d68987a008f6 Mon Sep 17 00:00:00 2001 From: Ryszard Schossler Date: Tue, 14 Jan 2025 14:04:09 +0100 Subject: [PATCH 3/5] fix: format --- .../voices/lib/widgets/tiles/document_builder_section_tile.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/catalyst_voices/apps/voices/lib/widgets/tiles/document_builder_section_tile.dart b/catalyst_voices/apps/voices/lib/widgets/tiles/document_builder_section_tile.dart index 4424dcc2d9c..2fd11effca6 100644 --- a/catalyst_voices/apps/voices/lib/widgets/tiles/document_builder_section_tile.dart +++ b/catalyst_voices/apps/voices/lib/widgets/tiles/document_builder_section_tile.dart @@ -281,6 +281,7 @@ class _PropertyBuilder extends StatelessWidget { property: castProperty as DocumentProperty, isEditMode: isEditMode, onChanged: onChanged, + ); case YesNoChoiceDefinition(): final castProperty = definition.castProperty(property); return YesNoChoiceWidget( From 472536af76caea192c6b5399cdb0c2f64cc0e6fa Mon Sep 17 00:00:00 2001 From: Ryszard Schossler Date: Wed, 15 Jan 2025 09:34:28 +0100 Subject: [PATCH 4/5] chore: changing name of the param for resizable box --- .../widgets/common/resizable_box_parent.dart | 14 ++++++-------- .../simple_text_entry_widget.dart | 17 ++++++++++++----- .../widgets/text_field/voices_text_field.dart | 2 +- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/catalyst_voices/apps/voices/lib/widgets/common/resizable_box_parent.dart b/catalyst_voices/apps/voices/lib/widgets/common/resizable_box_parent.dart index e72e8d6d45f..12eaad9e1a6 100644 --- a/catalyst_voices/apps/voices/lib/widgets/common/resizable_box_parent.dart +++ b/catalyst_voices/apps/voices/lib/widgets/common/resizable_box_parent.dart @@ -7,10 +7,10 @@ import 'package:flutter/widgets.dart'; class ResizableBoxParent extends StatelessWidget { final bool resizableVertically; final bool resizableHorizontally; - final bool maxLineSet; final Widget child; final double minWidth; final double minHeight; + final double iconBottomSpacing; const ResizableBoxParent({ super.key, @@ -19,7 +19,7 @@ class ResizableBoxParent extends StatelessWidget { required this.child, this.minWidth = 40, this.minHeight = 40, - this.maxLineSet = false, + this.iconBottomSpacing = 0, }); @override @@ -36,7 +36,7 @@ class ResizableBoxParent extends StatelessWidget { minHeight: minHeight, resizableHorizontally: resizableHorizontally, resizableVertically: resizableVertically, - maxLineSet: maxLineSet, + iconBottomSpacing: iconBottomSpacing, child: child, ); }, @@ -51,7 +51,7 @@ class _ResizableBox extends StatefulWidget { final double minHeight; final bool resizableVertically; final bool resizableHorizontally; - final bool maxLineSet; + final double iconBottomSpacing; const _ResizableBox({ required this.constraints, @@ -60,7 +60,7 @@ class _ResizableBox extends StatefulWidget { required this.minHeight, required this.resizableVertically, required this.resizableHorizontally, - required this.maxLineSet, + required this.iconBottomSpacing, }); @override @@ -96,9 +96,7 @@ class _ResizableBoxState extends State<_ResizableBox> { child: widget.child, ), Positioned( - // when maxLine is set, icon is placed at the max line text - // and not at the corner of the text field - bottom: widget.maxLineSet ? 18 : 0, + bottom: widget.iconBottomSpacing, right: 0, child: MouseRegion( cursor: SystemMouseCursors.resizeDownRight, diff --git a/catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart b/catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart index 1bd557c0996..b4614b10564 100644 --- a/catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart +++ b/catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart @@ -25,6 +25,11 @@ class _SimpleTextEntryWidgetState extends State { late final TextEditingController _controller; late final FocusNode _focusNode; + String get _description => widget.property.formattedDescription; + int? get _maxLength => widget.property.schema.strLengthRange?.max; + bool get _resizable => + widget.property.schema.definition is MultiLineTextEntryDefinition; + @override void initState() { super.initState(); @@ -56,11 +61,6 @@ class _SimpleTextEntryWidgetState extends State { super.dispose(); } - String get _description => widget.property.formattedDescription; - int? get _maxLength => widget.property.schema.strLengthRange?.max; - bool get _resizable => - widget.property.schema.definition is MultiLineTextEntryDefinition; - @override Widget build(BuildContext context) { return Column( @@ -80,6 +80,8 @@ class _SimpleTextEntryWidgetState extends State { onFieldSubmitted: _notifyChangeListener, validator: _validate, enabled: widget.isEditMode, + // TODO(ryszard-schossler): check if this is right after schema is finalized + hintText: widget.property.schema.defaultValue, resizable: _resizable, maxLength: _maxLength, ), @@ -134,6 +136,7 @@ class _SimpleDocumentTextField extends StatelessWidget { final ValueChanged? onFieldSubmitted; final VoicesTextFieldValidator? validator; final FocusNode? focusNode; + final String? hintText; final bool enabled; final bool resizable; final int? maxLength; @@ -143,6 +146,7 @@ class _SimpleDocumentTextField extends StatelessWidget { this.onFieldSubmitted, this.validator, this.focusNode, + this.hintText, this.enabled = false, this.resizable = false, this.maxLength, @@ -155,6 +159,9 @@ class _SimpleDocumentTextField extends StatelessWidget { focusNode: focusNode, onFieldSubmitted: onFieldSubmitted, validator: validator, + decoration: VoicesTextFieldDecoration( + hintText: hintText, + ), enabled: enabled, resizable: resizable, maxLengthEnforcement: MaxLengthEnforcement.none, diff --git a/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart b/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart index 900f1909409..61171b04800 100644 --- a/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart +++ b/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart @@ -214,7 +214,7 @@ class _VoicesTextFieldState extends State { resizableHorizontally: resizable, resizableVertically: resizable, minHeight: widget.maxLines == null ? 65 : 48, - maxLineSet: widget.maxLines == null, + iconBottomSpacing: widget.maxLines == null ? 18 : 0, child: TextFormField( textAlignVertical: TextAlignVertical.top, autofocus: widget.autofocus, From decebdfb11db917e4adb431a8a1b03de446681e5 Mon Sep 17 00:00:00 2001 From: Ryszard Schossler Date: Wed, 15 Jan 2025 09:57:02 +0100 Subject: [PATCH 5/5] fix: username in todos --- .config/dictionaries/project.dic | 2 +- .../apps/voices/lib/common/ext/guidance_ext.dart | 2 +- .../apps/voices/lib/dependency/dependencies.dart | 2 +- .../apps/voices/lib/widgets/cards/campaign_stage_card.dart | 4 ++-- .../widgets/document_builder/simple_text_entry_widget.dart | 2 +- .../campaign/campaign_builder/campaign_builder_cubit.dart | 4 ++-- .../internal/catalyst_voices_driver/lib/src/extension.dart | 4 ++-- .../document/definitions/nested_questions_definition.dart | 2 +- .../dto/document/schema/document_schema_property_dto.dart | 2 +- .../lib/src/utils/launch_url_mixin.dart | 2 +- .../lib/src/authentication/access_control.dart | 6 +++--- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.config/dictionaries/project.dic b/.config/dictionaries/project.dic index 52e4d0d526f..51d93e75f62 100644 --- a/.config/dictionaries/project.dic +++ b/.config/dictionaries/project.dic @@ -174,6 +174,7 @@ lovelace lovelaces LTRB Lynxx +LynxLynxx mdlint metadatum metadatums @@ -258,7 +259,6 @@ rustflags rustfmt rustls rxdart -ryszard-schossler saibatizoku Schemathesis Scripthash diff --git a/catalyst_voices/apps/voices/lib/common/ext/guidance_ext.dart b/catalyst_voices/apps/voices/lib/common/ext/guidance_ext.dart index 1a59ca68baa..5ab4aed3de9 100644 --- a/catalyst_voices/apps/voices/lib/common/ext/guidance_ext.dart +++ b/catalyst_voices/apps/voices/lib/common/ext/guidance_ext.dart @@ -9,7 +9,7 @@ extension GuidanceExt on GuidanceType { GuidanceType.tips => localizations.tipsGuidanceType, }; - // TODO(ryszard-schossler): when designers will + // TODO(LynxLynxx): when designers will // provide us with icon, change here accordingly SvgGenImage get icon { return switch (this) { diff --git a/catalyst_voices/apps/voices/lib/dependency/dependencies.dart b/catalyst_voices/apps/voices/lib/dependency/dependencies.dart index 9bfd7421253..3912fd712a8 100644 --- a/catalyst_voices/apps/voices/lib/dependency/dependencies.dart +++ b/catalyst_voices/apps/voices/lib/dependency/dependencies.dart @@ -89,7 +89,7 @@ final class Dependencies extends DependencyProvider { get(), ); }) - // TODO(ryszard-schossler): add repository for campaign management + // TODO(LynxLynxx): add repository for campaign management ..registerLazySingleton( CampaignBuilderCubit.new, ) diff --git a/catalyst_voices/apps/voices/lib/widgets/cards/campaign_stage_card.dart b/catalyst_voices/apps/voices/lib/widgets/cards/campaign_stage_card.dart index 543cfae12f1..c1aae85b85c 100644 --- a/catalyst_voices/apps/voices/lib/widgets/cards/campaign_stage_card.dart +++ b/catalyst_voices/apps/voices/lib/widgets/cards/campaign_stage_card.dart @@ -63,14 +63,14 @@ class CampaignStageCard extends StatelessWidget { if (campaign.stage == CampaignStage.live) ...[ const SizedBox(height: 16), OutlinedButton( - // TODO(ryszard-schossler): add logic + // TODO(LynxLynxx): add logic onPressed: () {}, child: Text(context.l10n.viewProposals), ), ] else if (campaign.stage == CampaignStage.completed) ...[ const SizedBox(height: 16), OutlinedButton( - // TODO(ryszard-schossler): add logic + // TODO(LynxLynxx): add logic onPressed: () {}, child: Text(context.l10n.viewVotingResults), ), diff --git a/catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart b/catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart index b4614b10564..fa2b97773a3 100644 --- a/catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart +++ b/catalyst_voices/apps/voices/lib/widgets/document_builder/simple_text_entry_widget.dart @@ -80,7 +80,7 @@ class _SimpleTextEntryWidgetState extends State { onFieldSubmitted: _notifyChangeListener, validator: _validate, enabled: widget.isEditMode, - // TODO(ryszard-schossler): check if this is right after schema is finalized + // TODO(LynxLynxx): check if this is right after schema is finalized hintText: widget.property.schema.defaultValue, resizable: _resizable, maxLength: _maxLength, diff --git a/catalyst_voices/packages/internal/catalyst_voices_blocs/lib/src/campaign/campaign_builder/campaign_builder_cubit.dart b/catalyst_voices/packages/internal/catalyst_voices_blocs/lib/src/campaign/campaign_builder/campaign_builder_cubit.dart index 4b689c568e6..945380d9ed2 100644 --- a/catalyst_voices/packages/internal/catalyst_voices_blocs/lib/src/campaign/campaign_builder/campaign_builder_cubit.dart +++ b/catalyst_voices/packages/internal/catalyst_voices_blocs/lib/src/campaign/campaign_builder/campaign_builder_cubit.dart @@ -21,7 +21,7 @@ class CampaignBuilderCubit extends Cubit { void updateCampaignPublish(CampaignPublish publish) { emit(state.copyWith(isLoading: true)); - // TODO(ryszard-schossler): call backend to update campaign status + // TODO(LynxLynxx): call backend to update campaign status emit( state.copyWith( @@ -37,7 +37,7 @@ class CampaignBuilderCubit extends Cubit { }) { emit(state.copyWith(isLoading: true)); - // TODO(ryszard-schossler): call backend to update campaign dates + // TODO(LynxLynxx): call backend to update campaign dates emit( state.copyWith( diff --git a/catalyst_voices/packages/internal/catalyst_voices_driver/lib/src/extension.dart b/catalyst_voices/packages/internal/catalyst_voices_driver/lib/src/extension.dart index f2d07858a9e..3392680861d 100644 --- a/catalyst_voices/packages/internal/catalyst_voices_driver/lib/src/extension.dart +++ b/catalyst_voices/packages/internal/catalyst_voices_driver/lib/src/extension.dart @@ -10,9 +10,9 @@ enum Browser { case Browser.chrome: return 'https://clients2.google.com/service/update2/crx?response=redirect&os=win&arch=x64&os_arch=x86_64&nacl_arch=x86-64&prod=chromiumcrx&prodchannel=beta&prodversion=79.0.3945.53&lang=ru&acceptformat=crx3&x=id%3D$extensionId%26installsource%3Dondemand%26uc'; case Browser.brave: - return 'https://brave.com/extension/$extensionId'; // TODO(ryszard-schossler): add brave store url + return 'https://brave.com/extension/$extensionId'; // TODO(LynxLynxx): add brave store url case Browser.firefox: - return 'https://addons.mozilla.org/en-US/firefox/addon/$extensionId'; // TODO(ryszard-schossler): add firefox store url + return 'https://addons.mozilla.org/en-US/firefox/addon/$extensionId'; // TODO(LynxLynxx): add firefox store url } } } diff --git a/catalyst_voices/packages/internal/catalyst_voices_models/lib/src/document/definitions/nested_questions_definition.dart b/catalyst_voices/packages/internal/catalyst_voices_models/lib/src/document/definitions/nested_questions_definition.dart index 5f6572b9b7e..0774a69e229 100644 --- a/catalyst_voices/packages/internal/catalyst_voices_models/lib/src/document/definitions/nested_questions_definition.dart +++ b/catalyst_voices/packages/internal/catalyst_voices_models/lib/src/document/definitions/nested_questions_definition.dart @@ -1,6 +1,6 @@ part of '../document_definitions.dart'; -// TODO(ryszard-schossler): Verify BaseDocumentDefinition type +// TODO(LynxLynxx): Verify BaseDocumentDefinition type final class NestedQuestionsDefinition extends BaseDocumentDefinition> { final DocumentDefinitionsFormat format; diff --git a/catalyst_voices/packages/internal/catalyst_voices_repositories/lib/src/dto/document/schema/document_schema_property_dto.dart b/catalyst_voices/packages/internal/catalyst_voices_repositories/lib/src/dto/document/schema/document_schema_property_dto.dart index 69c90f84ad4..ff34a84e3a3 100644 --- a/catalyst_voices/packages/internal/catalyst_voices_repositories/lib/src/dto/document/schema/document_schema_property_dto.dart +++ b/catalyst_voices/packages/internal/catalyst_voices_repositories/lib/src/dto/document/schema/document_schema_property_dto.dart @@ -27,7 +27,7 @@ final class DocumentSchemaPropertyDto { final int? minItems; final int? maxItems; - // TODO(ryszard-schossler): return to this + // TODO(LynxLynxx): return to this final Map? items; /// Logical boolean algebra conditions. diff --git a/catalyst_voices/packages/internal/catalyst_voices_shared/lib/src/utils/launch_url_mixin.dart b/catalyst_voices/packages/internal/catalyst_voices_shared/lib/src/utils/launch_url_mixin.dart index 252f63cd5d0..8efe6df5f1c 100644 --- a/catalyst_voices/packages/internal/catalyst_voices_shared/lib/src/utils/launch_url_mixin.dart +++ b/catalyst_voices/packages/internal/catalyst_voices_shared/lib/src/utils/launch_url_mixin.dart @@ -1,6 +1,6 @@ import 'package:url_launcher/url_launcher.dart'; -// TODO(ryszard-schossler): in future we can create error handling +// TODO(LynxLynxx): in future we can create error handling // solution for this mixin LaunchUrlMixin on State mixin LaunchUrlMixin { Future launchHrefUrl(Uri url) async { diff --git a/catalyst_voices/packages/internal/catalyst_voices_view_models/lib/src/authentication/access_control.dart b/catalyst_voices/packages/internal/catalyst_voices_view_models/lib/src/authentication/access_control.dart index eed09cc903d..1f9a5c349d7 100644 --- a/catalyst_voices/packages/internal/catalyst_voices_view_models/lib/src/authentication/access_control.dart +++ b/catalyst_voices/packages/internal/catalyst_voices_view_models/lib/src/authentication/access_control.dart @@ -44,11 +44,11 @@ final class AccessControl { if (account == null) return defaultSpacesAccess; if (account.isAdmin) return Space.values; if (_hasProposerOrDrepRole(account)) { - // TODO(ryszard-schossler): After F14 use _proposalAccess + // TODO(LynxLynxx): After F14 use _proposalAccess return [Space.discovery, Space.workspace]; } - // TODO(ryszard-schossler): After F14 use _votingAccess + // TODO(LynxLynxx): After F14 use _votingAccess return defaultSpacesAccess; } @@ -70,7 +70,7 @@ final class AccessControl { return allSpacesShortcutsActivators.useKeys([ Space.discovery, Space.workspace, - // TODO(ryszard-schossler): After F14 add + // TODO(LynxLynxx): After F14 add // Space.voting and Space.fundedProjects // OR use values from _proposalAccess ]);