Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate concerns in PaginatedList to simplify state management. #14371

Merged
merged 5 commits into from Jan 17, 2023

Conversation

linuspahl
Copy link
Contributor

@linuspahl linuspahl commented Jan 5, 2023

Description

Motivation and Context

With this PR we are simplifying the state management in the PaginatedList component. The component can maintain the state for the active page and page size in two different ways:

  1. It can have its own react state
  2. Or It can use the URL query params to maintain the state

Before this PR the component contained all necessary logic for both use cases. Even when the state was based on the URL query params it still maintained its own state. This resulted in a comparable complex state management.

The PaginatedList component now contains the stateless ListBase component which receives the active page and page size.
In case 1 we render a wrapper component which maintains a state for the active page and page size and passes it to the ListBase component.
In case 2 we render a wrapper component which extracts the page and page size from the URL and passes it to the ListBase component

With this approach the change in #14141 is no longer necessary.

One thought I had while working on the state management, in case 1 we currently often maintain two states, one outside of the PaginatedList and one which is part of the component. In my opinion we can remove the internal PaginatedList state to simplify the sate management even more.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

/nocl

@linuspahl linuspahl requested a review from zeeklop January 6, 2023 09:41
@linuspahl linuspahl marked this pull request as ready for review January 6, 2023 09:41
@linuspahl linuspahl requested a review from a team January 16, 2023 12:26
Copy link
Contributor

@zeeklop zeeklop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as expected. Tested locally and is looking good.

While testing the pagination, I found that the list of streams doesn't update when the sorting direction changes on one of the columns

@linuspahl
Copy link
Contributor Author

@zeeklop Thanks for having the look! The streams sorting issue has been fixed with #14447.

@linuspahl linuspahl merged commit 4466ad2 into master Jan 17, 2023
@linuspahl linuspahl deleted the refactoring/paginated-list branch January 17, 2023 15:33
dennisoelkers added a commit that referenced this pull request Jan 24, 2023
commit eec7668
Author: Dennis Oelkers <dennis@graylog.com>
Date:   Mon Jan 23 13:33:07 2023 +0100

    Simplifying view loading by decoupling view creation from loading. (#14368)

    * Fixing up type.

    * Getting rid of `withLocation` in `NewSearchPage`.

    * Getting rid of `withLocation` in `ShowViewPage`.

    * Getting rid of `withParams` in `ShowViewPage`.

    * Getting rid of `withlocation` in `NewDashboardPage`.

    * Getting rid of `withLocation`/`withParams` in `StreamSearchPage`.

    * Improving typing.

    * Improving type.

    * Improving typing for `History` module.

    * Removing unneeded action call.

    * Decoupling new search/dashboard creation from loading.

    * Loading view explicitly, separating hook processing.

    * Loading existing views without view loader.

    * Delegate loading/processing view to `SearchPage`.

    * Simplifying hooks a bit by using async/await.

    * Cleaning up `ViewLoader`.

    * Adjusting/restructuring test.

    * Fixing up defaults while loading view.

    * Waiting for current query to be loaded completely.

    * Qualifying import.

    * Triggering new state earlier.

    * Adding license headers.

    * Using type-import only.

    * Introducing `useSearchURLQueryParams` hook.

    * Reverting now unneeded change.

    * Adjusting test.

    * Passing `isNew` flag through when loading view.

    * Fixing up linter hint.

    * Removing `connect` usage.

    * Waiting for view to have loaded.

    * Adjusting test.

    * Mocking check for view being loaded in tests.

    * Waiting until view is completely loaded.

    * Adjusting tests.

    * Removing unused import.

commit d4b9c53
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Jan 23 08:09:21 2023 +0100

    Bump promise-polyfill from 8.2.3 to 8.3.0 in /graylog2-web-interface (#14483)

    Bumps [promise-polyfill](https://github.com/taylorhakes/promise-polyfill) from 8.2.3 to 8.3.0.
    - [Release notes](https://github.com/taylorhakes/promise-polyfill/releases)
    - [Changelog](https://github.com/taylorhakes/promise-polyfill/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/taylorhakes/promise-polyfill/commits)

    ---
    updated-dependencies:
    - dependency-name: promise-polyfill
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit e833b36
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Jan 23 08:09:07 2023 +0100

    Bump @tanstack/react-query (#14482)

    Bumps [@tanstack/react-query](https://github.com/tanstack/query) from 4.22.0 to 4.22.4.
    - [Release notes](https://github.com/tanstack/query/releases)
    - [Commits](TanStack/query@v4.22.0...v4.22.4)

    ---
    updated-dependencies:
    - dependency-name: "@tanstack/react-query"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit d2a7007
Author: Othello Maurer <othello@graylog.com>
Date:   Fri Jan 20 09:45:36 2023 +0100

    Remove GC warnings (#14298)

    * Remove GC warnings

    * Add changelog

    * Add upgrade notes

commit bb01bf2
Author: Patrick Mann <patrickmann@users.noreply.github.com>
Date:   Fri Jan 20 09:27:30 2023 +0100

    Add reply-to to email notification config (#14337)

    * add reply-to to email notification config

    * update cl

    * update content pack entity

    * add reply to field to email notification

    * add reply-to to Notification details

    * refactor EmailNotificationSummary to function

    * fix linter

    * Update graylog2-web-interface/src/components/event-notifications/event-notification-types/EmailNotificationForm.jsx

    Co-authored-by: Othello Maurer <othello@graylog.com>

    * Update graylog2-web-interface/src/components/event-notifications/event-notification-types/EmailNotificationForm.jsx

    Co-authored-by: Othello Maurer <othello@graylog.com>

    * review feedback

    Co-authored-by: Ousmane Samba <ousmane@graylog.com>
    Co-authored-by: Othello Maurer <othello@graylog.com>

commit 9f8b6c2
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Jan 20 09:01:59 2023 +0100

    Bump plotly.js and @types/plotly.js in /graylog2-web-interface (#14475)

    Bumps [plotly.js](https://github.com/plotly/plotly.js) and [@types/plotly.js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/plotly.js). These dependencies needed to be updated together.

    Updates `plotly.js` from 2.17.1 to 2.18.0
    - [Release notes](https://github.com/plotly/plotly.js/releases)
    - [Changelog](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md)
    - [Commits](plotly/plotly.js@v2.17.1...v2.18.0)

    Updates `@types/plotly.js` from 2.12.12 to 2.12.13
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/plotly.js)

    ---
    updated-dependencies:
    - dependency-name: plotly.js
      dependency-type: direct:production
      update-type: version-update:semver-minor
    - dependency-name: "@types/plotly.js"
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit e0a5c35
Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Date:   Thu Jan 19 15:25:32 2023 +0100

    Updating yarn lockfile (#14472)

    Co-authored-by: Gary Bot <garybot2@graylog.com>

commit 0536010
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Jan 19 12:08:07 2023 +0100

    Bump core-js from 3.27.1 to 3.27.2 in /graylog2-web-interface (#14470)

    Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.27.1 to 3.27.2.
    - [Release notes](https://github.com/zloirock/core-js/releases)
    - [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/zloirock/core-js/commits/v3.27.2/packages/core-js)

    ---
    updated-dependencies:
    - dependency-name: core-js
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 4032e3d
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Jan 19 08:06:11 2023 +0100

    Bump @types/react in /graylog2-web-interface/packages/graylog-web-plugin (#14468)

    Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.0.26 to 18.0.27.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

    ---
    updated-dependencies:
    - dependency-name: "@types/react"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit e3fb095
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Jan 19 08:05:52 2023 +0100

    Bump @types/plotly.js from 2.12.11 to 2.12.12 in /graylog2-web-interface (#14469)

    Bumps [@types/plotly.js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/plotly.js) from 2.12.11 to 2.12.12.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/plotly.js)

    ---
    updated-dependencies:
    - dependency-name: "@types/plotly.js"
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit cbb6d8f
Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Date:   Wed Jan 18 15:05:34 2023 +0100

    Updating yarn lockfile (#14465)

    Co-authored-by: Gary Bot <garybot2@graylog.com>

commit 44a1b11
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Jan 18 09:40:35 2023 +0100

    Bump @typescript-eslint/eslint-plugin (#14455)

    Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.48.1 to 5.48.2.
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.48.2/packages/eslint-plugin)

    ---
    updated-dependencies:
    - dependency-name: "@typescript-eslint/eslint-plugin"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit a3aad3a
Author: Jan Heise <jan.heise@graylog.com>
Date:   Wed Jan 18 09:02:00 2023 +0100

    Backend to support the Dynamic Startup Page (#13985)

    * initial commit, recent activity is dummy

    * recent activity for views

    * removed unused imports

    * fixed tests

    * added pagination

    * fixed possible 500 and added enum

    * fix for entities that are not in the catalog

    * added search filter facade
    renamed content-pack package in enterprise to be consistent to the name in server

    * added todos, fixed test

    * addded audit event

    * addded audit event

    * recent activities for reports

    * added user name that is responsible for the activity

    * fixed creation of elements in ViewService

    * renamed Pinned Items to Favorite Item

    * added unpinning

    * more renaming

    * added grantee, refactored catalog

    * added license

    * event restructuring

    * event restructuring

    * larger default

    * minor cosmetic changes

    * minor cosmetic changes

    * minor cosmetic changes

    * added license

    * fixed event listener

    * refactored recentActivities

    * refactored recentActivities

    * refactored recentActivities

    * refactorings for event creation

    * refactorings for event creation

    * refactorings for event creation

    * refactorings for event creation

    * fixed test

    * removed unnecessary imports

    * removed unnecessary code

    * added maximum constant

    * added capped collection

    * removed unused code

    * repackaging

    * repackaging

    * improved cache

    * added timestamp

    * added missing license

    * added size because it's needed

    * fixed yarn.lock

    * minor improvements for testing and a bugfix calculating the total for recent activities

    * added type to item

    * switch to record, add type info

    * renamed Object

    * renamed favorites

    * renamed last opened

    * fixed imports

    * fixed collection name

    * add properties that can be ignored/transient only for MongoDB

    * renamed annotation

    * added license

    * refactoring queries

    * refactoring queries

    * added resource

    * fixed resource

    * get view including favorite flag

    * using jackson to deconstruct json

    * added missing objectmapper to tests

    * fixing tests, adding correct ObjectMapper

    * fixing tests, adding correct ObjectMapper

    * fixed id

    * fixed test

    * fix for "_id", small refactorings

    * smaller refactorings

    * added license

    * fixed test data

    * small refactoring to avoid duplicate code

    * Test capped collection in MongoDB

    * Test with query for grantees

    * add IT test for favorites

    * add IT test for startPage

    * add IT test for startPage

    * removed id

    * added jsons specifically for startpage tests

    * fixing test error that occurs with multiple tests

    * fixed merge conflicts

    * small refactorings in tests

    * fixed conflicts/missing stuff from merge

    * fixed test

    Co-authored-by: Dennis Oelkers <dennis@graylog.com>

commit 4aeab19
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Jan 18 08:31:17 2023 +0100

    Bump @testing-library/dom (#14454)

    Bumps [@testing-library/dom](https://github.com/testing-library/dom-testing-library) from 8.19.1 to 8.20.0.
    - [Release notes](https://github.com/testing-library/dom-testing-library/releases)
    - [Changelog](https://github.com/testing-library/dom-testing-library/blob/main/CHANGELOG.md)
    - [Commits](testing-library/dom-testing-library@v8.19.1...v8.20.0)

    ---
    updated-dependencies:
    - dependency-name: "@testing-library/dom"
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit cceba66
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Jan 18 08:31:03 2023 +0100

    Bump @typescript-eslint/parser (#14453)

    Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.48.1 to 5.48.2.
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.48.2/packages/parser)

    ---
    updated-dependencies:
    - dependency-name: "@typescript-eslint/parser"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 2e0c4f6
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Jan 18 08:30:48 2023 +0100

    Bump eslint-plugin-react (#14452)

    Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.32.0 to 7.32.1.
    - [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
    - [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
    - [Commits](jsx-eslint/eslint-plugin-react@v7.32.0...v7.32.1)

    ---
    updated-dependencies:
    - dependency-name: eslint-plugin-react
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 8b94a10
Author: Dan Torrey <dan@graylog.com>
Date:   Tue Jan 17 14:09:15 2023 -0600

    Reduce logging and add metric for stream warning (#14409)

    * Calm logging and add metric for "cannot remove default" stream

    * Fix Prometheus metric name

    * Migrate to counter

    Rate information is more expensive and is not necessary.

    * Comment adjustment

    * Add changelog, fix test

    * Add changelog

    * Adjust wording

    * Properly quote warning message in changelog

    Co-authored-by: Bernd Ahlers <bernd@users.noreply.github.com>

    Co-authored-by: Bernd Ahlers <bernd@users.noreply.github.com>

commit 4466ad2
Author: Linus Pahl <linus@graylog.com>
Date:   Tue Jan 17 16:33:19 2023 +0100

    Separate concerns in `PaginatedList` to simplify state management. (#14371)

    * Separate concerns in `PaginatedList` to simplify state management.

    * Removing comment

    * Fixing linter hint

    * Fixing problem which occured when resetting active page outside of paginated list.

    * Adding test
dennisoelkers added a commit that referenced this pull request Feb 15, 2023
* Turning exclude from query handler into thunk.

* Ignore complete result path.

* Recreating search upon structural change in view.

* Recreating search when needed, waiting for query to be added.

* Extracting view-related selectors to separate module.

* Migrating action for copying widget to dashboard.

* Migrating action for moving widget to dashboard page.

* Adjusting tests.

* Cleaning up test, improve typing.

* Moving search execution selectors to separate module.

* Extracting search metadata selectors to separate module.

* Adding license headers.

* Replacing action with dispatch.

* Cleaning up `Search` component.

* Rewiring search execution for global override on  dashboard.

* Removing usages of `ViewStore`.

* Removing unused class.

* Adjusting and improving `syncWithQueryParameters`.~

* Fixing up `OnSaveNewDashboard`.

* Adjusting view saving/tests.

* Fixing up type.

* Getting rid of `withLocation` in `NewSearchPage`.

* Getting rid of `withLocation` in `ShowViewPage`.

* Getting rid of `withParams` in `ShowViewPage`.

* Getting rid of `withlocation` in `NewDashboardPage`.

* Getting rid of `withLocation`/`withParams` in `StreamSearchPage`.

* Improving typing.

* Improving type.

* Improving typing for `History` module.

* Removing unneeded action call.

* Decoupling new search/dashboard creation from loading.

* Loading view explicitly, separating hook processing.

* Loading existing views without view loader.

* Delegate loading/processing view to `SearchPage`.

* Simplifying hooks a bit by using async/await.

* Cleaning up `ViewLoader`.

* Adjusting/restructuring test.

* Fixing up defaults while loading view.

* Waiting for current query to be loaded completely.

* Qualifying import.

* Triggering new state earlier.

* Adding license headers.

* Using type-import only.

* Introducing `useSearchURLQueryParams` hook.

* Reverting now unneeded change.

* Adjusting test.

* Passing `isNew` flag through when loading view.

* Fixing up linter hint.

* Removing `connect` usage.

* Waiting for view to have loaded.

* Adjusting test.

* Adjusting widget creation placeholders.

* Adding license headers.

* Making functional creators being dispatched as thunks.

* Fixing up imports.

* Replaced usages of stores/actions.

* Making `useParameters` use root state.

* Handling widget config updates with dispatch.

* Using actions in widget query controls.

* Migrating field charts using dispatched actions.

* Using dispatched actions in on zoom handler.

* Handle reordering/renaming query tabs through dispatched actions.

* Replacing actions.

* Reimplementing changing title of tab.

* Reimplementing widget renaming.

* Turning field/value actions into thunks.

* Getting rid of `HighlightingRulesStore`.

* Streamlining `updateQuery`, adjusting tests.

* Dispatching widget removal.

* Dispatching widget updates.

* Using dispatched actions in `DataTable`.

* Replacing `ChartColorRulesStore`.

* Gradually adjusting test.

* Fixing up type.

* Getting rid of `withLocation` in `NewSearchPage`.

* Getting rid of `withLocation` in `ShowViewPage`.

* Getting rid of `withParams` in `ShowViewPage`.

* Getting rid of `withlocation` in `NewDashboardPage`.

* Getting rid of `withLocation`/`withParams` in `StreamSearchPage`.

* Improving typing.

* Improving type.

* Improving typing for `History` module.

* Removing unneeded action call.

* Decoupling new search/dashboard creation from loading.

* Loading view explicitly, separating hook processing.

* Loading existing views without view loader.

* Delegate loading/processing view to `SearchPage`.

* Simplifying hooks a bit by using async/await.

* Cleaning up `ViewLoader`.

* Adjusting/restructuring test.

* Fixing up defaults while loading view.

* Waiting for current query to be loaded completely.

* Qualifying import.

* Triggering new state earlier.

* Adding license headers.

* Using type-import only.

* Introducing `useSearchURLQueryParams` hook.

* Reverting now unneeded change.

* Adjusting test.

* Passing `isNew` flag through when loading view.

* Fixing up linter hint.

* Removing `connect` usage.

* Waiting for view to have loaded.

* Adjusting test.

* Mocking check for view being loaded in tests.

* Extending typings, fixing widget editing.

* Fixing up loading of aggregation functions.

* Fixing up import.

* Adding search id selector.

* Fixing up test, fixing smaller issues.

* Adjusting test.

* Wrapping SUT with store.

* Fixing up assertion.

* Simplifying test.

* Wrapping SUT with store.

* Fixing up test for `XYPlot`.

* Wrapping SUT with store.

* Wrapping `DataTable` in test with store.

* Wrapping `EditWidgetFrame` in test with store.

* Wrapping `TimerangeInfo` with store in tests.

* Adding license headers.

* Fixing up test.

* Wrapping `MessageList` with store in tests.

* Adjusting tests for `WidgetQueryControls`.

* Mocking `useAppDispatch` for `PlotLegend`.

* Adjusting test for widget aggregations.

* Wrapping `AreaVisualization` with store for tests.

* Less mocks => better.

* Wrapping `NumberVisualization` with store in tests.

* Wrapping `PieVisualization` with store in tests.

* Adjusting test for `AdaptableQueryTabsConfiguration`.

* Mocking `useAppDispatch` for `ActionMenuItem`.

* Adjusting tests for `WidgetFocusProvider`.

* Fixing up `ExportModal` + test.

* Rework `ViewHook`s to return a modified view, adjust tests.

* Extracting search fetching.

* Making use of `fetchSearch`.

* Adding action to duplicate query.

* Fixing up tests for `DashboardActionsMenu`.

* Improving `QueryTitle` test.

* Also logging error to console once.

* Cleaning up action a bit.

* Wrap `SearchActionsMenu` with store in tests.

* Mocking `dispatch` in tests for `AddWidgetButton`.

* Fixing up test for `AddToAllTablesActionHandler`.

* Fixing up test for `AggregateActionHandler`.

* Fixing up test for `ChartActionHandler`.

* Fixing up test for `RemoveFromAllTablesActionHandler`.

* Improving tests for pluggable widget query controls.

* Reverting cleanup, needs to be more tolerant.

* Do not update state if not mounted anymore.

* Adjusting tests for `WidgetActionsMenu`.

* Updating test for `Widget`.

* Wrap `DashboardSearchBar` with store in tests.

* Wrap `DashboardSearchBar` with store in tests for pluggable controls.

* Removing `TitlesStore`.

* Removing `GlobalOverrideStore`.

* Cleaning up test.

* Moving out type from `WidgetStore`.

* Cleaning up test.

* Turning widget extra actions into dispatchable actions.

* Cleaning up test.

* Removing `WidgetStore`.

* Cleaning up tests.

* Removing `CurrentViewStateStore`.

* Cleaning up tests.

* Removing `QueriesStore`.

* Removing `ViewStatesStore`.

* Cleaning up test.

* Extracting `useWidgetActions`, mock in tests.

* Fixing up usage of type.

* Removing `SearchLoadingStateStore`.

* Cleaning up test.

* Fixing up test description.

* Passing in `dispatch` to `ViewHook`s.

* Deleting `QueriesActions`.

* Adding action to bind parameter values.

* Passing in `SearchExecutionState` to `ViewHook`s, removing `dispatch`.

* Provide hook for parameters as map.

* Allow providing execution state to `SearchPage`.

* Cleaning up integration test.

* Adding hook to get parameters as `Map`.

* Adding action for removal of parameter.

* Passing in `dispatch` for pluggable search/dashboard bar form validations.

* Making pluggable widget types more lenient.

* Passing context to pluggable validation handlers.

* Handle updating parameters.

* Passing in current view to completers.

* Extracting method for parsing search, replacing store usage with it.

* Removing `SearchMetadataStore`.

* Squashed commit of the following:

commit eec7668
Author: Dennis Oelkers <dennis@graylog.com>
Date:   Mon Jan 23 13:33:07 2023 +0100

    Simplifying view loading by decoupling view creation from loading. (#14368)

    * Fixing up type.

    * Getting rid of `withLocation` in `NewSearchPage`.

    * Getting rid of `withLocation` in `ShowViewPage`.

    * Getting rid of `withParams` in `ShowViewPage`.

    * Getting rid of `withlocation` in `NewDashboardPage`.

    * Getting rid of `withLocation`/`withParams` in `StreamSearchPage`.

    * Improving typing.

    * Improving type.

    * Improving typing for `History` module.

    * Removing unneeded action call.

    * Decoupling new search/dashboard creation from loading.

    * Loading view explicitly, separating hook processing.

    * Loading existing views without view loader.

    * Delegate loading/processing view to `SearchPage`.

    * Simplifying hooks a bit by using async/await.

    * Cleaning up `ViewLoader`.

    * Adjusting/restructuring test.

    * Fixing up defaults while loading view.

    * Waiting for current query to be loaded completely.

    * Qualifying import.

    * Triggering new state earlier.

    * Adding license headers.

    * Using type-import only.

    * Introducing `useSearchURLQueryParams` hook.

    * Reverting now unneeded change.

    * Adjusting test.

    * Passing `isNew` flag through when loading view.

    * Fixing up linter hint.

    * Removing `connect` usage.

    * Waiting for view to have loaded.

    * Adjusting test.

    * Mocking check for view being loaded in tests.

    * Waiting until view is completely loaded.

    * Adjusting tests.

    * Removing unused import.

commit d4b9c53
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Jan 23 08:09:21 2023 +0100

    Bump promise-polyfill from 8.2.3 to 8.3.0 in /graylog2-web-interface (#14483)

    Bumps [promise-polyfill](https://github.com/taylorhakes/promise-polyfill) from 8.2.3 to 8.3.0.
    - [Release notes](https://github.com/taylorhakes/promise-polyfill/releases)
    - [Changelog](https://github.com/taylorhakes/promise-polyfill/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/taylorhakes/promise-polyfill/commits)

    ---
    updated-dependencies:
    - dependency-name: promise-polyfill
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit e833b36
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Jan 23 08:09:07 2023 +0100

    Bump @tanstack/react-query (#14482)

    Bumps [@tanstack/react-query](https://github.com/tanstack/query) from 4.22.0 to 4.22.4.
    - [Release notes](https://github.com/tanstack/query/releases)
    - [Commits](TanStack/query@v4.22.0...v4.22.4)

    ---
    updated-dependencies:
    - dependency-name: "@tanstack/react-query"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit d2a7007
Author: Othello Maurer <othello@graylog.com>
Date:   Fri Jan 20 09:45:36 2023 +0100

    Remove GC warnings (#14298)

    * Remove GC warnings

    * Add changelog

    * Add upgrade notes

commit bb01bf2
Author: Patrick Mann <patrickmann@users.noreply.github.com>
Date:   Fri Jan 20 09:27:30 2023 +0100

    Add reply-to to email notification config (#14337)

    * add reply-to to email notification config

    * update cl

    * update content pack entity

    * add reply to field to email notification

    * add reply-to to Notification details

    * refactor EmailNotificationSummary to function

    * fix linter

    * Update graylog2-web-interface/src/components/event-notifications/event-notification-types/EmailNotificationForm.jsx

    Co-authored-by: Othello Maurer <othello@graylog.com>

    * Update graylog2-web-interface/src/components/event-notifications/event-notification-types/EmailNotificationForm.jsx

    Co-authored-by: Othello Maurer <othello@graylog.com>

    * review feedback

    Co-authored-by: Ousmane Samba <ousmane@graylog.com>
    Co-authored-by: Othello Maurer <othello@graylog.com>

commit 9f8b6c2
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Jan 20 09:01:59 2023 +0100

    Bump plotly.js and @types/plotly.js in /graylog2-web-interface (#14475)

    Bumps [plotly.js](https://github.com/plotly/plotly.js) and [@types/plotly.js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/plotly.js). These dependencies needed to be updated together.

    Updates `plotly.js` from 2.17.1 to 2.18.0
    - [Release notes](https://github.com/plotly/plotly.js/releases)
    - [Changelog](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md)
    - [Commits](plotly/plotly.js@v2.17.1...v2.18.0)

    Updates `@types/plotly.js` from 2.12.12 to 2.12.13
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/plotly.js)

    ---
    updated-dependencies:
    - dependency-name: plotly.js
      dependency-type: direct:production
      update-type: version-update:semver-minor
    - dependency-name: "@types/plotly.js"
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit e0a5c35
Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Date:   Thu Jan 19 15:25:32 2023 +0100

    Updating yarn lockfile (#14472)

    Co-authored-by: Gary Bot <garybot2@graylog.com>

commit 0536010
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Jan 19 12:08:07 2023 +0100

    Bump core-js from 3.27.1 to 3.27.2 in /graylog2-web-interface (#14470)

    Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.27.1 to 3.27.2.
    - [Release notes](https://github.com/zloirock/core-js/releases)
    - [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/zloirock/core-js/commits/v3.27.2/packages/core-js)

    ---
    updated-dependencies:
    - dependency-name: core-js
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 4032e3d
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Jan 19 08:06:11 2023 +0100

    Bump @types/react in /graylog2-web-interface/packages/graylog-web-plugin (#14468)

    Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.0.26 to 18.0.27.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

    ---
    updated-dependencies:
    - dependency-name: "@types/react"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit e3fb095
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Jan 19 08:05:52 2023 +0100

    Bump @types/plotly.js from 2.12.11 to 2.12.12 in /graylog2-web-interface (#14469)

    Bumps [@types/plotly.js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/plotly.js) from 2.12.11 to 2.12.12.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/plotly.js)

    ---
    updated-dependencies:
    - dependency-name: "@types/plotly.js"
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit cbb6d8f
Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Date:   Wed Jan 18 15:05:34 2023 +0100

    Updating yarn lockfile (#14465)

    Co-authored-by: Gary Bot <garybot2@graylog.com>

commit 44a1b11
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Jan 18 09:40:35 2023 +0100

    Bump @typescript-eslint/eslint-plugin (#14455)

    Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.48.1 to 5.48.2.
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.48.2/packages/eslint-plugin)

    ---
    updated-dependencies:
    - dependency-name: "@typescript-eslint/eslint-plugin"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit a3aad3a
Author: Jan Heise <jan.heise@graylog.com>
Date:   Wed Jan 18 09:02:00 2023 +0100

    Backend to support the Dynamic Startup Page (#13985)

    * initial commit, recent activity is dummy

    * recent activity for views

    * removed unused imports

    * fixed tests

    * added pagination

    * fixed possible 500 and added enum

    * fix for entities that are not in the catalog

    * added search filter facade
    renamed content-pack package in enterprise to be consistent to the name in server

    * added todos, fixed test

    * addded audit event

    * addded audit event

    * recent activities for reports

    * added user name that is responsible for the activity

    * fixed creation of elements in ViewService

    * renamed Pinned Items to Favorite Item

    * added unpinning

    * more renaming

    * added grantee, refactored catalog

    * added license

    * event restructuring

    * event restructuring

    * larger default

    * minor cosmetic changes

    * minor cosmetic changes

    * minor cosmetic changes

    * added license

    * fixed event listener

    * refactored recentActivities

    * refactored recentActivities

    * refactored recentActivities

    * refactorings for event creation

    * refactorings for event creation

    * refactorings for event creation

    * refactorings for event creation

    * fixed test

    * removed unnecessary imports

    * removed unnecessary code

    * added maximum constant

    * added capped collection

    * removed unused code

    * repackaging

    * repackaging

    * improved cache

    * added timestamp

    * added missing license

    * added size because it's needed

    * fixed yarn.lock

    * minor improvements for testing and a bugfix calculating the total for recent activities

    * added type to item

    * switch to record, add type info

    * renamed Object

    * renamed favorites

    * renamed last opened

    * fixed imports

    * fixed collection name

    * add properties that can be ignored/transient only for MongoDB

    * renamed annotation

    * added license

    * refactoring queries

    * refactoring queries

    * added resource

    * fixed resource

    * get view including favorite flag

    * using jackson to deconstruct json

    * added missing objectmapper to tests

    * fixing tests, adding correct ObjectMapper

    * fixing tests, adding correct ObjectMapper

    * fixed id

    * fixed test

    * fix for "_id", small refactorings

    * smaller refactorings

    * added license

    * fixed test data

    * small refactoring to avoid duplicate code

    * Test capped collection in MongoDB

    * Test with query for grantees

    * add IT test for favorites

    * add IT test for startPage

    * add IT test for startPage

    * removed id

    * added jsons specifically for startpage tests

    * fixing test error that occurs with multiple tests

    * fixed merge conflicts

    * small refactorings in tests

    * fixed conflicts/missing stuff from merge

    * fixed test

    Co-authored-by: Dennis Oelkers <dennis@graylog.com>

commit 4aeab19
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Jan 18 08:31:17 2023 +0100

    Bump @testing-library/dom (#14454)

    Bumps [@testing-library/dom](https://github.com/testing-library/dom-testing-library) from 8.19.1 to 8.20.0.
    - [Release notes](https://github.com/testing-library/dom-testing-library/releases)
    - [Changelog](https://github.com/testing-library/dom-testing-library/blob/main/CHANGELOG.md)
    - [Commits](testing-library/dom-testing-library@v8.19.1...v8.20.0)

    ---
    updated-dependencies:
    - dependency-name: "@testing-library/dom"
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit cceba66
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Jan 18 08:31:03 2023 +0100

    Bump @typescript-eslint/parser (#14453)

    Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.48.1 to 5.48.2.
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.48.2/packages/parser)

    ---
    updated-dependencies:
    - dependency-name: "@typescript-eslint/parser"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 2e0c4f6
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Jan 18 08:30:48 2023 +0100

    Bump eslint-plugin-react (#14452)

    Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.32.0 to 7.32.1.
    - [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
    - [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
    - [Commits](jsx-eslint/eslint-plugin-react@v7.32.0...v7.32.1)

    ---
    updated-dependencies:
    - dependency-name: eslint-plugin-react
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 8b94a10
Author: Dan Torrey <dan@graylog.com>
Date:   Tue Jan 17 14:09:15 2023 -0600

    Reduce logging and add metric for stream warning (#14409)

    * Calm logging and add metric for "cannot remove default" stream

    * Fix Prometheus metric name

    * Migrate to counter

    Rate information is more expensive and is not necessary.

    * Comment adjustment

    * Add changelog, fix test

    * Add changelog

    * Adjust wording

    * Properly quote warning message in changelog

    Co-authored-by: Bernd Ahlers <bernd@users.noreply.github.com>

    Co-authored-by: Bernd Ahlers <bernd@users.noreply.github.com>

commit 4466ad2
Author: Linus Pahl <linus@graylog.com>
Date:   Tue Jan 17 16:33:19 2023 +0100

    Separate concerns in `PaginatedList` to simplify state management. (#14371)

    * Separate concerns in `PaginatedList` to simplify state management.

    * Removing comment

    * Fixing linter hint

    * Fixing problem which occured when resetting active page outside of paginated list.

    * Adding test

* Fixing up args in test.

* Adjusting tests.

* Aligning validation with other search bar forms.

* Adding some types.

* Reusing selector.

* Allow passing in execution state.

* Better error logging when processing view hooks.

* Removing `SearchExecutionStateStore`.

* Adding license header.

* Adding hook to execute function on search execution.

* Making use of `useOnSearchExecution` hook.

* Also execute upon initial search execution.

* Removing unneeded usages of `SearchActions` in tests.

* Moving `SearchExecutionResult` type out of `SearchStore`.

* Removing `SearchStore`.

* Removing `ViewStore`.

* Making sure components of big display mode are rendered within context.

* Reimplementing auto-refresh, fixing up tests.

* Addressing linter hints.

* Turning `OnZoom` into thunk.

* Making less use of store in visualizations.

* Fixing up updating favorite state for views.

* Disabling immutable/serializability checks for redux.

* Pick first query if supplied page does not exist.

* Making sure there is a query for the view in test.

* Making sure there is a query for the view in `Search` test.

* Making sure that view has propery search query in test.

* Always adding new widget with position.

* Do not recreate store when active query changes.

* Revert "Always adding new widget with position."

This reverts commit bc9e19a.

* Recalculate widget positions when adding widget.

* Simplifying creating widget with pre-defined position.

* Wrapping `ShowMessagePage` with pseudo-store for now.

* Removing unused import.

* Merge in existing parameters when declaring new one(s).

* Addressing PR feedback.

* Add widgets + positions atomically.

* Making sure that search is recreated when parameters are updated.

* Adjusting test for `ShowMessagePage`.

* Reexecuting search when widget filter is updated.

* Removing test case that has become unneeded.

* Removing unused import.

* Fixing up import.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants