Skip to content

[7.x] [Workplace Search] Wire up write view for Blocked windows (#114696)#114743

Merged
kibanamachine merged 1 commit intoelastic:7.xfrom
kibanamachine:backport/7.x/pr-114696
Oct 13, 2021
Merged

[7.x] [Workplace Search] Wire up write view for Blocked windows (#114696)#114743
kibanamachine merged 1 commit intoelastic:7.xfrom
kibanamachine:backport/7.x/pr-114696

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backports the following commits to 7.x:

…4696)

* Fix unsaved changes prompt showing up between tabs

We already added a reducer for this but forgot to implement this. Because we have shared state between the tabs, we need to overrule the unsaved changes prompt when simply navigating between tabs.

* Fix some timezone issues

After wiring up the backend and converting to UTC, some changes to mocks and time formats had to be made.

* Refactor to remove blockedWindows reducer

This commit refactors to make use of the already-in-state schedule object. Previously, while wiring up the static views, I used a blockedWindows array directly on the state tree. This simplifies things so that equality checks can be done with one object.

* Wire up ability to remove blocked window

* Fix key and remove fallback

It was hard to test removing an item from an array that doesn’t exist so I changed the code to expect the array to be present (! operator), since the other path is not possible.

Also updated the server value from deletion to delete to match the API

* Wire up blocked windows form to change values and update state

* Pass formatted blocked_windows to server

(test was covered in previous commit)

* Update link text, hrefs, and replace temp copy

One of the links was removed intentionally

* Fix typo

* Fix edge case where unsaved changes shown when removing last item

The API omits the key when there are no items so we need to have the item removed as well in the UI state. Otherwise, removing the last item will cause the UI to say there are unsaved changes when there are not.

I tried setting  it as:

schedule.blockedWindows = undefined

but the selector did not see those as equal but deleting the key does.

* More typo fixes

Syncronization -> Synchronization (+h)

* Fix link address

* Refactor for simplicity

Was unable to figure out the TypeScript  but did some more digging
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Oct 13, 2021
@kibanamachine kibanamachine enabled auto-merge (squash) October 13, 2021 01:35
@kibanamachine
Copy link
Copy Markdown
Contributor Author

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 1.4MB 1.4MB +834.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @scottybollinger

@kibanamachine kibanamachine merged commit faab520 into elastic:7.x Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants