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

Feat/module app/appsettings/getter #2577

Merged
merged 13 commits into from
Dec 3, 2024
Merged

Conversation

eikeland
Copy link
Contributor

@eikeland eikeland commented Nov 14, 2024

Changes:

  1. AppClient.ts

    • Added updateAppSettings method to set app settings by appKey.
    • Initialized #setSettings query in the constructor.
  2. AppModuleProvider.ts

    • Added updateAppSettings method to update app settings.
  3. App.ts

    • Added updateSettings and updateSettingsAsync methods to set app settings.
    • Added effects to monitor and dispatch events for settings updates.
  4. actions.ts

    • Added updateSettings async action for updating settings.
  5. create-reducer.ts

    • Added reducer case for updateSettings.success to update state settings.
  6. create-state.ts

    • Added handleUpdateSettings flow to handle updating settings.
  7. events.ts

    • Added new events: onAppSettingsUpdate, onAppSettingsUpdated, and onAppSettingsUpdateFailure.
  8. flows.ts

    • Added handleUpdateSettings flow to handle the set settings action.
  9. package.json

    • Added settings entry to exports and types.
  10. index.ts

    • Created new file to export useAppSettings.
  11. useAppSettings.ts

    • Created new hook for handling app settings.

Devops: AB#56190

Copy link

changeset-bot bot commented Nov 14, 2024

🦋 Changeset detected

Latest commit: d856c4f

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

This PR includes changesets to release 11 packages
Name Type
@equinor/fusion-framework-cookbook-app-react-settings Major
@equinor/fusion-framework-cli Minor
@equinor/fusion-framework-module-app Minor
@equinor/fusion-framework-react-app Minor
@equinor/fusion-framework-docs Minor
@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-app Patch
@equinor/fusion-framework-legacy-interopt Major

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 👾 React 🚀 feature New feature or request 🧬 Modules labels Nov 14, 2024
@eikeland eikeland force-pushed the feat/module-app/appsettings/getter branch from 0cfc99e to 25c7ee4 Compare November 14, 2024 14:32
@eikeland eikeland marked this pull request as ready for review November 14, 2024 14:33
@eikeland eikeland requested review from odinr and a team as code owners November 14, 2024 14:33
@eikeland eikeland self-assigned this Nov 14, 2024
Copy link
Contributor

github-actions bot commented Nov 14, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 0.37% 1746 / 467020
🔵 Statements 0.37% 1746 / 467020
🔵 Functions 22.9% 205 / 895
🔵 Branches 36.9% 386 / 1046
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
cookbooks/app-react-settings/src/App.tsx 0% 0% 0% 0% 1-90
cookbooks/app-react-settings/src/config.ts 0% 100% 100% 0% 3-5
cookbooks/app-react-settings/src/index.ts 0% 0% 0% 0% 1-30
cookbooks/app-react/src/App.tsx 0% 0% 0% 0% 1-30
packages/cli/src/bin/create-dev-serve.ts 0% 0% 0% 0% 1-170
packages/cli/src/lib/plugins/app-proxy/app-proxy-plugin.ts 0% 0% 0% 0% 1-192
packages/cli/src/lib/plugins/app-settings/index.ts 0% 0% 0% 0% 1-58
packages/cli/src/lib/utils/parse-json-request.ts 0% 0% 0% 0% 1-19
packages/modules/app/src/AppClient.ts 0% 0% 0% 0% 1-248
packages/modules/app/src/AppModuleProvider.ts 0% 0% 0% 0% 1-174
packages/modules/app/src/errors.ts 0% 100% 100% 0% 3-148
packages/modules/app/src/types.ts 100% 100% 100% 100%
packages/modules/app/src/app/App.ts 0% 0% 0% 0% 1-902
packages/modules/app/src/app/actions.ts 0% 0% 0% 0% 1-90
packages/modules/app/src/app/create-reducer.ts 0% 0% 0% 0% 1-52
packages/modules/app/src/app/create-state.ts 0% 0% 0% 0% 1-41
packages/modules/app/src/app/events.ts 100% 100% 100% 100%
packages/modules/app/src/app/flows.ts 0% 0% 0% 0% 1-187
packages/modules/app/src/app/types.ts 100% 100% 100% 100%
packages/react/app/src/settings/index.ts 0% 0% 0% 0% 1
packages/react/app/src/settings/useAppSetting.ts 0% 0% 0% 0% 1-112
packages/react/app/src/settings/useAppSettings.ts 0% 0% 0% 0% 1-99
packages/react/app/src/settings/useAppSettingsStatus.ts 0% 0% 0% 0% 1-48
Generated in workflow #8126 for commit 3fdaa1f by the Vitest Coverage Report Action

@eikeland eikeland marked this pull request as draft November 15, 2024 09:35
@github-actions github-actions bot added 💾 CLI fusion framework CLI 🚧 chore maintaines work, (update deps, workflos ...) labels Nov 15, 2024
@eikeland eikeland force-pushed the feat/module-app/appsettings/getter branch 2 times, most recently from ce2694c to 436ce93 Compare November 15, 2024 11:59
@eikeland eikeland marked this pull request as ready for review November 15, 2024 12:01
Copy link
Collaborator

@odinr odinr left a comment

Choose a reason for hiding this comment

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

We should have a quick squad code review on this feature, setting up a meeting

packages/modules/app/src/app/actions.ts Outdated Show resolved Hide resolved
packages/modules/app/src/app/actions.ts Outdated Show resolved Hide resolved
packages/modules/app/src/app/actions.ts Outdated Show resolved Hide resolved
packages/modules/app/src/app/actions.ts Outdated Show resolved Hide resolved
@eikeland eikeland force-pushed the feat/module-app/appsettings/getter branch 3 times, most recently from db0c0e4 to bd631bf Compare November 22, 2024 09:41
@eikeland eikeland force-pushed the feat/module-app/appsettings/getter branch from bd631bf to a08dd60 Compare November 28, 2024 09:34
@github-actions github-actions bot added the 📚 documentation Improvements or additions to documentation label Dec 2, 2024
eikeland and others added 13 commits December 2, 2024 16:27
* fix(cli): vite-proxy for persons/me/settings with own use proxy path

* fix(app-settings): improvements to flows

* fix(app-module): faiilover when meta.id is not set. vite proxy handles manifest only

* feat(cli): add appSettingsPlugin to handle app settings requests

* feat(app): add updateSetting and updateSettingAsync methods for app settings management

* fix(react-app): fix build of app settings

- Add README.md to settings directory
- changed functionality of `useAppSetting` from allowing dot path to only allowing root property name
- removed dot-path.ts

* feat(react-app): add initial setup for app-react-settings cookbook with configuration and main app component

* chore(dependencies): update devDependencies for app-react-settings cookbook

* Empty-Commit

* refactor(app): simplify state selection for observables in App class

* fix(app): improve action filtering for updateSettings in App class

* fix(app): enhance AppClient to utilize IHttpClient for updating app settings

`Query` does not support update actions, since the query method only execute a method, so the update must done in a separate action which mutates the query on update.

* fix(app): update appSettingsPlugin to directly assign parsed request body for PUT method

align the plugin with PUT, not PATCH

* fix(app): update settings handling and improve action structure in AppClient

* fix(app): enhance useAppSetting and useAppSettings hooks to support status handling and improve error management

* fix(app): enhance useAppSetting and useAppSettings hooks to support callback functions for setting updates and improve error handling

* fix(app): enhance App component to support new 'fancy' setting and loading states for theme and size updates

* fix(deps): add fast-deep-equal dependency at version 3.1.3 in pnpm-lock.yaml

* docs(settings): add section for Portal Settings in README.md

* feat(docs): add documentation for app settings

* docs(settings): update README.md with notes on global state handling and UI best practices for settings updates

---------

Co-authored-by: Øyvind Eikeland <oyvind@eikeland.me>
@odinr odinr force-pushed the feat/module-app/appsettings/getter branch from d856c4f to 3fdaa1f Compare December 2, 2024 15:28
@odinr odinr merged commit c3ba9f1 into main Dec 3, 2024
7 checks passed
@odinr odinr deleted the feat/module-app/appsettings/getter branch December 3, 2024 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🚧 chore maintaines work, (update deps, workflos ...) 💾 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