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

[Snyk] Upgrade typescript from 5.1.6 to 5.5.4 #776

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changeset/pr-759-2080482692.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

---
---
3 changes: 3 additions & 0 deletions .changeset/pr-770-2086136734.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

---
---
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export const Styles = {
margin-inline-start: 0px;
margin-inline-end: 0px;
padding-inline-start: 0;
/* gap: 1rem; */
`,
};

Expand All @@ -72,7 +71,7 @@ export const AppGroup = ({ group, onFavorite, dark, onClick }: AppGroupProps) =>
return (
<Styles.Group id={`groupe-${group.name}`}>
<Styles.Nav>
<Styles.Title isActive={isGroupActive} id={`groupe-${group.name}-name`} title={group.name}>
<Styles.Title isActive={isGroupActive} id={`groupe-${group.name}-name`} title={group.name || ''}>
{group.name}
</Styles.Title>
<Styles.List>
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion client/packages/core/src/context/components/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion client/packages/core/src/context/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './components';
export * from './types/relations';
export { useRelationsByType } from './hooks/use-relations-by-type';
1 change: 0 additions & 1 deletion client/packages/portal-core/src/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

This file was deleted.

134 changes: 78 additions & 56 deletions client/packages/service-message/components/ServiceMessageCard.tsx
Original file line number Diff line number Diff line change
@@ -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<HTMLDivElement>(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 (<StyledCard key={message.id} ref={ref}>
<StyledCardIndicator color={variant.color} />
<StyledContentWrapper>
<StyledHeaderWrapper >
<StyledHeaderItem>
<Icon {...variant} />
<StyledHeader width={ref.current?.offsetWidth ? ref.current?.offsetWidth - 300 : 200} title={message.title} token={tokens.typography.ui.accordion_header}>{message.title}
</StyledHeader>
</StyledHeaderItem>
<StyledHeaderItem>
<StyledTime variant="overline" >
<TimeStamp date={message.timestamp} />
</StyledTime>
{onClose ? <Button variant="ghost_icon" onClick={() => onClose()} >
<Icon name="close" />
</Button> : <Button variant="ghost_icon" disabled={!message.content} onClick={() => {
setShowContent(state => !state)
}} >
<Icon name={getIconName(showContent)} />
</Button>}
</StyledHeaderItem>
const getIconName = (active: boolean) => (active ? 'chevron_up' : 'chevron_down');

</StyledHeaderWrapper>
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<HTMLDivElement>(null);

{showContent && message.content &&
<StyledContent>
<MarkdownViewer markdown={message.content} />
</StyledContent>
}
return (
<StyledCard key={message.id} ref={ref}>
<StyledCardIndicator color={variant.color} />
<StyledContentWrapper>
<StyledHeaderWrapper>
<StyledHeaderItem>
<Icon {...variant} />
<StyledHeader
width={ref.current?.offsetWidth ? ref.current?.offsetWidth - 300 : 200}
title={message.title || ''}
token={tokens.typography.ui.accordion_header}
>
{message.title}
</StyledHeader>
</StyledHeaderItem>
<StyledHeaderItem>
<StyledTime variant="overline">
<TimeStamp date={message.timestamp} />
</StyledTime>
{onClose ? (
<Button variant="ghost_icon" onClick={() => onClose()}>
<Icon name="close" />
</Button>
) : (
<Button
variant="ghost_icon"
disabled={!message.content}
onClick={() => {
setShowContent((state) => !state);
}}
>
<Icon name={getIconName(showContent)} />
</Button>
)}
</StyledHeaderItem>
</StyledHeaderWrapper>

</StyledContentWrapper>
</StyledCard>)
}
{showContent && message.content && (
<StyledContent>
<MarkdownViewer markdown={message.content} />
</StyledContent>
)}
</StyledContentWrapper>
</StyledCard>
);
};
Loading
Loading