From 7d03d0dea5ad252f06dc5c7a4069f6e22ee2078d Mon Sep 17 00:00:00 2001 From: mark-cachy Date: Thu, 7 May 2026 16:28:01 +0200 Subject: [PATCH] feat-tickets (#14) Reviewed-on: https://gitea.catelli.it/brontomark/flux/pulls/14 Co-authored-by: mark-cachy Co-committed-by: mark-cachy --- .gitea/workflows/deploy.yml | 38 ++ android/app/src/main/AndroidManifest.xml | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- lib/core/routes/app_router.dart | 123 +++- .../shared_forms/attachments_section.dart} | 73 ++- .../shared_forms}/customer_section.dart | 41 +- .../shared_forms/mobile_upload_screen.dart} | 84 +-- .../widgets/shared_forms/model_section.dart | 165 +++++ .../shared_forms/shared_files_section.dart | 230 +++++++ .../widgets/shared_forms}/staff_section.dart | 53 +- .../shared_forms/upload_success_screen.dart | 52 ++ .../attachments/blocs/attachments_bloc.dart | 391 ++++++++++++ .../attachments/blocs/attachments_events.dart | 68 ++ .../blocs/attachments_state.dart} | 51 +- .../data/attachments_repository.dart | 187 +++++- .../attachments/models/attachment_model.dart | 7 + .../customers/blocs/customer_files_bloc.dart | 139 ---- .../blocs/customer_files_events.dart | 30 - .../customers/blocs/customer_files_state.dart | 34 - .../customers/ui/customer_detail_screen.dart | 42 +- .../ui/latest_store_operations_card.dart | 237 +++---- lib/features/home/ui/home_screen.dart | 108 ++-- .../blocs/operation_files_bloc.dart | 389 ------------ .../blocs/operation_files_events.dart | 81 --- .../operations/ui/operation_form_screen.dart | 44 +- .../ui/operation_mobile_upload_screen.dart | 303 --------- .../ui/widgets/details_section.dart | 160 +---- .../tickets/blocs/ticket_form_cubit.dart | 217 +++++++ .../tickets/blocs/ticket_form_state.dart | 40 ++ .../tickets/blocs/ticket_list_cubit.dart | 79 +++ .../tickets/blocs/ticket_list_state.dart | 69 ++ .../tickets/data/ticket_repository.dart | 238 +++++++ lib/features/tickets/models/ticket_model.dart | 367 +++++++++++ .../models/ticket_status_extension.dart | 43 ++ .../tickets/ui/ticket_form_screen.dart | 597 ++++++++++++++++++ .../tickets/ui/ticket_list_screen.dart | 291 +++++++++ lib/main.dart | 2 + web/_redirects | 1 + 38 files changed, 3594 insertions(+), 1486 deletions(-) create mode 100644 .gitea/workflows/deploy.yml rename lib/{features/operations/ui/widgets/operation_files_section.dart => core/widgets/shared_forms/attachments_section.dart} (92%) rename lib/{features/operations/ui/widgets => core/widgets/shared_forms}/customer_section.dart (84%) rename lib/{features/customers/ui/customer_mobile_upload_screen.dart => core/widgets/shared_forms/mobile_upload_screen.dart} (80%) create mode 100644 lib/core/widgets/shared_forms/model_section.dart create mode 100644 lib/core/widgets/shared_forms/shared_files_section.dart rename lib/{features/operations/ui/widgets => core/widgets/shared_forms}/staff_section.dart (77%) create mode 100644 lib/core/widgets/shared_forms/upload_success_screen.dart create mode 100644 lib/features/attachments/blocs/attachments_bloc.dart create mode 100644 lib/features/attachments/blocs/attachments_events.dart rename lib/features/{operations/blocs/operation_files_state.dart => attachments/blocs/attachments_state.dart} (53%) delete mode 100644 lib/features/customers/blocs/customer_files_bloc.dart delete mode 100644 lib/features/customers/blocs/customer_files_events.dart delete mode 100644 lib/features/customers/blocs/customer_files_state.dart delete mode 100644 lib/features/operations/blocs/operation_files_bloc.dart delete mode 100644 lib/features/operations/blocs/operation_files_events.dart delete mode 100644 lib/features/operations/ui/operation_mobile_upload_screen.dart create mode 100644 lib/features/tickets/blocs/ticket_form_cubit.dart create mode 100644 lib/features/tickets/blocs/ticket_form_state.dart create mode 100644 lib/features/tickets/blocs/ticket_list_cubit.dart create mode 100644 lib/features/tickets/blocs/ticket_list_state.dart create mode 100644 lib/features/tickets/data/ticket_repository.dart create mode 100644 lib/features/tickets/models/ticket_model.dart create mode 100644 lib/features/tickets/models/ticket_status_extension.dart create mode 100644 lib/features/tickets/ui/ticket_form_screen.dart create mode 100644 lib/features/tickets/ui/ticket_list_screen.dart create mode 100644 web/_redirects diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..c407ee9 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,38 @@ +name: Deploy to Cloudflare Pages +on: + push: + branches: + - main # O il nome del tuo branch principale + +jobs: + build-and-deploy: + runs-on: ubuntu-latest # O il runner configurato sul tuo Gitea + steps: + - name: Checkout del codice + uses: actions/checkout@v4 + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + channel: 'stable' + + - name: Crea il file .env per flutter_dotenv + run: | + echo "SUPABASE_URL=${{ secrets.SUPABASE_URL }}" >> .env + echo "SUPABASE_ANON_KEY=${{ secrets.SUPABASE_ANON_KEY }}" >> .env + + - name: Ottieni le dipendenze + run: flutter pub get + + - name: Compila per il Web + run: flutter build web --release + + - name: Crea file _redirects per Cloudflare + run: echo "/* /index.html 200" > build/web/_redirects + + - name: Deploy su Cloudflare Pages + env: + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + # QUESTA È LA RIGA MAGICA: Gli diciamo di prendere SOLO la cartella build/web + run: npx wrangler@latest pages deploy build/web --project-name Flux --branch main \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index b24b47c..2ffc11b 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -24,11 +24,11 @@ - + - +