Anna Koskinen [Thu, 19 Dec 2019 08:56:05 +0000 (10:56 +0200)]
Close window on ESC, when maximized button is clicked (#11840) (#11848)
* Close window on ESC, when maximized button is clicked (#11840)
Fixes #11838
Changes:
1. Close a window when maximized button is focused and ESC is pressed
2. Add additional check for a close button to react to the ESC key press
3. Rename a private method `onCloseClick` to `closeWindow` to allow code re-use
Anna Koskinen [Fri, 22 Nov 2019 08:47:12 +0000 (10:47 +0200)]
Don't attempt to send expand/collapse events for disabled TreeGrid. (#11823) (#11828)
The attempt gets blocked later down the line in any case and never
reaches the server, but sending it messes up TreeGrid's internal state.
It gets stuck waiting for the resolution of the blocked call that can
then only be resolved by server-side sending its own expand/collapse
request programmatically. Until that happens no further expand/collapse
attempts will get sent to server even after the TreeGrid has been
enabled again.
Tree is also affected as it is built upon TreeGrid.
Anna Koskinen [Tue, 19 Nov 2019 13:20:21 +0000 (15:20 +0200)]
Fix for TwinColSelect not correctly retaining visible selection (#11799) (#11816)
There is a bug in TwinColSelect loging, it retains selection by indexes not by values after being sorted when new item has been added. This is a fixed by changing updateListBox method to retain the selection as it is being called after selection is being done.
Anna Koskinen [Thu, 14 Nov 2019 09:20:42 +0000 (11:20 +0200)]
Reduce excess positioning calls for ComboBox popup. (#11808) (#11809)
- If an open popup is reset to its default position on every update from
the server before getting adjusted again to the actual expected
position, on heavier applications some of those intermediate positions
might get rendered. If the ComboBox is positioned at the right edge and
the popup contents are longer than the input field (i.e. popup should
open to the left, not right) this might cause flickering.
- Setting the default position is only actually needed when the popup is
opened in order to give it a baseline, otherwise it's better to simply
adjust the position if needed.
Anna Koskinen [Tue, 12 Nov 2019 12:53:46 +0000 (14:53 +0200)]
Use APPLICATION_SCOPE for the session lock (#11792) (#11803)
The Vaadin session itself is also stored in APPLICATION_SCOPE. The default
scope is PORTLET_SCOPE, so lock would otherwise not be in sync with
the session.
To be able to do this, relevant methods in VaadinService are made protected so
that VaadinPortletService can override them.
Anna Koskinen [Wed, 6 Nov 2019 14:12:28 +0000 (16:12 +0200)]
Fixing issue with Push stopping working in some circumstances (#11791) (#11795)
* Fixing issue with Push stopping working in some circumstances
If new request is attempted when resynchronization is ongoing, the Push will stop working. This patch fixes the issue by aborting handleJson if resynch is already ongoing.
Anna Koskinen [Wed, 6 Nov 2019 08:28:47 +0000 (10:28 +0200)]
Check actual Grid selection instead of relying on allSelected flag. (#11787) (#11790)
The checkbox for selecting all rows only selects all the rows that have
not been filtered out. Changing the filtering does not change the
selection or the checkbox state so assuming that all rows are selected
simply because the checkbox has been checked cannot work.
Anna Koskinen [Thu, 31 Oct 2019 12:36:56 +0000 (14:36 +0200)]
Switch from an assert to logging and return in Grid.onBrowserEvent (#11778) (#11782)
- If the Grid has frozen columns zooming can cause the regular column
cells to be ever so slightly out of sync with their corresponding rows.
This difference is not noticeable to naked eye but is big enough that
it's possible to hover over the row instead of the cell, which causes an
assertion error and a big ugly error popup. Switching to logging retains
the information delivered by the assertion error for developer purposes
but makes the end user experience smoother.
- Can be tested manually with GridColumnFrozenColumn test UI.
Anna Koskinen [Thu, 31 Oct 2019 12:22:44 +0000 (14:22 +0200)]
Added 1px tolerance to ScrollbarBundle's internal sanity check. (#11777) (#11781)
* Added 1px tolerance to ScrollbarBundle's internal sanity check.
Requiring exact match can cause this check to fail when the browser is
zoomed since rounding is involved. This can in turn block some features
like opening of Grid Editor from working until some more scrolling
happens and the minute inconsistency is fixed.
Can be tested manually using GridEditorUI, depending on the environment
different amounts of zooming may be required for the problem to
manifest.
Anna Koskinen [Mon, 28 Oct 2019 17:46:32 +0000 (19:46 +0200)]
Improvements to ScrollDestination sanity checks (#11772) (#11776)
- The new top row logical index should always be within the logical
range and high enough up to avoid leaving a gap if possible.
- Added regression testing for using the different scroll destination
types for scrolling to the top and to the bottom by index.
Anna Koskinen [Thu, 24 Oct 2019 12:31:04 +0000 (15:31 +0300)]
Make cancellation of uploads work regardless of Push configuration (#11743) (#11760)
- Checking the push configuration outside of session lock threw
an AssertionError, so the push configuration is not checked anymore.
- The original problem with cancelling Upload was due to a subtle
ordering issue that depended on the Push configuration.
In the case of PushMode.AUTOMATIC, a new StreamVariable was
added by the `Upload` component _before_ the `FileUploadHandler`
got a chance to remove the old `StreamVariable`. As a result, the
`FileUploadHandler` actually removed the fresh `StreamVariable`,
breaking future uploads.
Anna Koskinen [Thu, 24 Oct 2019 10:54:13 +0000 (13:54 +0300)]
Upload should preserve MIMEType after first selection (#11745) (#11759)
* Upload should preserve MIMEType after first selection
Fix #11698
* Remove unused imports
* Add sleep time in testing purposes
* Getting a new instance of an input, after file is downloaded
Exclude IE from tests. Throws https://stackoverflow.com/questions/23883071/unhandled-alert-exception-modal-dialog-present-selenium , but checked manually and it works
Anna Koskinen [Thu, 5 Sep 2019 13:57:25 +0000 (16:57 +0300)]
Fix scrollTo for destination START and END and add regression testing. (#11711)
- Initial implementation erroneously assumed that
ScrollDestination.START would only be used for scrolling up and
ScrollDestination.END for scrolling down. That's obviously not what they
are for, otherwise everyone would be using ScrollDestination.ANY.
- Moved actual scrolling to within the helper method that originally
only calculated the new scroll position. Parent method became too long
otherwise.
Anna Koskinen [Thu, 29 Aug 2019 13:06:25 +0000 (16:06 +0300)]
Updated row and spacer handling for Escalator (#11438)
Updated row and spacer handling for Escalator.
Main changes:
- Spacers are only maintained and checked for rows that have DOM
representation, and not at all if there is no details generator. This
gives notable performance improvements to some particularly large Grids
- Escalator no longer tries to trim away any rows that don't fit within
the viewport just because a details row gets opened in Grid. This leads
to some increase in simultaneous DOM elements, but simplifies the logic
considerably. For example opening or closing details rows doesn't
require checking the overall content validity beyond the details row
itself anymore, but some repositioning at most. There are also no longer
any orphaned spacers without corresponding DOM rows.
- Spacers are better integrated into the overall position calculations.
- Some public methods that are no longer used by Escalator or have
changed functionality or order of operations. Any extending classes that
tap into row, spacer, or scroll position handling are likely to need
reworking after this update.
- Auto-detecting row height is delayed until Escalator is both attached
and displayed.
Anna Koskinen [Tue, 16 Jul 2019 12:21:23 +0000 (15:21 +0300)]
Improvements to detail row index handling. (#11345)
- Escalator should notify when an existing details row is moved to a new
index.
- Grid and DetailsManagerConnector should update their internal indexing
when details manager index changes in Escalator.
Anna Koskinen [Fri, 12 Jul 2019 06:05:20 +0000 (09:05 +0300)]
Ensure the selection has been changed before updating . (#11658)
- Initial fix attempt interfered with selection events, added regression
testing for those and found a better way to ensure shift selection works
on IE11 also with Windows 7.
Tatu Lund [Tue, 25 Jun 2019 12:03:09 +0000 (15:03 +0300)]
Fixing upload handler error handling (#11630)
* Fixing upload handler error handling
For some reason stream variable cleanup did not use UI.getCurrent(), despite current UI was set earlier in handleRequest, what I see specifically for this purpose. So I chanted this. This will address also issue #7289
Furthermore there was TODO in handle request about error handling. I interpreted this to refer to possible corner case, that UI is not found via session. In this case it is more appropriate throw UploadException and abort, than lat NPE happen.
Zhe Sun [Wed, 12 Jun 2019 09:36:55 +0000 (12:36 +0300)]
Update Chrome version in Test (#11613)
1) recalculate the offset, as ChromeDriver starts to follow the standard;
2) update screenshots;
3) correct the `click()` call with using coordinates, related to 1)
4) `sendkey()` with using key.modifier adjustment
5) add sleep
6) workaround for mastery failures
Old patch https://github.com/vaadin/framework/issues/11416 calls navigateTo allways when Navigator is present, which is wrong, since it is needed only when navigation state has truly changed.
Martin Vysny [Thu, 16 May 2019 06:27:33 +0000 (08:27 +0200)]
Grid editor: TAB now skips non-editable columns (#11573)
* Grid editor: TAB now skips non-editable columns
Pressing TAB would shift the focus to non-editable cells when the Grid was in edit mode.
This patch makes DefaultEditorEventHandler to skip such columns.
edler-san [Thu, 2 May 2019 11:26:14 +0000 (13:26 +0200)]
Changed the handleSessionExpired logic to return a 404 instead of a 410 and added the no-cache parameter to the reply. (#11556)
* Changed the handleSessionExpired logic to return a 404 instead of a 410. Also added the no-cache parameter to the reply.
See https://github.com/vaadin/framework/issues/4417 for discussion.
Sun Zhe [Mon, 29 Apr 2019 08:27:35 +0000 (11:27 +0300)]
Replace the screenshot usage in framework test (#11547)
- Replace the GridDisabledTest screenshot usage
- Replace the screenshot tests in BasicCrudGridEditorRowTest
- Replace the screenshot tests in ComboboxVaadinIcons
- Replace the screenshot tests in ValoThemeUITest::accordions
- Added screenshotcomparetolerance to some screenshot test to make tests stable
Sun Zhe [Wed, 24 Apr 2019 10:28:01 +0000 (13:28 +0300)]
Reset Combobox internal state (#11412)
issue in #11343 and #11385 is not reproducible on top this patch
Three different bugs are involved in this fix:
we bring the old fix(#11094) back and fixed the other related issues:
1) allow adding the same new item after dataProvider got reset, This is cause by the client side parameter `LastNewItemString`, it saves the value added before resetting.
2) clear the pending newItem eagerly, so that the same value will not be added again.