From 0af3540340bac85a19ca3a8ec4e0ccd42b3090ee Mon Sep 17 00:00:00 2001 From: Odin Thomas Rochmann Date: Thu, 14 Dec 2023 10:26:06 +0100 Subject: [PATCH 1/6] fix(http): Refactor HTTP error handling and JSON parsing (#1621) --- .changeset/cool-forks-type.md | 21 ++++++++++++++ packages/modules/http/src/errors.ts | 29 +++++++++++++++++-- .../http/src/lib/selectors/json-selector.ts | 29 ++++++++++++++----- 3 files changed, 68 insertions(+), 11 deletions(-) create mode 100644 .changeset/cool-forks-type.md diff --git a/.changeset/cool-forks-type.md b/.changeset/cool-forks-type.md new file mode 100644 index 0000000000..da8c45ae14 --- /dev/null +++ b/.changeset/cool-forks-type.md @@ -0,0 +1,21 @@ +--- +'@equinor/fusion-framework-module-http': patch +--- + +__Improves error handling when processing json http response__ + +In packages/modules/http/src/errors.ts: +- The class HttpResponseError now has a generic parameter TResponse. + - Added a static property Name to the class. +- Added a new class HttpJsonResponseError which extends HttpResponseError and also has generic parameters TType and TResponse. + - Added a static property Name to the class. + - Added a public property data of type TType. + - Modified the constructor to accept an optional data parameter. + +In packages/modules/http/src/lib/selectors/json-selector.ts: +- Added an import statement for HttpJsonResponseError. +- Modified the jsonSelector function to handle errors when parsing the response. + - Added a try-catch block. + - Changed the JSON parsing logic to store the parsed data in a variable data. + - If the response is not OK, a HttpJsonResponseError is thrown with the appropriate error message, response object, and data property. + - If there is an error parsing the response, a HttpJsonResponseError is thrown with the appropriate error message, response object, and cause property. diff --git a/packages/modules/http/src/errors.ts b/packages/modules/http/src/errors.ts index b1cd0a682c..f2d4ad25dd 100644 --- a/packages/modules/http/src/errors.ts +++ b/packages/modules/http/src/errors.ts @@ -1,9 +1,32 @@ -export class HttpResponseError extends Error { +/** + * Represents an error that occurs when handling an HTTP response. + * @template TResponse The type of the HTTP response. + */ +export class HttpResponseError extends Error { + static Name = 'HttpResponseError'; constructor( - public message: string, - public response: Response, + message: string, + public readonly response: TResponse, options?: ErrorOptions, ) { super(message, options); } } + +/** + * Represents an error that occurs when handling a JSON response in an HTTP request. + * @template TType - The type of the data contained in the response. + * @template TResponse - The type of the HTTP response. + */ +export class HttpJsonResponseError< + TType = unknown, + TResponse = Response, +> extends HttpResponseError { + static Name = 'HttpJsonResponseError'; + public readonly data?: TType; + constructor(message: string, response: TResponse, options?: ErrorOptions & { data?: TType }) { + super(message, response, options); + this.name = HttpJsonResponseError.Name; + this.data = options?.data; + } +} diff --git a/packages/modules/http/src/lib/selectors/json-selector.ts b/packages/modules/http/src/lib/selectors/json-selector.ts index 34e05af274..58822d24ad 100644 --- a/packages/modules/http/src/lib/selectors/json-selector.ts +++ b/packages/modules/http/src/lib/selectors/json-selector.ts @@ -1,18 +1,31 @@ -export const jsonSelector = ( +import { HttpJsonResponseError } from '../../errors'; + +/** + * Converts the JSON response from an HTTP request into the specified type. + * If the response is not OK or if there is an error parsing the response, an error is thrown. + * If the response has a status code of 204 (No Content), a resolved Promise is returned. + * + * @param response The HTTP response object. + * @returns A Promise that resolves to the parsed JSON data. + * @throws {Error} If the network response is not OK. + * @throws {HttpJsonResponseError} If there is an error parsing the response. + */ +export const jsonSelector = async ( response: TResponse, ): Promise => { - if (!response.ok) { - throw new Error('network response was not OK'); - } - //Status code 204 is no content + /** Status code 204 is no content */ if (response.status === 204) { return Promise.resolve() as Promise; } try { - return response.json(); - } catch (err) { - throw Error('failed to parse response'); + const data = await response.json(); + if (!response.ok) { + throw new HttpJsonResponseError('network response was not OK', response, { data }); + } + return data; + } catch (cause) { + throw new HttpJsonResponseError('failed to parse response', response, { cause }); } }; From f85316f2344258896a77ef602bd4047dfa553788 Mon Sep 17 00:00:00 2001 From: Gustav-Eikaas <89254170+Gustav-Eikaas@users.noreply.github.com> Date: Thu, 14 Dec 2023 13:43:05 +0100 Subject: [PATCH 2/6] fix: package exports react-module-http (#1623) --- .changeset/neat-schools-kiss.md | 5 +++++ packages/react/modules/http/package.json | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/neat-schools-kiss.md diff --git a/.changeset/neat-schools-kiss.md b/.changeset/neat-schools-kiss.md new file mode 100644 index 0000000000..2ab09bae21 --- /dev/null +++ b/.changeset/neat-schools-kiss.md @@ -0,0 +1,5 @@ +--- +'@equinor/fusion-framework-react-module-http': patch +--- + +Fix package exports in react-module-http diff --git a/packages/react/modules/http/package.json b/packages/react/modules/http/package.json index 4fd46c4aa6..0f24aac5bc 100644 --- a/packages/react/modules/http/package.json +++ b/packages/react/modules/http/package.json @@ -4,7 +4,10 @@ "description": "", "main": "dist/esm/index.js", "exports": { - ".": "./dist/esm/index.js" + ".": { + "import": "./dist/esm/index.js", + "types": "./dist/types/index.d.ts" + } }, "types": "./dist/types/index.d.ts", "scripts": { From 8f7565c4c033815c4b7a17023d4c4b4a6b70c175 Mon Sep 17 00:00:00 2001 From: Christopher Berge Hove Date: Wed, 29 Nov 2023 13:05:27 +0100 Subject: [PATCH 3/6] feat: add no content message component --- .../src/components/messages/Message.tsx | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 packages/react/components/bookmark/src/components/messages/Message.tsx diff --git a/packages/react/components/bookmark/src/components/messages/Message.tsx b/packages/react/components/bookmark/src/components/messages/Message.tsx new file mode 100644 index 0000000000..4961635f86 --- /dev/null +++ b/packages/react/components/bookmark/src/components/messages/Message.tsx @@ -0,0 +1,82 @@ +import { Icon, Typography } from '@equinor/eds-core-react'; +import { tokens } from '@equinor/eds-tokens'; +import { PropsWithChildren } from 'react'; +import styled from 'styled-components'; + +import { error_outlined, file_description } from '@equinor/eds-icons'; + +export type PortalMessageType = 'Error' | 'Info' | 'Warning' | 'NoContent'; + +const getMessageType = (type?: PortalMessageType) => { + switch (type) { + case 'Error': + return { color: tokens.colors.interactive.danger__resting.hex, icon: error_outlined }; + case 'Info': + return { color: tokens.colors.interactive.primary__resting.hex, icon: error_outlined }; + case 'Warning': + return { color: tokens.colors.interactive.warning__resting.hex, icon: error_outlined }; + case 'NoContent': + return { + color: tokens.colors.interactive.primary__resting.hex, + icon: file_description, + }; + default: + return undefined; + } +}; + +const Styles = { + Wrapper: styled.div` + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + gap: 1rem; + justify-content: center; + `, + Content: styled.div` + display: flex; + flex-direction: column; + align-items: center; + gap: 0.5rem; + justify-content: center; + `, +}; + +interface MessageProps { + title: string; + body?: React.FC | string; + type?: PortalMessageType; + color?: string; +} + +export function Message({ + title, + type = 'Info', + color, + children, +}: PropsWithChildren) { + const currentType = getMessageType(type); + return ( + + + + + {title} + + + {children && children} + + + ); +} From 750a7f5f96104e33d4a436ff858044516e269c68 Mon Sep 17 00:00:00 2001 From: Christopher Berge Hove Date: Wed, 13 Dec 2023 12:36:18 +0100 Subject: [PATCH 4/6] feat: Implement a "No Content" message and relocate the "Loading" indicator to the bookmarks component. Additionally, incorporate an effect to handle cases where the "onBookmarksChanged" event is not triggered. --- .changeset/happy-radios-return.md | 5 +++ .../bookmark/src/components/Bookmark.tsx | 39 ++++++++++++++++++- .../src/components/messages/Message.tsx | 18 ++++----- .../components/sectionList/SectionList.tsx | 13 +------ 4 files changed, 52 insertions(+), 23 deletions(-) create mode 100644 .changeset/happy-radios-return.md diff --git a/.changeset/happy-radios-return.md b/.changeset/happy-radios-return.md new file mode 100644 index 0000000000..b2c0c70816 --- /dev/null +++ b/.changeset/happy-radios-return.md @@ -0,0 +1,5 @@ +--- +'@equinor/fusion-framework-react-components-bookmark': minor +--- + +Implement a "No Content" message and relocate the "Loading" indicator to the bookmarks component. Additionally, incorporate an effect to handle cases where the "onBookmarksChanged" event is not triggered. \ No newline at end of file diff --git a/packages/react/components/bookmark/src/components/Bookmark.tsx b/packages/react/components/bookmark/src/components/Bookmark.tsx index 50750ec1a1..d26ca8abb9 100644 --- a/packages/react/components/bookmark/src/components/Bookmark.tsx +++ b/packages/react/components/bookmark/src/components/Bookmark.tsx @@ -2,12 +2,15 @@ import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark'; import { useBookmarkGrouping } from '../hooks'; import { BookmarkFilter } from './filter/Filter'; import { SectionList } from './sectionList/SectionList'; -import { useEffect } from 'react'; +import { useEffect, useState } from 'react'; import { Icon } from '@equinor/eds-core-react'; import { chevron_down, chevron_right, share, more_vertical, add } from '@equinor/eds-icons'; import styled from 'styled-components'; +import { Message } from './messages/Message'; +import { Loading } from './loading/Loading'; +import { useFramework } from '@equinor/fusion-framework-react'; Icon.add({ chevron_down, @@ -29,10 +32,32 @@ const Styled = { overflow-x: hidden; height: calc((100vh - 85px) - 3rem); `, + NoContentWrapper: styled.div` + position: absolute; + top: 150px; + bottom: 200px; + left: 0px; + right: 0px; + `, }; export const Bookmark = () => { const { bookmarks, getAllBookmarks } = useBookmark(); + const [loading, setLoading] = useState(true); + + const { event } = useFramework().modules; + + useEffect(() => { + return event.addEventListener('onBookmarksChanged', () => { + setLoading(false); + }); + }, [event]); + + useEffect(() => { + if (bookmarks.length > 0) { + setLoading(false); + } + }, [bookmarks]); useEffect(() => { getAllBookmarks(); @@ -51,7 +76,17 @@ export const Bookmark = () => { setSearchText={setSearchText} /> - + {bookmarkGroups.length > 0 ? ( + + ) : loading ? ( + + ) : ( + + + You have not created any bookmarks yet. + + + )} ); diff --git a/packages/react/components/bookmark/src/components/messages/Message.tsx b/packages/react/components/bookmark/src/components/messages/Message.tsx index 4961635f86..223d74b138 100644 --- a/packages/react/components/bookmark/src/components/messages/Message.tsx +++ b/packages/react/components/bookmark/src/components/messages/Message.tsx @@ -44,19 +44,19 @@ const Styles = { `, }; -interface MessageProps { - title: string; - body?: React.FC | string; - type?: PortalMessageType; - color?: string; -} +type MessageProps = { + readonly title: string; + readonly body?: React.FC | string; + readonly type?: PortalMessageType; + readonly color?: string; +}; -export function Message({ +export const Message = ({ title, type = 'Info', color, children, -}: PropsWithChildren) { +}: PropsWithChildren) => { const currentType = getMessageType(type); return ( @@ -79,4 +79,4 @@ export function Message({ ); -} +}; diff --git a/packages/react/components/bookmark/src/components/sectionList/SectionList.tsx b/packages/react/components/bookmark/src/components/sectionList/SectionList.tsx index 9dcd1a689c..d12d99baf2 100644 --- a/packages/react/components/bookmark/src/components/sectionList/SectionList.tsx +++ b/packages/react/components/bookmark/src/components/sectionList/SectionList.tsx @@ -7,12 +7,11 @@ import { SharedIcon } from '../shared/SharedIcon'; import type { Bookmark } from '@equinor/fusion-framework-module-bookmark'; import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark'; import { useCurrentUser } from '@equinor/fusion-framework-react/hooks'; -import { useCallback, useEffect, useState } from 'react'; +import { useCallback, useState } from 'react'; import { delete_to_trash, share, edit, close, update } from '@equinor/eds-icons'; import { useFramework } from '@equinor/fusion-framework-react'; import { appendBookmarkIdToUrl } from '../../utils/append-bookmark-to-uri'; import { filterEmptyGroups, sortByName, toHumanReadable } from '../../utils/utils'; -import { Loading } from '../loading/Loading'; Icon.add({ delete_to_trash, @@ -30,19 +29,11 @@ export const SectionList = ({ bookmarkGroups }: SectionListProps) => { const { deleteBookmarkById, getCurrentAppKey, updateBookmark, removeBookmarkFavorite } = useBookmark(); - const [loading, setLoading] = useState(true); - const user = useCurrentUser(); const [isMenuByIdOpen, setIsMenuByIdOpen] = useState(''); const { event } = useFramework().modules; - useEffect(() => { - return event.addEventListener('onBookmarksChanged', () => { - setLoading(false); - }); - }, [event]); - const editBookmark = useCallback( (bookmarkId: string) => { event.dispatchEvent('onBookmarkEdit', { detail: { bookmarkId } }); @@ -81,8 +72,6 @@ export const SectionList = ({ bookmarkGroups }: SectionListProps) => { user?.localAccountId, ); - if (loading) return ; - return ( <> {bookmarkGroups.filter(filterEmptyGroups).map(({ groupingProperty, values }) => ( From cce198d6a91fb7912265d4383246dc405cf17a17 Mon Sep 17 00:00:00 2001 From: Odin Thomas Rochmann Date: Thu, 14 Dec 2023 15:23:38 +0100 Subject: [PATCH 5/6] fix(react-module-http): export http errors --- .changeset/green-badgers-build.md | 5 +++++ packages/react/modules/http/src/index.ts | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/green-badgers-build.md diff --git a/.changeset/green-badgers-build.md b/.changeset/green-badgers-build.md new file mode 100644 index 0000000000..24b36ef413 --- /dev/null +++ b/.changeset/green-badgers-build.md @@ -0,0 +1,5 @@ +--- +'@equinor/fusion-framework-react-module-http': patch +--- + +export http errors from `@equinor/fusion-framework-module-http/errors` diff --git a/packages/react/modules/http/src/index.ts b/packages/react/modules/http/src/index.ts index 3e58baeb61..95a79b68b4 100644 --- a/packages/react/modules/http/src/index.ts +++ b/packages/react/modules/http/src/index.ts @@ -4,4 +4,9 @@ export { FetchRequestInit, } from '@equinor/fusion-framework-module-http/client'; +export { + HttpResponseError, + HttpJsonResponseError, +} from '@equinor/fusion-framework-module-http/errors'; + export { useHttpClient } from './useHttpClient'; From ffbd960eec78d03fbfe7b90a437262dd09a51324 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:25:21 +0100 Subject: [PATCH 6/6] Version Packages (#1622) Co-authored-by: odinr[bot] --- .changeset/cool-forks-type.md | 21 ---------------- .changeset/green-badgers-build.md | 5 ---- .changeset/happy-radios-return.md | 5 ---- .changeset/neat-schools-kiss.md | 5 ---- packages/app/CHANGELOG.md | 9 +++++++ packages/app/package.json | 2 +- packages/cli/CHANGELOG.md | 8 +++++++ packages/cli/package.json | 2 +- packages/framework/CHANGELOG.md | 9 +++++++ packages/framework/package.json | 2 +- packages/modules/http/CHANGELOG.md | 24 +++++++++++++++++++ packages/modules/http/package.json | 2 +- .../modules/service-discovery/CHANGELOG.md | 7 ++++++ .../modules/service-discovery/package.json | 2 +- packages/modules/signalr/CHANGELOG.md | 7 ++++++ packages/modules/signalr/package.json | 2 +- packages/modules/widget/CHANGELOG.md | 8 +++++++ packages/modules/widget/package.json | 2 +- packages/react/app/CHANGELOG.md | 10 ++++++++ packages/react/app/package.json | 2 +- .../react/components/bookmark/CHANGELOG.md | 12 ++++++++++ .../react/components/bookmark/package.json | 2 +- .../components/people-resolver/CHANGELOG.md | 9 +++++++ .../components/people-resolver/package.json | 2 +- packages/react/framework/CHANGELOG.md | 9 +++++++ packages/react/framework/package.json | 2 +- packages/react/legacy-interopt/CHANGELOG.md | 12 ++++++++++ packages/react/legacy-interopt/package.json | 2 +- packages/react/modules/bookmark/CHANGELOG.md | 8 +++++++ packages/react/modules/bookmark/package.json | 2 +- packages/react/modules/http/CHANGELOG.md | 11 +++++++++ packages/react/modules/http/package.json | 2 +- packages/react/modules/signalr/CHANGELOG.md | 7 ++++++ packages/react/modules/signalr/package.json | 2 +- packages/widget/CHANGELOG.md | 9 +++++++ packages/widget/package.json | 2 +- 36 files changed, 175 insertions(+), 52 deletions(-) delete mode 100644 .changeset/cool-forks-type.md delete mode 100644 .changeset/green-badgers-build.md delete mode 100644 .changeset/happy-radios-return.md delete mode 100644 .changeset/neat-schools-kiss.md diff --git a/.changeset/cool-forks-type.md b/.changeset/cool-forks-type.md deleted file mode 100644 index da8c45ae14..0000000000 --- a/.changeset/cool-forks-type.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -'@equinor/fusion-framework-module-http': patch ---- - -__Improves error handling when processing json http response__ - -In packages/modules/http/src/errors.ts: -- The class HttpResponseError now has a generic parameter TResponse. - - Added a static property Name to the class. -- Added a new class HttpJsonResponseError which extends HttpResponseError and also has generic parameters TType and TResponse. - - Added a static property Name to the class. - - Added a public property data of type TType. - - Modified the constructor to accept an optional data parameter. - -In packages/modules/http/src/lib/selectors/json-selector.ts: -- Added an import statement for HttpJsonResponseError. -- Modified the jsonSelector function to handle errors when parsing the response. - - Added a try-catch block. - - Changed the JSON parsing logic to store the parsed data in a variable data. - - If the response is not OK, a HttpJsonResponseError is thrown with the appropriate error message, response object, and data property. - - If there is an error parsing the response, a HttpJsonResponseError is thrown with the appropriate error message, response object, and cause property. diff --git a/.changeset/green-badgers-build.md b/.changeset/green-badgers-build.md deleted file mode 100644 index 24b36ef413..0000000000 --- a/.changeset/green-badgers-build.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@equinor/fusion-framework-react-module-http': patch ---- - -export http errors from `@equinor/fusion-framework-module-http/errors` diff --git a/.changeset/happy-radios-return.md b/.changeset/happy-radios-return.md deleted file mode 100644 index b2c0c70816..0000000000 --- a/.changeset/happy-radios-return.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@equinor/fusion-framework-react-components-bookmark': minor ---- - -Implement a "No Content" message and relocate the "Loading" indicator to the bookmarks component. Additionally, incorporate an effect to handle cases where the "onBookmarksChanged" event is not triggered. \ No newline at end of file diff --git a/.changeset/neat-schools-kiss.md b/.changeset/neat-schools-kiss.md deleted file mode 100644 index 2ab09bae21..0000000000 --- a/.changeset/neat-schools-kiss.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@equinor/fusion-framework-react-module-http': patch ---- - -Fix package exports in react-module-http diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 6c4339a7e6..961a5dfa8b 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 7.1.13 + +### Patch Changes + +- Updated dependencies [[`0af3540`](https://github.com/equinor/fusion-framework/commit/0af3540340bac85a19ca3a8ec4e0ccd42b3090ee)]: + - @equinor/fusion-framework-module-http@5.1.3 + - @equinor/fusion-framework@7.0.26 + - @equinor/fusion-framework-module-app@5.2.12 + ## 7.1.12 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index ccbc0a08fa..26af7ce6ed 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework-app", - "version": "7.1.12", + "version": "7.1.13", "description": "", "main": "dist/esm/index.js", "exports": { diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index aad8edb0b8..6273d63c0b 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 9.5.4 + +### Patch Changes + +- Updated dependencies []: + - @equinor/fusion-framework-app@7.1.13 + - @equinor/fusion-framework-react-components-people-provider@1.1.7 + ## 9.5.3 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index 2f21f42868..f5afdc1a03 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework-cli", - "version": "9.5.3", + "version": "9.5.4", "keywords": [ "Fusion", "Fusion Framework", diff --git a/packages/framework/CHANGELOG.md b/packages/framework/CHANGELOG.md index be5bbca5e2..0789b47ddb 100644 --- a/packages/framework/CHANGELOG.md +++ b/packages/framework/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 7.0.26 + +### Patch Changes + +- Updated dependencies [[`0af3540`](https://github.com/equinor/fusion-framework/commit/0af3540340bac85a19ca3a8ec4e0ccd42b3090ee)]: + - @equinor/fusion-framework-module-http@5.1.3 + - @equinor/fusion-framework-module-service-discovery@7.0.16 + - @equinor/fusion-framework-module-services@3.2.3 + ## 7.0.25 ### Patch Changes diff --git a/packages/framework/package.json b/packages/framework/package.json index 7e42d5085e..f877b18049 100644 --- a/packages/framework/package.json +++ b/packages/framework/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework", - "version": "7.0.25", + "version": "7.0.26", "description": "", "main": "dist/esm/index.js", "exports": { diff --git a/packages/modules/http/CHANGELOG.md b/packages/modules/http/CHANGELOG.md index 99bb32c5cb..f0789b4cd8 100644 --- a/packages/modules/http/CHANGELOG.md +++ b/packages/modules/http/CHANGELOG.md @@ -1,5 +1,29 @@ # Change Log +## 5.1.3 + +### Patch Changes + +- [#1621](https://github.com/equinor/fusion-framework/pull/1621) [`0af3540`](https://github.com/equinor/fusion-framework/commit/0af3540340bac85a19ca3a8ec4e0ccd42b3090ee) Thanks [@odinr](https://github.com/odinr)! - **Improves error handling when processing json http response** + + In packages/modules/http/src/errors.ts: + + - The class HttpResponseError now has a generic parameter TResponse. + - Added a static property Name to the class. + - Added a new class HttpJsonResponseError which extends HttpResponseError and also has generic parameters TType and TResponse. + - Added a static property Name to the class. + - Added a public property data of type TType. + - Modified the constructor to accept an optional data parameter. + + In packages/modules/http/src/lib/selectors/json-selector.ts: + + - Added an import statement for HttpJsonResponseError. + - Modified the jsonSelector function to handle errors when parsing the response. + - Added a try-catch block. + - Changed the JSON parsing logic to store the parsed data in a variable data. + - If the response is not OK, a HttpJsonResponseError is thrown with the appropriate error message, response object, and data property. + - If there is an error parsing the response, a HttpJsonResponseError is thrown with the appropriate error message, response object, and cause property. + ## 5.1.2 ### Patch Changes diff --git a/packages/modules/http/package.json b/packages/modules/http/package.json index 90fb4c4ea4..ef57c2badb 100644 --- a/packages/modules/http/package.json +++ b/packages/modules/http/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework-module-http", - "version": "5.1.2", + "version": "5.1.3", "description": "", "main": "dist/esm/index.js", "types": "index.d.ts", diff --git a/packages/modules/service-discovery/CHANGELOG.md b/packages/modules/service-discovery/CHANGELOG.md index 1c48e9d002..f2fc6e5377 100644 --- a/packages/modules/service-discovery/CHANGELOG.md +++ b/packages/modules/service-discovery/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 7.0.16 + +### Patch Changes + +- Updated dependencies [[`0af3540`](https://github.com/equinor/fusion-framework/commit/0af3540340bac85a19ca3a8ec4e0ccd42b3090ee)]: + - @equinor/fusion-framework-module-http@5.1.3 + ## 7.0.15 ### Patch Changes diff --git a/packages/modules/service-discovery/package.json b/packages/modules/service-discovery/package.json index 360a10d98d..75eab0f3df 100644 --- a/packages/modules/service-discovery/package.json +++ b/packages/modules/service-discovery/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework-module-service-discovery", - "version": "7.0.15", + "version": "7.0.16", "description": "", "main": "dist/esm/index.js", "exports": { diff --git a/packages/modules/signalr/CHANGELOG.md b/packages/modules/signalr/CHANGELOG.md index ebd4df2aa2..68acbf6dcc 100644 --- a/packages/modules/signalr/CHANGELOG.md +++ b/packages/modules/signalr/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 2.0.15 + +### Patch Changes + +- Updated dependencies []: + - @equinor/fusion-framework-module-service-discovery@7.0.16 + ## 2.0.14 ### Patch Changes diff --git a/packages/modules/signalr/package.json b/packages/modules/signalr/package.json index d0c7f4b1f0..84da98546d 100644 --- a/packages/modules/signalr/package.json +++ b/packages/modules/signalr/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework-module-signalr", - "version": "2.0.14", + "version": "2.0.15", "description": "", "sideEffects": false, "main": "dist/esm/index.js", diff --git a/packages/modules/widget/CHANGELOG.md b/packages/modules/widget/CHANGELOG.md index d94223e750..975400ebe3 100644 --- a/packages/modules/widget/CHANGELOG.md +++ b/packages/modules/widget/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 2.0.6 + +### Patch Changes + +- Updated dependencies [[`0af3540`](https://github.com/equinor/fusion-framework/commit/0af3540340bac85a19ca3a8ec4e0ccd42b3090ee)]: + - @equinor/fusion-framework-module-http@5.1.3 + - @equinor/fusion-framework-module-service-discovery@7.0.16 + ## 2.0.5 ### Patch Changes diff --git a/packages/modules/widget/package.json b/packages/modules/widget/package.json index dd10846e7d..9348cba4bb 100644 --- a/packages/modules/widget/package.json +++ b/packages/modules/widget/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework-module-widget", - "version": "2.0.5", + "version": "2.0.6", "description": "", "main": "dist/esm/index.js", "exports": { diff --git a/packages/react/app/CHANGELOG.md b/packages/react/app/CHANGELOG.md index dece2f1c7f..7da07e72f2 100644 --- a/packages/react/app/CHANGELOG.md +++ b/packages/react/app/CHANGELOG.md @@ -1,5 +1,15 @@ # Change Log +## 4.1.18 + +### Patch Changes + +- Updated dependencies [[`cce198d`](https://github.com/equinor/fusion-framework/commit/cce198d6a91fb7912265d4383246dc405cf17a17), [`f85316f`](https://github.com/equinor/fusion-framework/commit/f85316f2344258896a77ef602bd4047dfa553788)]: + - @equinor/fusion-framework-react-module-http@4.0.3 + - @equinor/fusion-framework-app@7.1.13 + - @equinor/fusion-framework-module-app@5.2.12 + - @equinor/fusion-framework-react@5.3.6 + ## 4.1.17 ### Patch Changes diff --git a/packages/react/app/package.json b/packages/react/app/package.json index 08aeec28c0..1b5d014adf 100644 --- a/packages/react/app/package.json +++ b/packages/react/app/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework-react-app", - "version": "4.1.17", + "version": "4.1.18", "description": "", "main": "dist/esm/index.js", "exports": { diff --git a/packages/react/components/bookmark/CHANGELOG.md b/packages/react/components/bookmark/CHANGELOG.md index 00b9b5f3f9..4bdb58fd8d 100644 --- a/packages/react/components/bookmark/CHANGELOG.md +++ b/packages/react/components/bookmark/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## 0.3.0 + +### Minor Changes + +- [#1615](https://github.com/equinor/fusion-framework/pull/1615) [`750a7f5`](https://github.com/equinor/fusion-framework/commit/750a7f5f96104e33d4a436ff858044516e269c68) Thanks [@Noggling](https://github.com/Noggling)! - Implement a "No Content" message and relocate the "Loading" indicator to the bookmarks component. Additionally, incorporate an effect to handle cases where the "onBookmarksChanged" event is not triggered. + +### Patch Changes + +- Updated dependencies []: + - @equinor/fusion-framework-react@5.3.6 + - @equinor/fusion-framework-react-module-bookmark@2.0.25 + ## 0.2.14 ### Patch Changes diff --git a/packages/react/components/bookmark/package.json b/packages/react/components/bookmark/package.json index 872b2000ea..463ecfa8c7 100644 --- a/packages/react/components/bookmark/package.json +++ b/packages/react/components/bookmark/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework-react-components-bookmark", - "version": "0.2.14", + "version": "0.3.0", "description": "", "main": "dist/esm/index.js", "exports": { diff --git a/packages/react/components/people-resolver/CHANGELOG.md b/packages/react/components/people-resolver/CHANGELOG.md index c013aac2d4..508665ef3c 100644 --- a/packages/react/components/people-resolver/CHANGELOG.md +++ b/packages/react/components/people-resolver/CHANGELOG.md @@ -1,5 +1,14 @@ # @equinor/fusion-framework-react-components-people-provider +## 1.1.7 + +### Patch Changes + +- Updated dependencies []: + - @equinor/fusion-framework-module-services@3.2.3 + - @equinor/fusion-framework-react@5.3.6 + - @equinor/fusion-framework-react-module-bookmark@2.0.25 + ## 1.1.6 ### Patch Changes diff --git a/packages/react/components/people-resolver/package.json b/packages/react/components/people-resolver/package.json index 87e49df66a..2b243ebf8d 100644 --- a/packages/react/components/people-resolver/package.json +++ b/packages/react/components/people-resolver/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework-react-components-people-provider", - "version": "1.1.6", + "version": "1.1.7", "description": "", "main": "dist/esm/index.js", "exports": { diff --git a/packages/react/framework/CHANGELOG.md b/packages/react/framework/CHANGELOG.md index 3aee5dea11..7f7d9d1b21 100644 --- a/packages/react/framework/CHANGELOG.md +++ b/packages/react/framework/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 5.3.6 + +### Patch Changes + +- Updated dependencies [[`cce198d`](https://github.com/equinor/fusion-framework/commit/cce198d6a91fb7912265d4383246dc405cf17a17), [`f85316f`](https://github.com/equinor/fusion-framework/commit/f85316f2344258896a77ef602bd4047dfa553788)]: + - @equinor/fusion-framework-react-module-http@4.0.3 + - @equinor/fusion-framework@7.0.26 + - @equinor/fusion-framework-react-module-signalr@2.0.14 + ## 5.3.5 ### Patch Changes diff --git a/packages/react/framework/package.json b/packages/react/framework/package.json index 3e23d9df14..a09f6d13a8 100644 --- a/packages/react/framework/package.json +++ b/packages/react/framework/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework-react", - "version": "5.3.5", + "version": "5.3.6", "description": "", "main": "dist/esm/index.js", "exports": { diff --git a/packages/react/legacy-interopt/CHANGELOG.md b/packages/react/legacy-interopt/CHANGELOG.md index b53b1392f7..196de286d7 100644 --- a/packages/react/legacy-interopt/CHANGELOG.md +++ b/packages/react/legacy-interopt/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## 7.0.7 + +### Patch Changes + +- Updated dependencies [[`0af3540`](https://github.com/equinor/fusion-framework/commit/0af3540340bac85a19ca3a8ec4e0ccd42b3090ee)]: + - @equinor/fusion-framework-module-http@5.1.3 + - @equinor/fusion-framework-app@7.1.13 + - @equinor/fusion-framework@7.0.26 + - @equinor/fusion-framework-module-app@5.2.12 + - @equinor/fusion-framework-module-service-discovery@7.0.16 + - @equinor/fusion-framework-react-app@4.1.18 + ## 7.0.6 ### Patch Changes diff --git a/packages/react/legacy-interopt/package.json b/packages/react/legacy-interopt/package.json index 03e899e63f..0e7faefe33 100644 --- a/packages/react/legacy-interopt/package.json +++ b/packages/react/legacy-interopt/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework-legacy-interopt", - "version": "7.0.6", + "version": "7.0.7", "description": "Library for interopt legacy fusion applications", "main": "dist/esm/index.js", "exports": { diff --git a/packages/react/modules/bookmark/CHANGELOG.md b/packages/react/modules/bookmark/CHANGELOG.md index de2cdb1dac..b1144019f6 100644 --- a/packages/react/modules/bookmark/CHANGELOG.md +++ b/packages/react/modules/bookmark/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 2.0.25 + +### Patch Changes + +- Updated dependencies []: + - @equinor/fusion-framework-module-bookmark@1.0.17 + - @equinor/fusion-framework-react@5.3.6 + ## 2.0.24 ### Patch Changes diff --git a/packages/react/modules/bookmark/package.json b/packages/react/modules/bookmark/package.json index 40d9e11eb9..729bd281cf 100644 --- a/packages/react/modules/bookmark/package.json +++ b/packages/react/modules/bookmark/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework-react-module-bookmark", - "version": "2.0.24", + "version": "2.0.25", "description": "", "main": "dist/esm/index.js", "exports": { diff --git a/packages/react/modules/http/CHANGELOG.md b/packages/react/modules/http/CHANGELOG.md index 29879bdbf1..5b4faff13b 100644 --- a/packages/react/modules/http/CHANGELOG.md +++ b/packages/react/modules/http/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## 4.0.3 + +### Patch Changes + +- [`cce198d`](https://github.com/equinor/fusion-framework/commit/cce198d6a91fb7912265d4383246dc405cf17a17) Thanks [@odinr](https://github.com/odinr)! - export http errors from `@equinor/fusion-framework-module-http/errors` + +- [#1623](https://github.com/equinor/fusion-framework/pull/1623) [`f85316f`](https://github.com/equinor/fusion-framework/commit/f85316f2344258896a77ef602bd4047dfa553788) Thanks [@Gustav-Eikaas](https://github.com/Gustav-Eikaas)! - Fix package exports in react-module-http + +- Updated dependencies [[`0af3540`](https://github.com/equinor/fusion-framework/commit/0af3540340bac85a19ca3a8ec4e0ccd42b3090ee)]: + - @equinor/fusion-framework-module-http@5.1.3 + ## 4.0.2 ### Patch Changes diff --git a/packages/react/modules/http/package.json b/packages/react/modules/http/package.json index 0f24aac5bc..f39d4c224a 100644 --- a/packages/react/modules/http/package.json +++ b/packages/react/modules/http/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework-react-module-http", - "version": "4.0.2", + "version": "4.0.3", "description": "", "main": "dist/esm/index.js", "exports": { diff --git a/packages/react/modules/signalr/CHANGELOG.md b/packages/react/modules/signalr/CHANGELOG.md index c3ba14ab9e..be6796618f 100644 --- a/packages/react/modules/signalr/CHANGELOG.md +++ b/packages/react/modules/signalr/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 2.0.14 + +### Patch Changes + +- Updated dependencies []: + - @equinor/fusion-framework-module-signalr@2.0.15 + ## 2.0.13 ### Patch Changes diff --git a/packages/react/modules/signalr/package.json b/packages/react/modules/signalr/package.json index 566fcc094f..bb9a4d8ede 100644 --- a/packages/react/modules/signalr/package.json +++ b/packages/react/modules/signalr/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework-react-module-signalr", - "version": "2.0.13", + "version": "2.0.14", "description": "", "sideEffects": false, "main": "dist/esm/index.js", diff --git a/packages/widget/CHANGELOG.md b/packages/widget/CHANGELOG.md index 100a204fb3..447c41d229 100644 --- a/packages/widget/CHANGELOG.md +++ b/packages/widget/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 1.0.24 + +### Patch Changes + +- Updated dependencies [[`0af3540`](https://github.com/equinor/fusion-framework/commit/0af3540340bac85a19ca3a8ec4e0ccd42b3090ee)]: + - @equinor/fusion-framework-module-http@5.1.3 + - @equinor/fusion-framework@7.0.26 + - @equinor/fusion-framework-module-widget@2.0.6 + ## 1.0.23 ### Patch Changes diff --git a/packages/widget/package.json b/packages/widget/package.json index 9cd26f2732..3fc27efed8 100644 --- a/packages/widget/package.json +++ b/packages/widget/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/fusion-framework-widget", - "version": "1.0.23", + "version": "1.0.24", "description": "", "main": "dist/esm/index.js", "exports": {