diff --git a/.conf/nginx.conf b/.conf/nginx.conf new file mode 100644 index 00000000..66ee4e87 --- /dev/null +++ b/.conf/nginx.conf @@ -0,0 +1,33 @@ +################################################################################ + # Copyright (c) 2022,2023 BMW Group AG + # Copyright (c) 2022,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 + ################################################################################ + + +server { + + listen 8080; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html; + try_files $uri $uri/index.html /index.html; + } + +} \ No newline at end of file diff --git a/.env b/.env index 75bccfa9..791013ac 100644 --- a/.env +++ b/.env @@ -1,20 +1,24 @@ -REACT_APP_DASHBOARD_URL=http://localhost:8080/api/dashboard/getTableInfo? -REACT_APP_DASHBOARD_URL_RATINGSTABLE=http://localhost:8080/api/dashboard/ratingsByYear? -REACT_APP_DATEFORM_URL=http://localhost:8080/api/dashboard/allYears -REACT_APP_DASHBOARD_WOLRD_MAP_URL=http://localhost:8080/api/dashboard/getWorldMap? -REACT_APP_DASHBOARD_FILE_TEMPLATE_DOWNLOAD=http://localhost:8080/api/dashboard/getTemplate? -REACT_APP_GET_RANGES=http://localhost:8080/api/dashboard/getUserRanges? -REACT_APP_SAVE_RANGES=http://localhost:8080/api/dashboard/saveUserRanges? -REACT_APP_UPLOAD_FILE=http://localhost:8080/api/dashboard/uploadCsv? -REACT_APP_GET_COUNTRYS=http://localhost:8080/api/dashboard/getCountryFilterByISO2? -REACT_APP_GET_BPN_COUNTRYS=http://localhost:8080/api/dashboard/getBpnCountrys? -REACT_APP_GET_BPNS=http://localhost:8080/api/dashboard/getCompanyBpns? -REACT_APP_GET_REPORTS_BY_USER=http://localhost:8080/api/dashboard/getReportsByCompanyUser? -REACT_APP_GET_REPORT_VALUES_BY_REPORT=http://localhost:8080/api/dashboard/getReportsValueByReport? -REACT_APP_SAVE_REPORTS=http://localhost:8080/api/dashboard/saveReports? -REACT_APP_SHARE_REPORTS=http://localhost:8080/api/dashboard/shareReport? -REACT_APP_UPDATE_REPORTS=http://localhost:8080/api/dashboard/updateReports? -REACT_APP_DELETE_REPORTS=http://localhost:8080/api/dashboard/deleteReport -REACT_APP_GET_USER_BPDM_GATES=http://localhost:8080/api/dashboard/getAllUserBPDMGates? -REACT_APP_DELETE_RATINGS=http://localhost:8080/api/dashboard/deleteRating -REACT_APP_GET_COMPANY_USERS=http://localhost:8080/api/dashboard/getUserFromCompany? \ No newline at end of file +REACT_URL_ENV=http://localhost:8080 +REACT_APP_AUTH_URL=http://localhost:8080/auth +REACT_APP_PORTAL_URL=http://localhost:8080/auth +REACT_APP_PORTAL_BACKEND_URL=http://localhost:8080/auth +REACT_APP_DASHBOARD_URL=${REACT_URL_ENV}/api/dashboard/getTableInfo? +REACT_APP_DASHBOARD_URL_RATINGSTABLE=${REACT_URL_ENV}/api/dashboard/ratingsByYear? +REACT_APP_DATEFORM_URL=${REACT_URL_ENV}/api/dashboard/allYears +REACT_APP_DASHBOARD_WOLRD_MAP_URL=${REACT_URL_ENV}/api/dashboard/getWorldMap? +REACT_APP_DASHBOARD_FILE_TEMPLATE_DOWNLOAD=${REACT_URL_ENV}/api/dashboard/getTemplate? +REACT_APP_GET_RANGES=${REACT_URL_ENV}/api/dashboard/getUserRanges? +REACT_APP_SAVE_RANGES=${REACT_URL_ENV}/api/dashboard/saveUserRanges? +REACT_APP_UPLOAD_FILE=${REACT_URL_ENV}/api/dashboard/uploadCsv? +REACT_APP_GET_COUNTRYS=${REACT_URL_ENV}/api/dashboard/getCountryFilterByISO2? +REACT_APP_GET_BPN_COUNTRYS=${REACT_URL_ENV}/api/dashboard/getBpnCountrys? +REACT_APP_GET_BPNS=${REACT_URL_ENV}/api/dashboard/getCompanyBpns? +REACT_APP_GET_REPORTS_BY_USER=${REACT_URL_ENV}/api/dashboard/getReportsByCompanyUser? +REACT_APP_GET_REPORT_VALUES_BY_REPORT=${REACT_URL_ENV}/api/dashboard/getReportsValueByReport? +REACT_APP_SAVE_REPORTS=${REACT_URL_ENV}/api/dashboard/saveReports? +REACT_APP_SHARE_REPORTS=${REACT_URL_ENV}/api/dashboard/shareReport? +REACT_APP_UPDATE_REPORTS=${REACT_URL_ENV}/api/dashboard/updateReports? +REACT_APP_DELETE_REPORTS=${REACT_URL_ENV}/api/dashboard/deleteReport +REACT_APP_GET_USER_BPDM_GATES=${REACT_URL_ENV}/api/dashboard/getAllUserBPDMGates? +REACT_APP_DELETE_RATINGS=${REACT_URL_ENV}/api/dashboard/deleteRating +REACT_APP_GET_COMPANY_USERS=${REACT_URL_ENV}/api/dashboard/getUserFromCompany? diff --git a/.env.production b/.env.production index f442e5f9..96181dcf 100644 --- a/.env.production +++ b/.env.production @@ -1,20 +1,24 @@ -REACT_APP_DASHBOARD_URL=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/getTableInfo? -REACT_APP_DASHBOARD_URL_RATINGSTABLE=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/ratingsByYear? -REACT_APP_DATEFORM_URL=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/allYears -REACT_APP_DASHBOARD_WOLRD_MAP_URL=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/getWorldMap? -REACT_APP_DASHBOARD_FILE_TEMPLATE_DOWNLOAD=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/getTemplate? -REACT_APP_GET_RANGES=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/getUserRanges? -REACT_APP_SAVE_RANGES=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/saveUserRanges? -REACT_APP_UPLOAD_FILE=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/uploadCsv? -REACT_APP_GET_COUNTRYS=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/getCountryFilterByISO2? -REACT_APP_GET_BPN_COUNTRYS=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/getBpnCountrys? -REACT_APP_GET_BPNS=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/getCompanyBpns? -REACT_APP_GET_REPORTS_BY_USER=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/getReportsByCompanyUser? -REACT_APP_GET_REPORT_VALUES_BY_REPORT=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/getReportsValueByReport? -REACT_APP_SAVE_REPORTS=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/saveReports? -REACT_APP_SHARE_REPORTS=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/shareReport? -REACT_APP_UPDATE_REPORTS=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/updateReports? -REACT_APP_DELETE_REPORTS=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/deleteReport -REACT_APP_GET_USER_BPDM_GATES=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/getAllUserBPDMGates? -REACT_APP_DELETE_RATINGS=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/deleteRating -REACT_APP_GET_COMPANY_USERS=https://vas-country-risk-backend.int.demo.catena-x.net/api/dashboard/getUserFromCompany? \ No newline at end of file +REACT_URL_ENV=https://vas-country-risk-backend.int.demo.catena-x.net +REACT_APP_AUTH_URL=https://centralidp.int.demo.catena-x.net/auth +REACT_APP_PORTAL_URL=https://portal.dev.demo.catena-x.net +REACT_APP_PORTAL_BACKEND_URL=https://portal-backend.dev.demo.catena-x.net +REACT_APP_DASHBOARD_URL=${REACT_URL_ENV}/api/dashboard/getTableInfo? +REACT_APP_DASHBOARD_URL_RATINGSTABLE=${REACT_URL_ENV}/api/dashboard/ratingsByYear? +REACT_APP_DATEFORM_URL=${REACT_URL_ENV}/api/dashboard/allYears +REACT_APP_DASHBOARD_WOLRD_MAP_URL=${REACT_URL_ENV}/api/dashboard/getWorldMap? +REACT_APP_DASHBOARD_FILE_TEMPLATE_DOWNLOAD=${REACT_URL_ENV}/api/dashboard/getTemplate? +REACT_APP_GET_RANGES=${REACT_URL_ENV}/api/dashboard/getUserRanges? +REACT_APP_SAVE_RANGES=${REACT_URL_ENV}/api/dashboard/saveUserRanges? +REACT_APP_UPLOAD_FILE=${REACT_URL_ENV}/api/dashboard/uploadCsv? +REACT_APP_GET_COUNTRYS=${REACT_URL_ENV}/api/dashboard/getCountryFilterByISO2? +REACT_APP_GET_BPN_COUNTRYS=${REACT_URL_ENV}/api/dashboard/getBpnCountrys? +REACT_APP_GET_BPNS=${REACT_URL_ENV}/api/dashboard/getCompanyBpns? +REACT_APP_GET_REPORTS_BY_USER=${REACT_URL_ENV}/api/dashboard/getReportsByCompanyUser? +REACT_APP_GET_REPORT_VALUES_BY_REPORT=${REACT_URL_ENV}/api/dashboard/getReportsValueByReport? +REACT_APP_SAVE_REPORTS=${REACT_URL_ENV}/api/dashboard/saveReports? +REACT_APP_SHARE_REPORTS=${REACT_URL_ENV}/api/dashboard/shareReport? +REACT_APP_UPDATE_REPORTS=${REACT_URL_ENV}/api/dashboard/updateReports? +REACT_APP_DELETE_REPORTS=${REACT_URL_ENV}/api/dashboard/deleteReport +REACT_APP_GET_USER_BPDM_GATES=${REACT_URL_ENV}/api/dashboard/getAllUserBPDMGates? +REACT_APP_DELETE_RATINGS=${REACT_URL_ENV}/api/dashboard/deleteRating +REACT_APP_GET_COMPANY_USERS=${REACT_URL_ENV}/api/dashboard/getUserFromCompany? diff --git a/.idea/sonarlint/issuestore/f/4/f43ecdf8d666ee908aacce037b4cd72159e4741b b/.idea/sonarlint/issuestore/f/4/f43ecdf8d666ee908aacce037b4cd72159e4741b deleted file mode 100644 index e69de29b..00000000 diff --git a/CHANGELOG.md b/CHANGELOG.md index 45110dd8..a56e74bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,36 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.1.0] - 2023-02-22 + +### Changed + +- Removing fixed hardcoded url and change with dynamic vars +- Added Vars to index.html + +### Added +- Added script for injecting vars on nginx +- Added arq42 documentation +- Added UserGuide + +### Fixes +- Fixed a bug in the Help Dialog regarding broken attachments that we´re missing + +## [1.0.1] - 2023-02-21 + +### Changed + +- Styling changes on some components according to portal style guidelines; +- Fix whitespace handling that removed apiVersion declaration from Helm templates; + +### Added + +- Added user information icon on right top corner and logout option; +- Added Help Button which has documentation explained how to use the application; + +### Fixes + +- Bug fix. Country selected manually by the user would not persist when the map dialog was opened; ## [1.0.0] - 2023-01-26 @@ -13,6 +42,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - First Release -[Unreleased]: https://github.com/eclipse-tractusx/vas-country-risk-frontend/compare - -[1.0.0]: https://github.com/eclipse-tractusx/vas-country-risk-frontend/compare \ No newline at end of file +[unreleased]: https://github.com/eclipse-tractusx/vas-country-risk-frontend/compare +[1.0.0]: https://github.com/eclipse-tractusx/vas-country-risk-frontend/compare +[1.1.0]: https://github.com/eclipse-tractusx/vas-country-risk-frontend/compare diff --git a/charts/country-risk-frontend-charts/Chart.yaml b/charts/country-risk-frontend-charts/Chart.yaml index 3e8b2f35..3fb76bb8 100644 --- a/charts/country-risk-frontend-charts/Chart.yaml +++ b/charts/country-risk-frontend-charts/Chart.yaml @@ -34,13 +34,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.0.7 +version: 2.0.8 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "1.0.0" +appVersion: "1.1.0" diff --git a/charts/country-risk-frontend-charts/templates/configmap.yaml b/charts/country-risk-frontend-charts/templates/configmap.yaml index ae46ad18..bd11b2d4 100644 --- a/charts/country-risk-frontend-charts/templates/configmap.yaml +++ b/charts/country-risk-frontend-charts/templates/configmap.yaml @@ -17,11 +17,11 @@ # SPDX-License-Identifier: Apache-2.0 ############################################################### -{{- if .Values.configmap.create -}} +{{ if .Values.configmap.create }} apiVersion: v1 kind: ConfigMap metadata: name: config-frontend data: {{- toYaml .Values.configmap.data | nindent 2 }} -{{- end -}} \ No newline at end of file +{{ end }} \ No newline at end of file diff --git a/charts/country-risk-frontend-charts/templates/ingress.yaml b/charts/country-risk-frontend-charts/templates/ingress.yaml index 3103d9af..1d25d8cb 100644 --- a/charts/country-risk-frontend-charts/templates/ingress.yaml +++ b/charts/country-risk-frontend-charts/templates/ingress.yaml @@ -17,7 +17,7 @@ # SPDX-License-Identifier: Apache-2.0 ############################################################### -{{- if .Values.ingress.enabled -}} +{{ if .Values.ingress.enabled }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -53,4 +53,4 @@ spec: # Default secret for certificate creation already provided to your namespace secretName: tls-secret -{{- end }} +{{ end }} diff --git a/docs/Arc42-Documenation.md b/docs/Arc42-Documenation.md new file mode 100644 index 00000000..b5e05dfb --- /dev/null +++ b/docs/Arc42-Documenation.md @@ -0,0 +1,767 @@ +# + +**About arc42** + +arc42, the template for documentation of software and system +architecture. + +Template Version 8.1 EN. (based upon AsciiDoc version), May 2022 + +Created, maintained and © by Dr. Peter Hruschka, Dr. Gernot Starke and +contributors. See . + +# Introduction and Goals + +### Inital Situation from Business View + +Geographical risks become more relevant in VUCA times and User from Business need an excellent solution to fulfill their requirements. VUCA meens volatile, uncertain, complex, and ambigous. In VUCA times, situations can change quickly (e.g. Ukraine war). + +The Business challenge is to have awareness towards their business partners just in time. Be it in ongoing business or in the initiation of business. From business side the user needs to know who they are dealing with. This is especially true for business partners in a different country. + +The main part of the country risk score are information per country regarding corruption, political stability, economic risk and social and structural figures. + +### Business Solution Target Group + +Compliance, Legal, Purchasing, Customer Service or other Company functional departments, who work together with Business Partners. + + +### Challenges + +- The data is not updated frequently. Risk assessments, for example, often are carried out once a year. +- Most risk assessments are carried out manually or semi manually. +- Risk assessments are usually based on only a few sources. +- Not all business partners are considered (due to manual effort) +- Special events can only be analysed reactively and are very time-consuming. +- Due to a large system landscape, a direct check of all business partners is not possible. Manual data consolidation must take place. +- Manual reconciliation is error-prone + + +### Benefit Hypothesis & Problem Statement + +The benefit is to get to know your business partner or potential business partners better. Through more information better decisions can be made, like e.g. in a tender situation or from a marketing point of view. + +- This Catena-X solution does not only integrate data from various sources but also matches this data with the existent business partners to enable a risk view towards your customer and supplier base. +- Reduced effort for target group +- Reduction of costs (internal & external) +- Reduction of own interfaces to external data sources, since these are set up and administered by a service provider. +- Company individual country risk assessments (Lists) can be integrated +- A dashboard will keep you up to date at any time. + +## Requirements Overview +## Quality Goals + +## Stakeholders + +Role/Name | Contact | Expectations +----------------|-----------------------------------------------------------------------------------------------------------------------------------| ----------- +Member Company | A company that participates in the Catena-X ecosystem (use-cases and data sharing). | Participate in the overal value proposition/stream provided by Catena-X. +Company Admin | A person that manages a single member companies integration into the dataspace on behalf of his employer. | Manage and monitor the proper integration and function of a member company within the Catena-X ecosystem. +Company User | A person that acts within the provided functionality of Catena-X on behalf of his employer (that is a member company) | Execute various permitted tasks on behalf of a member company the user is assigned to. + + +# Architecture Constraints + +- Homogenous UI/UX design across all user facing elements. +- Run anywhere: can be deployed as a docker image, e. g. on Kubernetes (platform-independent, cloud, on prem or local). +- Modular design: core-components are loosely coupled. +- Freedom of choice for technology components stops where UX is negatively impacted. +(currently under revision by the overall catena architecture roundtable) +- Roles & Rights Matrix: Roles & Rights Concept + +## Roles Rights Management + + +There shall be 3 roles specific to the country risk application in the portal: + +- Global Admin (Operating Environment) +- Company Admin User +- Company Standard User + +![RolesRightsManagement](../docs/Images/RolesRights.jpg) + + +# System Scope and Context + +![System Scope](../docs/Images/image2023-1-15_19-3-44.png) + + +#### Example Data Sources + +##### General + +Diversifying the portfolio of a company across different countries can help to balance the potential volatility of conducting business in one economic region. + +A country risk assessment can help a business to identify and evaluate country-specific risks. In doing so, businesses can determine how much those risks might impact their business and what steps they can take to manage or mitigate those risks. + +Importance of Mitigating Country Risk + +Evaluating country risk prior to making investments or conducting business in a country should be a critical part of a due diligence process. By relying on trusted sources of analysis and information, companies can get a strong idea of the potential risks these countries represent. + +Ignoring country risk factors can lead to damaging consequences like: + +- Catastrophic losses +- Failure to thrive +- Lawsuits +- Lack of transparency +- Theft (due to the perception of a lax attitude) + + +##### Types of Risk in International Business + +There are many factors to consider, but those factors can largely be categorized as economic, political and social factors. + +1. Economic Risk + +- The stability and solvency of banks +- The short-, medium- and long-term outlook for country’s GDP and GNP +- Debt-to-GDP ratio +- Unemployment rate +- Overall government finances +- Monetary policy and currency stability +- Currency exchange rates +- Access to affordable capital + + +2. Political Risk + +- Government instability +- Information access and transparency +- Terrorism, violence and crime +- Regulatory and policy environment +- Workforce freedom and mobility +- Government assistance programs for businesses +- Immigration and employment laws +- Attitudes toward foreign investment + + +3. Social & Structural Assessment + +- Demographics +- Physical infrastructure +- Social infrastructure +- Labor force +- Competitors +- Treaty participation +- Export regulations +- Import acceptance from other countries +- Co-production opportunities with other nations + + +##### The globally available Scores in the Application are currently: + +CPI Rating 2021 +CPI Rating 2020 +All underlying CPI Scores 2021 +Basel Score 2021 +Basel Score 2020 + +They are currently calculated like this: + +Corruption Perception Index 0 - 100 ascending (0 - negative; 100 - positiv) + +AML Basel List +10 - 0.00 descending (10 - negative; 0 positiv) + +Self Created Rating 0 - 100 ascending (0 - negative; 100 - positive) + +Coface +-.0.1.2..4.5.6.7.8 *10 / (0 - negative; 100 - positive) + +Oecd tbd + + +##### Possible Data Sources for Country Risk Assessments +Commercial Providers +Control Risk Security Risk Forecast 2021 - (e.g. (Data)theft, fraud, physical damage to production facilities) +Control Risk Political Stability Forecast 2021 - (e.g., uncertainties in jurisdictions, expropriation, sanctions) +Euler Hermes Country Risk Ratings (189 Countries, Economic Risk, Business Environmental Risk, Political Risk, Commercial Risk, Financing Risk) +Dun & Bradstreet, Country Risk ( http://www.dnbcountryrisk.com/, 14 Scores) + + +## Business Context + + +## Technical Context + +![Technical Building](../docs/Images/image2022-10-26_18-42-52.png) + +Topic | Technologie +--------- | ------- +Backend | Rest API, Java, KeyCloak +Front-End | Typescript, ReactJS, React-Simple-Maps +Infrastructure | Postgres Database, Azure, Github, ArgoCD, SonarCloud, VeraCode +UI/UX | HTML, JavaScript, CSS + + +# Solution Strategy + +# Building Block View + +## Whitebox Overall System + +This components Diagram represents the possible actions to be done by the user when opening the dashboard. + +Each box represents a feature and each arrow between features represents its dependencies, as is the case of the world map that needs a rating selected to be filled in with the available colors. + +![InterfaceDisplay](../docs/Images/diagram_compenent.png) + +#### World Map View + +![WorldMap](../docs/Images/image2022-10-10_16-49-37.png) + +For this component, it is necessary to call three different APIs that allow mapping the Map and painting based on the score obtained from each country. + +![WorldMapAPI](../docs/Images/image2022-10-10_17-4-35.png) + +For each of these APIs we can consult its input and output in the APIs section. +##### Sample result + +![WorldMapColor](../docs/Images/image2022-10-10_16-52-17.png) + +#### Ratings + +![RatingTable](../docs/Images/image2022-10-10_17-8-48.png) + +For this component, it is necessary to call just one API that gets the Ratings available for the user. + +Some Ratings may be available globally by user or by the company they belong to but for more details we will address in the functionalities section. + +![RatingAPI](../docs/Images/image2022-10-10_17-17-20.png) + +#### Ranges + +![Ranges](../docs/Images/image2022-10-10_17-21-38.png) + +For this component we have a call to two APIs, one that allows searching for a user's ranges, if any, and another that allows saving them if the user wants to for the next validation of the Map. + +![RangesAPI](../docs/Images/image2022-10-10_17-33-9.png) + +#### Business Partners Table + +![Table](../docs/Images/image2022-10-10_17-34-12.png) + +For this component, it is necessary to call just one API that gets the information about the Business Partners and the scores on which country they are displayed. + +It is necessary for the user to select one or more ratings for this table to be fully initialized, more details in the functionalities section. + +![TableAPI](../docs/Images/image2022-10-10_17-42-14.png) + +##### Sample Result + +![SampleTable](../docs/Images/image2022-10-10_17-42-59.png) + +#### Country Picker + +![Picker](../docs/Images/image2022-10-11_8-23-17.png) + +In this component, we call one API to populate the dropdown menu with a selection of countries. The API used is the getBpnCountries and as explained in the APIs and Swagger section, it retrieves all the countries that are associated to the Business partners. + +![PickerAPi](../docs/Images/image2022-10-11_9-13-22.png) + +#### Company View + +![CompanyView](../docs/Images/image2022-10-11_8-30-59.png) + +For this component, it is necessary to call three different APIs. The APIs used are the getBpnCountries, getCountryFilterByISO2 and getTableInfo. With the data that we get from this APIs, and also with the value from the selected country in the country picker component, we can present on the map the markers for the Business Partners of the selected country with some information associated to the markers. + +![CompanyViewAPI](../docs/Images/image2022-10-11_9-12-26.png) + +# Interfaces + +Please Check Swagger Doku +https://vas-country-risk-backend.dev.demo.catena-x.net/swagger-ui/index.html#/ + + +### Endpoint explanation: + +![apiUpload](../docs/Images/image2022-10-10_13-32-5.png) + +In this endpoint, it is automatically inserted the information from the user that is accessing the tool, and it needs a manually inserted name and also an CSV file that can be retrieved in the download template in the tool. After this it is created a new registry with the information inside of the inserted CSV file onto the database. As parameters it requires the rating name, year, and type (Global, Company or Custom). +Example: +![csvselector](../docs/Images/image2022-12-5_14-24-2.png) +![csvfile](../docs/Images/image2022-10-10_15-43-52.png) + + +![saveRanges](../docs/Images/image2022-10-10_13-31-47.png) + +In this endpoint, it is automatically inserted the information from the user that is accessing the tool, and it is manually inputted the three ranges currently selected by the user in the ranges component. These values are all saved using an object type. +Example: +![ranges](../docs/Images/image2022-12-5_14-23-26.png) + + +![saveReports](../docs/Images/image2022-12-5_12-40-53.png) + +This endpoint is used to save an reports. It is used in the report component to save multiple selected data (Selected Ratings, Country, Range Values) and be able to use it in a later time. This endpoint receives as input field the Report name, the Type (Global, Company or Custom) of which the report should be saved for. Also it receives the current user information and an object that gathers all the selected data (Selected Ratings, Country, Range Values). +Example: +![Report](../docs/Images/image2022-12-5_12-59-48.png) + + +![Rating](../docs/Images/image2022-10-10_13-33-31.png) + +In this endpoint it is retrieved all the ratings for a selected year. For example, if we input the year 2021 it is retrieved the following data. +![ResponseRating](../docs/Images/image2022-10-10_14-32-53.png) + + +![getMap](../docs/Images/image2022-10-10_13-33-47.png) + +This endpoint retrieves a score based on selected ratings, year and current user. See example bellow. +![Ratingtable](../docs/Images/image2022-10-10_15-30-37.png) + + +![UserRanges](../docs/Images/image2022-10-10_13-34-17.png) + +This endpoint is used for retrieving an the current user ranges. The values retrieved are the three types of ranges (Minimum, middle and Maximum), each associated to a type of value. This values are used to populate the ranges component with the last saved ranges that the user inputted. +![RangesExample](../docs/Images/image2022-10-10_14-9-44.png) + + +![template](../docs/Images/image2022-10-10_13-36-1.png) + +This endpoint is used for retrieving an CSV file that the user can edit and use it for uploading data. + + +![Tableinfo](../docs/Images/image2022-10-10_13-43-5.png) + +This endpoint retrieves Business partners based on selected ratings, user and selected year. +![exampletableinfo](../docs/Images/image2022-10-10_14-53-55.png) + + +![getReportValue](../docs/Images/image2022-12-5_13-31-21.png) + +This endpoint is used to retrieve reports. This endpoint receives as input field an Report object and retrieves only a report relative to that information. +![examplereportvalue](../docs/Images/image2022-12-5_13-38-58.png) + + +![companyuserinfo](../docs/Images/image2022-12-5_13-31-59.png) + +This endpoint is used to retrieve reports. It is used in the report component to to populate the table. This endpoint only receives as input field the current user information. +![exampleuserinfo](../docs/Images/image2022-12-5_13-31-59.png) + + +![getcountryfilter](../docs/Images/image2022-10-10_13-43-23.png) + +This endpoint retrieves all the Countries ordered by their ISO2 code. +![exampleiso2code](../docs/Images/image2022-10-10_14-2-42.png) + + +![companybpn](../docs/Images/image2022-10-10_13-43-40.png) + +This endpoint retrieves all the Business partners associated to a company. +![examplebpn](../docs/Images/image2022-10-10_14-1-24.png) + + +![getcountrybpns](../docs/Images/image2022-10-10_13-43-58.png) + +This endpoint retrieves all the countries that are associated to the Business partners. +![examplecountrybpn](../docs/Images/image2022-10-10_13-55-27.png) + + +![getBpdmGates](../docs/Images/image2022-12-5_13-32-54.png) + +This endpoint returns information from the BPDM Gate to show the User specific Business Partners + + +![getscoresperbpn](../docs/Images/image2022-12-5_13-33-24.png) + +In this endpoint the User can request a Mapping of Business Partners to a specific Rating. As parameters it is needed an Rating and BPNs array and also the company of he user. +![examplequery](../docs/Images/image2022-12-5_14-14-19.png) +In this picture, we can see how both the Ratings and BPNs are composed. The Ratings array can contain multiple objects that have the dataSourceName and the + +following year. Regarding the BPNs array, it can also contain multiple objects, and each of them have the BPN name and a country of which can be given a value + +or no value. If the BPN has no country value, the backend will map it according to the BPN. + +![exampleresultmatching](../docs/Images/image2022-12-5_14-14-53.png) + + +![getRatingsforCompany](../docs/Images/image2022-12-5_13-33-41.png) + +In this endpoint it is possible for the user to request Information about which Ratings are available to his Company. The information needed is solely the Company and the Year. +![exampleratingsforcompany](../docs/Images/image2022-12-5_14-8-29.png) + + +![getyears](../docs/Images/image2022-10-10_13-44-13.png) + +This endpoint retrieves all the years that are currently saved on the database. This years are used to populate the year selection dropdown in the tool. + + +![deleteReport](../docs/Images/image2022-12-30_11-37-34.png) + +This endpoint is used to delete an report created by the user. It is used in the report table in the Front-End application. It needs the id related to the report selected and also the user information to proceed with the delete request. + + +![deleteRating](../docs/Images/image2022-12-30_11-50-52.png) + +This endpoint is used to delete an rating created by the user. It is used in the report table in the Front-End application. It needs the id related to the rating selected and also the user information to proceed with the delete request. + + + +# Architecture Decisions + +For all the planned use cases, a database was defined where we tried to optimize the relationships and the reuse of dynamic tables to the maximum to avoid extensive links and fields. + +![Database](../docs/Images/DataModel_v6.png) + +Entities: + +1. CompanyUser: Table that represents the user that will allow us to identify, based on the information coming from the keycloak, which company the user belongs to for other filters. +2. DataSource and DataSourceValue: Dynamic tables that allow saving the source such as CPI Rating and its values ​​for each country such as GERMANY , DE , 86. +3. Range: Table that keeps the ranges submitted by each user, so that each visit to the page can visualize the data with the ranges that he customized. There are 3 ranges green, yellow and red which are identified by max, between and min. +4. File: Table that stores the template that the user can obtain and then stores any uploads that the user makes regarding their rating. +5. Country: Table that saves all the countries. This table is important to distinguish any bad input that the user can put, because only the countries placed here can be validated with rating. +6. Region: Table that stores each region defined by the user, this can be customized or globalized as is the case of having the countries of the European Union within the EU Region. +7. Report and ReportValue: Dynamic Table that, like the DataSource, allows each Report to have multiple objects added to it, in this case we can define the selected country, the ranges, the ratings and if new features are implemented, they can be added to new reports without the need to change. +8. Type: Enums table that allows you to filter the 3 tables ( DataSource , Region and Reports) that may or may not have globally available data, only for the elements of the Company or for the User who uploaded them. + + +# Development Process + +We have two repositories in the TractusX Github Environment with the Eclipse Foundation. +Frontend: https://github.com/eclipse-tractusx/vas-country-risk-frontend +Backend: https://github.com/eclipse-tractusx/vas-country-risk-backend + +To maintain those 2 Github locations we mainly develop in the CatenaX-ng Github. Only for main Changes we push a request to a commiter with the Eclipse Foundation Github. + +To contribute to the development please follow these Branching guidelines in the CatenaX-ng environment. + +![Branching](../docs/Images/image2023-1-15_21-49-22.png) + +# Sequence Diagram + +#### Endpoint: /dashboard/getTableInfo + +![getDashboardTableinfo](../docs/Images/DashBoardResource_getAllDashBoardTable.jpg) +In the DashBoardResource we invoke the method getTableInfo, that is inside the DashboardService. + +In there we invoke the method getTableInfo, which is situated in the WorldMapAndTableLogicService. Inside this method is were most of the logic is located. + +In 1.1.1.1, we invoke the method getExternalBusinessPartners from the ExternalBusinessPartnersLogicService, in which we pass the object companyUser. In this method we return Business Partners associated to a company user. + +In 1.1.1.2, we invoke the method getExternalPartnersCountry from the ExternalBusinessPartnersLogicService, in which we pass the object companyUser. In this method we return the Countries from Business Partners associated to a Company User. + +In 1.1.1.3, we invoke the method findByRatingAndCountryAndScoreGreaterThanAndYear from the DataSourceValueService. In this method we pass countryList (List of countries from Business Partners associated to a company user), dataSources (List of datasources names) and the year (Integer). After this we call a similar method (1.1.1.3.1), but this time it is inside the DataSourceValueRepository. In the repository is were the data from the Database is retrieved using Query's in this case. + +In 1.1.1.4 and 1.1.1.4.1 there is a forEach logic, where the setter setWeight method is invoked to populate this variable in the recently returned ArrayList of DataDTO from the 1.1.1.3 methods. + +After this, in the 1.1.1.5, we invoke the method mapBusinessPartnerToDashboard, in which businessPartnerDTOS, dataDTOS and ratingDTO List are passed. Inside the method a new DashboardTableDTO object is created and business partners are associated to that object (1.1.1.5.2, 1.1.1.5.2.1). + +After that, in the 1.1.1.5.3 method, inside a for iteration, firstly it filters the countries which the business partners are associated. After that, in 1.1.1.5.3.3.1 method it is calculated the score for each country, using the weight value that comes as a parameters from the number of selected ratings in the dashboard. + + +#### Endpoint: /dashboard/getWorldMap + +![getWorldMap](../docs/Images/DashBoardResource_getDashBoardWorldMap.png.png) + +This Get Dashboard World endpoint is the entry point for populating the World Map. + +It receives parameters that allow knowing which data to filter. +These are: The user, the year and the Ratings chosen. + +The first important method Get World Map Info is divided into three steps. + + FindByRatingAndScoreGreaterThanAndYear method that, depending on the values + entered, will find all available Ratings for this user to choose later in the UI. + 1.1.2:() => it is not a method but a lambda expression that will assign the weights introduced by the user to the corresponding ratings. + Map Data Source To World Map is a method that maps the scores of each country in two important steps. + Distinct By Key each rating has multiple countries and we need to filter the list of single countries so this method returns a single list of countries based on the chosen ratings. + Calculate Final Score Based on the weight chosen by the user, the formula is applied to each rating to reference each score in each country present. + +Examples of the calculation done to get the score for each country: + +Formula: Score = ( rating1Score * weight1 ) + (rating2Score * weight2 ) + +Score: Country → Germany , Score = ( 36 from CPI Rating * 0.4 % ) + 50 from Basel * 0.6% ) + + +#### Endpoint: /dashboard/allYears + +![getAllYears](../docs/Images/DashBoardResource_getYears.png) + +This endpoint returns all possible years based on the ratings this user can view. +So in the UI we have a bar with the years in which, when changing, the user can see the various ratings for each selected year. + +We have only one important method which is the findRatingsByCompanyUser which based on the user who is consulting the year will be filtered and returned. + + +#### Endpoint: /dashboard/ratingsByYear + +![getRatings](../docs/Images/DashBoardResource_ratingsByYear.png) + +This endpoint, as mentioned above, receives the selected year and returns the available ratings for this user based on the year. + +Here we have an important step that calls two methods. + +On findRatingsByYearAndCompanyUser we need to call two methods, findRatingsByYearAndTypeGlobal which returns all global ratings that are for all users based on year and findRatingByYearAndUser all ratings that this user has available to him filtered by year here can be uniquely loaded by you in the api of Upload. + + +#### Endpoint: /dashboard/getTemplate + +![getTemplate](../docs/Images/image2022-10-13_16-45-20.jpg) + +This method just implements the download of a template so that users can fill and upload their own ratings. + + +#### Endpoint: /dashboard/uploadCsv + +![UploadCSV](../docs/Images/DashBoardResource_uploadFile.png) + +This method is used to upload new ratings, it receives the name of the rating and the user who uploaded it as a parameter. + +The save Csv method consists of two steps, getOrCreate and 1.1.2 saveCSV. + +Get or Create is based on searching if this user already exists and if it does not exist, it creates a new one with its data. + +1.1.2 Save Csv reads each line of the file, divides and validates if all the necessary parameters are present to be able to save each score corresponding to each country. + +Each line must contain the Continent of the Country, the name that may vary depending on the language, the isocode 2 and isocode 3, the score may not be mandatory and is by default at -1 if it is not present. + + +#### Endpoint: /dashboard/getUserRanges + +![getRanges](../docs/Images/DashBoardResource_userRanges.png) + +This endpoint is simple, it only validates if the user already has saved ranges or uses default values, these ranges are used to define the range of each color in the UI, which then defines how each country will be painted based on its score. + +Get User Ranges Or Default is the method that validates if they exist if not, by default, it returns their default values. + +Min → 0-25 that represents red color + +Between → 26-50 that represents yellow color + +Max → 51-100 that represents red color + + +#### Endpoint: /dashboard/getCountryFilterByISO2 + +![filterIso2](../docs/Images/DashBoardResource_getCompanyBpns.jpg) + +This endpoint retrieves all the Countries ordered by their ISO2 code. As a parameter it receives an CompanyUser object. + +This information flows through various methods (1, 1.1) until it reaches the method getCountryFilterByISO2 (1.1.1) in the class CountryLogicService where most of the operations are located. + +In this method, firstly it is invoked the findAll method (1.1.1.1) which gets all the countrys with an distinct ISO2 code (1.1.1.2) and this data is stored in the List of CountryDTO. After that the List is iterated using a forEach Statment (1.1.1.3), and inside of it it is invoked the getTotalBpnByCountry (1.1.1.3.1) from the ExternalBussinessPartnersLogicService class. + +The method getTotalBpnByCountry (1.1.1.3.1) receives as parameters an CountryDTO from the iteration of the List of CountryDTO that was returned on the method (1.1.1.1) and an CompanyUserDTO. Inside of the method it is invoked the getExternalBusinessPartners (1.1.1.3.1.1) which returns Business Partners associated to a Company User and this data is stored inside an List of BusinessPartnersDTO, which will then be used to filter the number of Business Partners present in the countries retrieved earlier in the 1.1.1.1 method. + +After that a value (Long) is returned consequently until the last List element is reached and using an setter method (setTotalBpn) it is added an value to the totalBpn variable in the Object of Countries List. + +After that, the List of CountryDTO's id returned all the way through to the DashBoardResource class that contains the getCountrys method. + + +#### Endpoint: /dashboard/getCompanyBpns + +![getCompanyBPN](../docs/Images/DashBoardResource_getCompanyBpns.jpg) + +This endpoint retrieves all the Business partners associated to a company. In the DashboardResource we invoke the getExternalBusinessPartners method, in which we send through an CompanyUser (1.1). + +Inside the DashboardService class we return the result from the method getExternalBusinessPartners (1.1.1) returns Business Partners associated to a Company User. + +In the end, after the data is retrieved, this data is returned as a List of BussinessPartners objects to the main class DashBoardResource in the method getCompanyBpns. + + +#### Endpoint: /dashboard/getBpnCountrys + +![getBPNCountry](../docs/Images/DashBoardResource_getBpnCountrys.jpg) + +This endpoint retrieves all the countries that are associated to the Business partners. In the DashboardResource we invoke the getCountryByAssociatedBPtoUser (1.1) method, in which we send through an CompanyUser. + +In the DashboardService class, we invoke the method getAssociatedCountries (1.1.1), in which there are two methods: getExternalPartnersCountry (1.1.1.1) and the findByCountryIn (1.1.1.2). + +The method getExternalPartnersCountry (1.1.1.1) it is returned the Countries from Business Partners associated to a Company User and store the result in a List of Strings. + +The method findByCountryIn (1.1.1.2) we pass the returned List of String of the method (1.1.1.1) and it is returned the full information of an country which is present on that same List of Strings. This information is then stored in a List of CountryDTO, which then is returned to the class DashBoardResource to the method getBpnCountrys (1). + + +#### Endpoint: /dashboard/saveUserRanges + +![saveRanges](../docs/Images/DashBoardResource_saveRanges.jpg) + +In this endpoint, it is received as a parameter a List of RangeDTO that contain three different values affect to three different "Types" (Max, Between and Min) and a CompanyUser. + +The method 1.1.1 getOrCreate does the following: if the presented company user does not have an row stored in the database, it creates it with the current information, otherwise it gets the current data on the row with the same data and returns it to the saveRanges (1.1) method. + +After that, in the 1.1.2 saveRanges method, that is inside the RangeLogicService class, it is passed as a parameter the returned CompanyUser and the RangesDTO. + +Inside this method (1.1.2), firstly it is invoked the method 1.1.2.1 getUserRanges which returns a List of RangeDTO related to the company user if this exists on the database. + +In 1.1.2.2 an iteration is made if the returned List is empty. In this iteration it is created an rangeDTO for the related company user and saved in 1.1.2.2.1. + +If the range already exists, in 1.1.2.3 an ForEach iteration is made where the RangeDTO objects from the returned List in 1.1.2 are updated (1.1.2.3.1) according the new values received as a parameter in the saveRanges method (1). + + +#### Endpoint: /dashboard/getReportsByCompanyUser + +![getReport](../docs/Images/DashBoardResource_getReportsByCompanyUser.jpg) + +In this endpoint, it is received as a parameter only the CompanyUser. It is used to return an list of ReportDTO related to the CompanyUser parameter received. + +The method 1.1 that is inside the dashboardService class, two methods are used to retrieve report information. The methods are the 1.1.1 getCompanyReports and 1.1.2 getReportsForCompanyUser + +The 1.1.1 method is going to retrieve a list of ReportDTO according the CompanyUser company name a Type Company. + +The 1.1.2 method is going to retrieve a list of ReportDTO according the CompanyUser name, CompanyUser company name and Type Custom. + +After that, this lists are joined into a biggest ReportDTO List, that then is returned to the main class method getReportsByCompanyUser. + + +#### Endpoint: /dashboard/saveReports + +![saveReport](../docs/Images/image2023-1-11_9-40-3.jpg) + +In this endpoint, it is received as a parameter the CompanyUser and an ReportDTO that will be saved. It is used to save an ReportDTO related to the CompanyUser parameter received. + +The method 1.1.1 getOrCreate will receive the parameter CompanyUser, and will do a verification if that user is already created. If not it will create that user. + +After that, on the 1.1.2 saveReport, both the companyUserDTO recently created or already present on the database and the ReportDTO will be used as variable on that method. + +Firstly an verification is done to check if the ReportDTO has an id associated to him. This will only be he case in the Update endpoint, so this verification will not be true. After this, it is associated to the ReportDTO the companyUserDTO company name and name, and after this the ReportDTO is saved (1.1.2.1.6.1). + +After this an verification is done onto the recently saved ReportDTO, to check if the ReportValuesDTO inside of this object is not empty or null. If this is false, an for each clause will occur and save each reportValues associated to the recently created Report. + +After this an Http OK alert is shown. + +If the report would been duplicated, an Http Bad Request status would be shown, and the same if some failure would occur on the process. + + +#### Endpoint: /dashboard/shareReports + +![shareReports](../docs/Images/image2023-1-11_9-48-39.jpg) + +In this endpoint, it is received as a parameter the CompanyUser and an ReportDTO that will be used to be shared. It is used to share an ReportDTO related to the CompanyUser parameter received. + +The method 1.1.1 findByNameEmailAndCompany will receive the name, email and company from the ReportDTO, and will do a verification if that user exists. If not it will show an Http status not found. + +After that, on the 1.1.2 saveReport, both the companyUserDTO recently created or already present on the database and the ReportDTO will be used as variable on that method. + +Firstly an verification is done to check if the ReportDTO has an id associated to him. This will only be he case in the Update endpoint, so this verification will not be true. After this, it is associated to the ReportDTO the companyUserDTO company name and name, and after this the ReportDTO is saved (1.1.2.1.6.1). + +After this an verification is done onto the recently saved ReportDTO, to check if the ReportValuesDTO inside of this object is not empty or null. If this is false, an for each clause will occur and save each reportValues associated to the recently created Report. + +After this an Http OK alert is shown. + +If the report would been duplicated, an Http Bad Request status would be shown, and the same if some failure would occur on the process. + + +#### Endpoint: /dashboard/updateReports + +![updateReports](../docs/Images/image2023-1-11_9-49-15.jpg) + +In this endpoint, it is received as a parameter the CompanyUser and an ReportDTO that will be used to be upated. It is used to update an ReportDTO related to the CompanyUser parameter received. + +The method 1.1.1 getOrCreate will receive the parameter CompanyUser, and will do a verification if that user is already created. If not it will create that user. + +After that, on the 1.1.2 saveReport, both the companyUserDTO recently created or already present on the database and the ReportDTO will be used as variable on that method. + +Firstly an verification is done to check if the ReportDTO has an id associated to him. This will only be he case in the Update endpoint, so this verification will true in this case. After this, the updateReport method (1.1.2.1) will be opened and in there the method 1.1.2.1.1 findOne will try to find an ReportDTO with respective id. If it is not found, an http not found error will show up. + +Else if this does not occur, an validation is done with the method 1.1.2.1.3 validatePermissionToChangeReport, which will do an cross check between the CompanyUser and the found ReportDTO. If this check is false, an http unauthorized error is shown, else the code continues. + +After the 1.1.2.1.3 verification, the respective ReportValues are found according to the ReportDTO, and each found values are firstly deleted and then saved with the new information. + +After this an Http no content alert is shown, as a sign that the request has been fulfilled. + + +#### Endpoint: /dashboard/getReportsValueByReport + +![getValueReport](../docs/Images/image2023-1-11_13-23-10.jpg) + +In this endpoint, it is received as a parameter the CompanyUser and an ReportDTO. It is used to return an list of ReportValuesDTO related to the CompanyUser and RepotDTO parameters received. + +The method 1.1 that is inside the dashboardService class, the 1.1.1 getReportValues is used to firstly do a verification if the ReportDTO parameter is null, in which case an empty ArrayList is returned, otherwise the 1.1.1.1 findByReport method is done to retrieved the data (ReportValuesDTO) associated with the ReportDTO. + +After this, an List of ReportValuesDTO is returned in the main class (DashBoardResouce). + + +#### Endpoint: /dashboard/getAllUserBPDMGates + +![getBPDMGates](../docs/Images/image2023-1-11_9-49-32.jpg) + +In this endpoint, it is received as a parameter the CompanyUser. It is used to return an list of CompanyGatesDTO related to the CompanyUser. + +The method 1.1.1 getGatesForCompanyUser, it firstly done the method getCompanyByCompanyName which should return an CompanyDTO in case this exists based on the CompanyUser Company. If this CompanyDTO is present, the 1.1.1.2 findByCompanyGroup method is called which will return a list of CompanyGatesDTO based on the recently returned CompanyDTO. + +After this, an List of CompanyGatesDTOS is returned in the main class (DashBoardResouce). + + +#### Endpoint: /dashboard/getAllRatingsForCompany + +![getAllRatingsforCompany](../docs/Images/image2023-1-11_9-58-31.jpg) + +In this endpoint, it is received as a parameter the CompanyUser and a Integer Year. It is used to return an list of DataSourceDTO related to the CompanyUser and inserted year. + +The method 1.1.1.1 findRatingsByYearAndTypeGlobal will return a list of DataSourceDTO based on the selected year, and only return these DTOs with Type Global. + +After that, the method 1.1.1.2 findByYearPublishedAndCompanyUserCompanyNameAndType will return also an List of DatasoureDTO based on the year, companyUser and the Type Company. + +After this, both lists are join onto one and returned in the main class as an List of DataSourceDTO. + + +#### Endpoint: /dashboard/getAllRatingsScoresForEachBpn + +![getRatingsScore](../docs/Images/image2023-1-11_9-58-28.jpg) + +In this endpoint, it is received as a parameter the CompanyUser an dataSource object and a businessPartner object. It is used to return an list of ShareDTO(Mapped ratings to the business partners) related to the parameters inserted. + +Inside the method 1.1.1 findRatingsScoresForEachBpn, the method 1.1.1.1 will add BusinessPartnerDTO into List of BusinessPartnerDTO. + +After this, an for each clause is done into the received list of businessPartner and other clause into the recently created list. This will set the country into the list of the businessPartners received into the parameter. + +After this, an List of String is created that will store all countries related to the BusinessPartnerDTO (1.1.1.3) and is populated according to the BusinessPartnetDTO countries. + +Then, an List of String that will get the name of the Data Sources will also be populated according the DataSourceDTO. + +With this, the DataSource parameter will be iterated with the for each clause, and an List of DataDTO will be filled according with the method 1.1.1.3.1.1, using as parameter both DataSource names and countries String list. + +Finnaly, the mapping will be done for each ShareDTO, that then will return inside of an List. + + +#### Endpoint: /dashboard/deleteReport/{id} + +![deleteReport](../docs/Images/image2023-1-11_9-58-36.jpg) + +This endpoint receives and CompanyUser and also an Long variable which is the id. It is used to delete an Report. + +Firstly in the method 1.1.1.1 it is used the report id to request the Report associated to that id. If this is not found, and Http Not Found error is presented. + +If that is not the case, an verification is done using the 1.1.1.3 validatePermissionToChangeReport method, which is where an verification is done to see if the found report values (CompanyName, Name) are the same as the CompanyUser, and also if the CompanyUser is an Admin, which only the Admin can delete an report in this case. + +If the CompanyUser in not an Admin, and Http Unauthorized is presented. + +If all verifications are met, then the 1.1.1.4 method findByReport will return an list of ReportValuesDTO related to the reportDTO found earlier, which then that list is iterated in an for each clause whit the 1.1.1.5.1 delete method, that received in each run the reportValuesDTO id and then in the 1.1.1.6 fully delte the ReportDTO using its id. + +After this, in the main class DashBoardResource, and Http no content is presented as an successful request. + + +#### Endpoint: /dashboard/deleteRating/{id} + +![deleteRating](../docs/Images/image2023-1-11_9-58-39.jpg) + +This endpoint receives and CompanyUser and also an Long variable which is the id. It is used to delete an Rating. + +Firstly in the method 1.1.1.1 it is used the rating id to request the Rating associated to that id. If this is not found, and Http Not Found error is presented. + +If that is not the case, an verification is done to see if the found rating values (CompanyName, Name, Email) are the same as the CompanyUser, and also if the CompanyUser is an Admin, which only the Admin can delete an rating in this case. + +If the CompanyUser in not an Admin, and Http Unauthorized is presented. + +If all verifications are met, then the 1.1.1.3 method findByDataSource will return an list of DataSourceValuesDTO related to the dataSourceDTO found earlier, which then that list is iterated in an for each clause whit the 1.1.1.4.1 delete method, that received in each run the DataSourceValueDTO id, and then in the 1.1.1.5 fully delte the DataSourceDTO using its id. + +After this, in the main class DashBoardResource, and Http no content is presented as an successful request. + + +#### Endpoint: /dashboard/getUserFromCompany + +![getCompany](../docs/Images/image2023-1-11_9-58-21.jpg) + +This endpoint receives as an parameter an CompanyUser. It is used to retrieve an List of CompanyUserDto from an company. + +In the method 1.1.1.1 findAllUserFromCompany, it simply uses the CompanyUser object, gets his company name and does a request to retrieve an List of CompanyUserDTO, which is then returned in the main class DashBoardResouce. + + + +# Quality Requirements + +## Quality Tree + +## Quality Scenarios + +# Risks and Technical Debts diff --git a/docs/Images/DashBoardResource_getAllDashBoardTable.jpg b/docs/Images/DashBoardResource_getAllDashBoardTable.jpg new file mode 100644 index 00000000..0559dfcc Binary files /dev/null and b/docs/Images/DashBoardResource_getAllDashBoardTable.jpg differ diff --git a/docs/Images/DashBoardResource_getBpnCountrys.jpg b/docs/Images/DashBoardResource_getBpnCountrys.jpg new file mode 100644 index 00000000..5f3de75a Binary files /dev/null and b/docs/Images/DashBoardResource_getBpnCountrys.jpg differ diff --git a/docs/Images/DashBoardResource_getCompanyBpns.jpg b/docs/Images/DashBoardResource_getCompanyBpns.jpg new file mode 100644 index 00000000..d0d5dc3c Binary files /dev/null and b/docs/Images/DashBoardResource_getCompanyBpns.jpg differ diff --git a/docs/Images/DashBoardResource_getCountrys.jpg b/docs/Images/DashBoardResource_getCountrys.jpg new file mode 100644 index 00000000..bd148ccb Binary files /dev/null and b/docs/Images/DashBoardResource_getCountrys.jpg differ diff --git a/docs/Images/DashBoardResource_getDashBoardWorldMap.png.png b/docs/Images/DashBoardResource_getDashBoardWorldMap.png.png new file mode 100644 index 00000000..1517ce41 Binary files /dev/null and b/docs/Images/DashBoardResource_getDashBoardWorldMap.png.png differ diff --git a/docs/Images/DashBoardResource_getReportsByCompanyUser.jpg b/docs/Images/DashBoardResource_getReportsByCompanyUser.jpg new file mode 100644 index 00000000..e345667a Binary files /dev/null and b/docs/Images/DashBoardResource_getReportsByCompanyUser.jpg differ diff --git a/docs/Images/DashBoardResource_getYears.png b/docs/Images/DashBoardResource_getYears.png new file mode 100644 index 00000000..a71c26b4 Binary files /dev/null and b/docs/Images/DashBoardResource_getYears.png differ diff --git a/docs/Images/DashBoardResource_ratingsByYear.png b/docs/Images/DashBoardResource_ratingsByYear.png new file mode 100644 index 00000000..aa3492af Binary files /dev/null and b/docs/Images/DashBoardResource_ratingsByYear.png differ diff --git a/docs/Images/DashBoardResource_saveRanges.jpg b/docs/Images/DashBoardResource_saveRanges.jpg new file mode 100644 index 00000000..a16d9a87 Binary files /dev/null and b/docs/Images/DashBoardResource_saveRanges.jpg differ diff --git a/docs/Images/DashBoardResource_uploadFile.png b/docs/Images/DashBoardResource_uploadFile.png new file mode 100644 index 00000000..1a68251d Binary files /dev/null and b/docs/Images/DashBoardResource_uploadFile.png differ diff --git a/docs/Images/DashBoardResource_userRanges.png b/docs/Images/DashBoardResource_userRanges.png new file mode 100644 index 00000000..3a387c51 Binary files /dev/null and b/docs/Images/DashBoardResource_userRanges.png differ diff --git a/docs/Images/DataModel_v6.png b/docs/Images/DataModel_v6.png new file mode 100644 index 00000000..2675d412 Binary files /dev/null and b/docs/Images/DataModel_v6.png differ diff --git a/docs/Images/RolesRights.jpg b/docs/Images/RolesRights.jpg new file mode 100644 index 00000000..c0abe050 Binary files /dev/null and b/docs/Images/RolesRights.jpg differ diff --git a/docs/Images/diagram_compenent.png b/docs/Images/diagram_compenent.png new file mode 100644 index 00000000..5c806034 Binary files /dev/null and b/docs/Images/diagram_compenent.png differ diff --git a/docs/Images/image2022-10-10_13-31-47.png b/docs/Images/image2022-10-10_13-31-47.png new file mode 100644 index 00000000..67a1c513 Binary files /dev/null and b/docs/Images/image2022-10-10_13-31-47.png differ diff --git a/docs/Images/image2022-10-10_13-32-5.png b/docs/Images/image2022-10-10_13-32-5.png new file mode 100644 index 00000000..1ab6508e Binary files /dev/null and b/docs/Images/image2022-10-10_13-32-5.png differ diff --git a/docs/Images/image2022-10-10_13-33-31.png b/docs/Images/image2022-10-10_13-33-31.png new file mode 100644 index 00000000..823d3c92 Binary files /dev/null and b/docs/Images/image2022-10-10_13-33-31.png differ diff --git a/docs/Images/image2022-10-10_13-33-47.png b/docs/Images/image2022-10-10_13-33-47.png new file mode 100644 index 00000000..2c60bed7 Binary files /dev/null and b/docs/Images/image2022-10-10_13-33-47.png differ diff --git a/docs/Images/image2022-10-10_13-34-17.png b/docs/Images/image2022-10-10_13-34-17.png new file mode 100644 index 00000000..9a9190a1 Binary files /dev/null and b/docs/Images/image2022-10-10_13-34-17.png differ diff --git a/docs/Images/image2022-10-10_13-36-1.png b/docs/Images/image2022-10-10_13-36-1.png new file mode 100644 index 00000000..bb9960df Binary files /dev/null and b/docs/Images/image2022-10-10_13-36-1.png differ diff --git a/docs/Images/image2022-10-10_13-43-23.png b/docs/Images/image2022-10-10_13-43-23.png new file mode 100644 index 00000000..9f0363cd Binary files /dev/null and b/docs/Images/image2022-10-10_13-43-23.png differ diff --git a/docs/Images/image2022-10-10_13-43-40.png b/docs/Images/image2022-10-10_13-43-40.png new file mode 100644 index 00000000..f93c92b3 Binary files /dev/null and b/docs/Images/image2022-10-10_13-43-40.png differ diff --git a/docs/Images/image2022-10-10_13-43-5.png b/docs/Images/image2022-10-10_13-43-5.png new file mode 100644 index 00000000..f47e2908 Binary files /dev/null and b/docs/Images/image2022-10-10_13-43-5.png differ diff --git a/docs/Images/image2022-10-10_13-43-58.png b/docs/Images/image2022-10-10_13-43-58.png new file mode 100644 index 00000000..6848c207 Binary files /dev/null and b/docs/Images/image2022-10-10_13-43-58.png differ diff --git a/docs/Images/image2022-10-10_13-44-13.png b/docs/Images/image2022-10-10_13-44-13.png new file mode 100644 index 00000000..439a861b Binary files /dev/null and b/docs/Images/image2022-10-10_13-44-13.png differ diff --git a/docs/Images/image2022-10-10_13-55-27.png b/docs/Images/image2022-10-10_13-55-27.png new file mode 100644 index 00000000..f3284348 Binary files /dev/null and b/docs/Images/image2022-10-10_13-55-27.png differ diff --git a/docs/Images/image2022-10-10_14-1-24.png b/docs/Images/image2022-10-10_14-1-24.png new file mode 100644 index 00000000..c508db67 Binary files /dev/null and b/docs/Images/image2022-10-10_14-1-24.png differ diff --git a/docs/Images/image2022-10-10_14-2-42.png b/docs/Images/image2022-10-10_14-2-42.png new file mode 100644 index 00000000..8d3f40f0 Binary files /dev/null and b/docs/Images/image2022-10-10_14-2-42.png differ diff --git a/docs/Images/image2022-10-10_14-32-53.png b/docs/Images/image2022-10-10_14-32-53.png new file mode 100644 index 00000000..ce1f21bc Binary files /dev/null and b/docs/Images/image2022-10-10_14-32-53.png differ diff --git a/docs/Images/image2022-10-10_14-53-55.png b/docs/Images/image2022-10-10_14-53-55.png new file mode 100644 index 00000000..40f317bf Binary files /dev/null and b/docs/Images/image2022-10-10_14-53-55.png differ diff --git a/docs/Images/image2022-10-10_14-9-44.png b/docs/Images/image2022-10-10_14-9-44.png new file mode 100644 index 00000000..c37a2d0e Binary files /dev/null and b/docs/Images/image2022-10-10_14-9-44.png differ diff --git a/docs/Images/image2022-10-10_15-30-37.png b/docs/Images/image2022-10-10_15-30-37.png new file mode 100644 index 00000000..0b46b4a4 Binary files /dev/null and b/docs/Images/image2022-10-10_15-30-37.png differ diff --git a/docs/Images/image2022-10-10_15-43-52.png b/docs/Images/image2022-10-10_15-43-52.png new file mode 100644 index 00000000..fa9a8701 Binary files /dev/null and b/docs/Images/image2022-10-10_15-43-52.png differ diff --git a/docs/Images/image2022-10-10_16-49-37.png b/docs/Images/image2022-10-10_16-49-37.png new file mode 100644 index 00000000..5e66edf9 Binary files /dev/null and b/docs/Images/image2022-10-10_16-49-37.png differ diff --git a/docs/Images/image2022-10-10_16-52-17.png b/docs/Images/image2022-10-10_16-52-17.png new file mode 100644 index 00000000..87877f44 Binary files /dev/null and b/docs/Images/image2022-10-10_16-52-17.png differ diff --git a/docs/Images/image2022-10-10_17-17-20.png b/docs/Images/image2022-10-10_17-17-20.png new file mode 100644 index 00000000..f4341897 Binary files /dev/null and b/docs/Images/image2022-10-10_17-17-20.png differ diff --git a/docs/Images/image2022-10-10_17-21-38.png b/docs/Images/image2022-10-10_17-21-38.png new file mode 100644 index 00000000..035d919b Binary files /dev/null and b/docs/Images/image2022-10-10_17-21-38.png differ diff --git a/docs/Images/image2022-10-10_17-33-9.png b/docs/Images/image2022-10-10_17-33-9.png new file mode 100644 index 00000000..09a0558c Binary files /dev/null and b/docs/Images/image2022-10-10_17-33-9.png differ diff --git a/docs/Images/image2022-10-10_17-34-12.png b/docs/Images/image2022-10-10_17-34-12.png new file mode 100644 index 00000000..a88b097c Binary files /dev/null and b/docs/Images/image2022-10-10_17-34-12.png differ diff --git a/docs/Images/image2022-10-10_17-4-35.png b/docs/Images/image2022-10-10_17-4-35.png new file mode 100644 index 00000000..086cd55d Binary files /dev/null and b/docs/Images/image2022-10-10_17-4-35.png differ diff --git a/docs/Images/image2022-10-10_17-42-14.png b/docs/Images/image2022-10-10_17-42-14.png new file mode 100644 index 00000000..ac446a64 Binary files /dev/null and b/docs/Images/image2022-10-10_17-42-14.png differ diff --git a/docs/Images/image2022-10-10_17-42-59.png b/docs/Images/image2022-10-10_17-42-59.png new file mode 100644 index 00000000..04bc3f91 Binary files /dev/null and b/docs/Images/image2022-10-10_17-42-59.png differ diff --git a/docs/Images/image2022-10-10_17-8-48.png b/docs/Images/image2022-10-10_17-8-48.png new file mode 100644 index 00000000..6f1f7fe6 Binary files /dev/null and b/docs/Images/image2022-10-10_17-8-48.png differ diff --git a/docs/Images/image2022-10-11_8-23-17.png b/docs/Images/image2022-10-11_8-23-17.png new file mode 100644 index 00000000..15c92e77 Binary files /dev/null and b/docs/Images/image2022-10-11_8-23-17.png differ diff --git a/docs/Images/image2022-10-11_8-30-59.png b/docs/Images/image2022-10-11_8-30-59.png new file mode 100644 index 00000000..dab31618 Binary files /dev/null and b/docs/Images/image2022-10-11_8-30-59.png differ diff --git a/docs/Images/image2022-10-11_9-12-26.png b/docs/Images/image2022-10-11_9-12-26.png new file mode 100644 index 00000000..b338a476 Binary files /dev/null and b/docs/Images/image2022-10-11_9-12-26.png differ diff --git a/docs/Images/image2022-10-11_9-13-22.png b/docs/Images/image2022-10-11_9-13-22.png new file mode 100644 index 00000000..92911474 Binary files /dev/null and b/docs/Images/image2022-10-11_9-13-22.png differ diff --git a/docs/Images/image2022-10-13_16-45-20.jpg b/docs/Images/image2022-10-13_16-45-20.jpg new file mode 100644 index 00000000..872c50d0 Binary files /dev/null and b/docs/Images/image2022-10-13_16-45-20.jpg differ diff --git a/docs/Images/image2022-10-26_18-42-52.png b/docs/Images/image2022-10-26_18-42-52.png new file mode 100644 index 00000000..647f67ef Binary files /dev/null and b/docs/Images/image2022-10-26_18-42-52.png differ diff --git a/docs/Images/image2022-12-30_11-37-34.png b/docs/Images/image2022-12-30_11-37-34.png new file mode 100644 index 00000000..c57d0a22 Binary files /dev/null and b/docs/Images/image2022-12-30_11-37-34.png differ diff --git a/docs/Images/image2022-12-30_11-50-52.png b/docs/Images/image2022-12-30_11-50-52.png new file mode 100644 index 00000000..27e87107 Binary files /dev/null and b/docs/Images/image2022-12-30_11-50-52.png differ diff --git a/docs/Images/image2022-12-5_12-40-53.png b/docs/Images/image2022-12-5_12-40-53.png new file mode 100644 index 00000000..74116161 Binary files /dev/null and b/docs/Images/image2022-12-5_12-40-53.png differ diff --git a/docs/Images/image2022-12-5_12-59-48.png b/docs/Images/image2022-12-5_12-59-48.png new file mode 100644 index 00000000..f7af3b1e Binary files /dev/null and b/docs/Images/image2022-12-5_12-59-48.png differ diff --git a/docs/Images/image2022-12-5_13-31-21.png b/docs/Images/image2022-12-5_13-31-21.png new file mode 100644 index 00000000..93b37fc9 Binary files /dev/null and b/docs/Images/image2022-12-5_13-31-21.png differ diff --git a/docs/Images/image2022-12-5_13-31-59.png b/docs/Images/image2022-12-5_13-31-59.png new file mode 100644 index 00000000..25257922 Binary files /dev/null and b/docs/Images/image2022-12-5_13-31-59.png differ diff --git a/docs/Images/image2022-12-5_13-32-54.png b/docs/Images/image2022-12-5_13-32-54.png new file mode 100644 index 00000000..41ae756a Binary files /dev/null and b/docs/Images/image2022-12-5_13-32-54.png differ diff --git a/docs/Images/image2022-12-5_13-33-24.png b/docs/Images/image2022-12-5_13-33-24.png new file mode 100644 index 00000000..41588c50 Binary files /dev/null and b/docs/Images/image2022-12-5_13-33-24.png differ diff --git a/docs/Images/image2022-12-5_13-33-41.png b/docs/Images/image2022-12-5_13-33-41.png new file mode 100644 index 00000000..1da052ff Binary files /dev/null and b/docs/Images/image2022-12-5_13-33-41.png differ diff --git a/docs/Images/image2022-12-5_13-38-58.png b/docs/Images/image2022-12-5_13-38-58.png new file mode 100644 index 00000000..7ff3fb55 Binary files /dev/null and b/docs/Images/image2022-12-5_13-38-58.png differ diff --git a/docs/Images/image2022-12-5_14-14-19.png b/docs/Images/image2022-12-5_14-14-19.png new file mode 100644 index 00000000..d9f8ca3c Binary files /dev/null and b/docs/Images/image2022-12-5_14-14-19.png differ diff --git a/docs/Images/image2022-12-5_14-14-53.png b/docs/Images/image2022-12-5_14-14-53.png new file mode 100644 index 00000000..c336f027 Binary files /dev/null and b/docs/Images/image2022-12-5_14-14-53.png differ diff --git a/docs/Images/image2022-12-5_14-23-26.png b/docs/Images/image2022-12-5_14-23-26.png new file mode 100644 index 00000000..7096ebd7 Binary files /dev/null and b/docs/Images/image2022-12-5_14-23-26.png differ diff --git a/docs/Images/image2022-12-5_14-24-2.png b/docs/Images/image2022-12-5_14-24-2.png new file mode 100644 index 00000000..0b493f48 Binary files /dev/null and b/docs/Images/image2022-12-5_14-24-2.png differ diff --git a/docs/Images/image2022-12-5_14-8-29.png b/docs/Images/image2022-12-5_14-8-29.png new file mode 100644 index 00000000..68566d45 Binary files /dev/null and b/docs/Images/image2022-12-5_14-8-29.png differ diff --git a/docs/Images/image2023-1-11_13-23-10.jpg b/docs/Images/image2023-1-11_13-23-10.jpg new file mode 100644 index 00000000..4f44237f Binary files /dev/null and b/docs/Images/image2023-1-11_13-23-10.jpg differ diff --git a/docs/Images/image2023-1-11_9-40-3.jpg b/docs/Images/image2023-1-11_9-40-3.jpg new file mode 100644 index 00000000..5ca2c130 Binary files /dev/null and b/docs/Images/image2023-1-11_9-40-3.jpg differ diff --git a/docs/Images/image2023-1-11_9-48-39.jpg b/docs/Images/image2023-1-11_9-48-39.jpg new file mode 100644 index 00000000..1f35348e Binary files /dev/null and b/docs/Images/image2023-1-11_9-48-39.jpg differ diff --git a/docs/Images/image2023-1-11_9-49-15.jpg b/docs/Images/image2023-1-11_9-49-15.jpg new file mode 100644 index 00000000..432c9eb8 Binary files /dev/null and b/docs/Images/image2023-1-11_9-49-15.jpg differ diff --git a/docs/Images/image2023-1-11_9-49-32.jpg b/docs/Images/image2023-1-11_9-49-32.jpg new file mode 100644 index 00000000..86b1bcbe Binary files /dev/null and b/docs/Images/image2023-1-11_9-49-32.jpg differ diff --git a/docs/Images/image2023-1-11_9-58-21.jpg b/docs/Images/image2023-1-11_9-58-21.jpg new file mode 100644 index 00000000..c69eb8e2 Binary files /dev/null and b/docs/Images/image2023-1-11_9-58-21.jpg differ diff --git a/docs/Images/image2023-1-11_9-58-28.jpg b/docs/Images/image2023-1-11_9-58-28.jpg new file mode 100644 index 00000000..3803ed7d Binary files /dev/null and b/docs/Images/image2023-1-11_9-58-28.jpg differ diff --git a/docs/Images/image2023-1-11_9-58-31.jpg b/docs/Images/image2023-1-11_9-58-31.jpg new file mode 100644 index 00000000..85406c7c Binary files /dev/null and b/docs/Images/image2023-1-11_9-58-31.jpg differ diff --git a/docs/Images/image2023-1-11_9-58-36.jpg b/docs/Images/image2023-1-11_9-58-36.jpg new file mode 100644 index 00000000..3e3740bc Binary files /dev/null and b/docs/Images/image2023-1-11_9-58-36.jpg differ diff --git a/docs/Images/image2023-1-11_9-58-39.jpg b/docs/Images/image2023-1-11_9-58-39.jpg new file mode 100644 index 00000000..55115fbd Binary files /dev/null and b/docs/Images/image2023-1-11_9-58-39.jpg differ diff --git a/docs/Images/image2023-1-15_19-3-44.png b/docs/Images/image2023-1-15_19-3-44.png new file mode 100644 index 00000000..f66df511 Binary files /dev/null and b/docs/Images/image2023-1-15_19-3-44.png differ diff --git a/docs/Images/image2023-1-15_21-49-22.png b/docs/Images/image2023-1-15_21-49-22.png new file mode 100644 index 00000000..4a10c033 Binary files /dev/null and b/docs/Images/image2023-1-15_21-49-22.png differ diff --git a/docs/User-Guide-Images/image2023-1-15_22-10-48.png b/docs/User-Guide-Images/image2023-1-15_22-10-48.png new file mode 100644 index 00000000..e6300631 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-15_22-10-48.png differ diff --git a/docs/User-Guide-Images/image2023-1-15_22-6-37.png b/docs/User-Guide-Images/image2023-1-15_22-6-37.png new file mode 100644 index 00000000..8e432a98 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-15_22-6-37.png differ diff --git a/docs/User-Guide-Images/image2023-1-15_22-6-5.png b/docs/User-Guide-Images/image2023-1-15_22-6-5.png new file mode 100644 index 00000000..3a87423d Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-15_22-6-5.png differ diff --git a/docs/User-Guide-Images/image2023-1-15_22-8-14.png b/docs/User-Guide-Images/image2023-1-15_22-8-14.png new file mode 100644 index 00000000..f43a6a65 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-15_22-8-14.png differ diff --git a/docs/User-Guide-Images/image2023-1-15_22-8-54.png b/docs/User-Guide-Images/image2023-1-15_22-8-54.png new file mode 100644 index 00000000..79d5b077 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-15_22-8-54.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_10-54-3.png b/docs/User-Guide-Images/image2023-1-16_10-54-3.png new file mode 100644 index 00000000..f79cc878 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_10-54-3.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_10-55-20.png b/docs/User-Guide-Images/image2023-1-16_10-55-20.png new file mode 100644 index 00000000..43f53b3e Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_10-55-20.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-0-2.png b/docs/User-Guide-Images/image2023-1-16_11-0-2.png new file mode 100644 index 00000000..cf855297 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-0-2.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-1-17.png b/docs/User-Guide-Images/image2023-1-16_11-1-17.png new file mode 100644 index 00000000..04323241 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-1-17.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-11-8.png b/docs/User-Guide-Images/image2023-1-16_11-11-8.png new file mode 100644 index 00000000..6e742c10 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-11-8.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-12-24.png b/docs/User-Guide-Images/image2023-1-16_11-12-24.png new file mode 100644 index 00000000..d76ec4da Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-12-24.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-13-58.png b/docs/User-Guide-Images/image2023-1-16_11-13-58.png new file mode 100644 index 00000000..fe3ced7f Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-13-58.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-19-57.png b/docs/User-Guide-Images/image2023-1-16_11-19-57.png new file mode 100644 index 00000000..a2be31a5 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-19-57.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-2-53.png b/docs/User-Guide-Images/image2023-1-16_11-2-53.png new file mode 100644 index 00000000..71c28ef5 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-2-53.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-24-0.png b/docs/User-Guide-Images/image2023-1-16_11-24-0.png new file mode 100644 index 00000000..a209c907 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-24-0.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-32-21.png b/docs/User-Guide-Images/image2023-1-16_11-32-21.png new file mode 100644 index 00000000..ac933f19 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-32-21.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-37-20.png b/docs/User-Guide-Images/image2023-1-16_11-37-20.png new file mode 100644 index 00000000..2fed2171 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-37-20.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-43-52.png b/docs/User-Guide-Images/image2023-1-16_11-43-52.png new file mode 100644 index 00000000..037dd664 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-43-52.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-44-50.png b/docs/User-Guide-Images/image2023-1-16_11-44-50.png new file mode 100644 index 00000000..0c94160e Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-44-50.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-47-48.png b/docs/User-Guide-Images/image2023-1-16_11-47-48.png new file mode 100644 index 00000000..fe6ab70c Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-47-48.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-52-12.png b/docs/User-Guide-Images/image2023-1-16_11-52-12.png new file mode 100644 index 00000000..48e1c4b9 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-52-12.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-58-21.png b/docs/User-Guide-Images/image2023-1-16_11-58-21.png new file mode 100644 index 00000000..1f9e044e Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-58-21.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_11-6-26.png b/docs/User-Guide-Images/image2023-1-16_11-6-26.png new file mode 100644 index 00000000..b91b81e6 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_11-6-26.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_12-32-50.png b/docs/User-Guide-Images/image2023-1-16_12-32-50.png new file mode 100644 index 00000000..b58466dd Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_12-32-50.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_12-33-58.png b/docs/User-Guide-Images/image2023-1-16_12-33-58.png new file mode 100644 index 00000000..2f1638cd Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_12-33-58.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_12-38-43.png b/docs/User-Guide-Images/image2023-1-16_12-38-43.png new file mode 100644 index 00000000..4988b2f2 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_12-38-43.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_12-39-35.png b/docs/User-Guide-Images/image2023-1-16_12-39-35.png new file mode 100644 index 00000000..e0cba43e Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_12-39-35.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_12-42-4.png b/docs/User-Guide-Images/image2023-1-16_12-42-4.png new file mode 100644 index 00000000..e2f22009 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_12-42-4.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_12-43-37.png b/docs/User-Guide-Images/image2023-1-16_12-43-37.png new file mode 100644 index 00000000..19345a7d Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_12-43-37.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_12-45-24.png b/docs/User-Guide-Images/image2023-1-16_12-45-24.png new file mode 100644 index 00000000..703e9df3 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_12-45-24.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_12-46-1.png b/docs/User-Guide-Images/image2023-1-16_12-46-1.png new file mode 100644 index 00000000..5be5f40c Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_12-46-1.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-10-31.png b/docs/User-Guide-Images/image2023-1-16_13-10-31.png new file mode 100644 index 00000000..932e03b7 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-10-31.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-12-53.png b/docs/User-Guide-Images/image2023-1-16_13-12-53.png new file mode 100644 index 00000000..0e939bfb Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-12-53.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-17-42.png b/docs/User-Guide-Images/image2023-1-16_13-17-42.png new file mode 100644 index 00000000..9793a2fa Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-17-42.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-17-55.png b/docs/User-Guide-Images/image2023-1-16_13-17-55.png new file mode 100644 index 00000000..d1b620a4 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-17-55.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-19-30.png b/docs/User-Guide-Images/image2023-1-16_13-19-30.png new file mode 100644 index 00000000..84c9583e Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-19-30.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-22-39.png b/docs/User-Guide-Images/image2023-1-16_13-22-39.png new file mode 100644 index 00000000..791e2723 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-22-39.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-23-29.png b/docs/User-Guide-Images/image2023-1-16_13-23-29.png new file mode 100644 index 00000000..1e3d6c42 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-23-29.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-23-4.png b/docs/User-Guide-Images/image2023-1-16_13-23-4.png new file mode 100644 index 00000000..a09a95f2 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-23-4.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-23-46.png b/docs/User-Guide-Images/image2023-1-16_13-23-46.png new file mode 100644 index 00000000..7959f5e5 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-23-46.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-24-3.png b/docs/User-Guide-Images/image2023-1-16_13-24-3.png new file mode 100644 index 00000000..e5bff3bf Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-24-3.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-26-39.png b/docs/User-Guide-Images/image2023-1-16_13-26-39.png new file mode 100644 index 00000000..8d664a3c Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-26-39.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-27-31.png b/docs/User-Guide-Images/image2023-1-16_13-27-31.png new file mode 100644 index 00000000..11a92bba Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-27-31.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-29-0.png b/docs/User-Guide-Images/image2023-1-16_13-29-0.png new file mode 100644 index 00000000..8ffc1ef9 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-29-0.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-29-44.png b/docs/User-Guide-Images/image2023-1-16_13-29-44.png new file mode 100644 index 00000000..dff6508d Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-29-44.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-3-10.png b/docs/User-Guide-Images/image2023-1-16_13-3-10.png new file mode 100644 index 00000000..0f5850f2 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-3-10.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-32-55.png b/docs/User-Guide-Images/image2023-1-16_13-32-55.png new file mode 100644 index 00000000..c3bb5a22 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-32-55.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-37-19.png b/docs/User-Guide-Images/image2023-1-16_13-37-19.png new file mode 100644 index 00000000..70825626 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-37-19.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-37-48.png b/docs/User-Guide-Images/image2023-1-16_13-37-48.png new file mode 100644 index 00000000..aa891b9b Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-37-48.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-38-26.png b/docs/User-Guide-Images/image2023-1-16_13-38-26.png new file mode 100644 index 00000000..1f014794 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-38-26.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-38-44.png b/docs/User-Guide-Images/image2023-1-16_13-38-44.png new file mode 100644 index 00000000..36f6124e Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-38-44.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-39-1.png b/docs/User-Guide-Images/image2023-1-16_13-39-1.png new file mode 100644 index 00000000..7e2d7013 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-39-1.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-5-31.png b/docs/User-Guide-Images/image2023-1-16_13-5-31.png new file mode 100644 index 00000000..64707722 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-5-31.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-6-12.png b/docs/User-Guide-Images/image2023-1-16_13-6-12.png new file mode 100644 index 00000000..f1229c43 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-6-12.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-7-35.png b/docs/User-Guide-Images/image2023-1-16_13-7-35.png new file mode 100644 index 00000000..69adfb1b Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-7-35.png differ diff --git a/docs/User-Guide-Images/image2023-1-16_13-9-11.png b/docs/User-Guide-Images/image2023-1-16_13-9-11.png new file mode 100644 index 00000000..79689875 Binary files /dev/null and b/docs/User-Guide-Images/image2023-1-16_13-9-11.png differ diff --git a/docs/User-Guide-Images/image2023-2-19_16-54-36.png b/docs/User-Guide-Images/image2023-2-19_16-54-36.png new file mode 100644 index 00000000..2b1eedaf Binary files /dev/null and b/docs/User-Guide-Images/image2023-2-19_16-54-36.png differ diff --git a/docs/User-Guide-Images/image2023-2-19_16-55-0.png b/docs/User-Guide-Images/image2023-2-19_16-55-0.png new file mode 100644 index 00000000..f0848de4 Binary files /dev/null and b/docs/User-Guide-Images/image2023-2-19_16-55-0.png differ diff --git a/docs/User-Guide-Images/image2023-2-19_16-55-45.png b/docs/User-Guide-Images/image2023-2-19_16-55-45.png new file mode 100644 index 00000000..65dc4f2a Binary files /dev/null and b/docs/User-Guide-Images/image2023-2-19_16-55-45.png differ diff --git a/docs/User-Guide.md b/docs/User-Guide.md new file mode 100644 index 00000000..b6f66ba3 --- /dev/null +++ b/docs/User-Guide.md @@ -0,0 +1,370 @@ +# User Guides + +## Portal to Dashboard + +In this Section we are describing how you can gain Access to the Dashboard +1. First you need to create an account for the Catena-X Environment +2. Your Company needs to setup everything for the Connection with our Application: This can be found with the BPDM 'Create a Gate' + And needs to be subscribed to the service + +![Portal](../docs/User-Guide-Images/image2023-1-16_10-55-20.png) + +3. Your Accounts needs to have one of the two Roles currently available + +![App](../docs/User-Guide-Images/image2023-1-16_10-54-3.png) + + +After the Previous steps are finished the way to the Dashboar dis very simple: + +1. Go to the Catena-X Portal +2. Open your Applications +3. Click on the Country Risk Dashboard +4. Afterwards you will be sent to the Country Risk Dashboard Login + You will be asked to Login + +![Login](../docs/User-Guide-Images/image2023-1-16_11-0-2.png) + +Choose the Login Option you want and is setup. + +![Input](../docs/User-Guide-Images/image2023-1-16_11-1-17.png) + +5. After the Login you will be directed to the Dashboard + +![Dashboard](../docs/User-Guide-Images/image2023-1-16_11-2-53.png) + + +## Country Rating Component + +![Rating](../docs/User-Guide-Images/image2023-1-16_11-6-26.png) + +This Component includes multiple smaller Functionalities + +- Year Selection +- Gate Selection +- Show More Ratings +- Upload Rating +- Download Template +- Weighting of Ratings +- Deletion of Ratings + +The first step you need to take is to select a year. + +![Year](../docs/User-Guide-Images/image2023-1-16_11-11-8.png) + +After you selected a year the Rating List will be updated. The Ratings in the List are saved for the selected year. +Currently all Globally available Ratings are Open Source. We do not create Scores, we only collect them and aggregate them according to your selections. + +![RatingTable](../docs/User-Guide-Images/image2023-1-16_11-12-24.png) + +Next to the Year Selection you will find the the Gate selection. This selection will be done for you atuomatically on the first start-up of the Dashbaord. + +![Gateselect](../docs/User-Guide-Images/image2023-1-16_11-13-58.png) + +The Gate gives the Input on which Business Partners you will be able see in all components. +Thereafter you can select one or multiple Ratings in the Table. + +![Ratingselected](../docs/User-Guide-Images/image2023-1-16_11-19-57.png) + +If you want to select more Ratings at once you can Opena Pop-Up with the 'Show Ratings' Button +In this Table you can manipulate the same way oyu can in the smaller Table. + +![Popupselection](../docs/User-Guide-Images/image2023-1-16_11-37-20.png) + + +After selecting a Rating the World Map will change the Color of each individual Country. +How is this done. Each Rating has a score for most of the Countries. We have a Score Range of 0-100 for each Rating +For Example the CPI Rating has a Score of 45 for China and 29 for Russia. +Depending on your selection with the Ranges the Country is then colored. + +![WorldMap](../docs/User-Guide-Images/image2023-1-16_11-32-21.png) + +As you can see the Weighting column to the right of the Names are automatically created and evenly distributed. +This weighting can be customized individually. + +The Rules for the weighting are: + 1. always needs to add up to 100% + ![weighting](../docs/User-Guide-Images/image2023-1-16_11-24-0.png) + 2. automatic weighting overwrites upon selecting new Raings + 3. when changing you need to confiem value by pressing "enter" +Changing the Weighting changes the Scores given in the Table below. How the Scores are calculated is this desbrided there. + + +### How can i Upload my own Rating and what do i need to know. + +The First step is to Download the Template. This is important since this is the Only Format the Application can progress the Upload. + +![excelfile](../docs/User-Guide-Images/image2023-1-16_11-43-52.png) +![excellist](../docs/User-Guide-Images/image2023-1-16_11-44-50.png) + +After filling out the Column E please save the File. The name is not important since the Name is set when the Rating is Uploaded. +After creating your own Rating all you have to Upload the File you start with clicking on 'Upload Rating' + +Then this Pop-Up is shown: +![popupupload](../docs/User-Guide-Images/image2023-1-16_11-47-48.png) + +You then have the Option to select who can see thiws Rating after Uploading. +You have the Option between 'Only For me' or 'For the Company'. The secon Option is grayed out if you dont have administration rights. +After selecting the Target group you can select the year for which this Rating is relevant for. +Below the year selection you can Give a Name to the Rating. A Rating Name can only be given once. +This Name is then shown in the Rating table after finishing the Upload. + + +![savingrating](../docs/User-Guide-Images/image2023-1-16_11-52-12.png) +Afterwards yoou will be asked to Upload the File you previously created. You can do thi s per darg and drop or by clicking on the cloud symbol to search your Explorer for the File. + +![popupsaved](../docs/User-Guide-Images/image2023-1-16_12-38-43.png) +After closing the Pop-Up the Rating is directly available in the table without the need to refresh the application. + +![refresh](../docs/User-Guide-Images/image2023-1-16_12-39-35.png) +If you want to delete a Rating you have the Option to do so by clicking on the 'Trash' Icon to the right of the Rating. +![deleterating](../docs/User-Guide-Images/image2023-1-16_11-58-21.png) +and then finish by confirming it. + + + +## World Map + +The Map shows an interactive Map of the World for the User + +- The User can zoom into the Map +- After the first Zoom step the country Codes are shown with the ISO 3166-1 alpha-2 Codes +- Hovering over the Codes shows the Complete Country Name +![hovercountry](../docs/User-Guide-Images/image2023-1-15_22-6-5.png) + +- Upon zooming in the User can see Markers in countries. +Those markers show the Location of the available Business Partners +Hovering over the Marker reveils the Company Name in that Location + +![hoveringmarker](../docs/User-Guide-Images/image2023-1-15_22-6-37.png) + +- The User has the Option to Expand the Map with the Help of the Icon in the top right corner +After Expanding the World Map the User can find a Legend in the bottom left corner which represents the Ranges +The functionalities remain in the expanded Mode + +![expandbutton](../docs/User-Guide-Images/image2023-1-15_22-8-14.png) +![popupMap](../docs/User-Guide-Images/image2023-1-15_22-8-54.png) + +- After Expanding the World Map the User can see the Option to Export the Image. +Upon clicking on the Button a PNG is created and downloaded. The File is named "worldMap.png" +![exportImage](../docs/User-Guide-Images/image2023-1-15_22-10-48.png) + + +## Company View + +The Company View shows a Map of the World. + +The Map is similar to the World Map. +In this Map the User can also zoom in to reveil more Information: + +![zoommap](../docs/User-Guide-Images/image2023-1-16_12-32-50.png) + +The User can also hover over one Country at a time. + +![hovercountrymap](../docs/User-Guide-Images/image2023-1-16_12-33-58.png) + +In the Company view we not only show the Name of the Country we also show how many Business Partners which are available to you are located in this country. +We also show the Score in the Hover since the COuntries are not being colored when a Rating is selected. + +New in this View is the Option to Filter for a country +![searchcountry](../docs/User-Guide-Images/image2023-1-16_12-42-4.png) + +After selecting a country the Map zooms to the country and shows the Markers for each Business Partner in this Country. +Also the Table below both Maps is filtered for the selected country. +![tablesearched](../docs/User-Guide-Images/image2023-1-16_12-43-37.png) + +The User has the Option to Expand the Map with the Help of the Icon in the top right corner. +The functionalities remain in the expanded Mode. +![expandcountrymap](../docs/User-Guide-Images/image2023-1-16_12-45-24.png) +![expandedcountrymap](../docs/User-Guide-Images/image2023-1-16_12-46-1.png) + +After Expanding the Map the User can see the Option to Export the Image. +Upon clicking on the Button a PNG is created and downloaded. The File is named "BusinessPartnerMap.png" + + +## Business Partner Table + +![Table](../docs/User-Guide-Images/image2023-2-19_16-54-36.png) + +Functionalities: + +- Search in every Column +- On the Fly calculated Score +- Sorting Desc/Asc +- Pagination +- KPI for filtered/unfiltered number of Business Partners +- Export of Table as a CSV File (depending on the selected Business partners) + + +In the Table we show 9 Columns: + +- Business Partner Number +- Legal Name +- Street +- House Number +- Zip-Code +- City Country +- Score +- Ratings (In the Rating Column we then show the selected Ratings.) + + +Upon starting the Application we are setting up a connection to the Gate your Company has setup and you are allowed to access. +We then make a request to get the Information for each BPN-L, BPN-S and BPN-A. +We then display all Business Partners in the table and the World Map. + +![tablefull](../docs/User-Guide-Images/image2023-2-19_16-55-0.png) + + +### Pagination + +On each Page we show 15 Business partners. If the User wants to see the next 15 business Partners he has the Option to switch to the next Page by clicking in the bottom right corner on the arrows +![pagination](../docs/User-Guide-Images/image2023-1-16_13-9-11.png) + +### The KPI +We show the number of filtered Business Partners next to the Export Option: +![kpi](../docs/User-Guide-Images/image2023-1-16_13-10-31.png) + +### The Score + +If the User selects a Rating we create a Score depending on his selection in the Rating Table and Color the background according to the Ranges set. + +The Score in the Column "Score" is calculated as follows. + +Situation 1: +You choose 1 Rating. The Score is taken from the database and shown. If there is none the field will be left empty. The Colore is chosen depending on the Ranges + +Situation 2: +You choose more than 1 Rating. The Formula: (Rating1 * Weighting1) + (Rating2 + Weighting2) + ... as many Ratings as you chose. + +Situation 3: +You choose more than 1 rating but there is only one Score. +Then the Formula looks like this: (Rating1(available) * Weighting1(100%)) + (Rating2(n/A) + Weighting2(0%)) + ... + + +### Filtering of the Table + +The User has the option to Filter in the table by Clicking on the Magnifying glas in the top right corner of the Table. +This search is looking in each column for the entered text. +![searchexample](../docs/User-Guide-Images/image2023-1-16_13-3-10.png) +![filteredtable](../docs/User-Guide-Images/image2023-2-19_16-55-45.png) + +### Export of the selected Table + +The User has the option to Export the Table and its content. + +1. The User selects which rows to export, each line individually or all rows + +![checkbox](../docs/User-Guide-Images/image2023-1-16_13-5-31.png) +2. The User then clicks on 'Export to csv' + +![exportbutton](../docs/User-Guide-Images/image2023-1-16_13-6-12.png) +3. After that a CSV File is created, which you can then Download. + +![exportedfile](../docs/User-Guide-Images/image2023-1-16_13-7-35.png) + + +## Reports + +![reports](../docs/User-Guide-Images/image2023-1-16_13-12-53.png) + +Functionalities: + +- Creating A Report +- Showing a Report +- Changing a Report +- Delete a Report +- Share a Report + +### How to create a Report: + +To create a Report the User can set multiple Filters: + +- Ratings selected +- Weighting set +- Country Filtered in the Company View +- Table Filter +- Ranges Set + + +When the User has set a view of the Dashboard he wants to acces regularly without the need to recreate it everytime he can save a report: + +1. Click on 'Save Report' + +![savereport](../docs/User-Guide-Images/image2023-1-16_13-17-55.png) + +2. Fill out the Pop-Up +The User can choose between Uploading a Report for himself or for the Company if he has the status of an admin +![savereportpopup](../docs/User-Guide-Images/image2023-1-16_13-17-42.png) + + +After setting a Name and clicking on Save the Report is then available in the Report Table +![definitionreport](../docs/User-Guide-Images/image2023-1-16_13-19-30.png) + + +### How to change a Saved report +The process of changing a saved Report is eay. + +1. Select the Report +![selectreport](../docs/User-Guide-Images/image2023-1-16_13-22-39.png) + +2. Change the Filters in the Dashboard +![changes1](../docs/User-Guide-Images/image2023-1-16_13-23-4.png) +![changes2](../docs/User-Guide-Images/image2023-1-16_13-23-29.png) + +3. Click on the Save Icon next to the selected Report +![saveicon](../docs/User-Guide-Images/image2023-1-16_13-23-46.png) + +4. Confirm that you want to save the changes +![confirmation](../docs/User-Guide-Images/image2023-1-16_13-24-3.png) + + +### How to Share a Report with a colleague + +To Share a Report with a Colleague, the Perosn needs to be known to our application. +Meaning he has to have created a Report or a Rating for himself. + +ToShare a Report you then select the Report you want to share and continue by clicking on the Share Icon to the most right of the Row. +![shareicon](../docs/User-Guide-Images/image2023-1-16_13-26-39.png) + +In the Dropdown you select the Person you want to share the Report with and click on 'share' +![selectusers](../docs/User-Guide-Images/image2023-1-16_13-27-31.png) +You can only share Reports with Users in the Same Company as you. + + +### How to delete a Report + +You can delete a Report by clicking on the 'trash' icon between the Save and Share functionality +![deleteicon](../docs/User-Guide-Images/image2023-1-16_13-29-0.png) + +Afterwards you confirm that you want to delete the Report by clicking on 'yes' +![confirm](../docs/User-Guide-Images/image2023-1-16_13-29-44.png) + + +## Rating Range Setter + +The Ranges define which color is shown for each Score +![rangesselector](../docs/User-Guide-Images/image2023-1-16_13-32-55.png) + +The Standard values are: +Green: 100 - 71 +Yellow: 70 - 31 +Red: 30 - 0 + + +### How to set Ranges + +The User can slide the endpoint Points of the Strings by dragging them per Mouse hold. +![draganddrop](../docs/User-Guide-Images/image2023-1-16_13-37-19.png) + +The other option is by inputing the Value into the Text fields next to the Sliders and confirming by either clicking out of the box or pressing enter. +![inputfield](../docs/User-Guide-Images/image2023-1-16_13-37-48.png) + +The Values automatically adjust to the changes. There is not an option to have overlapping Values. +![overlap](../docs/User-Guide-Images/image2023-1-16_13-38-26.png) + +### How To Save individual Ranges + +To save the Ranges the User can click on 'Save Ranges' they are then automatically set to the currently selected values. +![savebutton](../docs/User-Guide-Images/image2023-1-16_13-38-44.png) +![informationof saving](../docs/User-Guide-Images/image2023-1-16_13-39-1.png) + +When the User Returns at a later date the Saved Ranges are automatically set. \ No newline at end of file diff --git a/package.json b/package.json index 013c386d..b8f693aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dashboard-app", - "version": "1.0.0", + "version": "1.1.0", "private": true, "dependencies": { "@emotion/react": "^11.10.5", diff --git a/public/helpfiles/BusinessPartnerTable.pdf b/public/helpfiles/BusinessPartnerTable.pdf new file mode 100644 index 00000000..6819a16e Binary files /dev/null and b/public/helpfiles/BusinessPartnerTable.pdf differ diff --git a/public/helpfiles/CompanyView.pdf b/public/helpfiles/CompanyView.pdf new file mode 100644 index 00000000..d4089802 Binary files /dev/null and b/public/helpfiles/CompanyView.pdf differ diff --git a/public/helpfiles/CountryRatingList.pdf b/public/helpfiles/CountryRatingList.pdf new file mode 100644 index 00000000..42fddb4b Binary files /dev/null and b/public/helpfiles/CountryRatingList.pdf differ diff --git a/public/helpfiles/PortalToDashboard.pdf b/public/helpfiles/PortalToDashboard.pdf new file mode 100644 index 00000000..0f8a4e21 Binary files /dev/null and b/public/helpfiles/PortalToDashboard.pdf differ diff --git a/public/helpfiles/RatingRangeSetter.pdf b/public/helpfiles/RatingRangeSetter.pdf new file mode 100644 index 00000000..a89abd5f Binary files /dev/null and b/public/helpfiles/RatingRangeSetter.pdf differ diff --git a/public/helpfiles/Reports.pdf b/public/helpfiles/Reports.pdf new file mode 100644 index 00000000..ca161941 Binary files /dev/null and b/public/helpfiles/Reports.pdf differ diff --git a/public/helpfiles/WorldMap.pdf b/public/helpfiles/WorldMap.pdf new file mode 100644 index 00000000..5a695025 Binary files /dev/null and b/public/helpfiles/WorldMap.pdf differ diff --git a/public/index.html b/public/index.html index 6252f08e..f7091e08 100644 --- a/public/index.html +++ b/public/index.html @@ -8,5 +8,11 @@
+ diff --git a/scripts/inject-dynamic-env.sh b/scripts/inject-dynamic-env.sh new file mode 100644 index 00000000..9f236663 --- /dev/null +++ b/scripts/inject-dynamic-env.sh @@ -0,0 +1,9 @@ +#!/bin/bash + + +custom_env_vars='{REACT_URL_ENV:"'$REACT_URL_ENV'",REACT_APP_AUTH_URL:"'$REACT_APP_AUTH_URL'"}' +custom_env_vars_anchor='{REACT_URL_ENV:"http://localhost:8080",REACT_APP_AUTH_URL:"http://localhost:8080/auth"}' + +index_html_reference=`cat /usr/share/nginx/html/index.html.reference` +index_html=${index_html_reference//$custom_env_vars_anchor/$custom_env_vars} +echo "$index_html" > /usr/share/nginx/html/index.html \ No newline at end of file diff --git a/src/components/dashboard/CustomCompanyMap/CustomCompanyMap.js b/src/components/dashboard/CustomCompanyMap/CustomCompanyMap.js index afa35d14..cf255423 100644 --- a/src/components/dashboard/CustomCompanyMap/CustomCompanyMap.js +++ b/src/components/dashboard/CustomCompanyMap/CustomCompanyMap.js @@ -1,22 +1,22 @@ /******************************************************************************** -* Copyright (c) 2022,2023 BMW Group AG -* Copyright (c) 2022,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 -********************************************************************************/ + * Copyright (c) 2022,2023 BMW Group AG + * Copyright (c) 2022,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 React, { useState, useEffect, useContext } from "react"; import UserService from "../../services/UserService"; import { getAll } from "../../services/dashboard-api"; @@ -28,6 +28,7 @@ import ImageMarker from "../../../resources/marker.png"; import { ReportContext } from "../../../contexts/reports"; import { getWorldMapInfo } from "../../services/dashboard-api"; import { GatesContext } from "../../../contexts/gates"; + import { ComposableMap, Geographies, @@ -82,11 +83,13 @@ const CustomCompanyMap = (ratings) => { (r) => r.name === "Country" ); - updateCountry( - reportCountry.length && !Array.isArray(reportCountry[0].objectValue) - ? reportCountry[0].objectValue - : "none" - ); + if (!ratings.expand) { + updateCountry( + reportCountry.length && !Array.isArray(reportCountry[0].objectValue) + ? reportCountry[0].objectValue + : "none" + ); + } }, [reportValuesContext]); const geoUrl = require("./world-countries.json"); diff --git a/src/components/dashboard/DashBoardTable/DashboardTable.js b/src/components/dashboard/DashBoardTable/DashboardTable.js index bd12a24c..991ac82a 100644 --- a/src/components/dashboard/DashBoardTable/DashboardTable.js +++ b/src/components/dashboard/DashBoardTable/DashboardTable.js @@ -1,5 +1,5 @@ /******************************************************************************** -* Copyright (c) 2022,2023 BMW Group AG +* Copyright (c) 2022,2023 BMW Group AG * Copyright (c) 2022,2023 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional diff --git a/src/components/dashboard/DatePicker/DatePicker.js b/src/components/dashboard/DatePicker/DatePicker.js index 6d78b522..32590331 100644 --- a/src/components/dashboard/DatePicker/DatePicker.js +++ b/src/components/dashboard/DatePicker/DatePicker.js @@ -1,5 +1,5 @@ /******************************************************************************** -* Copyright (c) 2022,2023 BMW Group AG +* Copyright (c) 2022,2023 BMW Group AG * Copyright (c) 2022,2023 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional @@ -55,7 +55,7 @@ const DatePicker = ({ passYearSelected }) => { passYearSelected(date); }, [date]); - const { reportValuesContext, updateReport } = useContext(ReportContext); + const { reportValuesContext } = useContext(ReportContext); useEffect(() => { const reportRates = reportValuesContext.filter((r) => r.name === "Ratings"); diff --git a/src/components/dashboard/DeleteUpdateComponent/DeleteUpdateComponent.js b/src/components/dashboard/DeleteUpdateComponent/DeleteUpdateComponent.js index fb31e3c4..28fd9983 100644 --- a/src/components/dashboard/DeleteUpdateComponent/DeleteUpdateComponent.js +++ b/src/components/dashboard/DeleteUpdateComponent/DeleteUpdateComponent.js @@ -1,26 +1,31 @@ /******************************************************************************** -* Copyright (c) 2022,2023 BMW Group AG -* Copyright (c) 2022,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 -********************************************************************************/ + * Copyright (c) 2022,2023 BMW Group AG + * Copyright (c) 2022,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 React, { useContext } from "react"; import "./styles.scss"; import { CompanyUserContext } from "../../../contexts/companyuser"; -import { Button } from "cx-portal-shared-components"; +import { + Button, + DialogHeader, + DialogContent, + DialogActions, +} from "cx-portal-shared-components"; import { updateReports, deleteReport } from "../../services/reports-api"; import UserService from "../../services/UserService"; import { Report } from "../../model/Report"; @@ -124,18 +129,18 @@ const DeleteUpdateComponent = ({ return (
-

{deleteUpdateData.operation}

-
-

{deleteUpdateData.doubleCheckMessage}

-
-
+ + -
+
); }; diff --git a/src/components/dashboard/DeleteUpdateComponent/styles.scss b/src/components/dashboard/DeleteUpdateComponent/styles.scss index 5fb145ab..33e5aa90 100644 --- a/src/components/dashboard/DeleteUpdateComponent/styles.scss +++ b/src/components/dashboard/DeleteUpdateComponent/styles.scss @@ -75,9 +75,8 @@ .Dialog-Expand-Div { text-align: center; - background-color: #edf0f4; + background-color: #FFFFFF; border-radius: 39px !important; - border: 2px solid #000; .FirstLabel { margin-left: auto; diff --git a/src/components/dashboard/LeftMap/LeftMap.js b/src/components/dashboard/LeftMap/LeftMap.js index 1837cf9d..e925859f 100644 --- a/src/components/dashboard/LeftMap/LeftMap.js +++ b/src/components/dashboard/LeftMap/LeftMap.js @@ -1,25 +1,30 @@ /******************************************************************************** -* Copyright (c) 2022,2023 BMW Group AG -* Copyright (c) 2022,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 -********************************************************************************/ + * Copyright (c) 2022,2023 BMW Group AG + * Copyright (c) 2022,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 + ********************************************************************************/ /* eslint-disable no-console */ import React, { useState } from "react"; -import { Dialog, IconButton, Button } from "cx-portal-shared-components"; +import { + Dialog, + IconButton, + Button, + DialogHeader, +} from "cx-portal-shared-components"; import "./styles.scss"; import CustomWorldMap from "../CustomWorld/CustomWorldMap"; import OpenWithIcon from "@mui/icons-material/ZoomIn"; @@ -58,22 +63,22 @@ const LeftMap = (ratings) => { className="left-dialog-expand-map" >
+
+ + + +
+
-

World Map

- - - -
@@ -96,11 +101,10 @@ const LeftMap = (ratings) => {
-

World Map

+

World Map

{ + +return ( +
+
+ + + +
+ + + + +
+ +)}; + +export default DialogHelpContent; diff --git a/src/components/dashboard/NavigationBar/NavigationBar.js b/src/components/dashboard/NavigationBar/NavigationBar.js index c51c8edf..cf78646f 100644 --- a/src/components/dashboard/NavigationBar/NavigationBar.js +++ b/src/components/dashboard/NavigationBar/NavigationBar.js @@ -1,60 +1,89 @@ /******************************************************************************** -* Copyright (c) 2022,2023 BMW Group AG -* Copyright (c) 2022,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 { MainNavigation, Logo } from 'cx-portal-shared-components' -import React, { useContext } from 'react' -import Box from '@mui/material/Box' -import Button from '@mui/material/Button' -import IconButton from '@mui/material/IconButton' -import LogoSVG from '../../../resources/cxlogo.svg' -import { CompanyUserContext } from '../../../contexts/companyuser' -import { getPortalLink } from '../../services/EnvironmentService' -import Dialog from '@mui/material/Dialog' -import './styles.scss' -import CloseIcon from '@mui/icons-material/Close' + * Copyright (c) 2022,2023 BMW Group AG + * Copyright (c) 2022,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 { + MainNavigation, + Logo, + DialogHeader, + DialogContent, + DialogActions, + CardHorizontal, +} from "cx-portal-shared-components"; +import React, { useContext } from "react"; +import Box from "@mui/material/Box"; +import Button from "@mui/material/Button"; +import IconButton from "@mui/material/IconButton"; +import LogoSVG from "../../../resources/cxlogo.svg"; +import { CompanyUserContext } from "../../../contexts/companyuser"; +import { getPortalLink } from "../../services/EnvironmentService"; +import Dialog from "@mui/material/Dialog"; +import "./styles.scss"; +import CloseIcon from "@mui/icons-material/Close"; +import { UserInfo } from "./UserInformation/UserInfo"; +import DialogHelpContent from "./DialogContent/DialogHelpContent"; const NavigationBar = () => { - const { companyUser, updateCompanyUser } = useContext(CompanyUserContext) + const { companyUser, updateCompanyUser } = useContext(CompanyUserContext); - const [open, setOpen] = React.useState(false) + const [open, setOpen] = React.useState(false); - const openHelpDialog = () => { - setOpen(!open) - } + const openDialog = () => { + setOpen(!open); + }; return (
+ + + + - + -
+
+
+ +
+
- ) -} + ); +}; -export default NavigationBar +export default NavigationBar; diff --git a/src/components/dashboard/NavigationBar/UserInformation/UserInfo.js b/src/components/dashboard/NavigationBar/UserInformation/UserInfo.js new file mode 100644 index 00000000..1e85da78 --- /dev/null +++ b/src/components/dashboard/NavigationBar/UserInformation/UserInfo.js @@ -0,0 +1,63 @@ +import { useRef, useState } from "react"; +import { + UserAvatar, + UserMenu, + UserNav, + LanguageSwitch, +} from "cx-portal-shared-components"; +import UserService from "../../../services/UserService"; +import "./UserInfo.scss"; +import { getLogoutLink } from "../../../services/EnvironmentService"; + +export const UserInfo = () => { + const [menuOpen, setMenuOpen] = useState(false); + const wrapperRef = useRef(null); + + const openCloseMenu = () => setMenuOpen((prevVal) => !prevVal); + + const onClickAway = (e) => { + if (!wrapperRef.current || !wrapperRef.current.contains(e.target)) { + setMenuOpen(false); + } + }; + + const logoutHref = getLogoutLink(); + + console.log(logoutHref); + + return ( +
+
+ +
+ + + + {/**/} + + +
+ ); +}; diff --git a/src/components/dashboard/NavigationBar/UserInformation/UserInfo.scss b/src/components/dashboard/NavigationBar/UserInformation/UserInfo.scss new file mode 100644 index 00000000..8c978584 --- /dev/null +++ b/src/components/dashboard/NavigationBar/UserInformation/UserInfo.scss @@ -0,0 +1,4 @@ +.UserInfo { + position: relative; + z-index: 100; + } \ No newline at end of file diff --git a/src/components/dashboard/NavigationBar/styles.scss b/src/components/dashboard/NavigationBar/styles.scss index 6bc99c8e..4c0a6029 100644 --- a/src/components/dashboard/NavigationBar/styles.scss +++ b/src/components/dashboard/NavigationBar/styles.scss @@ -23,17 +23,13 @@ width: 170px; } -.btn-right { +.user-btn { display: flex; flex-direction: row; align-items: center; - .help-btn { - margin-right: 30%; - } - - .user-btn { - margin-right: 1%; + .btnHelp{ + margin-right: 20%; } } @@ -51,6 +47,18 @@ margin-top: 2%; } + .BoxHelp { + margin: 4%; + display: flex; + margin-left: 15%; + margin-right: auto; + border-radius: 20px; + + .Hyperlink { + text-decoration: none; + } + } + .Dialog-Help-Expand-Div { text-align: center; background-color: #FFFFFF; diff --git a/src/components/dashboard/RangeSlider/RangeSlider.js b/src/components/dashboard/RangeSlider/RangeSlider.js index 024be0e7..a276b931 100644 --- a/src/components/dashboard/RangeSlider/RangeSlider.js +++ b/src/components/dashboard/RangeSlider/RangeSlider.js @@ -1,5 +1,5 @@ /******************************************************************************** -* Copyright (c) 2022,2023 BMW Group AG +* Copyright (c) 2022,2023 BMW Group AG * Copyright (c) 2022,2023 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional @@ -79,7 +79,7 @@ const RangeSlider = () => { const [betweenValue, setMid] = useState(60); const [maxValue, setMax] = useState(100); - const { reportValuesContext, updateReport } = useContext(ReportContext); + const { reportValuesContext } = useContext(ReportContext); const getRanges = () => { getAllRanges(UserService.getToken(), companyUser).then((response) => { diff --git a/src/components/dashboard/Ratings/Ratings.js b/src/components/dashboard/Ratings/Ratings.js index 96f15b56..e3903ee9 100644 --- a/src/components/dashboard/Ratings/Ratings.js +++ b/src/components/dashboard/Ratings/Ratings.js @@ -1,26 +1,33 @@ /******************************************************************************** -* Copyright (c) 2022,2023 BMW Group AG -* Copyright (c) 2022,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 -********************************************************************************/ + * Copyright (c) 2022,2023 BMW Group AG + * Copyright (c) 2022,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 React, { useState, useContext, useEffect, useRef } from "react"; import "./styles.scss"; import Dialog from "@mui/material/Dialog"; -import { Table, Button, IconButton } from "cx-portal-shared-components"; +import { + Table, + Button, + IconButton, + DialogHeader, + DialogContent, + DialogActions, +} from "cx-portal-shared-components"; import Alert from "@mui/material/Alert"; import { RatesContext } from "../../../contexts/rates"; import { @@ -302,13 +309,20 @@ const Ratings = ({ aria-labelledby="customized-dialog-title" open={openWarning} onClose={openWarn} + maxWidth="md" >
-
-

Do you want to delete this Rating?

-
-
- -
+
@@ -334,11 +348,11 @@ const Ratings = ({
-

Ratings table

-

- In this it is possible to see the ratings. They can be selected one - at a time or all at the same time. -

+
5 ? false : true} >
-
- -
+
diff --git a/src/components/dashboard/Ratings/styles.scss b/src/components/dashboard/Ratings/styles.scss index 36496cef..1ee5cc31 100644 --- a/src/components/dashboard/Ratings/styles.scss +++ b/src/components/dashboard/Ratings/styles.scss @@ -45,7 +45,7 @@ .header { text-align: center; - margin-top: -5%; + margin-top: -7%; } @@ -58,6 +58,7 @@ margin-left: auto; margin-right: auto; margin-top: 3%; + margin-bottom: 3%; border-radius: 39px; font-size: 12px; } @@ -85,9 +86,8 @@ .Dialog-Expand-Div { text-align: center; - background-color: #edf0f4; + background-color: #FFFFFF; border-radius: 39px !important; - border: 2px solid #000; .warning-header { margin-left: auto; diff --git a/src/components/dashboard/Reports/Reports.js b/src/components/dashboard/Reports/Reports.js index a83a41b9..f6b47751 100644 --- a/src/components/dashboard/Reports/Reports.js +++ b/src/components/dashboard/Reports/Reports.js @@ -1,29 +1,35 @@ /******************************************************************************** -* Copyright (c) 2022,2023 BMW Group AG -* Copyright (c) 2022,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 -********************************************************************************/ + * Copyright (c) 2022,2023 BMW Group AG + * Copyright (c) 2022,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 React, { useState, useEffect, useContext } from "react"; import "./styles.scss"; import Dialog from "@mui/material/Dialog"; import FormLabel from "@mui/material/FormLabel"; import TextField from "@mui/material/TextField"; import FormControlLabel from "@mui/material/FormControlLabel"; -import { Button, Input } from "cx-portal-shared-components"; +import { + Button, + Input, + DialogActions, + DialogContent, + DialogHeader, +} from "cx-portal-shared-components"; import { getReportsByCompanyUser, saveReports, @@ -440,9 +446,10 @@ const Reports = () => { style: { fontSize: 12 }, readOnly: true, disableUnderline: true, + hiddenLabel: false, }} //Block edit on textfield className="formReports" - variant="filled" + variant="standard" value={valueTextField} onChange={handleChangeInput} size={"12px"} @@ -491,6 +498,10 @@ const Reports = () => { +
Select availability @@ -533,7 +544,14 @@ const Reports = () => { {severityMessage} -
+ + + -
+ { className="right-dialog-expand-map" >
+
+ + + +
+
-

Company View

- - -
{
-

Company View

+

Company View

{
{ return (
- - -
- -
+
{ open={openWarning} onClose={closeDialogs} > -
+ {" "} + { - -
- - Select availability - -
- - } - label="Only For me" - /> - } - label="For the company" - disabled={ratingType} - /> - -
-
- - - Select a Year - - - + } + label="Only For me" + /> + } + label="For the company" + disabled={ratingType} + /> + +
+
+ + + Select a Year + + + +
+
+ +
- + + -
+
+
- - {severityMessage} - + + + {severityMessage} + - - - + + + + +
diff --git a/src/components/dashboard/UploadDownloadZone/styles.scss b/src/components/dashboard/UploadDownloadZone/styles.scss index 78576aff..b6d70571 100644 --- a/src/components/dashboard/UploadDownloadZone/styles.scss +++ b/src/components/dashboard/UploadDownloadZone/styles.scss @@ -24,8 +24,7 @@ } .First-Dialog { - height: 100% !important; - width: 30%; + height: 100% !important;; text-align: center; margin-left: auto; margin-right: auto; @@ -33,16 +32,15 @@ .Dialog-Expand-Div { text-align: center; - background-color: #edf0f4; + background-color: #FFFFFF; border-radius: 39px !important; - border: 2px solid #000; - .btn-close-upload { - margin: 2%; + .form-year { + margin-top: 2%; } - .btn-next-upload { - margin: 2%; + .inputrating { + margin-top: 5%; } .FirstLabel { @@ -76,9 +74,8 @@ .Second-Expand-Div { text-align: center; - background-color: #dcdcdc; + background-color: #FFFFFF; border-radius: 39px !important; - border: 2px solid #000; .btn-close-upload-second { margin: 1%; diff --git a/src/components/services/EnvironmentService.js b/src/components/services/EnvironmentService.js index fb714119..de4e78eb 100644 --- a/src/components/services/EnvironmentService.js +++ b/src/components/services/EnvironmentService.js @@ -1,26 +1,24 @@ /******************************************************************************** -* Copyright (c) 2022,2023 BMW Group AG -* Copyright (c) 2022,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 -********************************************************************************/ -const LOCAL_SERVICES_FRONTEND = "https://portal.dev.demo.catena-x.net"; -const LOCAL_SERVICES_BACKEND = "https://portal-backend.dev.demo.catena-x.net"; -//const LOCAL_SERVICES_CENTRALIDP = 'https://centralidp.dev.demo.catena-x.net' -//const LOCAL_SERVICES_BPDM = 'https://bpdm.dev.demo.catena-x.net' + * Copyright (c) 2022,2023 BMW Group AG + * Copyright (c) 2022,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 + ********************************************************************************/ +const LOCAL_SERVICES_FRONTEND = process.env.REACT_APP_PORTAL_URL; +const LOCAL_SERVICES_BACKEND = process.env.REACT_APP_PORTAL_BACKEND_URL; export const getHostname = () => window.location.hostname; @@ -35,48 +33,21 @@ export const getAssetBase = () => `${isLocal() ? LOCAL_SERVICES_FRONTEND : ""}/assets`; export const getCentralIdp = () => { - const hostname = getHostname(); - if (hostname === "country-risk-dashboard.dev.demo.catena-x.net") - return "https://centralidp.dev.demo.catena-x.net/auth"; - if (hostname === "country-risk-dashboard.int.demo.catena-x.net") - return "https://centralidp.int.demo.catena-x.net/auth"; - return "https://centralidp.dev.demo.catena-x.net/auth"; + return process.env.REACT_APP_AUTH_URL; }; export const getPortalLink = () => { - const hostname = getHostname(); - if (hostname === "country-risk-dashboard.dev.demo.catena-x.net") - return "https://portal.dev.demo.catena-x.net/"; - if (hostname === "country-risk-dashboard.int.demo.catena-x.net") - return "https://portal.int.demo.catena-x.net/"; - return "https://portal.dev.demo.catena-x.net/"; + return process.env.REACT_APP_PORTAL_URL; +}; + +export const getLogoutLink = () => { + return process.env.REACT_APP_PORTAL_URL + "/logout"; }; export const getClientId = () => "Cl2-CX-Portal"; export const getCountryRiskClientId = () => "Cl16-CX-CRisk"; -//TODO: remove hard coded url and activate after setup of BPDM Api -export const getBpdmApiBase = () => { - const hostname = getHostname(); - if (hostname === "portal.int.demo.catena-x.net") - return "https://catenax-bpdm-int.demo.catena-x.net/api"; - if (hostname === "portal.catena-x.net") - return "https://catenax-bpdm-dev.demo.catena-x.net/api"; - return "https://catenax-bpdm-dev.demo.catena-x.net/api"; -}; -//export const getBpdmApiBase = () => -// isLocal() -// ? LOCAL_SERVICES_BPDM -// : window.location.origin.replace('portal', 'bpdm') - -export const getSemanticApiBase = () => { - const hostname = getHostname(); - if (hostname === "portal.int.demo.catena-x.net") - return "https://semantics.int.demo.catena-x.net/"; - return "https://semantics.dev.demo.catena-x.net/"; -}; - export const getClientIdSemantic = () => "Cl3-CX-Semantic"; export const getClientIdDigitalTwin = () => "Cl4-CX-DigitalTwin"; @@ -86,9 +57,7 @@ const EnvironmentService = { getHostname, getApiBase, getAssetBase, - getBpdmApiBase, getCentralIdp, - getSemanticApiBase, getClientId, getClientIdSemantic, getClientIdDigitalTwin, diff --git a/src/index.js b/src/index.js index dbb3cb1c..a34e7aec 100644 --- a/src/index.js +++ b/src/index.js @@ -1,22 +1,22 @@ /******************************************************************************** -* Copyright (c) 2022,2023 BMW Group AG -* Copyright (c) 2022,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 -********************************************************************************/ + * Copyright (c) 2022,2023 BMW Group AG + * Copyright (c) 2022,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 React from "react"; import ReactDOM from "react-dom/client"; import App from "./App"; @@ -29,15 +29,14 @@ import UserService from "./components/services/UserService"; import { getHostname } from "./components/services/EnvironmentService"; const hostname = getHostname(); -if (hostname === "country-risk-dashboard.dev.demo.catena-x.net") - import("./index-dev.scss"); -if (hostname === "country-risk-dashboard.int.demo.catena-x.net") - import("./index-int.scss"); +if (hostname.includes("country-risk-dashboard.dev")) import("./index-dev.scss"); +if (hostname.includes("country-risk-dashboard.int")) import("./index-int.scss"); else { import("./index-dev.scss"); } const root = ReactDOM.createRoot(document.getElementById("root")); + UserService.init((user) => { root.render(