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

Rewrite bookmark #2410

Merged
merged 8 commits into from
Nov 13, 2024
Merged

Rewrite bookmark #2410

merged 8 commits into from
Nov 13, 2024

Conversation

odinr
Copy link
Collaborator

@odinr odinr commented Aug 27, 2024

Why

closes:

Check off the following:

  • Confirm that I checked changes to branch which I am merging into.

    • I have validated included files
    • My code does not generate new linting warnings
    • My PR is not a duplicate, check existing pr`s
  • Confirm that the I have completed the self-review checklist.

  • Confirm that my changes meet our code of conduct.

Copy link

changeset-bot bot commented Aug 27, 2024

🦋 Changeset detected

Latest commit: 793cc9e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@equinor/fusion-framework-cookbook-app-react-bookmark Minor
@equinor/fusion-framework-react-app Minor
@equinor/fusion-framework-cli Minor
@equinor/fusion-framework-react-module-bookmark Minor
@equinor/fusion-framework-react-components-bookmark Major
@equinor/fusion-framework-module-services Major
@equinor/fusion-framework-module-bookmark Major
@equinor/fusion-framework-legacy-interopt Major
@equinor/fusion-framework-cookbook-app-react-context-custom-error Patch
@equinor/fusion-framework-cookbook-app-react-context Patch
@equinor/fusion-framework-cookbook-app-react-feature-flag Patch
poc-portal Patch
@equinor/fusion-framework-react-components-people-provider Patch
@equinor/fusion-framework Patch
@equinor/fusion-framework-app Patch
@equinor/fusion-framework-react Patch
@equinor/fusion-framework-react-widget Patch
@equinor/fusion-framework-widget Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added 🐞 bug Something isn't working 👨🏻‍🍳 cookbooks 👾 React 💾 CLI fusion framework CLI 📚 documentation Improvements or additions to documentation 🚀 feature New feature or request 🚧 chore maintaines work, (update deps, workflos ...) 🧬 Modules labels Aug 27, 2024
@odinr odinr force-pushed the feat/rewrite-bookmark-module branch 3 times, most recently from 4dc375b to 85c2478 Compare August 27, 2024 11:46
@github-actions github-actions bot removed the 🐞 bug Something isn't working label Aug 27, 2024
@odinr odinr force-pushed the feat/rewrite-bookmark-module branch 7 times, most recently from e22e306 to 0e2b639 Compare August 27, 2024 12:30
@odinr odinr self-assigned this Aug 27, 2024
@odinr odinr requested a review from Noggling August 27, 2024 13:13
@odinr odinr marked this pull request as ready for review August 27, 2024 13:14
@odinr odinr requested a review from a team as a code owner August 27, 2024 13:14
Copy link
Contributor

github-actions bot commented Aug 27, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 0.39% 1746 / 445453
🔵 Statements 0.39% 1746 / 445453
🔵 Functions 22.96% 203 / 884
🔵 Branches 37.1% 384 / 1035
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
cookbooks/app-react-bookmark/src/App.tsx 0% 0% 0% 0% 1-78
cookbooks/app-react-bookmark/src/config.ts 0% 0% 0% 0% 1-13
packages/cli/src/bin/dev-portal/BookMarkSideSheet.tsx 0% 0% 0% 0% 1-40
packages/cli/src/bin/dev-portal/Header.tsx 0% 0% 0% 0% 1-97
packages/cli/src/bin/dev-portal/config.ts 0% 0% 0% 0% 1-82
packages/modules/bookmark/src/BookmarkClient.interface.ts 100% 100% 100% 100%
packages/modules/bookmark/src/BookmarkClient.ts 0% 0% 0% 0% 1-225
packages/modules/bookmark/src/BookmarkConfigurator.ts 0% 0% 0% 0% 1-374
packages/modules/bookmark/src/BookmarkProvider.actions.ts 0% 0% 0% 0% 1-129
packages/modules/bookmark/src/BookmarkProvider.error.ts 0% 100% 100% 0% 5-20
packages/modules/bookmark/src/BookmarkProvider.events.ts 100% 100% 100% 100%
packages/modules/bookmark/src/BookmarkProvider.flows.ts 0% 0% 0% 0% 1-426
packages/modules/bookmark/src/BookmarkProvider.reducer.ts 0% 0% 0% 0% 1-141
packages/modules/bookmark/src/BookmarkProvider.selectors.ts 0% 100% 100% 0% 5-55
packages/modules/bookmark/src/BookmarkProvider.store.ts 0% 0% 0% 0% 1-52
packages/modules/bookmark/src/BookmarkProvider.ts 0% 0% 0% 0% 1-1307
packages/modules/bookmark/src/bookmark-config.schema.ts 0% 0% 0% 0% 1-41
packages/modules/bookmark/src/bookmark-module.ts 0% 0% 0% 0% 1-70
packages/modules/bookmark/src/bookmark.schemas.ts 0% 0% 0% 0% 1-50
packages/modules/bookmark/src/enable-bookmark.ts 0% 0% 0% 0% 1-25
packages/modules/bookmark/src/index.ts 0% 0% 0% 0% 1-26
packages/modules/bookmark/src/types.ts 100% 100% 100% 100%
packages/modules/services/src/provider.ts 0% 0% 0% 0% 1-114
packages/modules/services/src/types.ts 100% 100% 100% 100%
packages/modules/services/src/utils.ts 0% 0% 0% 0% 1-51
packages/modules/services/src/bookmarks/api-version.ts 0% 0% 0% 0% 1-4
packages/modules/services/src/bookmarks/client.ts 0% 0% 0% 0% 1-312
packages/modules/services/src/bookmarks/index.ts 0% 0% 0% 0% 1
packages/modules/services/src/bookmarks/schemas.ts 0% 0% 0% 0% 1-81
packages/modules/services/src/bookmarks/selectors.ts 0% 0% 0% 0% 1-49
packages/modules/services/src/bookmarks/types.ts 0% 0% 0% 0% 1
packages/modules/services/src/bookmarks/endpoints/bookmark-apply.get.ts 0% 0% 0% 0% 1-106
packages/modules/services/src/bookmarks/endpoints/bookmark.delete.ts 0% 0% 0% 0% 1-105
packages/modules/services/src/bookmarks/endpoints/bookmark.get.ts 0% 0% 0% 0% 1-110
packages/modules/services/src/bookmarks/endpoints/bookmark.patch.ts 0% 0% 0% 0% 1-127
packages/modules/services/src/bookmarks/endpoints/bookmark.post.ts 0% 0% 0% 0% 1-116
packages/modules/services/src/bookmarks/endpoints/user-bookmark-favourite.delete.ts 0% 0% 0% 0% 1-105
packages/modules/services/src/bookmarks/endpoints/user-bookmark-favourite.head.ts 0% 0% 0% 0% 1-106
packages/modules/services/src/bookmarks/endpoints/user-bookmark-favourite.post.ts 0% 0% 0% 0% 1-106
packages/modules/services/src/bookmarks/endpoints/user-bookmarks.get.ts 0% 0% 0% 0% 1-134
packages/react/app/src/bookmark/index.ts 0% 0% 0% 0% 1
packages/react/app/src/bookmark/useBookmark.ts 0% 0% 0% 0% 1-23
packages/react/app/src/bookmark/useCurrentBookmark.ts 0% 0% 0% 0% 1-39
packages/react/components/bookmark/src/components/Bookmark.tsx 0% 0% 0% 0% 1-106
packages/react/components/bookmark/src/components/BookmarkProvider.tsx 0% 0% 0% 0% 1-117
packages/react/components/bookmark/src/components/create-bookmark/CreateBookmark.tsx 0% 0% 0% 0% 1-110
packages/react/components/bookmark/src/components/create-bookmark/index.ts 0% 0% 0% 0% 1
packages/react/components/bookmark/src/components/edit-bookmark/EditBookmark.tsx 0% 0% 0% 0% 1-174
packages/react/components/bookmark/src/components/import-bookmark/ImportBookmark.tsx 0% 0% 0% 0% 1-77
packages/react/components/bookmark/src/components/row/Row.tsx 0% 0% 0% 0% 1-92
packages/react/components/bookmark/src/components/sectionList/SectionList.tsx 0% 0% 0% 0% 1-141
packages/react/components/bookmark/src/hooks/useBookmarkGrouping.ts 0% 0% 0% 0% 1-54
packages/react/components/bookmark/src/utils/utils.ts 0% 100% 100% 0% 3-13
packages/react/modules/bookmark/src/index.ts 0% 0% 0% 0% 1
packages/react/modules/bookmark/src/useBookmark.ts 0% 0% 0% 0% 1-184
packages/react/modules/bookmark/src/useBookmarkProvider.ts 0% 0% 0% 0% 1-9
packages/react/modules/bookmark/src/useCurrentBookmark.ts 0% 0% 0% 0% 1-60
packages/react/modules/bookmark/src/portal/useHasBookmark.ts 0% 0% 0% 0% 1-20
Generated in workflow #8004 for commit 793cc9e by the Vitest Coverage Report Action

@Noggling
Copy link
Collaborator

For min del så ser ting greit ut for utenom de tingen vi snakket om ;)

@github-actions github-actions bot added the 🐞 bug Something isn't working label Sep 2, 2024
@odinr odinr force-pushed the feat/rewrite-bookmark-module branch from 260c2f4 to af13757 Compare September 4, 2024 10:28
@github-actions github-actions bot removed the 🐞 bug Something isn't working label Sep 4, 2024
@odinr odinr force-pushed the feat/rewrite-bookmark-module branch 3 times, most recently from 1cd4423 to 9a151a8 Compare September 4, 2024 13:46
@odinr odinr force-pushed the feat/rewrite-bookmark-module branch from 9a151a8 to 7f76d80 Compare November 12, 2024 13:57
@github-actions github-actions bot removed the 🚧 chore maintaines work, (update deps, workflos ...) label Nov 12, 2024
* Empty-Commit

* refactor: Total rework of api interface for bookmarks.

The current version misrepresents the api, and does not provide a good interface for working with bookmarks. So was decided to rework the api interface to better represent the api, and provide a more robust interface for working with bookmarks. Instead of fixing the current implementation, it was decided to rework the entire module to save time and confusion in the future.

squash

squash
* feat(module-bookmark): rework bookmark module

Needed rewrite of the bookmark module to better represent the api, and provide a more robust interface for working with bookmarks. Instead of fixing the current implementation, it was decided to rework the entire module to save time and confusion in the future.

BREAKING CHANGES:
- new configurator
- new provider interface
This commit adds the `useBookmarkProvider` hook to the bookmark module. This hook allows users to retrieve the bookmark provider instance from the current modules. It enhances the bookmark management capabilities and improves the usability of the module.

feat: Add enableBookmark and additional types to bookmark module

This commit adds the `enableBookmark` function to the bookmark module, allowing users to enable bookmark functionality. It also includes additional types such as `Bookmark`, `Bookmarks`, `BookmarkData`, `BookmarkNew`, `BookmarkPayloadGenerator`, and `BookmarkProvider` to enhance the bookmark management capabilities and improve the usability of the module.

feat: Update useCurrentBookmark options

This commit modifies the `useCurrentBookmarkOptions` type in the `useCurrentBookmark.ts` file. The `payloadGenerator` property is now optional, allowing users to provide a payload generator function if needed. This change enhances the flexibility and usability of the `useCurrentBookmark` functionality.
This commit updates the exports in the bookmark module to use the wildcard import syntax. Instead of individually exporting specific functions and types, the module now exports everything from the '@equinor/fusion-framework-react-module-bookmark' module. This change improves the usability and flexibility of the bookmark module.
…rk provider

- BookmarkProvider should have provider as a parameter
- BookmarkProvider should share context of provided provider to child components
- Remove deprecated hook
- Update component to align with changes in modules

BREAKING CHANGES: BookmarkProvider now requires provider as parameter
This commit updates the bookmark module to use the provided bookmark provider. The `BookmarkProvider` component now requires the provider as a parameter and shares the context of the provided provider to its child components. The deprecated hook has been removed, and the component has been updated to align with the changes in the modules.

BREAKING CHANGES: The `BookmarkProvider` now requires the provider as a parameter.
@odinr odinr force-pushed the feat/rewrite-bookmark-module branch from 7f76d80 to 793cc9e Compare November 13, 2024 11:00
@odinr odinr merged commit 9d1cb90 into main Nov 13, 2024
6 checks passed
@odinr odinr deleted the feat/rewrite-bookmark-module branch November 13, 2024 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💾 CLI fusion framework CLI 👨🏻‍🍳 cookbooks 📚 documentation Improvements or additions to documentation 🚀 feature New feature or request 🧬 Modules 👾 React
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants