Skip to content

Commit

Permalink
Merge branch 'main' into feature/CPLP-3576/StepperUpdates
Browse files Browse the repository at this point in the history
  • Loading branch information
oyo authored Jan 8, 2024
2 parents 878f1da + 92240bb commit d80bd08
Show file tree
Hide file tree
Showing 13 changed files with 419 additions and 11 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/pullRequest-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# #############################################################################
# Copyright (c) 2023 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
# #############################################################################

name: "Lint PullRequest"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fail, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
Details:
```
${{ steps.lint_pr_title.outputs.error_message }}
```
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
# Changelog

## 2.1.14
## 2.1.15

- Add tooltip hint in stepper and make stepper responsive

## 2.1.14

- Technical Improvement: Search Element (active search & delete icon)

## 2.1.13

- Order Status Button UI changes

## 2.1.12

- New Sub Navigation Component which supportrs overlay of links and buttons

## 2.1.11

- Fix general issues

## 2.1.10

- fix(image gallery): responsiveness fix for number of images to show
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.12",
"version": "2.1.15",
"description": "Catena-X Portal Shared Components",
"author": "Catena-X Contributors",
"license": "Apache-2.0",
Expand Down
4 changes: 1 addition & 3 deletions src/components/basic/Menu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ export const MenuItem = ({
}}
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
onClick={(e) => {
(onClick == null || disable) ?? onClick(e)
}}
onClick={(e) => {(onClick == null || disable) ?? onClick(e)}}
>
<Link
component={component}
Expand Down
89 changes: 89 additions & 0 deletions src/components/basic/NewSubNavigation/NewSubNavigation.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/********************************************************************************
* Copyright (c) 2021, 2023 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 { ComponentStory } from '@storybook/react'
import { NewSubNavigation as Component } from '.'

export default {
title: 'Navigation',
component: Component,
argTypes: {},
}

const Template: ComponentStory<typeof Component> = (args: any) => (
<Component {...args} />
)

export const NewSubNavigation = Template.bind({})
NewSubNavigation.args = {
title: 'Sub Menu',
navigationArray: [
{
index: 1,
title: 'Introduction',
navigation: 'intro-id',
},
{
index: 2,
title: 'Core Values',
navigation: 'core-id',
},
{
index: 3,
title: 'Benefits',
navigation: 'advantage-id',
},
{
index: 4,
title: 'Terminology',
navigation: 'terminology-id',
},
{
index: 5,
title: 'Data models',
navigation: 'data-model-id',
},
{
index: 6,
title: 'Data exchange',
navigation: 'data-exchange-id',
},
{
index: 7,
title: 'Connectivity-Portfolio',
navigation: 'connection-id',
},
{
index: 8,
title: 'Business Applications',
navigation: 'application-id',
},
],
buttonArray: [
{
buttonLabel: 'Button1',
onButtonClick: () => console.log('Button1'),
},
{
buttonLabel: 'Button1',
onButtonClick: () => console.log('Button1'),
},
],
onClick: () => console.log('on navigation link click'),
}
178 changes: 178 additions & 0 deletions src/components/basic/NewSubNavigation/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
/********************************************************************************
* Copyright (c) 2021, 2023 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 { Button } from '../Button'
import EastIcon from '@mui/icons-material/East'
import MoreVertIcon from '@mui/icons-material/MoreVert'
import { Box, Divider } from '@mui/material'
import { useState } from 'react'
import { Typography } from '../Typography'
import './styles.scss'

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

export interface NavigationButton {
buttonLabel: string
onButtonClick: React.MouseEventHandler
}

export const NewSubNavigation = ({
title = 'Contents',
navigationArray,
buttonArray = [],
onClick,
updateHeaderTitle = false,
}: {
title?: string
navigationArray: NavigationItem[]
buttonArray?: NavigationButton[]
onClick: (navigation: string) => void
updateHeaderTitle?: boolean
}): JSX.Element => {
const [show, setShow] = useState(false)
const [header, setHeader] = useState(title)
const [highlight, setHighlight] = useState('')
return (
<Box onMouseOver={() => { setShow(true) }}>
{navigationArray?.length > 0 && (
<Box
className="navigationParentContainer"
onMouseLeave={() => { setShow(false) }}
>
<Box className="navigationContainer">
<Box className="navigationOverlayContainer">
<MoreVertIcon />
<Typography
variant="h4"
sx={{
marginLeft: '10px',
fontSize: '14px',
color: '#0f71cb',
}}
>
{header}
</Typography>
{show && (
<Box className="navigationOverlay">
{navigationArray?.map((link: NavigationItem) => {
return (
<Box
key={link.index}
onClick={() => {
onClick(link.navigation)
setShow(!show)
if (updateHeaderTitle) {
setHeader(link.title)
}
}}
className="navigationOverlayItem"
onMouseOut={() => { setHighlight(link.title) }}
onMouseOver={() => {
// do nothing
}}
sx={{
backgroundColor:
header === link.title || highlight === link.title
? 'rgba(15, 113, 203, 0.05)'
: 'transparent',
}}
>
<EastIcon
sx={{
marginRight: '16px',
fontSize: '18px',
color:
header === link.title || highlight === link.title
? '#0f71cb'
: '#EAF1FE',
}}
/>
<Typography
variant="h4"
sx={{
color:
header === link.title || highlight === link.title
? '#111111'
: '#888888',
fontSize: '14px',
}}
>
{link.title}
</Typography>
</Box>
)
})}
{buttonArray?.length > 1 && (
<Divider
sx={{
margin: '10px 0px',
borderWidth: '1px',
width: '100%',
}}
/>
)}
{buttonArray?.length > 1 &&
buttonArray?.map((btn: NavigationButton) => {
return (
<Button
key={btn.buttonLabel}
onClick={(e) => {
btn.onButtonClick(e)
setShow(!show)
}}
color="secondary"
variant="outlined"
size="small"
sx={{
marginTop: '10px',
}}
>
{btn.buttonLabel}
</Button>
)
})}
</Box>
)}
</Box>
{buttonArray?.length === 1 && (
<Button
onClick={(e) => {
buttonArray[0].onButtonClick(e)
setShow(!show)
}}
color="secondary"
variant="outlined"
size="small"
sx={{
marginTop: '10px',
}}
>
{buttonArray[0].buttonLabel}
</Button>
)}
</Box>
</Box>
)}
</Box>
)
}
Loading

0 comments on commit d80bd08

Please sign in to comment.