Wykres commitów

1236 Commity (cbdc63c6b2265ac4b18d347496b4df4a1de5b64a)

Autor SHA1 Wiadomość Data
LB Johnston 759c03abdf Fix collection field alignment in drop zone (multi-upload)
- Fixes #10280
2023-05-19 06:51:51 +01:00
Matt Westcott 14244d18d4 add mock for updateSettings when testing TableBlock 2023-05-15 15:33:17 +01:00
Sage Abdullah 68583c0ec2 Fix TableBlock resize target selector
Fixes #10427.

In d51ec00ce1, the target was changed from
'[data-field] > .handsontable' to '.handsontable', as the .handsontable
element is no longer a direct descendant of the [data-field] element.

However, this means that we're marking ALL elements with .handsontable
as resize targets, which is not ideal as pretty much all elements
generated by Handsontable have that class.

The original logic would presumably only select the outermost element
with the .handsontable class, which is equal to the element with the
foo-handsontable-container ID (we store this in the containerId
variable).

Frankly, removing this selector outright would also fix the issue. That
said, let's keep this selector in anyway, to match the logic in older
releases.
2023-05-15 14:08:25 +01:00
Sage Abdullah 14b4b19e40 Fix incorrect check of Handsontable size options
Regression in 933a730928 introduced in 4.2.

This causes the discrepancy seen between 4.1 vs 4.2 (and later). In 4.2,
this check was broken, which means the event handler never gets added.

The combination of the event handler and the incorrect selector (fixed
in the next commit) would resize all Handsontable elements, resulting in
the bug where the table cannot be interacted with.

The commit b9f8a6b6c0 fixed another cause
of the issue, which was calling `resizeWidth(getWidth())`. The
getWidth() function should only be used to set the Handsontable's
settings, while resizeWidth should be called with '100%' as done within
the event handler.

However, seeing that the event listener is not even attached in 4.2
onwards, dispatching the resize event might not be necessary and
Handsontable might already handle this correctly. That said, let's
avoid making other changes that could potentially cause issues.

With this commit, the bug should reappear in 4.2 and later releases,
making it consistent with 4.1. The bug will be fixed in the next commit.
2023-05-15 14:07:28 +01:00
Sage Abdullah 5d474b18a5 Dispatch resize event to resize Handsontable on initialisation 2023-04-20 14:39:15 +01:00
LB Johnston 0878d1677b Ensure datetimepicker widget overlay shows over modals
- Update to the exact same z-index as the modal
- Fixes #3604
2023-04-01 01:22:09 +01:00
Thibaud Colas f3dd9841bd Always display StreamField "Add" buttons 2023-03-30 01:18:26 +01:00
Thibaud Colas 14b38ff861 Always show StreamField and InlinePanel nesting guide lines 2023-03-30 01:18:23 +01:00
Thibaud Colas c83ba866b0 Always show StreamField and InlinePanel block actions 2023-03-30 01:18:20 +01:00
Babitha Kumari ba6d1fd9c7 Avoid showing scrollbars in the block picker unless necessary. Fix #10253 (#10268) 2023-03-28 17:21:52 +01:00
zerolab bb0b92c951 Fix TableBlock initialisation #10223
- move Handsontable render after load & resize width after load
- stops firing a resize event
- adjusts targets to account for the changed markup
- fixes #9107

# Conflicts:
#	CHANGELOG.txt
#	docs/releases/5.0.md
2023-03-21 07:08:08 +10:00
Sage Abdullah 5cf6abd072 Prevent checkbox and radio button from shrinking 2023-03-20 09:53:25 +00:00
Sage Abdullah 9462b20d5d Prevent select inputs from overflowing the parent container 2023-03-20 09:53:21 +00:00
Deepam Priyadarshi 5d948212ed Fixing duplicate addition of StreamField blocks with the new block picker. Fix #10057 (#10149)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2023-03-10 09:56:44 +00:00
Sam 7600327485
Fix dialog component's message to have rounded corners at the top side
Fixes #10177
2023-03-07 18:56:34 +00:00
4the4ryushin 7fccf79871
Prevent account name from overflowing the sidebar 2023-02-02 11:17:29 +00:00
Sage Abdullah d4b69cbfc1 Fix header search when q URL param is not present 2023-01-19 22:07:50 +00:00
Thibaud Colas 0fc8df059a Fix positioning of StreamField and rich text "add" toggle buttons 2023-01-19 16:57:24 +00:00
Thibaud Colas 8b231d19c6 Replace StreamField block picker with new ComboBox 2023-01-19 16:57:24 +00:00
Thibaud Colas a176616cda Use new ComboBox component in rich text 2023-01-19 16:57:24 +00:00
Thibaud Colas 3a7e489cdf Add new ComboBox React component based on downshift 2023-01-19 16:57:24 +00:00
Albina a3f10acae1
Userbar & accessibility checker UI improvements (#9913)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2023-01-19 16:06:11 +00:00
Sage Abdullah 711d592052
Move `pages/workflow_history` templates to `shared` 2023-01-19 14:06:11 +00:00
Thibaud Colas e33cdbf8db
Set up CSS LTR-RTL direction variable and fix incorrect transforms (#9914). Fix #9800
- Fix Draftail block toolbar trigger overlay in RTL mode
- Fix switch component rendering in RTL mode
- Fix panel header positioning in RTL mode
- Remove unused 404 styles
- Fix comments positioning in RTL mode
- Fix sidebar sub-menus transition direction
- Fix form side panels in RTL mode
- Fix minimap positioning in RTL mode
- Fix Draftail tooltips positioning in RTL mode
- Fix page explorer transition direction in RTL mode
- Set up CSS LTR-RTL direction variable
2023-01-19 12:06:43 +00:00
Thibaud Colas 1b7f92351f Improve page editor side panel closing animation 2023-01-19 11:19:25 +00:00
Albina 55d04366f7
Axe accessibility checker integration with floating dialog component (#9899)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2023-01-18 15:59:44 +00:00
Matt Westcott 4468b55d2d Enforce max_num on MultipleChooserPanel
Enable / disable the open-modal button on reaching the limit, as we do for InlinePanel's standard add button; and when handling the response from the modal, stop adding new items when max_num is reached
2023-01-18 14:31:08 +00:00
Matt Westcott 2574204b27 Make title into a label rather than a link when in multiple choice mode 2023-01-18 14:31:08 +00:00
Matt Westcott 32f8c78b58 Enable / disable submit button once a selection is made 2023-01-18 14:31:08 +00:00
Matt Westcott f4125d04e0 Import ChooserFactory classes in telepath endpoint files, rather than relying on them existing in the global scope 2023-01-18 14:31:08 +00:00
Matt Westcott 89179da1fd Eliminate jquery from MultipleChooserPanel 2023-01-18 14:31:08 +00:00
Matt Westcott af168d62f8 Implement multiple chooser UI on page chooser modal 2023-01-18 14:31:08 +00:00
Matt Westcott 78b88a605a Populate MultipleChooserPanel from modal results 2023-01-18 14:31:08 +00:00
Matt Westcott 67ff655111 Add mechanism for retrieving an existing widget instance from ChooserFactory 2023-01-18 14:31:08 +00:00
Matt Westcott d534567f81 Add checkboxes for selecting multiple items 2023-01-18 14:31:08 +00:00
Matt Westcott e94e268ecb Recognise 'multiple' option in ChooserModal as a URL parameter to pass to the modal view
the modal view doesn't do anything with it yet
2023-01-18 14:31:08 +00:00
Matt Westcott c66b793957 Add JS initialiser / open-modal behaviour for MultipleChooserPanel 2023-01-18 14:31:08 +00:00
Matt Westcott d56c25704b Add openModal method to ChooserFactory 2023-01-18 14:31:08 +00:00
Matt Westcott d70bf142f3 Pass modalUrl in opts dict as standard, and use it in preference to the data-chooser-url attribute on the HTML element
We keep data-chooser-url in the HTML output, and use it as a fallback in the JS - for backwards compatibility with existing BaseChooser subclasses that don't pass an options dict (such as AdminTaskChooser, which overrides render_js_init)
2023-01-18 14:31:08 +00:00
Matt Westcott 8fe23a4f61 Standardise on camel case for opts dictionary keys
At this point we've been turning the 'opts' dict from a private API specific to PageChooser, that more or less transparently passes options on to the modal as URL query parameters, into a convention shared across all chooser widgets where the question of "will this option become a URL parameter" is an internal implementation detail. Since this is notionally a bundle of JS variables rather than a bundle of URL params, we should take this opportunity to consistently adopt camel case, before this pattern becomes widespread in third-party code and ends up as a mishmash of camel-case and snake-case.
2023-01-18 14:31:08 +00:00
Matt Westcott 3dc3d37bbf Move FooChooserFactory definitions into the widget JS endpoints rather than the telepath ones
This makes it cleaner for FooChooser and FooChooserFactory to share definitions (e.g. modal handler classes)
2023-01-18 14:31:08 +00:00
Matt Westcott ed8d999887 Use the base ChooserFactory class for PageChooserFactory 2023-01-18 14:31:08 +00:00
Matt Westcott 536d1096c2 Change PageChooser widget constructor to accept `parent_id` as part of the opts dict
The old signature is still accepted for backwards compatibility.

This then matches the signature of the other chooser widget JS classes, allowing PageChooserFactory to extend the generic ChooserFactory.
2023-01-18 14:31:08 +00:00
Matt Westcott dcba3a9194 Consistently pass an opts dict to the constructors of Chooser and ChooserFactory 2023-01-18 14:31:07 +00:00
Matt Westcott f238d659ee Move PageChooserFactory to its own JS endpoint
This will allow us to refactor it, including adding class-level references to window.PageChooser and window.PageChooserModal as necessary, without dealing with the possibility of telepath/widgets.js being imported before the includes that define those.
2023-01-18 14:31:07 +00:00
Matt Westcott 7a1ae9f16b Eliminate jQuery from PageChooserFactory.render
This matches the implementation in components/ChooserWidget. This change breaks the tests that pass a jQuery collection object rather than a DOM element, but that was never valid in the first place as per https://docs.wagtail.org/en/stable/reference/streamfield/widget_api.html - fix the tests accordingly.
2023-01-18 14:31:07 +00:00
Matt Westcott 947a7883f9 Add a higher-level API for chooser modals
Previously, anything invoking the chooser modal needed to make its own call to ModalWorkflow, which meant it needed to import the corresponding 'onloadHandlers' dict, know the appropriate chosen response identifier to listen to, and know how to modify the chooser URL to pass parameters (if applicable). This would mean a lot of duplicated logic if there were multiple places where the modal is invoked.

Here we introduce a ChooserModal base class which encapsulates those details - a caller just needs to instantiate it with the base URL, and call `open` on it to open the modal (passing an options dict and a response callback).
2023-01-18 14:31:07 +00:00
Lovelyfin00 b929694203 Migrate lock/unlock actions to w-action controller
- Revise 'redirect' from a string to a 'continue' boolean that defaults to false
- Use 'continue=true' for cases where we do not want to create a next param on submit that takes the user back to the current page
- Fixes #9815
2023-01-18 19:00:47 +10:00
Lovelyfin00 9e9a84c953 Pull out loadiconSprite function from inline script
- wrote test for initIconSpirite
- changed from xmlhttprequest to fetch
- prepared a domReady util
- Fixes #9811
2023-01-18 08:04:55 +10:00
Thibaud Colas 34f6bab633
Rich text toolbar refinements from usability testing. Fix #9281 (#9905) 2023-01-17 17:21:45 +00:00