Skip to content

Commit

Permalink
bugfix(common): fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
oyo authored Nov 24, 2023
2 parents 5428ad0 + 95916f1 commit a402daf
Show file tree
Hide file tree
Showing 44 changed files with 416 additions and 355 deletions.
8 changes: 4 additions & 4 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ const withI18next = (Story) => {
<Story />
</I18nextProvider>
</SharedThemeProvider>
);
};
)
}

export const decorators = [withI18next];
export const decorators = [withI18next]

export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
Expand All @@ -44,4 +44,4 @@ export const parameters = {
date: /Date$/,
},
},
}
}
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.1.11

- Fix general issues

## 2.1.10

- fix(image gallery): responsiveness fix for number of images to show
Expand Down Expand Up @@ -40,7 +44,7 @@
## 2.1.1

- Migrate MUI date picker to v6

## 2.0.34

- Linter Findings
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@catena-x/portal-shared-components",
"version": "2.1.10",
"version": "2.1.11",
"description": "Catena-X Portal Shared Components",
"author": "Catena-X Contributors",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/basic/Breadcrumb/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { BackButton, type BackButtonProps } from '../Button/BackButton'

interface BreadcrumbProps {
onBackButtonClick?: React.MouseEventHandler
breadcrumbs: []
breadcrumbs: [] | JSX.Element[]
}

export const Breadcrumb = ({
Expand Down
8 changes: 4 additions & 4 deletions src/components/basic/Carousel/CarouselBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ export interface CarouselProps {
}

export interface CarouselNavArrows {
className?: string,
style?: React.CSSProperties,
onClick?: React.MouseEventHandler,
show: boolean,
className?: string
style?: React.CSSProperties
onClick?: React.MouseEventHandler
show: boolean
isNext: boolean
}

Expand Down
8 changes: 6 additions & 2 deletions src/components/basic/Carousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ export const Carousel = ({
position = 'relative',
}: CarouselProps) => {
const [showArrows, setShowArrows] = useState(false)
const onMouseEnter = () => { setShowArrows(true) }
const onMouseLeave = () => { setShowArrows(false) }
const onMouseEnter = () => {
setShowArrows(true)
}
const onMouseLeave = () => {
setShowArrows(false)
}
const arrayChildren = Children.toArray(children)

useEffect(() => {
Expand Down
17 changes: 11 additions & 6 deletions src/components/basic/Datepicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ export const Datepicker = ({
const ServerDay = (props: PickersDayProps<Date>) => {
const { selected, day, today } = props
const bgColor = today ? todayColor : '#ffffff'
const bgSelected = selected
? daySelectedColor
: bgColor
const bgSelected = selected ? daySelectedColor : bgColor
const colorSelected = selected ? '#fff' : '#202020'
const isBold = today ? '500' : '400'

Expand Down Expand Up @@ -169,9 +167,16 @@ export const Datepicker = ({
}}
slotProps={{
textField: {
variant, onClick: handleOpen, label, helperText, error,
margin, disabled, focused: open, inputProps: { placeholder }
}
variant,
onClick: handleOpen,
label,
helperText,
error,
margin,
disabled,
focused: open,
inputProps: { placeholder },
},
}}
/>
</LocalizationProvider>
Expand Down
3 changes: 2 additions & 1 deletion src/components/basic/Dialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const MODAL_DEFAULT_WIDTH = '1000px'

interface AddtionalDialogProps {
modalBorderRadius?: number
additionalModalRootStyles?: React.CSSProperties
// eslint-disable-next-line
additionalModalRootStyles?: any
}

export type DialogProps = Pick<
Expand Down
3 changes: 2 additions & 1 deletion src/components/basic/ImageGallery/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ export interface ImageType {
modalWidth?: string
width?: string
height?: string
additionalStyles?: React.CSSProperties
// eslint-disable-next-line
additionalStyles?: any
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { SelectedTag } from './SelectedTag'
import { type TagSizeType } from '..'

interface SelectAddMoreProps {
selected: Array<{keyTitle: string}>
selected: Array<{ keyTitle: string }>
buttonAddMore: string
notItemsText: string
label: string
Expand Down Expand Up @@ -75,7 +75,7 @@ export const SelectAddMore = ({
}}
>
{selected.length > 0 ? (
selected.map(item => (
selected.map((item) => (
<SelectedTag
title={item.keyTitle}
size={tagSize}
Expand Down
18 changes: 9 additions & 9 deletions src/components/basic/MultiSelectList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface PartsType {
text: string
highlight: boolean
}
export type IHashMap<T> = Record<string, T>;
export type IHashMap<T> = Record<string, T>

export interface MultiSelectListProps
extends Omit<TextFieldProps, 'variant' | 'size'> {
Expand Down Expand Up @@ -81,7 +81,7 @@ export const MultiSelectList = ({
const theme = useTheme()
const [selected, setSelected] = useState<[]>([])
const [showItems, setShowItems] = useState(false)

// Add an ESLint exception until there is a solution
// eslint-disable-next-line
const handleChange = (selectedItems: any) => {
Expand All @@ -97,7 +97,7 @@ export const MultiSelectList = ({
? filterOptionsArgs
: {
matchFrom: 'any',
stringify: (option: {keyTitle: string}) => option.keyTitle
stringify: (option: { keyTitle: string }) => option.keyTitle,
}
)

Expand Down Expand Up @@ -140,16 +140,16 @@ export const MultiSelectList = ({
multiple
disabled={disabled}
options={items.map((item) => item)}
// Add an ESLint exception until there is a solution
// eslint-disable-next-line
// Add an ESLint exception until there is a solution
// eslint-disable-next-line
getOptionLabel={(option: any) => option[keyTitle]}
value={selected}
filterOptions={filterOptions}
// Add an ESLint exception until there is a solution
// eslint-disable-next-line
renderTags={(selectedItems: any[], getTagProps) =>
// Add an ESLint exception until there is a solution
// eslint-disable-next-line
renderTags={(selectedItems: any[], getTagProps) =>
// Add an ESLint exception until there is a solution
// eslint-disable-next-line
selectedItems.map((option: any, index: number) => (
<Chip
{...getTagProps({ index })}
Expand Down Expand Up @@ -206,7 +206,7 @@ export const MultiSelectList = ({
/>
)
}}
onChange={(_,selectedItems) => {
onChange={(_, selectedItems) => {
handleChange(selectedItems)
}}
onBlur={() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/basic/ProcessList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const ProcessList = ({
key={i}
step={item.step}
headline={item.headline}
description={item.description}
description={item.description ?? ''}
stepsColor={stepsColor}
stepsFontColor={stepsFontColor}
lastItem={item.step === elementNumbers}
Expand Down
11 changes: 7 additions & 4 deletions src/components/basic/SelectList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import isEqual from 'lodash/isEqual'
import { useState } from 'react'

interface SelectListProps extends Omit<TextFieldProps, 'variant'> {
items: []
// eslint-disable-next-line
items: any
label: string
placeholder: string
keyTitle: string
Expand All @@ -39,7 +40,8 @@ interface SelectListProps extends Omit<TextFieldProps, 'variant'> {
noOptionsText?: string
defaultValue?: unknown
disableClearable?: boolean
onChangeItem: (items: []) => void
// eslint-disable-next-line
onChangeItem: (items: any) => void
}

export const SelectList = ({
Expand Down Expand Up @@ -74,7 +76,8 @@ export const SelectList = ({
noOptionsText={noOptionsText}
ListboxProps={{ style: { maxHeight: selectHeight } }}
disabled={disabled}
options={items.map((item) => item)}
// eslint-disable-next-line
options={items.map((item: any) => item)}
getOptionLabel={(option) => option[keyTitle] || ''}
onChange={(_, reason) => {
setSelected(reason)
Expand Down Expand Up @@ -107,4 +110,4 @@ export const SelectList = ({
}}
/>
)
}
}
21 changes: 15 additions & 6 deletions src/components/basic/StaticTable/VerticalTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export const VerticalTable = ({
data: TableType
handleEdit?: (inputValue: string) => void
}) => {
const [inputField, setInputField] = useState<{row: unknown, column: unknown} | null>()
const [inputField, setInputField] = useState<{
row: unknown
column: unknown
} | null>()
const [inputValue, setInputValue] = useState('')
const [inputErrorMsg, setInputErrorMessage] = useState('')

Expand Down Expand Up @@ -91,7 +94,9 @@ export const VerticalTable = ({
</Tooltips>
)}
<CloseIcon
onClick={() => { setInputField(null) }}
onClick={() => {
setInputField(null)
}}
sx={{ marginTop: '25px' }}
/>
</div>
Expand All @@ -101,7 +106,9 @@ export const VerticalTable = ({
return (
<table
style={{ width: '100%', borderCollapse: 'collapse' }}
onClick={() => { setInputField(null) }}
onClick={() => {
setInputField(null)
}}
>
<thead>
<tr>
Expand Down Expand Up @@ -137,8 +144,8 @@ export const VerticalTable = ({
>
<div style={{ display: 'flex', alignItems: 'center' }}>
{inputField &&
inputField.row === r &&
inputField.column === c ? (
inputField.row === r &&
inputField.column === c ? (
renderInputField(r, c)
) : (
<Link
Expand Down Expand Up @@ -185,7 +192,9 @@ export const VerticalTable = ({
) : (
<span style={{ marginLeft: 'auto' }}>
<EditIcon
onClick={(e) => { handleEditFn(e, r, c) }}
onClick={(e) => {
handleEditFn(e, r, c)
}}
sx={{
fontSize: '18px',
color: '#888888',
Expand Down
8 changes: 4 additions & 4 deletions src/components/basic/Stepper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import { Box } from '@mui/material'
import { StepperItem } from './StepperItem'

export interface StepList {
step: number,
headline: string,
description: string,
text?: string,
step: number
headline: string
description?: string
text?: string
color?: string
}

Expand Down
42 changes: 21 additions & 21 deletions src/components/basic/SubNavigation/ParentSubNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import { Button } from '../Button'
import EastIcon from '@mui/icons-material/East'

export interface NavigationItem {
export interface NavigationItem {
index: number
title: string
navigation: string
navigation: string
}

export const ParentSubNavigation = ({
Expand All @@ -36,25 +36,25 @@ export const ParentSubNavigation = ({
}) => {
return (
<>
{navigationArray?.map(
(link: NavigationItem) => {
return (
<Button
key={link.index}
onClick={() => { onClick(link.navigation) }}
color="secondary"
variant="text"
size="medium"
sx={{
fontSize: '16px',
}}
>
<EastIcon sx={{ marginRight: '16px', fontSize: '15px' }} />
{link.title}
</Button>
)
}
)}
{navigationArray?.map((link: NavigationItem) => {
return (
<Button
key={link.index}
onClick={() => {
onClick(link.navigation)
}}
color="secondary"
variant="text"
size="medium"
sx={{
fontSize: '16px',
}}
>
<EastIcon sx={{ marginRight: '16px', fontSize: '15px' }} />
{link.title}
</Button>
)
})}
</>
)
}
Loading

0 comments on commit a402daf

Please sign in to comment.