spree_cm_commissioner 1.21.0 → 2.0.0.pre.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.env.example +0 -3
- data/.github/workflows/test_and_build_gem.yml +16 -2
- data/.gitignore +2 -1
- data/Gemfile.lock +28 -1
- data/Rakefile +33 -4
- data/app/assets/javascripts/spree_cm_commissioner/backend.js +0 -1
- data/app/assets/stylesheets/spree_cm_commissioner/backend/calendar.scss +8 -11
- data/app/assets/stylesheets/spree_cm_commissioner/backend/commissioner_admin.css.scss +0 -1
- data/app/controllers/concerns/spree_cm_commissioner/content_cachable.rb +1 -2
- data/app/controllers/spree/admin/event_blazer_queries_controller.rb +4 -11
- data/app/controllers/spree/admin/inventory_items_controller.rb +83 -0
- data/app/controllers/spree/admin/stock_managements_controller.rb +63 -1
- data/app/controllers/spree/admin/tenants_controller.rb +0 -8
- data/app/controllers/spree/api/v2/organizer/invite_guests_controller.rb +1 -1
- data/app/controllers/spree/api/v2/storefront/accommodations/variants_controller.rb +42 -0
- data/app/controllers/spree/api/v2/storefront/accommodations_controller.rb +14 -31
- data/app/controllers/spree/api/v2/storefront/dynamic_field_options_controller.rb +1 -5
- data/app/controllers/spree/api/v2/storefront/guests_controller.rb +5 -31
- data/app/controllers/spree/api/v2/storefront/queue_cart/line_items_controller.rb +2 -2
- data/app/controllers/spree/api/v2/tenant/checkout_controller.rb +0 -2
- data/app/controllers/spree_cm_commissioner/admin/variants_controller_decorator.rb +1 -1
- data/app/controllers/spree_cm_commissioner/api/v2/storefront/checkout_controller_decorator.rb +0 -11
- data/app/controllers/spree_cm_commissioner/well_known_controller.rb +17 -31
- data/app/factory/spree_cm_commissioner/invite_guest_claimed_telegram_message_factory.rb +84 -37
- data/app/finders/spree_cm_commissioner/accommodations/find.rb +37 -0
- data/app/finders/spree_cm_commissioner/accommodations/find_variant.rb +32 -0
- data/app/interactors/spree_cm_commissioner/ensure_correct_product_type.rb +40 -0
- data/app/interactors/spree_cm_commissioner/inventory_item_syncer.rb +25 -0
- data/app/interactors/spree_cm_commissioner/pin_code_sender.rb +1 -0
- data/app/interactors/spree_cm_commissioner/sms.rb +1 -1
- data/app/interactors/spree_cm_commissioner/stock/inventory_item_resetter.rb +44 -0
- data/app/interactors/spree_cm_commissioner/stock/inventory_items_adjuster.rb +13 -0
- data/app/interactors/spree_cm_commissioner/stock/inventory_items_generator.rb +15 -0
- data/app/interactors/spree_cm_commissioner/stock/permanent_inventory_items_generator.rb +75 -0
- data/app/interactors/spree_cm_commissioner/stock/stock_movement_creator.rb +32 -0
- data/app/interactors/spree_cm_commissioner/user_id_token_authenticator.rb +3 -7
- data/app/interactors/spree_cm_commissioner/user_id_token_checker.rb +3 -11
- data/app/interactors/spree_cm_commissioner/user_identity_checker.rb +6 -12
- data/app/interactors/spree_cm_commissioner/user_registration_with_id_token.rb +1 -7
- data/app/interactors/spree_cm_commissioner/vattanac_bank_initiator.rb +1 -5
- data/app/jobs/spree_cm_commissioner/application_job.rb +20 -0
- data/app/jobs/spree_cm_commissioner/application_unique_job.rb +20 -0
- data/app/jobs/spree_cm_commissioner/ensure_correct_product_type_job.rb +7 -0
- data/app/jobs/spree_cm_commissioner/inventory_item_syncer_job.rb +7 -0
- data/app/jobs/spree_cm_commissioner/sms_pin_code_job.rb +1 -1
- data/app/jobs/spree_cm_commissioner/stock/inventory_items_adjuster_job.rb +11 -0
- data/app/jobs/spree_cm_commissioner/stock/inventory_items_generator_job.rb +11 -0
- data/app/jobs/spree_cm_commissioner/stock/permanent_inventory_items_generator_job.rb +9 -0
- data/app/models/concerns/spree_cm_commissioner/line_item_durationable.rb +9 -15
- data/app/models/concerns/spree_cm_commissioner/option_type_attr_type.rb +1 -13
- data/app/models/concerns/spree_cm_commissioner/order_seatable.rb +44 -0
- data/app/models/concerns/spree_cm_commissioner/order_state_machine.rb +39 -0
- data/app/models/concerns/spree_cm_commissioner/product_delegation.rb +1 -3
- data/app/models/concerns/spree_cm_commissioner/product_type.rb +10 -0
- data/app/models/concerns/spree_cm_commissioner/taxon_kind.rb +1 -1
- data/app/models/concerns/spree_cm_commissioner/tenant_preference.rb +0 -4
- data/app/models/spree_cm_commissioner/block.rb +23 -0
- data/app/models/spree_cm_commissioner/dynamic_field.rb +3 -17
- data/app/models/spree_cm_commissioner/dynamic_field_option.rb +1 -7
- data/app/models/spree_cm_commissioner/guest.rb +19 -1
- data/app/models/spree_cm_commissioner/guest_dynamic_field.rb +3 -21
- data/app/models/spree_cm_commissioner/inventory.rb +11 -0
- data/app/models/spree_cm_commissioner/inventory_item.rb +69 -0
- data/app/models/spree_cm_commissioner/invite.rb +6 -4
- data/app/models/spree_cm_commissioner/invite_team.rb +1 -3
- data/app/models/spree_cm_commissioner/line_item_decorator.rb +46 -78
- data/app/models/spree_cm_commissioner/notification_taxon.rb +1 -1
- data/app/models/spree_cm_commissioner/option_type_decorator.rb +1 -11
- data/app/models/spree_cm_commissioner/order_decorator.rb +30 -1
- data/app/models/spree_cm_commissioner/pin_code.rb +2 -3
- data/app/models/spree_cm_commissioner/place.rb +1 -3
- data/app/models/spree_cm_commissioner/price_decorator.rb +9 -0
- data/app/models/spree_cm_commissioner/product_decorator.rb +10 -4
- data/app/models/spree_cm_commissioner/redis_stock/cached_inventory_items_builder.rb +41 -0
- data/app/models/spree_cm_commissioner/redis_stock/inventory_updater.rb +126 -0
- data/app/models/spree_cm_commissioner/redis_stock/line_items_cached_inventory_items_builder.rb +36 -0
- data/app/models/spree_cm_commissioner/redis_stock/variant_cached_inventory_items_builder.rb +25 -0
- data/app/models/spree_cm_commissioner/reserved_block.rb +30 -0
- data/app/models/spree_cm_commissioner/seat_layout.rb +20 -0
- data/app/models/spree_cm_commissioner/seat_section.rb +16 -0
- data/app/models/spree_cm_commissioner/seats/blocks_canceler.rb +30 -0
- data/app/models/spree_cm_commissioner/seats/blocks_holder.rb +53 -0
- data/app/models/spree_cm_commissioner/seats/blocks_reserver.rb +49 -0
- data/app/models/spree_cm_commissioner/seats/errors/blocks_are_on_hold_by_other_guest.rb +4 -0
- data/app/models/spree_cm_commissioner/seats/errors/blocks_are_reserved_by_other_guest.rb +4 -0
- data/app/models/spree_cm_commissioner/seats/errors/blocks_are_reserved_by_same_guest.rb +4 -0
- data/app/models/spree_cm_commissioner/seats/errors/unable_to_save_reserved_block_record.rb +4 -0
- data/app/models/spree_cm_commissioner/service_calendar.rb +0 -2
- data/app/models/spree_cm_commissioner/state_decorator.rb +0 -1
- data/app/models/spree_cm_commissioner/stock/availability_checker.rb +26 -25
- data/app/models/spree_cm_commissioner/stock/availability_validator_decorator.rb +2 -1
- data/app/models/spree_cm_commissioner/stock/line_item_availability_checker.rb +3 -3
- data/app/models/spree_cm_commissioner/stock/order_availability_checker.rb +44 -0
- data/app/models/spree_cm_commissioner/stock_item_decorator.rb +17 -0
- data/app/models/spree_cm_commissioner/taxon_blazer_query.rb +8 -0
- data/app/models/spree_cm_commissioner/taxon_decorator.rb +2 -6
- data/app/models/spree_cm_commissioner/taxonomy_decorator.rb +0 -6
- data/app/models/spree_cm_commissioner/trip.rb +12 -10
- data/app/models/spree_cm_commissioner/trip_connection.rb +5 -5
- data/app/models/spree_cm_commissioner/trip_stop.rb +2 -3
- data/app/models/spree_cm_commissioner/user_identity_provider.rb +4 -26
- data/app/models/spree_cm_commissioner/user_taxon.rb +0 -1
- data/app/models/spree_cm_commissioner/variant_block.rb +9 -0
- data/app/models/spree_cm_commissioner/variant_decorator.rb +36 -47
- data/app/models/spree_cm_commissioner/variant_options.rb +0 -23
- data/app/models/spree_cm_commissioner/vehicle.rb +9 -14
- data/app/models/spree_cm_commissioner/vendor_decorator.rb +7 -10
- data/app/models/spree_cm_commissioner/vendor_place.rb +6 -5
- data/app/models/spree_cm_commissioner/vendor_stop.rb +1 -2
- data/app/overrides/spree/admin/variants/_form/kyc_field.html.erb.deface +2 -2
- data/app/queries/spree_cm_commissioner/guest_searcher_query.rb +3 -45
- data/app/queries/spree_cm_commissioner/trip_query.rb +23 -26
- data/app/request_schemas/spree_cm_commissioner/accommodation_request_schema.rb +3 -0
- data/app/request_schemas/spree_cm_commissioner/application_request_schema.rb +1 -1
- data/app/request_schemas/spree_cm_commissioner/variant_request_schema.rb +19 -0
- data/app/serializers/spree/v2/storefront/accommodation_serializer.rb +2 -0
- data/app/serializers/spree/v2/storefront/line_item_serializer_decorator.rb +1 -0
- data/app/serializers/spree/v2/tenant/user_serializer.rb +0 -1
- data/app/serializers/spree_cm_commissioner/v2/operator/dashboard_crew_event_serializer.rb +1 -4
- data/app/serializers/spree_cm_commissioner/v2/storefront/dynamic_field_option_serializer.rb +3 -1
- data/app/serializers/spree_cm_commissioner/v2/storefront/dynamic_field_serializer.rb +3 -1
- data/app/serializers/spree_cm_commissioner/v2/storefront/guest_dynamic_field_serializer.rb +1 -2
- data/app/services/spree_cm_commissioner/organizer/export_guest_csv_service.rb +15 -23
- data/app/services/spree_cm_commissioner/user_authenticator.rb +1 -1
- data/app/views/blazer/queries/_content.html.erb +0 -8
- data/app/views/spree/admin/inventory_items/show.html.erb +72 -0
- data/app/views/spree/admin/stock_managements/_variant_stock_items.html.erb +7 -2
- data/app/views/spree/admin/stock_managements/calendar.html.erb +56 -0
- data/app/views/spree/admin/stock_managements/index.html.erb +55 -6
- data/app/views/spree/admin/tenants/_form.html.erb +42 -109
- data/config/initializers/paper_trail.rb +1 -0
- data/config/initializers/spree_permitted_attributes.rb +5 -2
- data/config/locales/en.yml +0 -5
- data/config/routes.rb +22 -6
- data/db/migrate/20240202080634_update_counter_cache_of_vehicle_type.rb +3 -1
- data/db/migrate/20250304293518_create_cm_inventory_items.rb +21 -0
- data/db/migrate/20250429094228_add_lock_version_to_cm_inventory_items.rb +5 -0
- data/db/migrate/20250502025848_add_index_to_spree_products.rb +5 -0
- data/db/migrate/20250502030001_add_product_type_to_spree_variants.rb +5 -0
- data/db/migrate/20250502030002_add_product_type_to_spree_line_items.rb +5 -0
- data/db/migrate/20250603035256_add_inventory_item_to_spree_prices.rb +7 -0
- data/db/migrate/20250619073724_drop_table_cm_line_item_seats.rb +5 -0
- data/db/migrate/20250619073812_drop_table_cm_vehicle_seats.rb +5 -0
- data/db/migrate/20250619073844_drop_table_cm_vehicle_types.rb +9 -0
- data/db/migrate/20250619073957_drop_table_cm_option_value_vehicle_types.rb +5 -0
- data/db/migrate/20250619082354_remove_unnecessary_fields_from_cm_places.rb +9 -0
- data/db/migrate/20250619082736_remove_route_type_from_spree_products.rb +5 -0
- data/db/migrate/20250619083055_remove_unnecessary_fields_from_spree_taxons.rb +5 -0
- data/db/migrate/20250620083055_remove_variant_id_from_cm_trips.rb +5 -0
- data/db/migrate/20250620090000_update_cm_trip_connections_to_use_cm_trips.rb +6 -0
- data/db/migrate/20250620090001_create_cm_seat_layouts.rb +17 -0
- data/db/migrate/20250620090002_create_cm_seat_sections.rb +18 -0
- data/db/migrate/20250620090003_create_cm_blocks.rb +18 -0
- data/db/migrate/20250624091005_create_cm_reserved_blocks.rb +29 -0
- data/db/migrate/20250626083642_create_cm_variant_blocks.rb +24 -0
- data/db/migrate/20250627023314_add_block_id_to_cm_guests.rb +13 -0
- data/docker-compose.yml +1 -1
- data/lib/cm_app_logger.rb +11 -4
- data/lib/generators/spree_cm_commissioner/install/install_generator.rb +14 -11
- data/lib/generators/spree_cm_commissioner/install/templates/app/javascript/{spree_cm_commissioner → spree_dashboard/spree_cm_commissioner}/utilities.js +4 -0
- data/lib/spree_cm_commissioner/cached_inventory_item.rb +23 -0
- data/lib/spree_cm_commissioner/calendar_event.rb +11 -1
- data/lib/spree_cm_commissioner/test_helper/factories/block_factory.rb +9 -0
- data/lib/spree_cm_commissioner/test_helper/factories/guest_factory.rb +10 -0
- data/lib/spree_cm_commissioner/test_helper/factories/homepage_section_relatable_factory.rb +1 -1
- data/lib/spree_cm_commissioner/test_helper/factories/inventory_item_factory.rb +9 -0
- data/lib/spree_cm_commissioner/test_helper/factories/line_item_factory.rb +1 -1
- data/lib/spree_cm_commissioner/test_helper/factories/option_type_factory.rb +6 -30
- data/lib/spree_cm_commissioner/test_helper/factories/order_factory.rb +0 -36
- data/lib/spree_cm_commissioner/test_helper/factories/product_factory.rb +18 -34
- data/lib/spree_cm_commissioner/test_helper/factories/reserved_block_factory.rb +27 -0
- data/lib/spree_cm_commissioner/test_helper/factories/seat_layout_factory.rb +8 -0
- data/lib/spree_cm_commissioner/test_helper/factories/seat_section_factory.rb +8 -0
- data/lib/spree_cm_commissioner/test_helper/factories/stock_location_factory.rb +2 -2
- data/lib/spree_cm_commissioner/test_helper/factories/trip_connection_factory.rb +6 -0
- data/lib/spree_cm_commissioner/test_helper/factories/trip_factory.rb +10 -3
- data/lib/spree_cm_commissioner/test_helper/factories/user_identity_provider_factory.rb +1 -1
- data/lib/spree_cm_commissioner/test_helper/factories/variant_block_factory.rb +7 -0
- data/lib/spree_cm_commissioner/test_helper/factories/variant_factory.rb +41 -19
- data/lib/spree_cm_commissioner/test_helper/factories/vehicle_factory.rb +1 -1
- data/lib/spree_cm_commissioner/test_helper/factories/vendor_factory.rb +1 -1
- data/lib/spree_cm_commissioner/version.rb +1 -1
- data/lib/spree_cm_commissioner.rb +35 -1
- data/lib/tasks/create_default_non_permanent_inventory_items.rake +16 -0
- data/lib/tasks/ensure_correct_product_type.rake +7 -0
- data/lib/tasks/generate_inventory_items.rake +7 -0
- data/spree_cm_commissioner.gemspec +7 -0
- metadata +135 -57
- data/app/assets/images/cm-hangmeas-checkout_image.svg +0 -63
- data/app/assets/images/cm-hangmeas-failed.svg +0 -56
- data/app/assets/images/cm-hangmeas-loader.svg +0 -50
- data/app/assets/images/cm-hangmeas-success.svg +0 -51
- data/app/assets/javascripts/spree_cm_commissioner/tenant_payment_icon_fields.js +0 -65
- data/app/assets/stylesheets/spree_cm_commissioner/backend/tenant_payment_icon_fields.scss +0 -60
- data/app/controllers/concerns/spree_cm_commissioner/transit/taxon_bitwise.rb +0 -44
- data/app/controllers/spree/admin/trip_blazer_queries_controller.rb +0 -35
- data/app/controllers/spree/api/v2/organizer/invite_crews_controller.rb +0 -33
- data/app/finders/spree_cm_commissioner/line_items/find_by_variant_decorator.rb +0 -20
- data/app/interactors/spree_cm_commissioner/apple_app_site_association_fetcher.rb +0 -27
- data/app/interactors/spree_cm_commissioner/asset_links_fetcher.rb +0 -27
- data/app/interactors/spree_cm_commissioner/crew_invite_link_handler.rb +0 -48
- data/app/interactors/spree_cm_commissioner/telegram_chats_auto_finder.rb +0 -144
- data/app/models/concerns/spree_cm_commissioner/event_check_in_flowable.rb +0 -30
- data/app/models/spree_cm_commissioner/blazer_queryable.rb +0 -8
- data/app/models/spree_cm_commissioner/branch.rb +0 -12
- data/app/models/spree_cm_commissioner/crew_invite_link.rb +0 -4
- data/app/models/spree_cm_commissioner/line_item_seat.rb +0 -10
- data/app/models/spree_cm_commissioner/option_value_vehicle_type.rb +0 -8
- data/app/models/spree_cm_commissioner/pin_code_telegram.rb +0 -28
- data/app/models/spree_cm_commissioner/promotion_category_decorator.rb +0 -11
- data/app/models/spree_cm_commissioner/stop.rb +0 -23
- data/app/models/spree_cm_commissioner/telegram_chat.rb +0 -6
- data/app/models/spree_cm_commissioner/vehicle_seat.rb +0 -11
- data/app/models/spree_cm_commissioner/vehicle_type.rb +0 -76
- data/app/overrides/spree/admin/taxons/_form/check_in_flows.html.erb.deface +0 -18
- data/app/queries/spree_cm_commissioner/trip_search_query.rb +0 -76
- data/app/queries/spree_cm_commissioner/variant_availability/non_permanent_stock_query.rb +0 -45
- data/app/queries/spree_cm_commissioner/variant_availability/permanent_stock_query.rb +0 -55
- data/app/serializers/spree/v2/organizer/invite_crews_serializer.rb +0 -11
- data/app/services/spree_cm_commissioner/vehicle_option_value_creator.rb +0 -11
- data/db/migrate/20250616084219_add_description_to_cm_vendor_place.rb +0 -5
- data/db/migrate/20250630103536_create_cm_telegram_chats.rb +0 -13
- data/db/migrate/20250701093203_add_configurations_to_cm_dynamic_field.rb +0 -6
- data/db/migrate/20250702091305_add_dynamic_field_option_to_guest_dynamic_field.rb +0 -5
- data/db/migrate/20250702091935_add_status_to_dynamic_field_option.rb +0 -5
- data/db/migrate/20250707032008_add_vendor_id_to_spree_category.rb +0 -7
- data/db/migrate/20250711092937_add_position_to_cm_dynamic_fields.rb +0 -11
- data/db/migrate/20250711093045_add_position_to_cm_dynamic_field_options.rb +0 -11
- data/db/migrate/20250714121508_rename_cm_taxon_blazer_query_to_blazer_queryables.rb +0 -7
- data/db/migrate/20250714124323_make_cm_blazer_queryables_polymorphic.rb +0 -19
- data/db/migrate/20250715103333_remove_indexes_from_cm_user_identity_providers.rb +0 -13
- data/lib/spree_cm_commissioner/test_helper/factories/branch_factory.rb +0 -12
- data/lib/spree_cm_commissioner/test_helper/factories/departure_time_option_type_factory.rb +0 -8
- data/lib/spree_cm_commissioner/test_helper/factories/duration_option_type_factory.rb +0 -8
- data/lib/spree_cm_commissioner/test_helper/factories/line_item_seat_factory.rb +0 -7
- data/lib/spree_cm_commissioner/test_helper/factories/stop_factory.rb +0 -14
- data/lib/spree_cm_commissioner/test_helper/factories/transit_place_factory.rb +0 -8
- data/lib/spree_cm_commissioner/test_helper/factories/vehicle_option_type_factory.rb +0 -8
- data/lib/spree_cm_commissioner/test_helper/factories/vehicle_type_factory.rb +0 -96
- data/lib/spree_cm_commissioner/trip_seat_layout_result.rb +0 -11
@@ -1,63 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<svg id="payment_proccessing" data-name="payment proccessing" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 334 200">
|
3
|
-
<defs>
|
4
|
-
<clipPath id="clippath">
|
5
|
-
<path d="m332.72,16.62v166.75c0,8.27-6.28,15.08-14.33,15.92-.55.05-1.11.08-1.67.08H16c-.48,0-.96-.02-1.43-.06-8.17-.73-14.57-7.59-14.57-15.94V16.62C0,7.78,7.16.62,16,.62h300.72c8.84,0,16,7.16,16,16Z" style="fill: none;"/>
|
6
|
-
</clipPath>
|
7
|
-
</defs>
|
8
|
-
<g style="clip-path: url(#clippath);">
|
9
|
-
<path d="m332.72,16.62v166.75c0,8.27-6.28,15.08-14.33,15.92-.55.05-1.11.08-1.67.08H16c-.48,0-.96-.02-1.43-.06-8.17-.73-14.57-7.59-14.57-15.94V16.62C0,7.78,7.16.62,16,.62h300.72c8.84,0,16,7.16,16,16Z" style="fill: #130d07;"/>
|
10
|
-
<path d="m160.11,89.69c1.41-5.81-3.61-9.74-10.21-9.27-6.6.47-26.31,10.68-28.51,12.26-2.2,1.57-29.54,6.6-34.25,3.77-4.71-2.83-12.46-7.49-12.46-7.49,0,0-23.81-23.81-40.47,2.86-16.67,26.66-13.99,61.42-13.99,61.42l-24.1,29.05s-10.95,10,3.81,19.05,22.11,18.14,31.15,21.3c9.04,3.16,14.46-7,14.46-7.68,0-.68,19.43-30.27,19.43-30.27,10.27-.69,20.53-1.41,30.79-2.17,10.81-.8,24.65.44,31.99-9.08,3.2-4.15,1.59-8.37-.02-12.85.06.18,3.68-1,4-1.13,1.81-.72,3.12-1.91,3.94-3.7,1.55-3.36,2.03-8.12.07-11.41-2.91-4.88-3.85-5.31-3.85-5.31.93.42,4.7-2.76,5.32-3.27,2.69-2.21,4.81-5.03,5.27-8.57,1.31-10.16-10.01-17.26-18.56-19.27,5.59,1.31,10.8,2.15,16.21-.39,3.01-1.41,5.69-3.43,8.35-5.44,4.02-3.03,10.38-7.18,11.65-12.41" style="fill: #e89875;"/>
|
11
|
-
<path d="m138.73,45.68c-1.83-.91-5.84-1.99-7.86-2.27-3.17-.44-12.78-.68-12.78-.68l-1.24,3.76-31.45-1.3c-4.73-.2-8.98,2.88-10.27,7.44l-27.87,101.59c-1.74,6.14,2.5,12.35,8.85,12.97l49.44,1.78c4.98.49,9.59-2.69,10.89-7.53l27.25-101.35c.17-.64.26-1.28.31-1.92,0-.02.01-.05.02-.07,1.59-7.52-1.35-10.47-5.29-12.43Z" style="fill: #302b31;"/>
|
12
|
-
<path d="m51.51,163.26l49.44,1.78c4.98.49,9.59-2.69,10.89-7.53l27.25-101.35c1.7-6.33-2.91-12.61-9.46-12.88l-48.82-2.02c-4.73-.2-8.98,2.88-10.27,7.44l-27.87,101.59c-1.74,6.14,2.5,12.35,8.85,12.97Z" style="fill: #212028;"/>
|
13
|
-
<path d="m108.45,126.85c-1.64.07-3.43-.23-5.08-.3-4.13-.18-8.26-.36-12.39-.54l-22.43-.98-.81-.04c-2.87-.41-4.61-1.99-3.7-4.96l.84-3.54c.55-2.49,2.89-4.15,5.42-3.86,13.54.41,27.15.41,40.66,1.23,2,.12,4.17.45,4.34,2.96.15,2.13-1.09,4.94-1.91,6.87-1.02,2.41-2.87,3.07-4.95,3.16Z" style="fill: #f59b1d;"/>
|
14
|
-
<path d="m117.78,96.1l-48.7-1.94c-2.03-.08-3.25-1.77-2.74-3.76l8.36-32.34c.52-2,2.58-3.55,4.61-3.47l48.7,1.94c2.03.08,3.25,1.77,2.74,3.76l-8.36,32.34c-.52,2-2.58,3.55-4.61,3.47Z" style="fill: #fffaf8;"/>
|
15
|
-
<path d="m85.83,77.72l-8.87-.35c-.88-.04-1.41-.77-1.19-1.63l1.23-4.78c.22-.87,1.12-1.54,2-1.51l8.87.35c.88.04,1.41.77,1.19,1.63l-1.23,4.78c-.22.87-1.12,1.54-2,1.51Z" style="fill: #d6d6d6;"/>
|
16
|
-
<path d="m124.55,64.16l-9.8-.39c-.62-.02-1-.54-.84-1.15l.45-1.74c.16-.61.79-1.09,1.41-1.06l9.8.39c.62.02,1,.54.84,1.15l-.45,1.74c-.16.61-.79,1.09-1.41,1.06Z" style="fill: #d6d6d6;"/>
|
17
|
-
<path d="m84.05,81.98l-8.95-.36c-.47-.02-.75-.41-.63-.87l.22-.86c.12-.46.59-.82,1.06-.8l8.95.36c.47.02.75.41.63.87l-.22.86c-.12.46-.59.82-1.06.8Z" style="fill: #d6d6d6;"/>
|
18
|
-
<path d="m99.83,91.71l-27.44-1.09c-.25-.01-.41-.22-.34-.47l.42-1.62c.06-.25.32-.44.57-.43l27.44,1.09c.25.01.41.22.34.47l-.42,1.62c-.06.25-.32.44-.57.43Z" style="fill: #d6d6d6;"/>
|
19
|
-
<path d="m95.54,82.43l-8.95-.36c-.47-.02-.75-.41-.63-.87l.22-.86c.12-.46.59-.82,1.06-.8l8.95.36c.47.02.75.41.63.87l-.22.86c-.12.46-.59.82-1.06.8Z" style="fill: #d6d6d6;"/>
|
20
|
-
<path d="m107.03,82.89l-8.95-.36c-.47-.02-.75-.41-.63-.87l.22-.86c.12-.46.59-.82,1.06-.8l8.95.36c.47.02.75.41.63.87l-.22.86c-.12.46-.59.82-1.06.8Z" style="fill: #d6d6d6;"/>
|
21
|
-
<path d="m118.52,83.35l-8.95-.36c-.47-.02-.75-.41-.63-.87l.22-.86c.12-.46.59-.82,1.06-.8l8.95.36c.47.02.75.41.63.87l-.22.86c-.12.46-.59.82-1.06.8Z" style="fill: #d6d6d6;"/>
|
22
|
-
<path d="m111.65,93.7c-.49.15-.94.45-1.44.61-2.03.64-4.12-.62-4.15-2.53-.02-1.28.45-2.44,1.6-3.42.84-.72,1.78-1.08,2.78-1.14.88-.05,1.65.12,2.24.65.12.11.29.16.44.24-.17.19.02.23.08.32.37.57.57,1.21.45,1.96-.2,1.22-.73,2.32-1.89,3.17-.05.03-.08.09-.11.14Z" style="fill: #d6d6d6;"/>
|
23
|
-
<path d="m111.65,93.7s.07-.11.11-.14c1.16-.85,1.69-1.95,1.89-3.17.12-.75-.08-1.39-.45-1.96-.06-.09-.25-.14-.08-.32.59-.27,1.16-.59,1.79-.67,2.25-.26,3.6.86,3.66,2.68.06,1.96-1.32,3.73-3.42,4.37-1.29.39-2.36.14-3.23-.58-.09-.07-.18-.15-.26-.22Z" style="fill: #5e5e5e;"/>
|
24
|
-
<path d="m53.69,110.12s1.51-5.75,5.56,2.51c4.05,8.27,15.38,11.23,20.41,6.86s-.79-23.41-15.54-36.21c-14.75-12.8-30.48,5.41-37.12,19.9-6.65,14.49-6.78,50.07-6.78,50.07l48.9,21.12s8.3-15.25.02-34.98c-4.68-11.15-9.08-16.86-12.8-21.88-3.73-5.02-2.64-7.37-2.64-7.37Z" style="fill: #e89875;"/>
|
25
|
-
<g>
|
26
|
-
<rect x="222.73" y="98.72" width="8.27" height="27.35" style="fill: #fbc01a;"/>
|
27
|
-
<polygon points="231 100.13 222.73 100.13 221.53 95.4 232.39 95.4 231 100.13" style="fill: #fbc01a;"/>
|
28
|
-
<line x1="223.67" y1="100.13" x2="231" y2="100.13" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
|
29
|
-
<polygon points="222.73 126.08 231 126.08 232.2 130.8 221.33 130.8 222.73 126.08" style="fill: #fbc01a;"/>
|
30
|
-
<line x1="231" y1="126.08" x2="222.73" y2="126.08" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
|
31
|
-
</g>
|
32
|
-
<g>
|
33
|
-
<rect x="240.34" y="98.72" width="8.27" height="27.35" style="fill: #f4b200;"/>
|
34
|
-
<polygon points="248.61 100.13 240.34 100.13 239.15 95.4 250.01 95.4 248.61 100.13" style="fill: #f4b200;"/>
|
35
|
-
<polygon points="240.35 126.08 248.62 126.08 249.81 130.8 238.95 130.8 240.35 126.08" style="fill: #f4b200;"/>
|
36
|
-
</g>
|
37
|
-
<g>
|
38
|
-
<rect x="257.95" y="98.72" width="8.27" height="27.35" style="fill: #fbc01a;"/>
|
39
|
-
<polygon points="266.22 100.13 257.95 100.13 256.76 95.4 267.62 95.4 266.22 100.13" style="fill: #fbc01a;"/>
|
40
|
-
<line x1="258.9" y1="100.13" x2="266.22" y2="100.13" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
|
41
|
-
<polygon points="257.96 126.08 266.23 126.08 267.42 130.8 256.56 130.8 257.96 126.08" style="fill: #fbc01a;"/>
|
42
|
-
<line x1="266.22" y1="126.08" x2="257.96" y2="126.08" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
|
43
|
-
</g>
|
44
|
-
<g>
|
45
|
-
<rect x="275.56" y="98.72" width="8.27" height="27.35" style="fill: #fbc01a;"/>
|
46
|
-
<polygon points="283.84 100.13 275.56 100.13 274.37 95.4 285.23 95.4 283.84 100.13" style="fill: #fbc01a;"/>
|
47
|
-
<line x1="276.51" y1="100.13" x2="283.84" y2="100.13" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
|
48
|
-
<polygon points="275.57 126.08 283.84 126.08 285.04 130.8 274.17 130.8 275.57 126.08" style="fill: #fbc01a;"/>
|
49
|
-
<line x1="283.84" y1="126.08" x2="275.57" y2="126.08" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
|
50
|
-
</g>
|
51
|
-
<rect x="218.79" y="91.42" width="69.46" height="3.98" style="fill: #f9b500;"/>
|
52
|
-
<rect x="218.79" y="130.8" width="69.46" height="3.98" style="fill: #fbc01a;"/>
|
53
|
-
<rect x="209.25" y="134.79" width="88.53" height="4.09" style="fill: #f4b200;"/>
|
54
|
-
<path d="m216.67,88.29l34.23-15.08c2.1-.93,4.5-.93,6.6,0l34.23,15.08c1.62.71,1.11,3.13-.66,3.13h-73.75c-1.77,0-2.28-2.42-.66-3.13Z" style="fill: #fbc01a;"/>
|
55
|
-
<path d="m230.81,86.16l21.33-9.4c1.31-.58,2.8-.58,4.11,0l21.33,9.4c1.01.44.69,1.95-.41,1.95h-45.96c-1.1,0-1.42-1.51-.41-1.95Z" style="fill: #f4b200;"/>
|
56
|
-
<path d="m256.72,83.21c0-1.39-1.13-2.51-2.51-2.51s-2.51,1.13-2.51,2.51,1.13,2.51,2.51,2.51,2.51-1.13,2.51-2.51Z" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
|
57
|
-
<line x1="218.8" y1="131.54" x2="288.24" y2="131.54" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
|
58
|
-
<path d="m143.42,43.43l2.99-1.92c34.81-22.3,81.11-12.16,103.41,22.65h0" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 4px;"/>
|
59
|
-
<polyline points="242.93 64.16 250.34 64.16 250.34 56.12" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 3px;"/>
|
60
|
-
<path d="m253.66,141.68l-3.52,4.34c-28.53,29.92-75.91,31.04-105.83,2.5h0" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 4px;"/>
|
61
|
-
<polyline points="151 146.9 143.8 148.65 145.77 156.76" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 3px;"/>
|
62
|
-
</g>
|
63
|
-
</svg>
|
@@ -1,56 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<svg
|
3
|
-
xmlns="http://www.w3.org/2000/svg"
|
4
|
-
viewBox="0 0 52 52"
|
5
|
-
width="100"
|
6
|
-
height="100"
|
7
|
-
>
|
8
|
-
<style>
|
9
|
-
.svg-failed {
|
10
|
-
stroke: white;
|
11
|
-
stroke-width: 5;
|
12
|
-
stroke-miterlimit: 10;
|
13
|
-
stroke-linecap: round;
|
14
|
-
stroke-linejoin: round;
|
15
|
-
fill: none;
|
16
|
-
animation: svg-failed-scale 0.3s ease-in-out 0.9s both;
|
17
|
-
}
|
18
|
-
|
19
|
-
.svg-failed-circle {
|
20
|
-
stroke: none;
|
21
|
-
fill: #FF5A5F;
|
22
|
-
}
|
23
|
-
|
24
|
-
.svg-failed-x {
|
25
|
-
stroke-dasharray: 48;
|
26
|
-
stroke-dashoffset: 48;
|
27
|
-
animation: svg-failed-draw 0.5s ease forwards 0.6s;
|
28
|
-
}
|
29
|
-
|
30
|
-
@keyframes svg-failed-draw {
|
31
|
-
to {
|
32
|
-
stroke-dashoffset: 0;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
@keyframes svg-failed-scale {
|
37
|
-
0%, 100% {
|
38
|
-
transform: scale(1);
|
39
|
-
}
|
40
|
-
50% {
|
41
|
-
transform: scale(1.1);
|
42
|
-
}
|
43
|
-
}
|
44
|
-
</style>
|
45
|
-
|
46
|
-
<circle class="svg-failed-circle" cx="26" cy="26" r="25" />
|
47
|
-
<!-- X mark: two lines crossing -->
|
48
|
-
<path
|
49
|
-
class="svg-failed svg-failed-x"
|
50
|
-
d="M16 16 L36 36"
|
51
|
-
/>
|
52
|
-
<path
|
53
|
-
class="svg-failed svg-failed-x"
|
54
|
-
d="M36 16 L16 36"
|
55
|
-
/>
|
56
|
-
</svg>
|
@@ -1,50 +0,0 @@
|
|
1
|
-
<svg class="pl" width="300" height="300" viewBox="0 0 300 300" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<style>
|
3
|
-
.pl__ring { animation: ringA 3s linear infinite; }
|
4
|
-
.pl__ring--a { stroke: #F79E1B; }
|
5
|
-
.pl__ring--b { animation-name: ringB; stroke: #F79E1B; }
|
6
|
-
.pl__ring--c { animation-name: ringC; stroke: #F79E1B; }
|
7
|
-
.pl__ring--d { animation-name: ringD; stroke: #F79E1B; }
|
8
|
-
|
9
|
-
@keyframes ringA {
|
10
|
-
from, 4% { stroke-dasharray: 0 660; stroke-width: 20; stroke-dashoffset: -330; }
|
11
|
-
12% { stroke-dasharray: 60 600; stroke-width: 30; stroke-dashoffset: -335; }
|
12
|
-
32% { stroke-dasharray: 60 600; stroke-width: 30; stroke-dashoffset: -595; }
|
13
|
-
40%, 54% { stroke-dasharray: 0 660; stroke-width: 20; stroke-dashoffset: -660; }
|
14
|
-
62% { stroke-dasharray: 60 600; stroke-width: 30; stroke-dashoffset: -665; }
|
15
|
-
82% { stroke-dasharray: 60 600; stroke-width: 30; stroke-dashoffset: -925; }
|
16
|
-
90%, to { stroke-dasharray: 0 660; stroke-width: 20; stroke-dashoffset: -990; }
|
17
|
-
}
|
18
|
-
@keyframes ringB {
|
19
|
-
from, 12% { stroke-dasharray: 0 220; stroke-width: 20; stroke-dashoffset: -110; }
|
20
|
-
20% { stroke-dasharray: 20 200; stroke-width: 30; stroke-dashoffset: -115; }
|
21
|
-
40% { stroke-dasharray: 20 200; stroke-width: 30; stroke-dashoffset: -195; }
|
22
|
-
48%, 62% { stroke-dasharray: 0 220; stroke-width: 20; stroke-dashoffset: -220; }
|
23
|
-
70% { stroke-dasharray: 20 200; stroke-width: 30; stroke-dashoffset: -225; }
|
24
|
-
90% { stroke-dasharray: 20 200; stroke-width: 30; stroke-dashoffset: -305; }
|
25
|
-
98%, to { stroke-dasharray: 0 220; stroke-width: 20; stroke-dashoffset: -330; }
|
26
|
-
}
|
27
|
-
@keyframes ringC {
|
28
|
-
from { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: 0; }
|
29
|
-
8% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -5; }
|
30
|
-
28% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -175; }
|
31
|
-
36%, 58% { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: -220; }
|
32
|
-
66% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -225; }
|
33
|
-
86% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -395; }
|
34
|
-
94%, to { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: -440; }
|
35
|
-
}
|
36
|
-
@keyframes ringD {
|
37
|
-
from, 8% { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: 0; }
|
38
|
-
16% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -5; }
|
39
|
-
36% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -175; }
|
40
|
-
44%, 50% { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: -220; }
|
41
|
-
58% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -225; }
|
42
|
-
78% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -395; }
|
43
|
-
86%, to { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: -440; }
|
44
|
-
}
|
45
|
-
</style>
|
46
|
-
<circle class="pl__ring pl__ring--a" cx="150" cy="150" r="105" fill="none" stroke-width="20" stroke-dasharray="0 660" stroke-dashoffset="-330" stroke-linecap="round"/>
|
47
|
-
<circle class="pl__ring pl__ring--b" cx="150" cy="150" r="35" fill="none" stroke-width="20" stroke-dasharray="0 220" stroke-dashoffset="-110" stroke-linecap="round"/>
|
48
|
-
<circle class="pl__ring pl__ring--c" cx="115" cy="150" r="70" fill="none" stroke-width="20" stroke-dasharray="0 440" stroke-linecap="round"/>
|
49
|
-
<circle class="pl__ring pl__ring--d" cx="185" cy="150" r="70" fill="none" stroke-width="20" stroke-dasharray="0 440" stroke-linecap="round"/>
|
50
|
-
</svg>
|
@@ -1,51 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<svg
|
3
|
-
xmlns="http://www.w3.org/2000/svg"
|
4
|
-
viewBox="0 0 52 52"
|
5
|
-
width="100"
|
6
|
-
height="100"
|
7
|
-
>
|
8
|
-
<style>
|
9
|
-
.svg-checkmark {
|
10
|
-
stroke: white;
|
11
|
-
stroke-width: 5;
|
12
|
-
stroke-miterlimit: 10;
|
13
|
-
stroke-linecap: round;
|
14
|
-
stroke-linejoin: round;
|
15
|
-
fill: none;
|
16
|
-
animation: svg-success-scale 0.3s ease-in-out 0.9s both;
|
17
|
-
}
|
18
|
-
|
19
|
-
.svg-checkmark-circle {
|
20
|
-
stroke: none;
|
21
|
-
fill: #00D290;
|
22
|
-
}
|
23
|
-
|
24
|
-
.svg-checkmark-check {
|
25
|
-
stroke-dasharray: 48;
|
26
|
-
stroke-dashoffset: 48;
|
27
|
-
animation: svg-success-draw 0.5s ease forwards 0.6s;
|
28
|
-
}
|
29
|
-
|
30
|
-
@keyframes svg-success-draw {
|
31
|
-
to {
|
32
|
-
stroke-dashoffset: 0;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
@keyframes svg-success-scale {
|
37
|
-
0%, 100% {
|
38
|
-
transform: scale(1);
|
39
|
-
}
|
40
|
-
50% {
|
41
|
-
transform: scale(1.1);
|
42
|
-
}
|
43
|
-
}
|
44
|
-
</style>
|
45
|
-
|
46
|
-
<circle class="svg-checkmark-circle" cx="26" cy="26" r="25" />
|
47
|
-
<path
|
48
|
-
class="svg-checkmark svg-checkmark-check"
|
49
|
-
d="M14.1 27.2l7.1 7.2 16.7-16.8"
|
50
|
-
/>
|
51
|
-
</svg>
|
@@ -1,65 +0,0 @@
|
|
1
|
-
document.addEventListener('DOMContentLoaded', function () {
|
2
|
-
// Initialize Select2 for all tenant-payment-icon-select elements
|
3
|
-
if (window.$ && $.fn.select2) {
|
4
|
-
$('.tenant-payment-icon-select').each(function () {
|
5
|
-
$(this).select2({
|
6
|
-
width: '100%'
|
7
|
-
});
|
8
|
-
});
|
9
|
-
}
|
10
|
-
|
11
|
-
// Handle icon selection change
|
12
|
-
document.querySelectorAll('.tenant-payment-icon-select').forEach(function (select) {
|
13
|
-
select.addEventListener('change', function (e) {
|
14
|
-
const field = e.target.name.match(/\[([^\]]*)\]$/)[1]; // Extract field name
|
15
|
-
const preview = document.getElementById(`icon-preview-${field}`);
|
16
|
-
const removeBtn = document.querySelector(`.remove-icon-btn[data-target="${field}"]`);
|
17
|
-
const iconPath = e.target.value;
|
18
|
-
|
19
|
-
if (!preview || !removeBtn) return;
|
20
|
-
|
21
|
-
if (!iconPath) {
|
22
|
-
preview.innerHTML = '<span class="no-icon-placeholder"></span>';
|
23
|
-
removeBtn.classList.add('hidden');
|
24
|
-
return;
|
25
|
-
}
|
26
|
-
|
27
|
-
// Fetch SVG for the selected icon
|
28
|
-
fetch(`/admin/vector_icons/svg?path=${encodeURIComponent(iconPath)}`)
|
29
|
-
.then((response) => {
|
30
|
-
if (!response.ok) throw new Error('Failed to fetch SVG');
|
31
|
-
return response.text();
|
32
|
-
})
|
33
|
-
.then((svg) => {
|
34
|
-
preview.innerHTML = svg;
|
35
|
-
removeBtn.classList.remove('hidden');
|
36
|
-
})
|
37
|
-
.catch((error) => {
|
38
|
-
console.error('Error fetching SVG:', error);
|
39
|
-
preview.innerHTML = '<span class="no-icon-placeholder">Error loading icon</span>';
|
40
|
-
});
|
41
|
-
});
|
42
|
-
});
|
43
|
-
|
44
|
-
document.addEventListener('click', function (e) {
|
45
|
-
if (!e.target.classList.contains('remove-icon-btn')) return;
|
46
|
-
|
47
|
-
const field = e.target.getAttribute('data-target');
|
48
|
-
const select = document.querySelector(`.tenant-payment-icon-select[name*="[${field}]"]`);
|
49
|
-
const preview = document.getElementById(`icon-preview-${field}`);
|
50
|
-
const removeBtn = e.target;
|
51
|
-
|
52
|
-
if (!select || !preview || !removeBtn) return;
|
53
|
-
|
54
|
-
// Clear the select input
|
55
|
-
select.value = '';
|
56
|
-
|
57
|
-
if (window.$ && $(select).hasClass('select2-hidden-accessible')) {
|
58
|
-
$(select).val('').trigger('change.select2');
|
59
|
-
} else {
|
60
|
-
select.dispatchEvent(new Event('change', { bubbles: true }));
|
61
|
-
}
|
62
|
-
preview.innerHTML = '<span class="no-icon-placeholder"></span>';
|
63
|
-
removeBtn.classList.add('hidden');
|
64
|
-
});
|
65
|
-
});
|
@@ -1,60 +0,0 @@
|
|
1
|
-
.payment-icon-preview {
|
2
|
-
width: 80px;
|
3
|
-
height: 80px;
|
4
|
-
background: #f8f9fa;
|
5
|
-
border: 1px dashed #ccc;
|
6
|
-
display: inline-flex;
|
7
|
-
align-items: center;
|
8
|
-
justify-content: center;
|
9
|
-
cursor: pointer;
|
10
|
-
}
|
11
|
-
|
12
|
-
.payment-icon-preview svg {
|
13
|
-
width: 100%;
|
14
|
-
height: 100%;
|
15
|
-
object-fit: contain;
|
16
|
-
}
|
17
|
-
|
18
|
-
|
19
|
-
.no-icon-placeholder {
|
20
|
-
width: 40px;
|
21
|
-
height: 40px;
|
22
|
-
border: 1px dashed #ddd;
|
23
|
-
background: #f8f9fa;
|
24
|
-
display: inline-block;
|
25
|
-
}
|
26
|
-
|
27
|
-
.icon-preview-container {
|
28
|
-
position: relative;
|
29
|
-
display: inline-block;
|
30
|
-
}
|
31
|
-
|
32
|
-
.remove-icon-btn {
|
33
|
-
position: absolute;
|
34
|
-
top: -8px;
|
35
|
-
right: -8px;
|
36
|
-
width: 24px;
|
37
|
-
height: 24px;
|
38
|
-
border-radius: 50%;
|
39
|
-
background: #dc3545;
|
40
|
-
color: white;
|
41
|
-
border: 2px solid white;
|
42
|
-
display: flex;
|
43
|
-
align-items: center;
|
44
|
-
justify-content: center;
|
45
|
-
cursor: pointer;
|
46
|
-
font-size: 12px;
|
47
|
-
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
|
48
|
-
transition: all 0.2s ease;
|
49
|
-
z-index: 10;
|
50
|
-
}
|
51
|
-
|
52
|
-
.remove-icon-btn:hover {
|
53
|
-
background: #c82333;
|
54
|
-
transform: scale(1.1);
|
55
|
-
box-shadow: 0 3px 6px rgba(0,0,0,0.3);
|
56
|
-
}
|
57
|
-
|
58
|
-
.remove-icon-btn.hidden {
|
59
|
-
display: none;
|
60
|
-
}
|
@@ -1,44 +0,0 @@
|
|
1
|
-
module SpreeCmCommissioner
|
2
|
-
module Transit
|
3
|
-
module TaxonBitwise
|
4
|
-
extend ActiveSupport::Concern
|
5
|
-
|
6
|
-
BIT_STOP = 0b001
|
7
|
-
BIT_STATION = 0b010
|
8
|
-
BIT_BRANCH = 0b100
|
9
|
-
BIT_LOCATION = 0b1000
|
10
|
-
|
11
|
-
included do
|
12
|
-
attr_accessor :stop, :station, :branch, :location
|
13
|
-
|
14
|
-
before_validation :at_least_one_checkbox_selected
|
15
|
-
end
|
16
|
-
|
17
|
-
def stop?
|
18
|
-
data_type & BIT_STOP != 0
|
19
|
-
end
|
20
|
-
|
21
|
-
def station?
|
22
|
-
data_type & BIT_STATION != 0
|
23
|
-
end
|
24
|
-
|
25
|
-
def branch?
|
26
|
-
data_type & BIT_BRANCH != 0
|
27
|
-
end
|
28
|
-
|
29
|
-
def location?
|
30
|
-
data_type & BIT_LOCATION != 0
|
31
|
-
end
|
32
|
-
|
33
|
-
private
|
34
|
-
|
35
|
-
def at_least_one_checkbox_selected
|
36
|
-
if stop.nil? && station.nil? && branch.nil? && location.nil?
|
37
|
-
nil
|
38
|
-
elsif stop.to_i.zero? && station.to_i.zero? && branch.to_i.zero? && location.to_i.zero?
|
39
|
-
errors.add(:base, 'At least one checkbox (stop, branch, or location) must be selected')
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
module Admin
|
3
|
-
class TripBlazerQueriesController < Spree::Admin::ResourceController
|
4
|
-
def model_class
|
5
|
-
SpreeCmCommissioner::BlazerQueryable
|
6
|
-
end
|
7
|
-
|
8
|
-
def object_name
|
9
|
-
'spree_cm_commissioner_blazer_queryable'
|
10
|
-
end
|
11
|
-
|
12
|
-
def create
|
13
|
-
queryable = SpreeCmCommissioner::Trip.find_by(id: params[:trip_id])
|
14
|
-
|
15
|
-
if queryable.nil?
|
16
|
-
flash[:alert] = I18n.t('trip_blazer_queries.not_found')
|
17
|
-
redirect_to request.referer || spree.admin_trips_path and return
|
18
|
-
end
|
19
|
-
|
20
|
-
trip_blazer = SpreeCmCommissioner::BlazerQueryable.new(
|
21
|
-
queryable: queryable,
|
22
|
-
blazer_query_id: params[:blazer_query_id]
|
23
|
-
)
|
24
|
-
|
25
|
-
if trip_blazer.save
|
26
|
-
flash[:success] = I18n.t('trip_blazer_queries.success')
|
27
|
-
else
|
28
|
-
flash[:alert] = trip_blazer.errors.full_messages.join(', ')
|
29
|
-
end
|
30
|
-
|
31
|
-
redirect_to blazer.query_path(id: trip_blazer.blazer_query_id, trip_id: queryable.id)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
module Api
|
3
|
-
module V2
|
4
|
-
module Organizer
|
5
|
-
class InviteCrewsController < ::Spree::Api::V2::Organizer::BaseController
|
6
|
-
def show
|
7
|
-
render_serialized_payload { serialize_resource(invite) }
|
8
|
-
end
|
9
|
-
|
10
|
-
def update
|
11
|
-
context = SpreeCmCommissioner::CrewInviteLinkHandler.call(
|
12
|
-
params: params
|
13
|
-
)
|
14
|
-
|
15
|
-
if context.success?
|
16
|
-
render_serialized_payload { serialize_resource(context.invite) }
|
17
|
-
else
|
18
|
-
render_error_payload(context.message || I18n.t('invite.accept_fail'))
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def invite
|
23
|
-
@invite ||= SpreeCmCommissioner::Invite.find_by!(token: params[:id])
|
24
|
-
end
|
25
|
-
|
26
|
-
def resource_serializer
|
27
|
-
::Spree::V2::Organizer::InviteCrewsSerializer
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module SpreeCmCommissioner
|
2
|
-
module LineItems
|
3
|
-
module FindByVariantDecorator
|
4
|
-
# ovveride
|
5
|
-
def execute(order:, variant:, options: {})
|
6
|
-
return super unless variant.product.product_type == 'transit'
|
7
|
-
|
8
|
-
order.line_items.detect do |line_item|
|
9
|
-
next if options[:date].present? && !(line_item.variant_id == variant.id && line_item.date == options[:date])
|
10
|
-
|
11
|
-
Spree::Dependencies.cart_compare_line_items_service.constantize.call(order: order, line_item: line_item, options: options).value
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
unless Spree::LineItems::FindByVariant.included_modules.include?(SpreeCmCommissioner::LineItems::FindByVariantDecorator)
|
19
|
-
Spree::LineItems::FindByVariant.prepend(SpreeCmCommissioner::LineItems::FindByVariantDecorator)
|
20
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module SpreeCmCommissioner
|
2
|
-
class AppleAppSiteAssociationFetcher < BaseInteractor
|
3
|
-
delegate :store, :tenant, :refreshed, to: :context
|
4
|
-
|
5
|
-
def call
|
6
|
-
key = cache_key
|
7
|
-
|
8
|
-
CmAppLogger.log(label: 'LOOKING_UP_CACHE', data: { cache_key: key })
|
9
|
-
|
10
|
-
Rails.cache.delete(key) if refreshed
|
11
|
-
|
12
|
-
context.contents = Rails.cache.fetch(key) do
|
13
|
-
CmAppLogger.log(label: 'CACHE_MISS', data: { cache_key: key })
|
14
|
-
resource.preferred_apple_app_site_association
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def cache_key
|
19
|
-
updated_at = tenant&.updated_at || store&.updated_at
|
20
|
-
"well_known:apple-app-site-association:#{resource.class.name}:#{resource.id}:#{updated_at}"
|
21
|
-
end
|
22
|
-
|
23
|
-
def resource
|
24
|
-
tenant || store
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module SpreeCmCommissioner
|
2
|
-
class AssetLinksFetcher < BaseInteractor
|
3
|
-
delegate :store, :tenant, :refreshed, to: :context
|
4
|
-
|
5
|
-
def call
|
6
|
-
key = cache_key
|
7
|
-
|
8
|
-
CmAppLogger.log(label: 'LOOKING_UP_CACHE', data: { cache_key: key })
|
9
|
-
|
10
|
-
Rails.cache.delete(key) if refreshed
|
11
|
-
|
12
|
-
context.contents = Rails.cache.fetch(key) do
|
13
|
-
CmAppLogger.log(label: 'CACHE_MISS', data: { cache_key: key })
|
14
|
-
resource.preferred_assetlinks
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def cache_key
|
19
|
-
updated_at = tenant&.updated_at || store&.updated_at
|
20
|
-
"well_known:assetlinks.json:#{resource.class.name}:#{resource.id}:#{updated_at}"
|
21
|
-
end
|
22
|
-
|
23
|
-
def resource
|
24
|
-
tenant || store
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
module SpreeCmCommissioner
|
2
|
-
class CrewInviteLinkHandler < BaseInteractor
|
3
|
-
delegate :params, to: :context
|
4
|
-
|
5
|
-
def call
|
6
|
-
validate_data
|
7
|
-
assign_role_to_user
|
8
|
-
create_user_event
|
9
|
-
end
|
10
|
-
|
11
|
-
private
|
12
|
-
|
13
|
-
def validate_data
|
14
|
-
if invite.nil?
|
15
|
-
context.fail!(message: I18n.t('invite.url_not_found'))
|
16
|
-
else
|
17
|
-
context.invite = invite
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def assign_role_to_user
|
22
|
-
return if user.operator?
|
23
|
-
|
24
|
-
role = Spree::Role.find_by(name: 'operator')
|
25
|
-
role_user = Spree::RoleUser.new(user_id: user.id, role_id: role.id)
|
26
|
-
role_user.save
|
27
|
-
end
|
28
|
-
|
29
|
-
def create_user_event
|
30
|
-
@user_event = SpreeCmCommissioner::UserEvent.new(
|
31
|
-
taxon_id: invite.taxon_id,
|
32
|
-
user_id: user.id
|
33
|
-
)
|
34
|
-
|
35
|
-
return if @user_event.save
|
36
|
-
|
37
|
-
context.fail!(message: I18n.t('invite.already_invited'))
|
38
|
-
end
|
39
|
-
|
40
|
-
def invite
|
41
|
-
@invite ||= SpreeCmCommissioner::Invite.find_by(token: params[:id])
|
42
|
-
end
|
43
|
-
|
44
|
-
def user
|
45
|
-
@user ||= Spree::User.find(params[:user_id])
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|