Skip to content

Commit e9e6a8d

Browse files
committed
Merge branch 'main' into prod/festapp
2 parents ef2606a + db1f1e8 commit e9e6a8d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1791
-719
lines changed

assets/translations/cs.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,5 +364,15 @@
364364
"Report": "Report",
365365
"Returned": "Vráceno",
366366
"History": "Historie",
367+
"Responses": "Odpovědi",
368+
"Scan tickets": "Skenovat lístky",
369+
"Copy": "Kopírovat",
370+
"Link for tickets scan:": "Odkaz pro skenování lístků:",
371+
"Generate New Code": "Generovat nový kód",
372+
"Provide the following link or code to the people who will be checking the tickets.": "Předejte následující odkaz nebo kód lidem, kteří budou kontrolovat vstupenky.",
373+
"By generating a new code, the old one will be replaced and will no longer work.": "Vygenerováním nového kódu bude starý nahrazen a již nebude fungovat.",
374+
"Confirm Ticket": "Potvrdit vstupenku",
375+
"Scan Code": "Kód ke skenování",
376+
"Enter Scan Code": "Vložte kód ke skenování",
367377
"_": "_"
368378
}

assets/translations/en.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,5 +364,15 @@
364364
"Report": "Report",
365365
"Returned": "Returned",
366366
"History": "History",
367+
"Responses": "Responses",
368+
"Scan tickets": "Scan tickets",
369+
"Copy": "Copy",
370+
"Link for tickets scan:": "Link for tickets scan:",
371+
"Generate New Code": "Generate New Code",
372+
"Provide the following link or code to the people who will be checking the tickets.": "Provide the following link or code to the people who will be checking the tickets.",
373+
"By generating a new code, the old one will be replaced and will no longer work.": "By generating a new code, the old one will be replaced and will no longer work.",
374+
"Confirm Ticket": "Confirm Ticket",
375+
"Scan Code": "Scan Code",
376+
"Enter Scan Code": "Enter Scan Code",
367377
"_":"_"
368378
}

lib/AppRouter.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ class AppRouter extends RootStackRouter {
4343
AutoRoute(page: SettingsRoute.page, path: sl(SettingsPage.ROUTE)),
4444
AutoRoute(page: InstallRoute.page, path: sl(InstallPage.ROUTE)),
4545
AutoRoute(page: AdminDashboardRoute.page, path: sl(AdminDashboardPage.ROUTE)),
46-
AutoRoute(page: AdminDashboardRoute.page, path: sl(AdminDashboardPage.ROUTE)),
47-
AutoRoute(page: ScanRoute.page, path: sl(ScanPage.ROUTE)),
46+
AutoRoute(page: ScanRoute.page, path: "/${ScanPage.ROUTE}", children: [
47+
AutoRoute(path: ':scanCode', page: ScanRoute.page,),
48+
]),
49+
// AutoRoute(page: ScanRoute.page, path: "/${ScanPage.ROUTE}"),
50+
// AutoRoute(page: ScanRoute.page, path: "/${ScanPage.ROUTE}/:scanCode"),
4851
AutoRoute(page: FormRoute.page, path: "/${FormPage.ROUTE}/:formLink"),
4952
AutoRoute(page: FormEditRoute.page, path: "/${FormPage.ROUTE}/:formLink/edit"),
5053
AutoRoute(page: CheckRoute.page, path: "/:{$LINK}/${CheckPage.ROUTE}/:id"),

lib/AppRouter.gr.dart

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -625,13 +625,16 @@ class ResetPasswordRoute extends _i28.PageRouteInfo<void> {
625625
/// generated route for
626626
/// [_i20.ScanPage]
627627
class ScanRoute extends _i28.PageRouteInfo<ScanRouteArgs> {
628-
ScanRoute({int? id, _i29.Key? key, List<_i28.PageRouteInfo>? children})
629-
: super(
630-
ScanRoute.name,
631-
args: ScanRouteArgs(id: id, key: key),
632-
rawPathParams: {'id': id},
633-
initialChildren: children,
634-
);
628+
ScanRoute({
629+
String? scanCode,
630+
_i30.Key? key,
631+
List<_i28.PageRouteInfo>? children,
632+
}) : super(
633+
ScanRoute.name,
634+
args: ScanRouteArgs(scanCode: scanCode, key: key),
635+
rawPathParams: {'scanCode': scanCode},
636+
initialChildren: children,
637+
);
635638

636639
static const String name = 'ScanRoute';
637640

@@ -640,26 +643,26 @@ class ScanRoute extends _i28.PageRouteInfo<ScanRouteArgs> {
640643
builder: (data) {
641644
final pathParams = data.inheritedPathParams;
642645
final args = data.argsAs<ScanRouteArgs>(
643-
orElse: () => ScanRouteArgs(id: pathParams.optInt('id')),
646+
orElse: () => ScanRouteArgs(scanCode: pathParams.optString('scanCode')),
644647
);
645648
return _i28.DeferredWidget(
646649
_i20.loadLibrary,
647-
() => _i20.ScanPage(id: args.id, key: args.key),
650+
() => _i20.ScanPage(scanCode: args.scanCode, key: args.key),
648651
);
649652
},
650653
);
651654
}
652655

653656
class ScanRouteArgs {
654-
const ScanRouteArgs({this.id, this.key});
657+
const ScanRouteArgs({this.scanCode, this.key});
655658

656-
final int? id;
659+
final String? scanCode;
657660

658-
final _i29.Key? key;
661+
final _i30.Key? key;
659662

660663
@override
661664
String toString() {
662-
return 'ScanRouteArgs{id: $id, key: $key}';
665+
return 'ScanRouteArgs{scanCode: $scanCode, key: $key}';
663666
}
664667
}
665668

lib/appConfig.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AppConfig {
1515
static const bool isWebNotificationsSupported = true;
1616
static const String oneSignalAppId = '73f77f22-961a-4ded-9647-e33a7ac14f90';
1717

18-
static const int organization = 1;
18+
static const int organization = 3;
1919
//setup occasion id to force occasion
2020
static const String? forceOccasionLink = null;
2121
static const bool isPublicNotificationSendingDisabled = false;

lib/components/dataGrid/AdminPageHelper.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'package:easy_localization/easy_localization.dart';
22
import 'package:flutter/material.dart';
33
import 'package:fstapp/RouterService.dart';
4-
import 'package:fstapp/pages/Eshop/FormEditorTab.dart';
54
import 'package:fstapp/pages/AdministrationOccasion/GameTab.dart';
65
import 'package:fstapp/pages/AdministrationOccasion/InformationTab.dart';
76
import 'package:fstapp/pages/AdministrationOccasion/PlacesTab.dart';
@@ -10,6 +9,7 @@ import 'package:fstapp/pages/AdministrationOccasion/ServiceTab.dart';
109
import 'package:fstapp/pages/AdministrationOccasion/UserGroupsTab.dart';
1110
import 'package:fstapp/pages/AdministrationOccasion/UsersTab.dart';
1211
import 'package:fstapp/pages/Eshop/BlueprintEditorTab.dart';
12+
import 'package:fstapp/pages/Eshop/FormTab.dart';
1313
import 'package:fstapp/pages/Eshop/OrdersTab.dart';
1414
import 'package:fstapp/pages/Eshop/ReportTab.dart';
1515
import 'package:fstapp/pages/Eshop/TicketsTab.dart';
@@ -84,7 +84,7 @@ class AdminTabDefinition {
8484
users: AdminTabDefinition(label: "Users".tr(), icon: Icons.people, widget: UsersTab()),
8585
game: AdminTabDefinition(label: "Game".tr(), icon: Icons.gamepad, widget: GameTab()),
8686

87-
form: AdminTabDefinition(label: "Form".tr(), icon: Icons.list, widget: FormEditorTab()),
87+
form: AdminTabDefinition(label: "Form".tr(), icon: Icons.list, widget: FormTab()),
8888
blueprint: AdminTabDefinition(label: "Blueprint".tr(), icon: Icons.grid_on, widget: BlueprintTab()),
8989
tickets: AdminTabDefinition(label: "Tickets".tr(), icon: Icons.local_activity, widget: TicketsTab()),
9090
orders: AdminTabDefinition(label: "Orders".tr(), icon: Icons.shopping_cart, widget: OrdersTab()),

lib/components/dataGrid/DataGridHelper.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,21 @@ class DataGridHelper
5757
);
5858
}
5959

60+
static Widget buildTab(BuildContext context, IconData icon, String text) {
61+
return Row(
62+
children: [
63+
Icon(icon, color: ThemeConfig.blackColor(context)),
64+
Padding(
65+
padding: const EdgeInsets.all(8),
66+
child: Text(
67+
text,
68+
style: TextStyle(color: ThemeConfig.blackColor(context)),
69+
),
70+
),
71+
],
72+
);
73+
}
74+
6075
static T? getValueOrNull<T>(dynamic value, {T? emptyValue}) {
6176
if (value == emptyValue || value == "") return null;
6277
if (value is String) return value.trim() as T;

lib/dataModels/FormFieldModel.dart

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/cupertino.dart';
22
import 'package:fstapp/components/dataGrid/PlutoAbstract.dart';
3+
import 'package:fstapp/dataModelsEshop/ProductTypeModel.dart';
34
import 'package:fstapp/dataModelsEshop/TbEshop.dart';
45
import 'package:intl/intl.dart';
56
import 'package:pluto_grid_plus/pluto_grid_plus.dart';
@@ -13,9 +14,13 @@ class FormFieldModel extends IPlutoRowModel {
1314
String? type;
1415
bool? isRequired;
1516
bool? isHidden;
17+
bool? isTicketField;
1618
int? form;
1719
int? order;
18-
dynamic data; // Added the 'data' field here
20+
int? productTypeId;
21+
dynamic data;
22+
23+
ProductTypeModel? productType;
1924

2025
static const String metaRequired = "required";
2126
static const String metaHidden = "hidden";
@@ -31,25 +36,33 @@ class FormFieldModel extends IPlutoRowModel {
3136
this.type,
3237
this.isRequired,
3338
this.isHidden,
39+
this.isTicketField,
3440
this.form,
3541
this.order,
36-
this.data, // Added the 'data' parameter here
42+
this.data,
43+
this.productTypeId,
44+
this.productType,
3745
});
3846

3947
factory FormFieldModel.fromJson(Map<String, dynamic> json) {
4048
return FormFieldModel(
41-
id: json[TbEshop.form_fields.id],
42-
createdAt: json[TbEshop.form_fields.created_at] != null
43-
? DateTime.parse(json[TbEshop.form_fields.created_at])
44-
: null,
45-
title: json[TbEshop.form_fields.title],
46-
description: json[TbEshop.form_fields.description],
47-
type: json[TbEshop.form_fields.type],
48-
isRequired: json[TbEshop.form_fields.is_required],
49-
isHidden: json[TbEshop.form_fields.is_hidden],
50-
form: json[TbEshop.form_fields.form],
51-
order: json[TbEshop.form_fields.order],
52-
data: json[TbEshop.form_fields.data],
49+
id: json[TbEshop.form_fields.id],
50+
createdAt: json[TbEshop.form_fields.created_at] != null
51+
? DateTime.parse(json[TbEshop.form_fields.created_at])
52+
: null,
53+
title: json[TbEshop.form_fields.title],
54+
description: json[TbEshop.form_fields.description],
55+
type: json[TbEshop.form_fields.type],
56+
isRequired: json[TbEshop.form_fields.is_required],
57+
isHidden: json[TbEshop.form_fields.is_hidden],
58+
isTicketField: json[TbEshop.form_fields.is_ticket_field],
59+
form: json[TbEshop.form_fields.form],
60+
order: json[TbEshop.form_fields.order],
61+
data: json[TbEshop.form_fields.data],
62+
productTypeId: json[TbEshop.form_fields.product_type],
63+
productType: json[TbEshop.form_fields.product_type_data] != null
64+
? ProductTypeModel.fromJson(json[TbEshop.form_fields.product_type_data])
65+
: null
5366
);
5467
}
5568

@@ -59,8 +72,10 @@ class FormFieldModel extends IPlutoRowModel {
5972
TbEshop.form_fields.type: type,
6073
TbEshop.form_fields.is_required: isRequired,
6174
TbEshop.form_fields.is_hidden: isHidden,
75+
TbEshop.form_fields.is_ticket_field: isTicketField,
6276
TbEshop.form_fields.order: order,
6377
TbEshop.form_fields.data: data,
78+
'product_type': productType?.toJson(),
6479
};
6580

6681
@override
@@ -76,6 +91,7 @@ class FormFieldModel extends IPlutoRowModel {
7691
TbEshop.form_fields.type: PlutoCell(value: type ?? ""),
7792
metaRequired: PlutoCell(value: isRequired.toString()),
7893
metaHidden: PlutoCell(value: isHidden.toString()),
94+
TbEshop.form_fields.is_ticket_field: PlutoCell(value: isTicketField.toString()),
7995
TbEshop.form_fields.order: PlutoCell(value: order ?? 0),
8096
});
8197
}
@@ -84,17 +100,16 @@ class FormFieldModel extends IPlutoRowModel {
84100
return FormFieldModel(
85101
id: json[TbEshop.form_fields.id] == -1 ? null : json[TbEshop.form_fields.id],
86102
isHidden: json[TbEshop.form_fields.is_hidden],
103+
isTicketField: json[TbEshop.form_fields.is_ticket_field],
87104
);
88105
}
89106

90107
@override
91108
Future<void> deleteMethod() async {
92-
// Implement your delete logic here
93109
}
94110

95111
@override
96112
Future<void> updateMethod() async {
97-
// Implement your update logic here
98113
}
99114

100115
@override

0 commit comments

Comments
 (0)