Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI updates: Landing message and feature value editing cosmetics #1143

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class FHInfoCardWidget extends StatelessWidget {
color: Theme.of(context).primaryColorLight,
borderRadius: const BorderRadius.all(Radius.circular(4)),
),
preferBelow: false,
waitDuration: const Duration(milliseconds: 300),
verticalOffset: 10,
child: const Icon(
Icons.info_outline,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ class StrategyCardWidget extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.only(left: 8.0, right: 2.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
flex: 2,
flex: 4,
child: groupRolloutStrategy != null
? Text(groupRolloutStrategy!.name,
maxLines: 2,
Expand All @@ -59,12 +58,13 @@ class StrategyCardWidget extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style:
Theme.of(context).textTheme.labelLarge))),
Flexible(flex: 3, child: editableHolderWidget),
Expanded(flex: 6, child: editableHolderWidget),
Expanded(
flex: 1,
flex: 2,
child: rolloutStrategy != null &&
groupRolloutStrategy == null
? Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
EditValueStrategyLinkButton(
editable: editable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,34 +42,37 @@ class _EditBooleanValueDropDownWidgetState

@override
Widget build(BuildContext context) {
return SizedBox(
width: 50,
child: DropdownButtonHideUnderline(
child: DropdownButton(
isDense: true,
isExpanded: true,
items: <String>['On', 'Off']
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(
value,
style: Theme.of(context).textTheme.bodyMedium,
),
);
}).toList(),
value: boolFeatureValue,
onChanged: widget.editable && widget.unlocked
? (value) {
final replacementBoolean = (value == 'On');
_updateFeatureValue(replacementBoolean);
setState(() {
boolFeatureValue = replacementBoolean ? 'On' : 'Off';
});
}
: null,
disabledHint: Text(boolFeatureValue,
style: Theme.of(context).textTheme.bodySmall),
return Align(
alignment: Alignment.centerLeft,
child: SizedBox(
width: 50,
child: DropdownButtonHideUnderline(
child: DropdownButton(
isDense: true,
isExpanded: true,
items: <String>['On', 'Off']
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(
value,
style: Theme.of(context).textTheme.bodyMedium,
),
);
}).toList(),
value: boolFeatureValue,
onChanged: widget.editable && widget.unlocked
? (value) {
final replacementBoolean = (value == 'On');
_updateFeatureValue(replacementBoolean);
setState(() {
boolFeatureValue = replacementBoolean ? 'On' : 'Off';
});
}
: null,
disabledHint: Text(boolFeatureValue,
style: Theme.of(context).textTheme.bodySmall),
),
),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class _EditJsonValueContainerState extends State<EditJsonValueContainer> {
}

return SizedBox(
width: 250,
height: 30,
child: InkWell(
canRequestFocus: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class _EditNumberValueContainerState extends State<EditNumberValueContainer> {
final debouncer = Debouncer(milliseconds: 1000);

return SizedBox(
width: 250,
height: 36,
child: TextField(
style: Theme.of(context).textTheme.bodyLarge,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class _EditStringValueContainerState extends State<EditStringValueContainer> {
final debouncer = Debouncer(milliseconds: 1000);

return SizedBox(
width: 250,
height: 36,
child: TextField(
style: Theme.of(context).textTheme.bodyLarge,
Expand Down
55 changes: 29 additions & 26 deletions admin-frontend/open_admin_app/lib/widgets/setup/page3_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,38 @@ class _FinalSetupPageOverlayWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder<bool>(
stream: bloc.setupState,
builder: (BuildContext context, AsyncSnapshot<bool> snap) {
if (snap.hasError) {
bloc.mrClient.dialogError(snap.error, null);
} else if (snap.hasData && snap.data!) {
return FHAlertDialog(
title: title(context),
content: Padding(
padding: const EdgeInsets.only(top: 8.0, bottom: 8.0),
stream: bloc.setupState,
builder: (BuildContext context, AsyncSnapshot<bool> snap) {
if (snap.hasError) {
bloc.mrClient.dialogError(snap.error, null);
} else if (snap.hasData && snap.data!) {
return FHAlertDialog(
title: title(context),
content: Padding(
padding: const EdgeInsets.only(top: 8.0, bottom: 8.0),
child: SizedBox(
width: 600,
child: Text(
'Ok, next step is to create your first application, an environment and add some features. You can follow the progress stepper by clicking the "rocket" icon on the right of the app bar.',
'Next step is to create your first application and add some features.'
' Your first environment called "Production" will be created by default.'
' Or you can follow the "Quick Setup" helper by clicking the "rocket" icon on the right of the app bar.',
style: Theme.of(context).textTheme.bodyLarge),
),
actions: <Widget>[
FHFlatButton(
title: 'Next',
onPressed: () {
bloc.mrClient.removeOverlay();
bloc.reinitialize();
})
]
);
}
else if (snap.connectionState == ConnectionState.waiting) {
return const Center(child:CircularProgressIndicator());
}
return Container();
},
);
),
actions: <Widget>[
FHFlatButton(
title: 'Next',
onPressed: () {
bloc.mrClient.removeOverlay();
bloc.reinitialize();
})
]);
} else if (snap.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator());
}
return Container();
},
);
}

Widget title(BuildContext context) {
Expand Down
Loading