SP-1613-fe-remove-the-word-condition-from-the-task-dialog-in-the-routine (#253)

<!--
  Thanks for contributing!

Provide a description of your changes below and a general summary in the
title

Please look at the following checklist to ensure that your PR can be
accepted quickly:
-->

## Jira Ticket
[SP-1613](https://syncrow.atlassian.net/browse/SP-1613)

## Description

use word condition when going to if and functions when going to THEN

## Type of Change

<!--- Put an `x` in all the boxes that apply: -->

- [ ]  New feature (non-breaking change which adds functionality)
- [x] 🛠️ Bug fix (non-breaking change which fixes an issue)
- [ ]  Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] 🧹 Code refactor
- [ ]  Build configuration change
- [ ] 📝 Documentation
- [ ] 🗑️ Chore 


[SP-1613]:
https://syncrow.atlassian.net/browse/SP-1613?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
This commit is contained in:
raf-dev1
2025-06-16 08:46:07 +03:00
committed by GitHub
11 changed files with 36 additions and 13 deletions

View File

@ -118,6 +118,7 @@ class DeviceDialogHelper {
uniqueCustomId: data['uniqueCustomId'], uniqueCustomId: data['uniqueCustomId'],
deviceSelectedFunctions: deviceSelectedFunctions, deviceSelectedFunctions: deviceSelectedFunctions,
device: data['device'], device: data['device'],
dialogType: dialogType,
); );
case 'NCPS': case 'NCPS':
return FlushPresenceSensor.showFlushFunctionsDialog( return FlushPresenceSensor.showFlushFunctionsDialog(

View File

@ -65,7 +65,9 @@ class ACHelper {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const DialogHeader('AC Functions'), DialogHeader(dialogType == 'THEN'
? 'AC Functions'
: 'AC Conditions'),
Expanded( Expanded(
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,

View File

@ -96,7 +96,9 @@ class _WallPresenceSensorState extends State<FlushPresenceSensor> {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const DialogHeader('Presence Sensor Condition'), DialogHeader(widget.dialogType == 'THEN'
? 'Presence Sensor Functions'
: 'Presence Sensor Condition'),
Expanded(child: _buildMainContent(context, state)), Expanded(child: _buildMainContent(context, state)),
_buildDialogFooter(context, state), _buildDialogFooter(context, state),
], ],

View File

@ -16,9 +16,10 @@ class GatewayDialog extends StatefulWidget {
required this.functions, required this.functions,
required this.deviceSelectedFunctions, required this.deviceSelectedFunctions,
required this.device, required this.device,
required this.dialogType,
super.key, super.key,
}); });
final String dialogType;
final String? uniqueCustomId; final String? uniqueCustomId;
final List<DeviceFunction> functions; final List<DeviceFunction> functions;
final List<DeviceFunctionData> deviceSelectedFunctions; final List<DeviceFunctionData> deviceSelectedFunctions;
@ -55,7 +56,9 @@ class _GatewayDialogState extends State<GatewayDialog> {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const DialogHeader('Gateway Conditions'), DialogHeader(widget.dialogType == 'THEN'
? 'Gateway Functions'
: 'Gateway Conditions'),
Expanded(child: _buildMainContent(context, state)), Expanded(child: _buildMainContent(context, state)),
_buildDialogFooter(context, state), _buildDialogFooter(context, state),
], ],

View File

@ -14,6 +14,7 @@ abstract final class GatewayHelper {
required String? uniqueCustomId, required String? uniqueCustomId,
required List<DeviceFunctionData> deviceSelectedFunctions, required List<DeviceFunctionData> deviceSelectedFunctions,
required AllDevicesModel? device, required AllDevicesModel? device,
required String dialogType,
}) async { }) async {
return showDialog( return showDialog(
context: context, context: context,
@ -27,6 +28,7 @@ abstract final class GatewayHelper {
functions: functions, functions: functions,
deviceSelectedFunctions: deviceSelectedFunctions, deviceSelectedFunctions: deviceSelectedFunctions,
device: device, device: device,
dialogType:dialogType,
), ),
), ),
); );

View File

@ -59,7 +59,9 @@ class OneGangSwitchHelper {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const DialogHeader('1 Gang Light Switch Condition'), DialogHeader(dialogType == 'THEN'
? '1 Gang Light Switch Functions'
: '1 Gang Light Switch Condition'),
Expanded( Expanded(
child: Row( child: Row(
children: [ children: [

View File

@ -98,7 +98,9 @@ class _EnergyClampDialogState extends State<EnergyClampDialog> {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const DialogHeader('Energy Clamp Conditions'), DialogHeader(widget.dialogType == 'THEN'
? 'Energy Clamp Functions'
: 'Energy Clamp Conditions'),
Expanded( Expanded(
child: Visibility( child: Visibility(
visible: _functions.isNotEmpty, visible: _functions.isNotEmpty,

View File

@ -58,7 +58,9 @@ class ThreeGangSwitchHelper {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const DialogHeader('3 Gangs Light Switch Condition'), DialogHeader(dialogType == 'THEN'
? '3 Gangs Light Switch Functions'
: '3 Gangs Light Switch Condition'),
Expanded( Expanded(
child: Row( child: Row(
children: [ children: [

View File

@ -59,7 +59,9 @@ class TwoGangSwitchHelper {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const DialogHeader('2 Gangs Light Switch Condition'), DialogHeader(dialogType == 'THEN'
? '2 Gangs Light Switch Functions'
: '2 Gangs Light Switch Condition'),
Expanded( Expanded(
child: Row( child: Row(
children: [ children: [

View File

@ -63,7 +63,8 @@ class _WallPresenceSensorState extends State<WallPresenceSensor> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_wpsFunctions = widget.functions.whereType<WpsFunctions>().where((function) { _wpsFunctions =
widget.functions.whereType<WpsFunctions>().where((function) {
if (widget.dialogType == 'THEN') { if (widget.dialogType == 'THEN') {
return function.type == 'THEN' || function.type == 'BOTH'; return function.type == 'THEN' || function.type == 'BOTH';
} }
@ -97,7 +98,9 @@ class _WallPresenceSensorState extends State<WallPresenceSensor> {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const DialogHeader('Presence Sensor Condition'), DialogHeader(widget.dialogType == 'THEN'
? 'Presence Sensor Functions'
: 'Presence Sensor Condition'),
Expanded(child: _buildMainContent(context, state)), Expanded(child: _buildMainContent(context, state)),
_buildDialogFooter(context, state), _buildDialogFooter(context, state),
], ],

View File

@ -93,7 +93,9 @@ class _WaterHeaterDialogRoutinesState extends State<WaterHeaterDialogRoutines> {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const DialogHeader('Water Heater Condition'), DialogHeader(widget.dialogType == 'THEN'
? 'Water Heater Funtions'
: 'Water Heater Condition'),
Expanded(child: _buildMainContent(context, state)), Expanded(child: _buildMainContent(context, state)),
_buildDialogFooter(context, state), _buildDialogFooter(context, state),
], ],