Commit Graph

16218 Commits

Author SHA1 Message Date
cyrillefr
38dbe6ebc5 Increasing the placeholder size 2024-06-17 14:56:23 +02:00
cyrillefr
4082511ed7 Add Time in flatpickr control 2024-06-17 14:56:23 +02:00
cyrillefr
40128d7311 Force start date before end date with range mode flatpickr
- modify view to get a flatpickr component in range mode
  - modify spec to take into account range mode
2024-06-17 14:56:23 +02:00
Abdul Aziz Ali
ca516f7cef Define tax_on_fees i8n key #11680 2024-06-17 14:56:23 +02:00
Abdul Aziz Ali
5fb1c0798d Display additional tax total in order #11680
Add new text key admin.order.edit.additional_tax_included_in_price
Add spec file for additional tax display. Add new trait for enterprise fee and calculator factory
2024-06-17 14:56:23 +02:00
David Cook
0796a83f1e Update comment
[skip ci]
2024-06-17 14:56:23 +02:00
David Cook
2a4d0db0de Remove unused method 2024-06-17 14:56:23 +02:00
David Cook
f97241dce3 Detect changes in price
Price is actually an association with lots of custom methods to make it look like a field, and so changes were ignored.
Now this issue is fixed, perhaps it should be moved to a concern..

Note, there are other delegated fields: product name and description may be assigned from the variant. But there's no hooks to save the prroduct, so I didn't include it when checking for changes.
2024-06-17 14:56:23 +02:00
David Cook
18ed034e31 Remove duplicate assign 2024-06-17 14:56:23 +02:00
isidzukuri
ba1133ad44 Do not commit to db unchanged products is bulk save 2024-06-17 14:56:23 +02:00
David Cook
0b3246b01c Add comment 2024-06-17 14:56:23 +02:00
Ana Nunes da Silva
442fe8c956 Add div to sanitizer supported tags 2024-06-17 14:56:23 +02:00
Ana Nunes da Silva
cbee263222 Add safe trix tags to html sanitizer;
Use custom html sanitizer in product description.
2024-06-17 14:56:23 +02:00
Ana Nunes da Silva
4dfddd4801 Sanitize product description using rails default sanitizer 2024-06-17 14:56:23 +02:00
Ahmed Ejaz
d08039e498 12398: add lazylookup for translations 2024-06-17 14:56:22 +02:00
Ahmed Ejaz
d30951b64d 12398: fix lint issues 2024-06-17 14:56:22 +02:00
Ahmed Ejaz
e11a3ac53e 12398: fix failing specs 2024-06-17 14:56:22 +02:00
Ahmed Ejaz
e8ff8e4e70 12398: append flash in the flashes container 2024-06-17 14:56:22 +02:00
Ahmed Ejaz
e8141bbb74 12398: add flash.now 2024-06-17 14:56:22 +02:00
Ahmed Ejaz
52a5b5fb2b 12398: add slide-out animation 2024-06-17 14:56:22 +02:00
Ahmed Ejaz
897596de5f remove delete methods from products reflex 2024-06-17 14:56:22 +02:00
Ahmed Ejaz
aa040737dd 12398: add turbo stream to delete variants 2024-06-17 14:56:22 +02:00
Ahmed Ejaz
bb2e7af190 rename destroy.turbo_stream to make it more generic 2024-06-17 14:56:22 +02:00
Ahmed Ejaz
f2bca2260c 12398: implement the destroy action for products 2024-06-17 14:56:22 +02:00
Ahmed Ejaz
4d81f11c39 12398: update modal-link-controller to dynamically set
form action as per the selected product to delete
2024-06-17 14:56:22 +02:00
Ahmed Ejaz
59435c1298 12398: add destroy action with turbo stream 2024-06-17 14:56:22 +02:00
Ahmed Ejaz
52b683743b 12398: update confirm_modal to use button_to form submission 2024-06-17 14:56:22 +02:00
David Cook
1ae1c95e15 When dropdown fields don't allow blank, but are blank, show as changed
They were already counted as changed by the javascript, but didn't have a 'changed' class to indicate it.
The reason they are 'changed', is because the dropdown has no blank option, and is forced to select the first item in the list.

This is purely to cover the case of invalid data, but should help a lot when debugging data issues. I don't think it's any less efficient, because the extra 'classList.toggle' calls don't do anything on unchanged fields.
2024-06-17 14:56:22 +02:00
Maikel Linke
c321104c21 Move Connected Apps form out of Enterprise form
Nested forms are not valid HTML and we were submitting the wrong
authenticity token to Rails when updating the enterprise.

I inverted the hierarchy of the form and the panels. The menu and
tab-panel structure now sits above and the enterprise edit form is
nested within.

The current structure is not ideal but it's only a transition phase. I'm
expecting the page to get re-designed at some point and re-writen
without AngularJS.
2024-06-17 14:56:22 +02:00
cyrillefr
0d8b5ea6f7 Fix RedundantPresenceValidationOnBelongs on some files (part VI)
- presence: true is redundant since Rails 5.0 BUT applies
   with new default config of
   belongs_to_required_by_default to true.
   Lots of files with belongs_to_required_by_default = false
   (backward compatibility).
   So: deleting this setting implies to adding optional: true
 - added 'NOT NULL' constraints so model constraints match
   with contraints on DB tables.
 - corresponding migration files to match AR Models &
   DB tables
 - rake tasks to check corrupt data (ie: NULL/nil in id fields)
   (previous commit)
 - updated the todo
2024-06-17 14:56:22 +02:00
Maikel Linke
44a296691a Clearer naming of helper method 2024-06-17 14:56:22 +02:00
Maikel Linke
4b4ae8c7ba Allow only enterprise managers to connect apps
Otherwise it doesn't work because non-managers, like super admins, are
not authorised to access enterprise data via the DFC API.
2024-06-17 14:56:22 +02:00
Cillian O'Ruanaidh
b428450cf8 Make sure OSM map is not enabled in test environment in case it abuses OSM tile servers 2024-06-17 14:56:22 +02:00
Cillian O'Ruanaidh
87fe5f413b Get registration location map working with OSM 2024-06-17 14:56:22 +02:00
Filipe
a01dcaadcf Merge pull request #12506 from anansilva/12448-sanitise-html-enterprise-group
Sanitise HTML in long description of enterprise group [read-only]
2024-05-30 14:07:20 +02:00
Gaetan Craig-Riou
0e9b753bbc Merge pull request #12514 from cyrillefr/RedundantPresenceValidationOnBelongs_part_V
Fix redundant presence validation on belongs part V
2024-05-29 09:57:22 +10:00
cyrillefr
5bc6d16f34 Fix redundant presence validation on belongs part V
- presence: true is redundant since Rails 5.0 BUT applies
   with new default config of
   belongs_to_required_by_default to true.
   Lots of files with belongs_to_required_by_default = false
   (backward compatibility).
   So: deleting this setting implies to adding optional: true
2024-05-24 08:22:20 +02:00
Filipe
88baf5e1de Merge pull request #12496 from isidzukuri/12355-remove-unused-discourse
[12355] Remove discourse
2024-05-23 19:28:02 +01:00
Filipe
5455e68620 Merge pull request #12504 from dacook/buu/edit-image-turbo-12399
[BUU] Remove StimulusReflex from Image Edit
2024-05-23 17:32:59 +01:00
David Cook
55ac816a87 Show success message
Phew, that was really easy.
And now the existing feature spec still Just Works.
2024-05-23 11:55:56 +10:00
David Cook
05f0b93548 Use requestSubmit to allow JS events
Yay, now it works. Not sure the best way to show loading yet.
- currently the Turbo loading indicator shows which is better than nothing (blue bar at top)
- ideally we could show a small spinner over the image thumbnail. need to write some stimulus to hook into turbo lifecycle I guess.
- or we could activate the frame-level loading overlay. refactor loading_controller a bit so that it's applied on the container, then hopefully  we can just call  change->loading#showLoading. the turbo_stream response could dectivate it.
2024-05-23 11:55:33 +10:00
David Cook
665273ce2f [wip] Attempt to update edited image in-place with Turbo Stream
but it doesn't quite work.

Maybe we can force it with JS (https://www.writesoftwarewell.com/process-turbo-stream-javascript/)
2024-05-23 11:55:29 +10:00
David Cook
0e03ff6925 Merge branch 'master' into RedundantPresenceValidationOnBelongs_part_IV 2024-05-23 09:22:36 +10:00
Maikel
74cfa42461 Merge pull request #12465 from MrBowmanXD/mirror
Allow return or line break in shipping / payment method description
2024-05-23 09:10:13 +10:00
Maikel
32eb9c5504 Merge pull request #12481 from mkllnk/connect-app-once
Avoid submitting duplicate Connected Apps
2024-05-23 08:50:34 +10:00
Manuel Gonçalves
2bc481d8f7 Merge branch 'master' into mirror 2024-05-22 23:35:45 +01:00
Ana Nunes da Silva
73218fab05 Sanitize read and write long description in enterprise group 2024-05-22 22:40:24 +01:00
Filipe
1130bf8cbe Merge pull request #12460 from mkllnk/enterprise-data-purge
Clean up unused enterprise fields
2024-05-22 21:29:54 +01:00
cyrillefr
46cd60aa3c Fix RedundantPresenceValidationOnBelongs on two files
- presence: true is redundant since Rails 5.0 BUT applies
       with new default config of
       belongs_to_required_by_default to true.
       Lots of files with belongs_to_required_by_default = false
       (backward compatibility).
       So: deleting this setting implies to adding optional: true
     - added 'NOT NULL' constraints so model constraints match
       with contraints on DB tables.
     - corresponding migration files to match AR Models &
       DB tables
     - rake tasks to check corrupt data (ie: NULL/nil in id fields)
     - updated the todo
2024-05-22 09:44:02 +02:00
David Cook
536b5608ab Show edit form for new images 2024-05-22 17:08:58 +10:00