diff --git a/mobile/lib/l10n/app_en.arb b/mobile/lib/l10n/app_en.arb index 382a4b8..89f42de 100644 --- a/mobile/lib/l10n/app_en.arb +++ b/mobile/lib/l10n/app_en.arb @@ -43,5 +43,7 @@ "tryToConnect": "Try to connect", "routeToApi": "Route to API", "setupAPIRoute": "Setup API Route", - "paramInheritTip": "To inherit parameters from previous actions, type '{' in the text field and tap on the choosen parameter" + "paramInheritTip": "To inherit parameters from previous actions, type '{' in the text field and tap on the choosen parameter", + "parameters": "Parameters", + "noParameter": "No parameter" } \ No newline at end of file diff --git a/mobile/lib/l10n/app_fr.arb b/mobile/lib/l10n/app_fr.arb index 776233e..e3e9614 100644 --- a/mobile/lib/l10n/app_fr.arb +++ b/mobile/lib/l10n/app_fr.arb @@ -43,5 +43,7 @@ "tryToConnect": "Tester la connection", "routeToApi": "Route de l'API", "setupAPIRoute": "Choisir la route de l'API", - "paramInheritTip": "Afin d'hériter de variables venant d'actions précedentes, entrez '{' dans un champ et choisissez la valeur" + "paramInheritTip": "Afin d'hériter de variables venant d'actions précedentes, entrez '{' dans un champ et choisissez la valeur", + "parameters": "Paramètres", + "noParameter": "Aucun paramètre" } \ No newline at end of file diff --git a/mobile/lib/src/aeris_api.dart b/mobile/lib/src/aeris_api.dart index 3283e75..e89f18e 100644 --- a/mobile/lib/src/aeris_api.dart +++ b/mobile/lib/src/aeris_api.dart @@ -149,15 +149,8 @@ class AerisAPI { var res = await _requestAPI('/workflows', AerisAPIRequestType.get, null); if (res.ok == false) return []; final List body = jsonDecode(res.body); - var decodedList = body.map((e) => Pipeline.fromJSON(Map.from(e))).toList(); - decodedList.add( - Pipeline(id: 0, name: "My Dummy", triggerCount: 0, enabled: true, trigger: - Trigger(name: "Trigger name", displayName: "Trigger Display", service: Service.discord(), parameters: [for (var i = 0; i < 3; i++) ActionParameter(name: "para$i", value: "value$i", description: "desc$i")] - ), reactions: [ - Reaction(service: const Service.anilist(), name: "Reaction name", displayName: "Reaction display", parameters: [for (var i = 0; i < 3; i++) ActionParameter(name: "para$i", value: "value$i", description: "desc$i")]) - ]) - ); - return decodedList; + + return body.map((e) => Pipeline.fromJSON(Map.from(e))).toList(); } /// Fetch the services the user is authenticated to diff --git a/mobile/lib/src/widgets/action_detail_card.dart b/mobile/lib/src/widgets/action_detail_card.dart index e82330d..04814f4 100644 --- a/mobile/lib/src/widgets/action_detail_card.dart +++ b/mobile/lib/src/widgets/action_detail_card.dart @@ -2,6 +2,7 @@ import 'package:aeris/src/models/action.dart' as aeris; import 'package:aeris/src/models/action_parameter.dart'; import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; class ActionDetailCard extends StatelessWidget { ///The source of information @@ -58,14 +59,15 @@ class ActionDetailCard extends StatelessWidget { children: [ Expanded(child: action.service.getLogo(logoSize: 50), flex: 2), Expanded( - child: Text( + child: Padding(padding: const EdgeInsets.only(left: 10), + child: Text( action.displayName, style: TextStyle( color: Theme.of(context).colorScheme.onSurface, fontSize: 15 ), textAlign: TextAlign.center, - ), + )), flex: 8 ), ], @@ -79,7 +81,7 @@ class ActionDetailCard extends StatelessWidget { Padding(child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text(action.parameters.isEmpty ? "No parameter": "Parameters:"), //TODO translta + Text(action.parameters.isEmpty ? AppLocalizations.of(context).noParameter: "${AppLocalizations.of(context).parameters}:"), popupMenu ]), padding: const EdgeInsets.only(bottom: 5)