Skip to content

Commit

Permalink
Merge branch 'main' into feat/657/allow-clientid-for-rolecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
oyo authored Sep 11, 2024
2 parents fcf136d + 062ae3a commit 919ddf1
Show file tree
Hide file tree
Showing 15 changed files with 87 additions and 76 deletions.
53 changes: 32 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
# Changelog

## Unreleased main
## Unreleased

### Feature

- Use scroll to top button from shared components
- Enable more fine grained permission checks by client id and roles
- Subscription Overlay
- implement loading state for provider subscription detail overlay
- Customer Detail Data Overlay
- **Roles and Permissions**
- Enable more fine grained permission checks by client id and roles
- **Customer Detail Data Overlay**
- implement new UI design for customer detail data overlay
- **Company Subscription Management**
- Extended the subscription detail page for customer to include more app-related information [#1051](https://github.com/eclipse-tractusx/portal-frontend/pull/1051)
- extended the subscription detail page for customer to include more app-related information [#1051](https://github.com/eclipse-tractusx/portal-frontend/pull/1051)

### Change

- **Technical User Management**
- Removed 'Inactive' filter in technical user management [#1046](https://github.com/eclipse-tractusx/portal-frontend/pull/1046)
- **Application Requests and Connector Management**
- update the status(skipped) in application requests and necessary changes with checkbox in connector management [#1019](https://github.com/eclipse-tractusx/portal-frontend/pull/1019)
- **Technical User Management**
- Removed 'Inactive' filter in technical user management [#1046](https://github.com/eclipse-tractusx/portal-frontend/pull/1046)
- **Company Subscriptions**
- Update and bind API with filter options [#1062](https://github.com/eclipse-tractusx/portal-frontend/pull/1062)

Expand All @@ -36,7 +28,7 @@
- Show appropriate error message.
- Fix closing page notification bar issue
- **IDP management**
- Fixed statusTag color in status coloumn [#978](https://github.com/eclipse-tractusx/portal-frontend/pull/978)
- Fixed statusTag color in status column [#978](https://github.com/eclipse-tractusx/portal-frontend/pull/978)
- **Connector Management**
- Updated SD document download API to fix downloading SD document issue [#1038](https://github.com/eclipse-tractusx/portal-frontend/pull/1038)
- **Service Release Process**
Expand All @@ -50,25 +42,44 @@
- **OSP Consent form**
- Display invited company name in OSP consent form (Previously hard coded with 'BMW') [#1083](https://github.com/eclipse-tractusx/portal-frontend/pull/1083)

## 2.2.0-RC3

### Change

- **Technical User Management**
- removed 'Inactive' filter in technical user management [#1046](https://github.com/eclipse-tractusx/portal-frontend/pull/1046)
- updated filters view and logic [#1087](https://github.com/eclipse-tractusx/portal-frontend/pull/1087)
- **Skipping of GX compliance service interface**
- updated the status (skipped) in application requests and changed checkbox in connector management [#1019](https://github.com/eclipse-tractusx/portal-frontend/pull/1019)
- **Company data**
- disabled csv upload [#1091](https://github.com/eclipse-tractusx/portal-frontend/pull/1091)

### Bugfixes

- **Company data**
- removed page notification on download csv template action [#1071](https://github.com/eclipse-tractusx/portal-frontend/pull/1071)
- fixed broken title and description in modal [#1070](https://github.com/eclipse-tractusx/portal-frontend/pull/1070)
- fixed translation error [#1070](https://github.com/eclipse-tractusx/portal-frontend/pull/1070)

## 2.2.0-RC2

### Feature

- **Onboarding Service Provider Management**:
- Create new page for onboarding service provider management [#1052](https://github.com/eclipse-tractusx/portal-frontend/pull/1052)
- created new page for onboarding service provider management [#1052](https://github.com/eclipse-tractusx/portal-frontend/pull/1052)
- **Company data**
- Disable confirm button if input value is not matching with the regular expression [#1056](https://github.com/eclipse-tractusx/portal-frontend/pull/1056)
- Fix infinite loop issue in add New Address Modal
- Add new csv bulk upload modal [#1056](https://github.com/eclipse-tractusx/portal-frontend/pull/1056)
- disabled confirm button if input value is not matching with the regular expression [#1056](https://github.com/eclipse-tractusx/portal-frontend/pull/1056)
- fixed infinite loop issue in add New Address Modal
- added new csv bulk upload modal [#1056](https://github.com/eclipse-tractusx/portal-frontend/pull/1056)
- **Service Subscription**
- Update auto setup api response data in the service subscription response overlay
- updated auto setup api response data in the service subscription response overlay

### Bugfixes

- **Partner Network**
- Change interface of the partner network apis. add /members to the POST api and update the business logic accordingly [#1002](https://github.com/eclipse-tractusx/portal-frontend/pull/1002)
- changed interface of the partner network apis. add /members to the POST api and update the business logic accordingly [#1002](https://github.com/eclipse-tractusx/portal-frontend/pull/1002)
- **Business Partner invite**
- fix person name regex patter [#1040](https://github.com/eclipse-tractusx/portal-frontend/pull/1040)
- fixed person name regex patter [#1040](https://github.com/eclipse-tractusx/portal-frontend/pull/1040)

## 2.2.0-RC1

Expand Down
2 changes: 1 addition & 1 deletion DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ npm/npmjs/@babel/template/7.24.0, MIT, approved, clearlydefined
npm/npmjs/@babel/traverse/7.24.1, MIT AND (BSD-2-Clause AND ISC AND MIT) AND BSD-2-Clause AND BSD-3-Clause, approved, #13926
npm/npmjs/@babel/types/7.24.0, MIT, approved, clearlydefined
npm/npmjs/@bcoe/v8-coverage/0.2.3, ISC AND MIT, approved, clearlydefined
npm/npmjs/@catena-x/portal-shared-components/3.4.0, Apache-2.0 AND CC-BY-4.0 AND OFL-1.1, approved, #16027
npm/npmjs/@catena-x/portal-shared-components/3.5.1, Apache-2.0 AND CC-BY-4.0 AND OFL-1.1, approved, #16079
npm/npmjs/@cspotcode/source-map-support/0.8.1, MIT, approved, clearlydefined
npm/npmjs/@date-io/core/3.0.0, MIT, approved, clearlydefined
npm/npmjs/@date-io/date-fns/3.0.0, MIT, approved, #14023
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@catena-x/portal-frontend",
"version": "v2.2.0-RC2",
"version": "v2.2.0-RC3",
"description": "Catena-X Portal Frontend",
"author": "Catena-X Contributors",
"license": "Apache-2.0",
Expand Down Expand Up @@ -34,7 +34,7 @@
]
},
"dependencies": {
"@catena-x/portal-shared-components": "^3.4.0",
"@catena-x/portal-shared-components": "^3.5.1",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@hookform/error-message": "^2.0.1",
Expand Down
6 changes: 3 additions & 3 deletions src/assets/locales/de/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,8 +971,7 @@
"resetCredentialError": "Something went wrong",
"resetCredentialSuccess": "Credential reset was successful",
"tabs": {
"active": "Aktiv",
"inactive": "Inaktiv",
"showAll": "Alle anzeigen",
"managed": "Gelang es",
"owned": "Besessen"
},
Expand Down Expand Up @@ -2295,7 +2294,8 @@
},
"userRoles": {
"title": "Assigned Catena-X Portal Roles",
"changeRoleBtn": "Change Portal Role"
"changeRoleBtn": "Change Portal Role",
"errorMsg": "Sie sind nicht berechtigt, Ihre eigenen Administrator-Rollen zu ändern. Bitte wenden Sie sich an einen anderen Administrator."
}
},
"global": {
Expand Down
6 changes: 3 additions & 3 deletions src/assets/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,7 @@
"resetCredentialError": "Something went wrong",
"resetCredentialSuccess": "Credential reset was successful",
"tabs": {
"active": "Active",
"inactive": "Inactive",
"showAll": "Show All",
"managed": "Managed",
"owned": "Owned"
},
Expand Down Expand Up @@ -2268,7 +2267,8 @@
},
"userRoles": {
"title": "Assigned Catena-X Portal Roles",
"changeRoleBtn": "Change Portal Role"
"changeRoleBtn": "Change Portal Role",
"errorMsg": "You are not authorized to change your own admin roles. Please contact another admin."
}
},
"global": {
Expand Down
1 change: 0 additions & 1 deletion src/components/overlays/CSVUploadOverlay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ export default function CSVUploadOverlay(): JSX.Element {
document.body.appendChild(a)
a.click()
a.remove()
CopySuccess(t('content.companyData.upload.downloadSuccess'))
})
}

Expand Down
21 changes: 21 additions & 0 deletions src/components/overlays/EditPortalRoles/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
DialogActions,
DialogContent,
DialogHeader,
Typography,
} from '@catena-x/portal-shared-components'
import {
type AppRole,
Expand All @@ -40,6 +41,7 @@ import { useTranslation } from 'react-i18next'
import { useDispatch } from 'react-redux'
import { OVERLAYS } from 'types/Constants'
import './style.scss'
import UserService from 'services/UserService'

export default function EditPortalRoles({ id }: { id: string }) {
const { t } = useTranslation()
Expand All @@ -58,6 +60,7 @@ export default function EditPortalRoles({ id }: { id: string }) {
const [allRoles, setAllRoles] = useState<AppRole[]>([])
const [selectedRoles, setSelectedRoles] = useState<string[]>([])
const [offerId, setOfferId] = useState<string>('')
const [allAdminRoles, setAllAdminRoles] = useState<AppRole[]>([])

const [updatePortalRoles] = useUpdatePortalRolesMutation()

Expand All @@ -68,6 +71,13 @@ export default function EditPortalRoles({ id }: { id: string }) {
}
}, [appRoles])

useEffect(() => {
if (allRoles) {
const adminRoles = allRoles.filter((item) => item.role.includes('Admin'))
setAllAdminRoles(adminRoles)
}
}, [allRoles])

useEffect(() => {
setSelectedRoles(assignedRoles ?? [])
}, [assignedRoles])
Expand Down Expand Up @@ -112,6 +122,11 @@ export default function EditPortalRoles({ id }: { id: string }) {
assignedRoles.length === selectedRoles.length &&
assignedRoles.every((value) => selectedRoles.includes(value)))

const disabledCheckbox = (currentRole: AppRole) =>
UserService.getUsername() === id
? allAdminRoles.includes(currentRole)
: false

return (
<>
<div className="roles-heading">
Expand All @@ -132,6 +147,7 @@ export default function EditPortalRoles({ id }: { id: string }) {
allRoles.map((role) => (
<li key={role.roleId}>
<Checkbox
disabled={disabledCheckbox(role)}
label={role.role}
checked={selectedRoles.indexOf(role.role) !== -1}
onChange={(e) => {
Expand All @@ -142,6 +158,11 @@ export default function EditPortalRoles({ id }: { id: string }) {
))}
</ul>
</div>
{UserService.getUsername() === id && (
<Typography variant="body3" sx={{ mt: 3 }}>
{t('shared.userRoles.errorMsg')}
</Typography>
)}
</DialogContent>

<DialogActions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function AddressDetails({
const companyAddressData = useSelector(companyDataSelector)
const addressData = [
{
key: t('content.companyData.address.form.companySite.name'),
key: t('content.companyData.site.form.site.name'),
value: companyAddressData.site?.name ?? '',
},
{
Expand Down
12 changes: 10 additions & 2 deletions src/components/pages/CompanyData/components/CompanyAddressList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {
setSharingStateInfo,
} from 'features/companyData/slice'
import { statusColorMap } from 'utils/dataMapper'
import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'

export const CompanyAddressList = ({
handleButtonClick,
Expand Down Expand Up @@ -186,12 +187,19 @@ export const CompanyAddressList = ({
setPage((i) => i + 1)
}}
hideFooterPagination={true}
buttons={[
{
title: t('content.companyData.table.buttonSite'),
click: () => {
handleSecondButtonClick()
},
icon: <AddCircleOutlineIcon />,
},
]}
autoFocus={false}
onButtonClick={handleButtonClick}
rowsCount={inputs.length + outputs.length}
buttonLabel={t('content.companyData.table.buttonAddress')}
secondButtonLabel={t('content.companyData.table.buttonSite')}
onSecondButtonClick={handleSecondButtonClick}
toolbarVariant="premium"
searchPlaceholder={t('content.companyData.table.search')}
columnHeadersBackgroundColor={'#FFFFFF'}
Expand Down
15 changes: 0 additions & 15 deletions src/components/pages/CompanyData/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,8 @@ import MyCompanyInfoComponent from '../Organization/MyCompanyInfoComponent'
import EditForm from './components/EditForm'
import { useDispatch } from 'react-redux'
import { setCompanyPageRefetch } from 'features/companyData/slice'
import { Button } from '@catena-x/portal-shared-components'
import { useTranslation } from 'react-i18next'
import { show } from 'features/control/overlay'
import { OVERLAYS } from 'types/Constants'

export default function CompanyData() {
const { t } = useTranslation()
const [showOverlay, setShowOverlay] = useState({
address: false,
site: false,
Expand All @@ -48,16 +43,6 @@ export default function CompanyData() {
<main className="organization-main">
<div className="organization-section">
<MyCompanyInfoComponent editable={false} />
<div>
<Button
sx={{ margin: '-30px auto 30px auto', display: 'block' }}
onClick={() => {
dispatch(show(OVERLAYS.CSV_UPLOAD_OVERLAY))
}}
>
{t('content.companyData.csvUploadBtn')}
</Button>
</div>
</div>
<CompanyAddressList
handleButtonClick={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export const statusColorMap: Record<
ComponentProps<typeof StatusTag>['color']
> = {
[ServiceAccountStatus.ACTIVE]: 'confirmed',
[ServiceAccountStatus.INACTIVE]: 'declined',
[ServiceAccountStatus.DELETED]: 'deleted',
[ServiceAccountStatus.PENDING]: 'pending',
[ServiceAccountStatus.PENDING_DELETION]: 'pending',
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,7 @@ interface FetchHookArgsType {
statusFilter: string
expr: string
}
type StatusTagColor =
| 'pending'
| 'confirmed'
| 'declined'
| 'label'
| 'deleted'
| undefined
type StatusTagColor = 'pending' | 'confirmed' | 'label' | undefined

export const TechnicalUserTable = () => {
const { t } = useTranslation()
Expand All @@ -57,7 +51,9 @@ export const TechnicalUserTable = () => {
const [fetchHookArgs, setFetchHookArgs] = useState<FetchHookArgsType>()
const [expr, setExpr] = useState<string>('')
const [refresh, setRefresh] = useState<number>(0)
const [group, setGroup] = useState<string>(ServiceAccountStatusFilter.ACTIVE)
const [group, setGroup] = useState<string>(
ServiceAccountStatusFilter.SHOW_ALL
)
const setView = (e: React.MouseEvent<HTMLInputElement>) => {
const viewValue = e.currentTarget.value
setGroup(viewValue)
Expand All @@ -77,8 +73,8 @@ export const TechnicalUserTable = () => {

const filterButtons = [
{
buttonText: t('content.usermanagement.technicalUser.tabs.active'),
buttonValue: ServiceAccountStatusFilter.ACTIVE,
buttonText: t('content.usermanagement.technicalUser.tabs.showAll'),
buttonValue: ServiceAccountStatusFilter.SHOW_ALL,
onButtonClick: setView,
},
{
Expand All @@ -95,8 +91,6 @@ export const TechnicalUserTable = () => {

const statusColorMap: Record<ServiceAccountStatus, StatusTagColor> = {
[ServiceAccountStatus.ACTIVE]: 'confirmed',
[ServiceAccountStatus.INACTIVE]: 'declined',
[ServiceAccountStatus.DELETED]: 'deleted',
[ServiceAccountStatus.PENDING]: 'pending',
[ServiceAccountStatus.PENDING_DELETION]: 'pending',
}
Expand Down
3 changes: 0 additions & 3 deletions src/components/shared/basic/DeleteObjectContent/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
********************************************************************************/

.remove-object-content {
max-width: 930px;
margin-top: -20px;

* {
width: fit-content;
text-align: center;
Expand Down
Loading

0 comments on commit 919ddf1

Please sign in to comment.