Skip to content

Commit

Permalink
Merge pull request #6 from catenax-ng/dev
Browse files Browse the repository at this point in the history
Merge dev in main: release 0.6.0
  • Loading branch information
evegufy authored Oct 19, 2022
2 parents 11e614c + 37f44cb commit 046a59c
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 4 deletions.
158 changes: 158 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"fileHeaderComment.parameter": {
"*": {
"commentbegin": "/********************************************************************************",
"commentend": " ********************************************************************************/",
"commentprefix": "",
"commentbegin#": "###############################################################",
"commentend#": "###############################################################",
"commentprefix#": "#",
"cx_header_default_bmw":[
"* Copyright (c) 2021,2022 BMW Group AG",
" * Copyright (c) 2021,2022 Contributors to the CatenaX (ng) GitHub Organisation.",
" *",
" * 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"
],
"cx_header_with_#_bmw":[
"Copyright (c) 2021,2022 BMW Group AG",
"# Copyright (c) 2021,2022 Contributors to the CatenaX (ng) GitHub Organisation.",
"#",
"# 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"
],
"cx_header_default_mercedes":[
"* Copyright (c) 2021,2022 Mercedes-Benz Group AG and BMW Group AG",
" * Copyright (c) 2021,2022 Contributors to the CatenaX (ng) GitHub Organisation.",
" *",
" * 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"
],
"cx_header_with_#_mercedes":[
"Copyright (c) 2021,2022 Mercedes-Benz Group AG and BMW Group AG",
"# Copyright (c) 2021,2022 Contributors to the CatenaX (ng) GitHub Organisation.",
"#",
"# 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"
],
"cx_header_default_tsystems":[
"* Copyright (c) 2021,2022 T-Systems International GmbH and BMW Group AG",
" * Copyright (c) 2021,2022 Contributors to the CatenaX (ng) GitHub Organisation.",
" *",
" * 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"
],
"cx_header_with_#_tsystems":[
"Copyright (c) 2021,2022 T-Systems International GmbH and BMW Group AG",
"# Copyright (c) 2021,2022 Contributors to the CatenaX (ng) GitHub Organisation.",
"#",
"# 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"
],
}
},
"fileHeaderComment.template": {
"cx_header_default_bmw":[
"${commentbegin}",
"${commentprefix} ${cx_header_default_bmw}",
"${commentend}"
],
"cx_header_with_#_bmw":[
"${commentbegin#}",
"${commentprefix#} ${cx_header_with_#_bmw}",
"${commentend#}"
],
"cx_header_default_mercedes":[
"${commentbegin}",
"${commentprefix} ${cx_header_default_mercedes}",
"${commentend}"
],
"cx_header_with_#_mercedes":[
"${commentbegin#}",
"${commentprefix#} ${cx_header_with_#_mercedes}",
"${commentend#}"
],
"cx_header_default_tsystems":[
"${commentbegin}",
"${commentprefix} ${cx_header_default_tsystems}",
"${commentend}"
],
"cx_header_with_#_tsystems":[
"${commentbegin#}",
"${commentprefix#} ${cx_header_with_#_tsystems}",
"${commentend#}"
]
},
}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

New features, fixed bugs, known defects and other noteworthy changes to each release of the Catena-X Portal Frontend Registration.

### 0.6.0

* Bugfix - Finish page
* Bugfix - Closed loading time issue
* Bugfix - BPN save and submit applicationId api url
* Enabler - Merge delta since eclipse foundation initial contribution
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "product-portal-frontend-registration",
"version": "0.5.5.1",
"version": "0.6.0",
"license": "Apache-2.0",
"homepage": "/registration",
"scripts": {
Expand Down
13 changes: 10 additions & 3 deletions src/components/verifyRegistration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ import { FooterButton } from './footerButton'
import { connect, useDispatch, useSelector } from 'react-redux'
import { IState } from '../state/features/user/redux.store.types'
import { addCurrentStep } from '../state/features/user/action'
import { withRouter } from 'react-router-dom'
import { useEffect } from 'react'
import { useHistory, withRouter } from 'react-router-dom'
import { useEffect, useState } from 'react'
import { Dispatch } from 'redux'
import { ToastContainer, toast } from 'react-toastify'
import {
fetchRegistrationData,
saveRegistration,
} from '../state/features/applicationVerifyRegister/actions'
import { applicationSelector } from '../state/features/application/slice'
import { stateSelector } from '../state/features/applicationVerifyRegister/slice'
import { registrationSuccessSelector, stateSelector } from '../state/features/applicationVerifyRegister/slice'
import { stateSelector as documentSelector } from '../state/features/applicationDocuments/slice'

interface VerifyRegistrationProps {
Expand All @@ -47,13 +47,19 @@ export const VerifyRegistration = ({
addCurrentStep,
}: VerifyRegistrationProps) => {
const { t } = useTranslation()
const history = useHistory()

const dispatch = useDispatch()

const [ confirmState, setConfirmState ] = useState(false)

const { status, error, companyDetails } = useSelector(applicationSelector)
const { registrationData } = useSelector(stateSelector)
const registrationSuccess = useSelector(registrationSuccessSelector)
const { documents } = useSelector(documentSelector)

if(confirmState && registrationSuccess) history.push('/finish')

const obj = status[status.length - 1]
const applicationId = obj['applicationId']
if (error) {
Expand All @@ -69,6 +75,7 @@ export const VerifyRegistration = ({
}

const nextClick = () => {
setConfirmState(true)
dispatch(saveRegistration(applicationId))
}

Expand Down
7 changes: 7 additions & 0 deletions src/state/features/applicationVerifyRegister/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { RegistrationState, InitialRegistrationValue } from './types'
const initialState: RegistrationState = {
registrationData: InitialRegistrationValue,
loading: false,
success: false,
error: null,
}

Expand Down Expand Up @@ -55,16 +56,19 @@ const applicationSlice = createSlice({
builder.addCase(saveRegistration.pending, (state) => ({
...state,
loading: true,
success: false,
error: null,
}))
builder.addCase(saveRegistration.fulfilled, (state) => ({
...state,
loading: false,
success: true,
error: null,
}))
builder.addCase(saveRegistration.rejected, (state, action) => ({
...state,
loading: false,
success: false,
error: action.error.message as string,
}))
},
Expand All @@ -73,4 +77,7 @@ const applicationSlice = createSlice({
export const stateSelector = (state: RootState): RegistrationState =>
state.registrationData

export const registrationSuccessSelector = (state: RootState): boolean =>
state.registrationData.success

export default applicationSlice
1 change: 1 addition & 0 deletions src/state/features/applicationVerifyRegister/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
export interface RegistrationState {
registrationData: RegistrationDetails | null
loading: boolean
success: boolean,
error: string
}

Expand Down

0 comments on commit 046a59c

Please sign in to comment.