diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..e5bbb5d6 --- /dev/null +++ b/.vscode/settings.json @@ -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#}" + ] + }, +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..e6781cf0 --- /dev/null +++ b/CHANGELOG.md @@ -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 diff --git a/package.json b/package.json index e73a7362..ee4bbdcb 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/components/verifyRegistration.tsx b/src/components/verifyRegistration.tsx index 3be578e0..3eccfb2c 100644 --- a/src/components/verifyRegistration.tsx +++ b/src/components/verifyRegistration.tsx @@ -25,8 +25,8 @@ 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 { @@ -34,7 +34,7 @@ import { 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 { @@ -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) { @@ -69,6 +75,7 @@ export const VerifyRegistration = ({ } const nextClick = () => { + setConfirmState(true) dispatch(saveRegistration(applicationId)) } diff --git a/src/state/features/applicationVerifyRegister/slice.ts b/src/state/features/applicationVerifyRegister/slice.ts index 47801a54..1a49f27c 100644 --- a/src/state/features/applicationVerifyRegister/slice.ts +++ b/src/state/features/applicationVerifyRegister/slice.ts @@ -26,6 +26,7 @@ import { RegistrationState, InitialRegistrationValue } from './types' const initialState: RegistrationState = { registrationData: InitialRegistrationValue, loading: false, + success: false, error: null, } @@ -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, })) }, @@ -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 diff --git a/src/state/features/applicationVerifyRegister/types.ts b/src/state/features/applicationVerifyRegister/types.ts index 0ae8790e..9bd93a39 100644 --- a/src/state/features/applicationVerifyRegister/types.ts +++ b/src/state/features/applicationVerifyRegister/types.ts @@ -21,6 +21,7 @@ export interface RegistrationState { registrationData: RegistrationDetails | null loading: boolean + success: boolean, error: string }