Skip to content

Commit

Permalink
Merge branch 'main' into feature/infinite-scroll-page-loading-table
Browse files Browse the repository at this point in the history
  • Loading branch information
shahmargi12 committed Sep 9, 2024
2 parents a732804 + a6aa96a commit 7e068ef
Show file tree
Hide file tree
Showing 19 changed files with 596 additions and 190 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v2.227
uses: github/codeql-action/init@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v2.227
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -91,7 +91,7 @@ jobs:
# Automates dependency installation for Python, Ruby, and JavaScript, optimizing the CodeQL analysis setup.
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v2.227
uses: github/codeql-action/autobuild@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v2.227

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -104,6 +104,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v2.227
uses: github/codeql-action/analyze@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v2.227
with:
category: '/language:${{matrix.language}}'
2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
if: steps.dependencies-changed.outputs.changed == 'true'

- name: Upload DEPENDENCIES file
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
path: DEPENDENCIES
if: steps.dependencies-changed.outputs.changed == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ jobs:
# Upload findings to GitHub Advanced Security Dashboard
- name: Upload SARIF file for GitHub Advanced Security Dashboard
if: always()
uses: github/codeql-action/upload-sarif@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5
uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
with:
sarif_file: kicsResults/results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
vuln-type: 'os,library'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5
uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
if: always()
with:
sarif_file: 'trivy-results1.sarif'
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## [3.5.1](https://github.com/eclipse-tractusx/portal-shared-components/compare/v3.5.0...v3.5.1) (2024-09-05)


### Bug Fixes

* **chor:** pretty ([b8c5264](https://github.com/eclipse-tractusx/portal-shared-components/commit/b8c5264ec5d442bd8d06459b7347e5591c1d8c7b))
* **chor:** update version number ([3f03f0e](https://github.com/eclipse-tractusx/portal-shared-components/commit/3f03f0e8a01dcce597e6916fd8c882f630d5a490))
* **table:** add new props to support multiple buttons in table component ([e0e7271](https://github.com/eclipse-tractusx/portal-shared-components/commit/e0e72713bc00523dcb11e0810c97ab702c6b87af))
* **table:** support buttons props ([9ea1295](https://github.com/eclipse-tractusx/portal-shared-components/commit/9ea12951b17a737332b25018e10d78517cba499f))

## [3.5.0](https://github.com/eclipse-tractusx/portal-shared-components/compare/v3.4.0...v3.5.0) (2024-09-03)

### Features

- **new toggle switch:** dependencies check failed issue fixed ([8546941](https://github.com/eclipse-tractusx/portal-shared-components/commit/8546941870a4591316201ae2c35a89f58b84e3f4))
- **new toggle switch:** implement new toggle switch design ([c5b5481](https://github.com/eclipse-tractusx/portal-shared-components/commit/c5b5481ccba9fb60d3134fbbc08890377a92266a))
- **new toggle switch:** version change and revert changelog changes ([6bf9c9a](https://github.com/eclipse-tractusx/portal-shared-components/commit/6bf9c9a1130539d626a31739470640e4e0a1f8a7))
- **toggle switch:** implement new toggle switch design ([2a4c87c](https://github.com/eclipse-tractusx/portal-shared-components/commit/2a4c87ce8ab9a1cf6c67f3b5bbd2972c3675c282))

### Bug Fixes

- **chor:** update dependency file ([ffd77bc](https://github.com/eclipse-tractusx/portal-shared-components/commit/ffd77bc5753af35b8167e385a90b2da126259b7e))
- **dailog:** add mdx file to the dailog component ([df0db55](https://github.com/eclipse-tractusx/portal-shared-components/commit/df0db55da522344c489e236760ca3dc7286b86f8))
- **dialog:** add mdx file to the dialog component ([c2cfd75](https://github.com/eclipse-tractusx/portal-shared-components/commit/c2cfd75bd74850eece1ccdec33858d4d67c26851))
- update 'add service card' design & add app card variant in storybook ([8c72d7a](https://github.com/eclipse-tractusx/portal-shared-components/commit/8c72d7a2de005cc546169446359d0f0faf85314c))

## [3.4.0](https://github.com/eclipse-tractusx/portal-shared-components/compare/v3.3.0...v3.4.0) (2024-08-28)

### Features
Expand Down
39 changes: 21 additions & 18 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ npm/npmjs/-/eslint-plugin-import/2.29.1, MIT, approved, #11187
npm/npmjs/-/eslint-plugin-n/16.6.2, MIT, approved, #12657
npm/npmjs/-/eslint-plugin-promise/6.1.1, ISC, approved, clearlydefined
npm/npmjs/-/eslint-plugin-react-hooks/4.6.2, MIT, approved, clearlydefined
npm/npmjs/-/eslint-plugin-react-refresh/0.4.9, MIT, approved, clearlydefined
npm/npmjs/-/eslint-plugin-react-refresh/0.4.11, MIT, approved, clearlydefined
npm/npmjs/-/eslint-plugin-react/7.34.4, MIT, approved, #13825
npm/npmjs/-/eslint-plugin-storybook/0.8.0, MIT, approved, clearlydefined
npm/npmjs/-/eslint-scope/5.1.1, BSD-2-Clause, approved, clearlydefined
Expand Down Expand Up @@ -593,7 +593,7 @@ npm/npmjs/-/restore-cursor/3.1.0, MIT, approved, clearlydefined
npm/npmjs/-/reusify/1.0.4, MIT, approved, clearlydefined
npm/npmjs/-/rimraf/2.6.3, ISC, approved, clearlydefined
npm/npmjs/-/rimraf/3.0.2, ISC, approved, clearlydefined
npm/npmjs/-/rollup/4.13.0, MIT, approved, clearlydefined
npm/npmjs/-/rollup/4.21.2, MIT, approved, clearlydefined
npm/npmjs/-/run-parallel/1.2.0, MIT, approved, clearlydefined
npm/npmjs/-/safe-array-concat/1.1.2, MIT, approved, clearlydefined
npm/npmjs/-/safe-buffer/5.2.1, MIT, approved, clearlydefined
Expand Down Expand Up @@ -726,7 +726,7 @@ npm/npmjs/-/validator/13.11.0, MIT, approved, clearlydefined
npm/npmjs/-/vary/1.1.2, MIT, approved, clearlydefined
npm/npmjs/-/vite-plugin-dts/3.7.3, MIT, approved, #14014
npm/npmjs/-/vite-plugin-lib-inject-css/2.0.1, MIT, approved, #14016
npm/npmjs/-/vite/5.4.1, MIT AND (ISC AND MIT) AND (Apache-2.0 AND BSD-2-Clause AND BlueOak-1.0.0 AND CC0-1.0 AND ISC AND MIT) AND (BSD-3-Clause AND MIT) AND ISC AND (BSD-2-Clause AND BSD-3-Clause), approved, #15844
npm/npmjs/-/vite/5.4.2, MIT AND (ISC AND MIT) AND (Apache-2.0 AND BSD-2-Clause AND BlueOak-1.0.0 AND CC0-1.0 AND ISC AND MIT) AND (BSD-3-Clause AND MIT) AND ISC AND (BSD-2-Clause AND BSD-3-Clause), approved, #15844
npm/npmjs/-/void-elements/3.1.0, MIT, approved, clearlydefined
npm/npmjs/-/vue-template-compiler/2.7.16, 0BSD AND MIT AND MIT, approved, #3476
npm/npmjs/-/vue-tsc/1.8.27, MIT, approved, clearlydefined
Expand Down Expand Up @@ -811,7 +811,7 @@ npm/npmjs/@babel/helper-wrap-function/7.25.0, MIT, approved, clearlydefined
npm/npmjs/@babel/helpers/7.25.0, MIT, approved, clearlydefined
npm/npmjs/@babel/highlight/7.24.7, MIT AND (BSD-2-Clause AND ISC AND MIT) AND BSD-2-Clause AND BSD-3-Clause, approved, #13941
npm/npmjs/@babel/parser/7.24.8, MIT AND (BSD-2-Clause AND ISC AND MIT) AND BSD-2-Clause AND BSD-3-Clause, approved, #13492
npm/npmjs/@babel/parser/7.25.3, MIT, approved, clearlydefined
npm/npmjs/@babel/parser/7.25.3, MIT AND (BSD-2-Clause AND ISC AND MIT) AND BSD-2-Clause AND BSD-3-Clause, approved, #16041
npm/npmjs/@babel/plugin-bugfix-firefox-class-in-computed-class-key/7.25.3, MIT, approved, clearlydefined
npm/npmjs/@babel/plugin-bugfix-safari-class-field-initializer-scope/7.25.0, MIT, approved, clearlydefined
npm/npmjs/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/7.25.0, MIT, approved, clearlydefined
Expand Down Expand Up @@ -915,7 +915,7 @@ npm/npmjs/@babel/template/7.24.7, MIT, approved, clearlydefined
npm/npmjs/@babel/template/7.25.0, MIT, approved, clearlydefined
npm/npmjs/@babel/traverse/7.24.8, MIT AND (BSD-2-Clause AND ISC AND MIT) AND BSD-2-Clause AND BSD-3-Clause, approved, #13926
npm/npmjs/@babel/traverse/7.25.3, MIT, approved, clearlydefined
npm/npmjs/@babel/types/7.25.2, MIT, approved, clearlydefined
npm/npmjs/@babel/types/7.25.2, MIT AND (BSD-2-Clause AND ISC AND MIT) AND BSD-2-Clause AND BSD-3-Clause, approved, #16040
npm/npmjs/@base2/pretty-print-object/1.0.1, BSD-2-Clause, approved, clearlydefined
npm/npmjs/@bcoe/v8-coverage/0.2.3, ISC AND MIT, approved, clearlydefined
npm/npmjs/@chromatic-com/storybook/1.6.1, MIT AND (BSD-2-Clause AND ISC AND MIT), approved, #15710
Expand Down Expand Up @@ -1016,19 +1016,22 @@ npm/npmjs/@nodelib/fs.stat/2.0.5, MIT, approved, clearlydefined
npm/npmjs/@nodelib/fs.walk/1.2.8, MIT, approved, clearlydefined
npm/npmjs/@popperjs/core/2.11.8, MIT, approved, clearlydefined
npm/npmjs/@rollup/pluginutils/5.1.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-android-arm-eabi/4.13.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-android-arm64/4.13.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-darwin-arm64/4.13.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-darwin-x64/4.13.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-arm-gnueabihf/4.13.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-arm64-gnu/4.13.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-arm64-musl/4.13.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-riscv64-gnu/4.13.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-x64-gnu/4.13.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-x64-musl/4.13.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-win32-arm64-msvc/4.13.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-win32-ia32-msvc/4.13.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-win32-x64-msvc/4.13.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-android-arm-eabi/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-android-arm64/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-darwin-arm64/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-darwin-x64/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-arm-gnueabihf/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-arm-musleabihf/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-arm64-gnu/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-arm64-musl/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-powerpc64le-gnu/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-riscv64-gnu/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-s390x-gnu/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-x64-gnu/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-x64-musl/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-win32-arm64-msvc/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-win32-ia32-msvc/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-win32-x64-msvc/4.21.2, MIT, approved, clearlydefined
npm/npmjs/@rushstack/node-core-library/3.62.0, MIT, approved, clearlydefined
npm/npmjs/@rushstack/rig-package/0.5.1, MIT, approved, clearlydefined
npm/npmjs/@rushstack/ts-command-line/4.17.1, MIT, approved, clearlydefined
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": "3.4.0",
"version": "3.5.1",
"description": "Catena-X Portal Shared Components",
"author": "Catena-X Contributors",
"license": "Apache-2.0",
Expand Down
82 changes: 82 additions & 0 deletions src/components/basic/Dialog/Dailog.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/}

import { Story, Meta } from '@storybook/blocks'
import { SharedThemeProvider } from '../SharedThemeProvider'
import { SharedCssBaseline } from '../SharedCssBaseline'
import { DialogHeader } from './DialogHeader'
import { DialogContent } from './DialogContent'
import { DialogActions } from './DialogActions'
import { Button } from '../Button'
import { Dialog } from '.'


<Meta title="Design Guidelines/Modal" />


#### Modal Description:
A modal is a dialog window that is displayed on top of the main application content. It is used to capture user attention and prompt them to perform an action or provide additional information without leaving the current context. Our modals are designed to be flexible and can include a variety of content, such as text, tables, input fields, buttons, and expandable components.
<br /> <br />
#### Do's:
* **Use modals for critical user interactions** that require immediate attention, such as confirming a delete action or completing a multi-step process.
* **Keep the content simple and focused**. A modal should contain only what is necessary to complete the task at hand.
* **Include a clear and visible way to close the modal**, such as a close button or an 'X' in the top corner.
* **Trap focus within the modal** when it is open to maintain accessibility standards.
* **Implement keyboard navigation** within the modal, allowing users to tab through inputs and select options.
* **Use modals sparingly** to avoid disrupting the user's workflow.
* **Test modals for responsiveness** to ensure they are usable on all devices and screen sizes.
* **Document all variations** of modals in Storybook, providing clear examples of use cases.
<br /> <br />
#### Don'ts:
* **Don't overuse modals**, as they can become disruptive and annoying if they are too frequent.
* **Don't include too much information** that can overwhelm the user. Modals are meant to be focused and to-the-point.
* **Don't make modals too complex**. If a process is too long, consider breaking it up into smaller steps or using a different UI pattern.
* **Don't forget to test for accessibility**. All users should be able to interact with the modal content.
* **Don't use modals for non-essential information** that can be displayed within the main content of the page.
* **Don't neglect mobile users**. Ensure modals are just as functional and aesthetically pleasing on mobile devices.
<br /> <br />

#### Modal Header
<br />

<SharedThemeProvider>
<SharedCssBaseline />
<DialogHeader title={'title'} intro={'introduction description goes her'} />
</SharedThemeProvider>
<br /> <br />

#### Modal content
<br />

<SharedThemeProvider>
<SharedCssBaseline />
<DialogContent>Content goes here</DialogContent>
</SharedThemeProvider>
<br /> <br />

#### Modal Actions
<br />

<SharedThemeProvider>
<SharedCssBaseline />
<DialogActions>
<Button variant="outlined">Cancel</Button>
<Button variant="contained">Confirm</Button>
</DialogActions>
</SharedThemeProvider>
19 changes: 19 additions & 0 deletions src/components/basic/Table/components/Toolbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ interface SearchInputState {
text: string
}

export interface AdditionalButtonsType {
title?: string
click?: React.MouseEventHandler
icon?: JSX.Element
}

export interface ToolbarProps {
title?: string
rowsCount?: number
Expand All @@ -71,6 +77,7 @@ export interface ToolbarProps {
selectedFilter?: SelectedFilter
onClearSearch?: () => void
autoFocus?: boolean
buttons?: AdditionalButtonsType[]
}

const getIconColor = (openFilter: boolean) => {
Expand Down Expand Up @@ -99,6 +106,7 @@ export const Toolbar = ({
selectedFilter,
onClearSearch,
autoFocus,
buttons,
}: ToolbarProps) => {
const { spacing } = useTheme()
const isSearchText = searchExpr && searchExpr !== ''
Expand Down Expand Up @@ -223,6 +231,17 @@ export const Toolbar = ({
{secondButtonLabel}
</Button>
)}
{buttons?.map((button) => (
<Button
key={button.title}
startIcon={button.icon}
size="small"
onClick={button.click}
sx={{ marginLeft: 5 }}
>
{button.title}
</Button>
))}
</Box>
<Box sx={{ display: 'flex', justifyContent: 'flex-end' }}>
{openSearch ? (
Expand Down
9 changes: 8 additions & 1 deletion src/components/basic/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ import {
} from '@mui/x-data-grid'
import { Box, Stack } from '@mui/material'
import { StatusTag } from './components/StatusTag'
import { Toolbar, type ToolbarProps } from './components/Toolbar'
import {
type AdditionalButtonsType,
Toolbar,
type ToolbarProps,
} from './components/Toolbar'
import { UltimateToolbar } from './components/Toolbar/UltimateToolbar'
import { theme } from '../../../theme'
import { SearchAndFilterButtonToolbar } from './components/Toolbar/SearchAndFilterButtonToolbar'
Expand Down Expand Up @@ -83,6 +87,7 @@ export interface TableProps extends DataGridProps {
hasMore?: boolean
loadLabel?: string
nextPage?: () => void
buttons?: AdditionalButtonsType[]
}

export const Table = ({
Expand Down Expand Up @@ -126,6 +131,7 @@ export const Table = ({
hasMore = false,
loadLabel = 'load more',
nextPage,
buttons,
...props
}: TableProps) => {
const toolbarProps = {
Expand All @@ -151,6 +157,7 @@ export const Table = ({
sortOptions,
onSortClick,
autoFocus,
buttons,
}

// TODO: this method contains application specific row attributes and must therefore
Expand Down
Loading

0 comments on commit 7e068ef

Please sign in to comment.