From fa974a3fcf0bb46a067588670fb75351db0b6079 Mon Sep 17 00:00:00 2001 From: Christopher Berge Hove Date: Mon, 23 Sep 2024 13:01:10 +0200 Subject: [PATCH 1/3] chore: update style components (#770) --- .changeset/pr-770-2086136734.md | 3 + client/package.json | 2 +- .../src/components/app-group/AppGroup.tsx | 3 +- .../components/ServiceMessageCard.tsx | 134 +++++++------ client/yarn.lock | 181 +++++++----------- 5 files changed, 147 insertions(+), 176 deletions(-) create mode 100644 .changeset/pr-770-2086136734.md diff --git a/.changeset/pr-770-2086136734.md b/.changeset/pr-770-2086136734.md new file mode 100644 index 000000000..017b123fe --- /dev/null +++ b/.changeset/pr-770-2086136734.md @@ -0,0 +1,3 @@ + +--- +--- diff --git a/client/package.json b/client/package.json index cc67edc24..f7634991d 100644 --- a/client/package.json +++ b/client/package.json @@ -100,7 +100,7 @@ "react-query": "^3.39.2", "react-router-dom": "^6.16.0", "rxjs": "^7.5.7", - "styled-components": "5.3.11", + "styled-components": "^6.1.13", "swiper": "^9.3.2", "zod": "^3.22.4" }, diff --git a/client/packages/components/src/components/app-group/AppGroup.tsx b/client/packages/components/src/components/app-group/AppGroup.tsx index 897adffd2..02a75ccf1 100644 --- a/client/packages/components/src/components/app-group/AppGroup.tsx +++ b/client/packages/components/src/components/app-group/AppGroup.tsx @@ -54,7 +54,6 @@ export const Styles = { margin-inline-start: 0px; margin-inline-end: 0px; padding-inline-start: 0; - /* gap: 1rem; */ `, }; @@ -72,7 +71,7 @@ export const AppGroup = ({ group, onFavorite, dark, onClick }: AppGroupProps) => return ( - + {group.name} diff --git a/client/packages/service-message/components/ServiceMessageCard.tsx b/client/packages/service-message/components/ServiceMessageCard.tsx index 18a582728..7039764cb 100644 --- a/client/packages/service-message/components/ServiceMessageCard.tsx +++ b/client/packages/service-message/components/ServiceMessageCard.tsx @@ -1,65 +1,87 @@ -import { Button, Card, Icon } from "@equinor/eds-core-react"; -import { tokens } from "@equinor/eds-tokens"; +import { Button, Card, Icon } from '@equinor/eds-core-react'; +import { tokens } from '@equinor/eds-tokens'; +import { FC, useRef, useState } from 'react'; +import styled from 'styled-components'; +import { ServiceMessage } from '../types/types'; -import { FC, useRef, useState } from "react"; -import styled from "styled-components"; -import { ServiceMessage } from "../types/types" - -import MarkdownViewer from "./MarkdownViewer"; -import { StyledCard, StyledCardIndicator, StyledContentWrapper, StyledHeader, StyledHeaderItem, StyledHeaderWrapper, StyledTime } from "./ServiceMessageCardStyles"; -import { TimeStamp } from "./TimeStamp"; - +import MarkdownViewer from './MarkdownViewer'; +import { + StyledCard, + StyledCardIndicator, + StyledContentWrapper, + StyledHeader, + StyledHeaderItem, + StyledHeaderWrapper, + StyledTime, +} from './ServiceMessageCardStyles'; +import { TimeStamp } from './TimeStamp'; const StyledContent = styled(Card.Content)``; -const getIconVariant = (type: "Issue" | "Maintenance" | "Info") => { - const variant = { - Issue: { name: "warning_filled", color: tokens.colors.interactive.danger__resting.rgba }, - Maintenance: { name: "error_filled", color: tokens.colors.interactive.warning__resting.rgba }, - Info: { name: "error_filled", color: tokens.colors.infographic.primary__moss_green_100.rgba } - } - return variant[type] -} - -const getIconName = (active: boolean) => active ? "chevron_up" : "chevron_down" - - -export const ServiceMessageCard: FC<{ message: ServiceMessage, onClose?: VoidFunction, compact?: boolean }> = ({ message, onClose, compact = true }) => { - const variant = getIconVariant(message.type); - const [showContent, setShowContent] = useState(compact || message.type === "Issue" && message.content !== null); - const ref = useRef(null); +const getIconVariant = (type: 'Issue' | 'Maintenance' | 'Info') => { + const variant = { + Issue: { name: 'warning_filled', color: tokens.colors.interactive.danger__resting.rgba }, + Maintenance: { name: 'error_filled', color: tokens.colors.interactive.warning__resting.rgba }, + Info: { name: 'error_filled', color: tokens.colors.infographic.primary__moss_green_100.rgba }, + }; + return variant[type]; +}; - return ( - - - - - - {message.title} - - - - - - - {onClose ? : } - +const getIconName = (active: boolean) => (active ? 'chevron_up' : 'chevron_down'); - +export const ServiceMessageCard: FC<{ message: ServiceMessage; onClose?: VoidFunction; compact?: boolean }> = ({ + message, + onClose, + compact = true, +}) => { + const variant = getIconVariant(message.type); + const [showContent, setShowContent] = useState(compact || (message.type === 'Issue' && message.content !== null)); + const ref = useRef(null); - {showContent && message.content && - - - - } + return ( + + + + + + + + {message.title} + + + + + + + {onClose ? ( + + ) : ( + + )} + + - - ) -} \ No newline at end of file + {showContent && message.content && ( + + + + )} + + + ); +}; diff --git a/client/yarn.lock b/client/yarn.lock index 8d8e6a392..0e31b2897 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -56,7 +56,7 @@ resolved "https://registry.yarnpkg.com/@azure/msal-common/-/msal-common-13.2.1.tgz#64f2c42d35df1c6ee0ea9ac03ba127482dd8692c" integrity sha512-9CtyVdDtAOw+raemKg8gdBuE7gleObgSb7p4bzMIlUt8eM69/Gaow7uqr1gK3jLYINSrss32OZW8mBbdgVLiHg== -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.10", "@babel/code-frame@^7.22.5": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13": version "7.22.10" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.10.tgz#1c20e612b768fefa75f6e90d6ecb86329247f0a3" integrity sha512-/KKIMG4UEL35WmI9OlvMhurwtytjvXoFcGNrOvyG9zIzA8YmPjVtIZUf7b05+TPO7G7/GEmLHDaoCgACHl9hhA== @@ -98,16 +98,6 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.22.10": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.10.tgz#c92254361f398e160645ac58831069707382b722" - integrity sha512-79KIf7YiWjjdZ81JnLujDRApWtl7BxTqWD88+FFdQEIOG8LJ0etDOM7CXuIgGJa55sGOwZVwuEsaLEm0PJ5/+A== - dependencies: - "@babel/types" "^7.22.10" - "@jridgewell/gen-mapping" "^0.3.2" - "@jridgewell/trace-mapping" "^0.3.17" - jsesc "^2.5.1" - "@babel/generator@^7.23.6": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" @@ -118,13 +108,6 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/helper-annotate-as-pure@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" - integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== - dependencies: - "@babel/types" "^7.22.5" - "@babel/helper-compilation-targets@^7.23.6": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz#4d79069b16cbcf1461289eccfbbd81501ae39991" @@ -141,19 +124,6 @@ resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== -"@babel/helper-environment-visitor@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98" - integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q== - -"@babel/helper-function-name@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz#ede300828905bb15e582c037162f99d5183af1be" - integrity sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ== - dependencies: - "@babel/template" "^7.22.5" - "@babel/types" "^7.22.5" - "@babel/helper-function-name@^7.23.0": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" @@ -169,7 +139,7 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.16.7", "@babel/helper-module-imports@^7.22.5": +"@babel/helper-module-imports@^7.16.7": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz#1a8f4c9f4027d23f520bd76b364d44434a72660c" integrity sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg== @@ -270,18 +240,6 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== -"@babel/parser@^7.22.10", "@babel/parser@^7.22.5": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.10.tgz#e37634f9a12a1716136c44624ef54283cabd3f55" - integrity sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ== - -"@babel/plugin-syntax-jsx@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918" - integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-transform-react-jsx-self@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.23.3.tgz#ed3e7dadde046cce761a8e3cf003a13d1a7972d9" @@ -326,15 +284,6 @@ "@babel/parser" "^7.22.15" "@babel/types" "^7.22.15" -"@babel/template@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec" - integrity sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw== - dependencies: - "@babel/code-frame" "^7.22.5" - "@babel/parser" "^7.22.5" - "@babel/types" "^7.22.5" - "@babel/traverse@^7.23.7": version "7.23.7" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.7.tgz#9a7bf285c928cb99b5ead19c3b1ce5b310c9c305" @@ -351,22 +300,6 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/traverse@^7.4.5": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.10.tgz#20252acb240e746d27c2e82b4484f199cf8141aa" - integrity sha512-Q/urqV4pRByiNNpb/f5OSv28ZlGJiFiiTh+GAHktbIrkPhPbl90+uW6SmpoLyZqutrg9AEaEf3Q/ZBRHBXgxig== - dependencies: - "@babel/code-frame" "^7.22.10" - "@babel/generator" "^7.22.10" - "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-function-name" "^7.22.5" - "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.22.10" - "@babel/types" "^7.22.10" - debug "^4.1.0" - globals "^11.1.0" - "@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.23.0", "@babel/types@^7.23.6": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.6.tgz#be33fdb151e1f5a56877d704492c240fc71c7ccd" @@ -376,7 +309,7 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" -"@babel/types@^7.22.10", "@babel/types@^7.22.5": +"@babel/types@^7.22.5": version "7.22.10" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.10.tgz#4a9e76446048f2c66982d1a989dd12b8a2d2dc03" integrity sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg== @@ -439,7 +372,14 @@ resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.9.1.tgz#4ffb0055f7ef676ebc3a5a91fb621393294e2f43" integrity sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ== -"@emotion/is-prop-valid@^1.1.0", "@emotion/is-prop-valid@^1.2.0": +"@emotion/is-prop-valid@1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-1.2.2.tgz#d4175076679c6a26faa92b03bb786f9e52612337" + integrity sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw== + dependencies: + "@emotion/memoize" "^0.8.1" + +"@emotion/is-prop-valid@^1.2.0": version "1.2.1" resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-1.2.1.tgz#23116cf1ed18bfeac910ec6436561ecb1a3885cc" integrity sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw== @@ -493,17 +433,7 @@ "@emotion/use-insertion-effect-with-fallbacks" "^1.0.0" "@emotion/utils" "^1.2.0" -"@emotion/stylis@^0.8.4": - version "0.8.5" - resolved "https://registry.yarnpkg.com/@emotion/stylis/-/stylis-0.8.5.tgz#deacb389bd6ee77d1e7fcaccce9e16c5c7e78e04" - integrity sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ== - -"@emotion/unitless@^0.7.4": - version "0.7.5" - resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.7.5.tgz#77211291c1900a700b8a78cfafda3160d76949ed" - integrity sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg== - -"@emotion/unitless@^0.8.1": +"@emotion/unitless@0.8.1", "@emotion/unitless@^0.8.1": version "0.8.1" resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.8.1.tgz#182b5a4704ef8ad91bde93f7a860a88fd92c79a3" integrity sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ== @@ -2966,6 +2896,11 @@ "@types/react" "*" csstype "^3.0.2" +"@types/stylis@4.2.5": + version "4.2.5" + resolved "https://registry.yarnpkg.com/@types/stylis/-/stylis-4.2.5.tgz#1daa6456f40959d06157698a653a9ab0a70281df" + integrity sha512-1Xve+NMN7FWjY14vLoY5tL3BVEQ/n42YLwaqJIPYhotZ9uBHt87VceMwWQpzmdEt2TNXIorIFG+YeCUUW7RInw== + "@types/tough-cookie@*": version "4.0.5" resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" @@ -3557,17 +3492,6 @@ babel-plugin-macros@^3.1.0: cosmiconfig "^7.0.0" resolve "^1.19.0" -"babel-plugin-styled-components@>= 1.12.0": - version "2.1.4" - resolved "https://registry.yarnpkg.com/babel-plugin-styled-components/-/babel-plugin-styled-components-2.1.4.tgz#9a1f37c7f32ef927b4b008b529feb4a2c82b1092" - integrity sha512-Xgp9g+A/cG47sUyRwwYxGM4bR/jDRg5N6it/8+HxCnbT5XNKSKDT9xm4oag/osgqjC2It/vH0yXsomOG6k558g== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-module-imports" "^7.22.5" - "@babel/plugin-syntax-jsx" "^7.22.5" - lodash "^4.17.21" - picomatch "^2.3.1" - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -4151,7 +4075,7 @@ css-select@^5.1.0: domutils "^3.0.1" nth-check "^2.0.1" -css-to-react-native@^3.0.0: +css-to-react-native@3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-3.2.0.tgz#cdd8099f71024e149e4f6fe17a7d46ecd55f1e32" integrity sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ== @@ -4213,6 +4137,11 @@ cssstyle@^3.0.0: dependencies: rrweb-cssom "^0.6.0" +csstype@3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" + integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw== + csstype@^2.5.2: version "2.6.21" resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.21.tgz#2efb85b7cc55c80017c66a5ad7cbd931fda3a90e" @@ -5491,7 +5420,7 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.1, hoist-non-react-statics@^3.3.2: +hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.1, hoist-non-react-statics@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== @@ -7850,6 +7779,15 @@ postcss-value-parser@^4.0.2: resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== +postcss@8.4.38: + version "8.4.38" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.38.tgz#b387d533baf2054288e337066d81c6bee9db9e0e" + integrity sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A== + dependencies: + nanoid "^3.3.7" + picocolors "^1.0.0" + source-map-js "^1.2.0" + postcss@^8.4.32: version "8.4.32" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.32.tgz#1dac6ac51ab19adb21b8b34fd2d93a86440ef6c9" @@ -8403,7 +8341,7 @@ shallow-clone@^3.0.0: dependencies: kind-of "^6.0.2" -shallowequal@^1.1.0: +shallowequal@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== @@ -8504,6 +8442,11 @@ source-map-js@^1.0.1, source-map-js@^1.0.2: resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== +source-map-js@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" + integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== + source-map@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -8742,28 +8685,32 @@ strong-log-transformer@2.1.0, strong-log-transformer@^2.1.0: minimist "^1.2.0" through "^2.3.4" -styled-components@5.3.11: - version "5.3.11" - resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-5.3.11.tgz#9fda7bf1108e39bf3f3e612fcc18170dedcd57a8" - integrity sha512-uuzIIfnVkagcVHv9nE0VPlHPSCmXIUGKfJ42LNjxCCTDTL5sgnJ8Z7GZBq0EnLYGln77tPpEpExt2+qa+cZqSw== - dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/traverse" "^7.4.5" - "@emotion/is-prop-valid" "^1.1.0" - "@emotion/stylis" "^0.8.4" - "@emotion/unitless" "^0.7.4" - babel-plugin-styled-components ">= 1.12.0" - css-to-react-native "^3.0.0" - hoist-non-react-statics "^3.0.0" - shallowequal "^1.1.0" - supports-color "^5.5.0" +styled-components@^6.1.13: + version "6.1.13" + resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-6.1.13.tgz#2d777750b773b31469bd79df754a32479e9f475e" + integrity sha512-M0+N2xSnAtwcVAQeFEsGWFFxXDftHUD7XrKla06QbpUMmbmtFBMMTcKWvFXtWxuD5qQkB8iU5gk6QASlx2ZRMw== + dependencies: + "@emotion/is-prop-valid" "1.2.2" + "@emotion/unitless" "0.8.1" + "@types/stylis" "4.2.5" + css-to-react-native "3.2.0" + csstype "3.1.3" + postcss "8.4.38" + shallowequal "1.1.0" + stylis "4.3.2" + tslib "2.6.2" stylis@4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.2.0.tgz#79daee0208964c8fe695a42fcffcac633a211a51" integrity sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw== -supports-color@^5.3.0, supports-color@^5.5.0: +stylis@4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.3.2.tgz#8f76b70777dd53eb669c6f58c997bf0a9972e444" + integrity sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg== + +supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== @@ -9011,6 +8958,11 @@ tsconfig-paths@^4.1.2: minimist "^1.2.6" strip-bom "^3.0.0" +tslib@2.6.2, tslib@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + tslib@^1.8.1: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -9021,11 +8973,6 @@ tslib@^2.0.1, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.4.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410" integrity sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig== -tslib@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" - integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== - tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" From 400dacac00a55ebe0a65456b985b6f8e404ef0f8 Mon Sep 17 00:00:00 2001 From: Christopher Berge Hove Date: Mon, 23 Sep 2024 13:01:54 +0200 Subject: [PATCH 2/3] chore: remove unused hook use-store-current-view-id (#759) Co-authored-by: Noggling --- .changeset/pr-759-2080482692.md | 3 + .../components/ContextNotAvailableDialog.tsx | 58 ------------------- .../core/src/context/components/index.ts | 1 - client/packages/core/src/context/index.ts | 1 - .../packages/portal-core/src/hooks/index.ts | 1 - .../src/hooks/use-store-current-view-id.ts | 10 ---- 6 files changed, 3 insertions(+), 71 deletions(-) create mode 100644 .changeset/pr-759-2080482692.md delete mode 100644 client/packages/core/src/context/components/ContextNotAvailableDialog.tsx delete mode 100644 client/packages/core/src/context/components/index.ts delete mode 100644 client/packages/portal-core/src/hooks/use-store-current-view-id.ts diff --git a/.changeset/pr-759-2080482692.md b/.changeset/pr-759-2080482692.md new file mode 100644 index 000000000..017b123fe --- /dev/null +++ b/.changeset/pr-759-2080482692.md @@ -0,0 +1,3 @@ + +--- +--- diff --git a/client/packages/core/src/context/components/ContextNotAvailableDialog.tsx b/client/packages/core/src/context/components/ContextNotAvailableDialog.tsx deleted file mode 100644 index 71cfc956b..000000000 --- a/client/packages/core/src/context/components/ContextNotAvailableDialog.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import { useOnboardedContextsDialog } from '@equinor/portal-core'; -import { Button, Dialog } from '@equinor/eds-core-react'; -import { PortalProgressLoader } from '@equinor/portal-ui'; -import styled from 'styled-components'; - -type ContextNotAvailableDialogProps = { - allowAllContext?: boolean; -}; - -const Style = { - Wrapper: styled.div` - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - z-index: 900; - background-color: #fff; - `, -}; - -export const ContextNotAvailableDialog = ({ allowAllContext }: ContextNotAvailableDialogProps) => { - const { hasContext, clearContext, currentContext, isLoading } = useOnboardedContextsDialog(allowAllContext); - - if (currentContext && isLoading && !allowAllContext) { - return ( - - ; - - ); - } - - return ( - { - clearContext(); - }} - > - {currentContext?.title} not available. - - The selected {currentContext?.type.id.toLowerCase()} is not enabled, please contact a portal - administrator - - - - - - ); -}; diff --git a/client/packages/core/src/context/components/index.ts b/client/packages/core/src/context/components/index.ts deleted file mode 100644 index 98f877754..000000000 --- a/client/packages/core/src/context/components/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { ContextNotAvailableDialog } from './ContextNotAvailableDialog'; diff --git a/client/packages/core/src/context/index.ts b/client/packages/core/src/context/index.ts index 72fa31faa..9fe0e097e 100644 --- a/client/packages/core/src/context/index.ts +++ b/client/packages/core/src/context/index.ts @@ -1,3 +1,2 @@ -export * from './components'; export * from './types/relations'; export { useRelationsByType } from './hooks/use-relations-by-type'; diff --git a/client/packages/portal-core/src/hooks/index.ts b/client/packages/portal-core/src/hooks/index.ts index a0fbe2aa4..4bb46018e 100644 --- a/client/packages/portal-core/src/hooks/index.ts +++ b/client/packages/portal-core/src/hooks/index.ts @@ -3,7 +3,6 @@ export * from './use-context-resolver'; export * from './use-framework-context'; export * from './use-framework-current-context'; export * from './use-portal-client'; -export * from './use-store-current-view-id'; export * from './use-top-bar-actions'; export * from './use-onboarded-contexts'; export * from './use-portal-config'; diff --git a/client/packages/portal-core/src/hooks/use-store-current-view-id.ts b/client/packages/portal-core/src/hooks/use-store-current-view-id.ts deleted file mode 100644 index 66fda31e9..000000000 --- a/client/packages/portal-core/src/hooks/use-store-current-view-id.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { useEffect } from 'react'; -import { Observable } from 'rxjs'; -import { viewStorage } from '../store'; - -export function useStoreCurrentViewId(obs$: Observable) { - useEffect(() => { - const sub = obs$.subscribe(viewStorage.storeId); - return () => sub.unsubscribe(); - }, []); -} From 87276aaed9ad17bbc419ab95093ce341a97671a2 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Tue, 24 Sep 2024 06:27:06 +0000 Subject: [PATCH 3/3] fix: upgrade @equinor/fusion-observable from 8.1.2 to 8.4.0 Snyk has created this PR to upgrade @equinor/fusion-observable from 8.1.2 to 8.4.0. See this package in yarn: @equinor/fusion-observable See this project in Snyk: https://app.snyk.io/org/project-portal-agk/project/10037f30-0258-4361-97c1-e05195d073f1?utm_source=github&utm_medium=referral&page=upgrade-pr --- legacyAppLoader/package.json | 2 +- legacyAppLoader/yarn.lock | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/legacyAppLoader/package.json b/legacyAppLoader/package.json index f76583dd3..2a6228ded 100644 --- a/legacyAppLoader/package.json +++ b/legacyAppLoader/package.json @@ -23,7 +23,7 @@ "@equinor/fusion-framework-module-navigation": "^3.0.6", "@equinor/fusion-framework-react": "^5.3.2", "@equinor/fusion-framework-react-app": "^4.1.9", - "@equinor/fusion-observable": "^8.1.2", + "@equinor/fusion-observable": "^8.4.0", "@equinor/fusion-react-styles": "^0.5.11", "@types/react": "^17.0.70", "@types/react-dom": "^17.0.25", diff --git a/legacyAppLoader/yarn.lock b/legacyAppLoader/yarn.lock index a14862f0f..fd2bf06b0 100644 --- a/legacyAppLoader/yarn.lock +++ b/legacyAppLoader/yarn.lock @@ -636,6 +636,15 @@ rxjs "^7.5.7" uuid "^8.3.2" +"@equinor/fusion-observable@^8.4.0": + version "8.4.1" + resolved "https://registry.yarnpkg.com/@equinor/fusion-observable/-/fusion-observable-8.4.1.tgz#e8d429904313d66339447731594ff9156a009e95" + integrity sha512-MZfZ9X3JGkpdVvO8THBLe6gdtF3kUI16t6COxEKKlpGnZiWUjFIR0ZKqu38q0ve+0u3h5DqV1lSa1qqbXFoDzg== + dependencies: + immer "^9.0.16" + rxjs "^7.8.1" + uuid "^10.0.0" + "@equinor/fusion-query@^4.0.2": version "4.0.2" resolved "https://registry.yarnpkg.com/@equinor/fusion-query/-/fusion-query-4.0.2.tgz#e88bf3872b8859bce8c795e2ee00f64077dcec62" @@ -5897,6 +5906,11 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== +uuid@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-10.0.0.tgz#5a95aa454e6e002725c79055fd42aaba30ca6294" + integrity sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ== + uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"