Skip to content

Commit

Permalink
MOSIP-36036: Sonar bugs, security hotspots, duplications for UI code. (
Browse files Browse the repository at this point in the history
…#1091)

* MOSIP-37610: UI Enhancements Applicable for all Partners and Partner Admin screens

Signed-off-by: Anil_Kumar_Majji <106086523+Anil-kumar-Majji@users.noreply.github.com>

* MOSIP-37610: UI Enhancements Applicable for all Partners and Partner Admin screens

Signed-off-by: Anil_Kumar_Majji <106086523+Anil-kumar-Majji@users.noreply.github.com>

* MOSIP-36036: Sonar bugs, security hotspots, duplications for UI code

Signed-off-by: Anil_Kumar_Majji <106086523+Anil-kumar-Majji@users.noreply.github.com>

---------

Signed-off-by: Anil_Kumar_Majji <106086523+Anil-kumar-Majji@users.noreply.github.com>
  • Loading branch information
Anil-kumar-Majji authored Jan 15, 2025
1 parent 0f57f0d commit 8cddd6c
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { useState, useEffect } from "react";
import DropdownComponent from "../../common/fields/DropdownComponent.js";
import TextInputComponent from "../../common/fields/TextInputComponent.js";
import { useTranslation } from "react-i18next";
import { createDropdownData } from "../../../utils/AppUtils.js";
import { isLangRTL } from '../../../utils/AppUtils';
import { createDropdownData, isLangRTL } from "../../../utils/AppUtils.js";
import { getUserProfile } from '../../../services/UserProfileService';

function AdminApiKeysListFilter({ onApplyFilter }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { useState, useEffect } from "react";
import DropdownComponent from "../../common/fields/DropdownComponent.js";
import TextInputComponent from "../../common/fields/TextInputComponent.js";
import { useTranslation } from "react-i18next";
import { createDropdownData } from "../../../utils/AppUtils.js";
import { isLangRTL } from '../../../utils/AppUtils';
import { createDropdownData, isLangRTL } from "../../../utils/AppUtils.js";
import { getUserProfile } from '../../../services/UserProfileService';

function AdminOidcClientsFilter ({ onApplyFilter }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { useState, useEffect } from "react";
import DropdownComponent from "../../common/fields/DropdownComponent.js";
import TextInputComponent from "../../common/fields/TextInputComponent.js";
import { useTranslation } from "react-i18next";
import { createDropdownData, fetchDeviceTypeDropdownData, fetchDeviceSubTypeDropdownData } from "../../../utils/AppUtils.js";
import { isLangRTL } from '../../../utils/AppUtils.js';
import { isLangRTL, createDropdownData, fetchDeviceTypeDropdownData, fetchDeviceSubTypeDropdownData } from "../../../utils/AppUtils.js";
import { getUserProfile } from '../../../services/UserProfileService.js';

function AdminDeviceDetailsFilter({ onApplyFilter, setErrorCode, setErrorMsg, removeSbiFields}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { useState, useEffect } from "react";
import DropdownComponent from "../../common/fields/DropdownComponent.js";
import TextInputComponent from "../../common/fields/TextInputComponent.js";
import { useTranslation } from "react-i18next";
import { createDropdownData } from "../../../utils/AppUtils.js";
import { isLangRTL } from '../../../utils/AppUtils';
import { createDropdownData, isLangRTL } from "../../../utils/AppUtils.js";
import { getUserProfile } from '../../../services/UserProfileService';

function AdminFtmListFilter ({ onApplyFilter }) {
Expand Down
3 changes: 1 addition & 2 deletions pmp-revamp-ui/src/pages/admin/partners/PartnersListFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { useState, useEffect } from "react";
import DropdownComponent from "../../common/fields/DropdownComponent.js";
import TextInputComponent from "../../common/fields/TextInputComponent.js";
import { useTranslation } from "react-i18next";
import { createDropdownData, createRequest, getPartnerManagerUrl, handleServiceErrors } from "../../../utils/AppUtils.js";
import { isLangRTL } from '../../../utils/AppUtils';
import { isLangRTL, createDropdownData, createRequest, getPartnerManagerUrl, handleServiceErrors } from "../../../utils/AppUtils.js";
import { getUserProfile } from '../../../services/UserProfileService';
import { HttpService } from "../../../services/HttpService.js";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { useState, useEffect } from "react";
import DropdownComponent from "../../common/fields/DropdownComponent.js";
import TextInputComponent from "../../common/fields/TextInputComponent.js";
import { useTranslation } from "react-i18next";
import { createDropdownData } from "../../../utils/AppUtils.js";
import { isLangRTL } from '../../../utils/AppUtils';
import { isLangRTL, createDropdownData } from "../../../utils/AppUtils.js";
import { getUserProfile } from '../../../services/UserProfileService';

function PoliciesListFilter({ onApplyFilter }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { useState, useEffect } from "react";
import DropdownComponent from "../../common/fields/DropdownComponent.js";
import TextInputComponent from "../../common/fields/TextInputComponent.js";
import { useTranslation } from "react-i18next";
import { createDropdownData } from "../../../utils/AppUtils.js";
import { isLangRTL } from '../../../utils/AppUtils';
import { isLangRTL, createDropdownData } from "../../../utils/AppUtils.js";
import { getUserProfile } from '../../../services/UserProfileService';

function PolicyGroupListFilter({ onApplyFilter }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { useState, useEffect } from "react";
import DropdownComponent from "../../common/fields/DropdownComponent.js";
import TextInputComponent from "../../common/fields/TextInputComponent.js";
import { useTranslation } from "react-i18next";
import { createDropdownData, createRequest, getPartnerManagerUrl, handleServiceErrors } from "../../../utils/AppUtils.js";
import { isLangRTL } from '../../../utils/AppUtils';
import { isLangRTL, createDropdownData, createRequest, getPartnerManagerUrl, handleServiceErrors } from "../../../utils/AppUtils.js";
import { getUserProfile } from '../../../services/UserProfileService';
import { HttpService } from "../../../services/HttpService.js";

Expand Down
1 change: 0 additions & 1 deletion pmp-revamp-ui/src/pages/common/ApproveRejectPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import LoadingIcon from './LoadingIcon';
import ErrorMessage from './ErrorMessage';
import close_icon from '../../svg/close_icon.svg';
import FocusTrap from 'focus-trap-react';
import { onPressEnterKey } from '../../utils/AppUtils.js';

function ApproveRejectPopup({ popupData, closePopUp, approveRejectResponse, title, subtitle, header, description }) {
const { t } = useTranslation();
Expand Down
2 changes: 1 addition & 1 deletion pmp-revamp-ui/src/pages/common/Title.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import { getUserProfile } from '../../services/UserProfileService';
import { isLangRTL, moveToHome, onPressEnterKey, getStatusCode, bgOfStatus } from '../../utils/AppUtils';
import { isLangRTL, moveToHome, getStatusCode, bgOfStatus } from '../../utils/AppUtils';
import backArrow from '../../svg/back_arrow.svg';

function Title({ title, subTitle, subTitle2, backLink, backLink2, status, version }) {
Expand Down
4 changes: 2 additions & 2 deletions pmp-revamp-ui/src/pages/common/fields/DropdownComponent.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

import { useState, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import { handleMouseClickForDropdown } from '../../../utils/AppUtils';
import { isLangRTL } from '../../../utils/AppUtils';
import { isLangRTL, handleMouseClickForDropdown } from '../../../utils/AppUtils';
import { } from '../../../utils/AppUtils';
import { getUserProfile } from '../../../services/UserProfileService';
import Information from './Information';

Expand Down
5 changes: 2 additions & 3 deletions pmp-revamp-ui/src/pages/dashboard/ConsentPopup.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { useState, useRef } from 'react';
import { useState } from 'react';
import { HttpService } from "../../services/HttpService.js";
import { logout, onPressEnterKey } from '../../utils/AppUtils.js';
import { logout, onPressEnterKey, getPartnerManagerUrl, handleServiceErrors } from '../../utils/AppUtils.js';
import { useTranslation } from 'react-i18next';
import ErrorMessage from "../common/ErrorMessage.js";
import LoadingIcon from '../common/LoadingIcon.js';
import { getPartnerManagerUrl, handleServiceErrors } from '../../utils/AppUtils.js';
import FocusTrap from 'focus-trap-react';

function ConsentPopup() {
Expand Down
3 changes: 1 addition & 2 deletions pmp-revamp-ui/src/pages/dashboard/Dashboard.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { useNavigate } from 'react-router-dom';
import { useState, useEffect } from 'react';
import { getUserProfile } from '../../services/UserProfileService.js';
import { isLangRTL, onPressEnterKey } from '../../utils/AppUtils.js';
import { useTranslation } from "react-i18next";
import { getPartnerManagerUrl, createRequest, handleServiceErrors, moveToOidcClientsList } from '../../utils/AppUtils.js';
import { isLangRTL, onPressEnterKey, getPartnerManagerUrl, createRequest, handleServiceErrors, moveToOidcClientsList } from '../../utils/AppUtils.js';
import { HttpService } from '../../services/HttpService.js';
import ErrorMessage from '../common/ErrorMessage.js';
import LoadingIcon from "../common/LoadingIcon.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { useState, useEffect, useRef } from "react";
import { useNavigate } from "react-router-dom";
import { useTranslation } from "react-i18next";
import { getUserProfile } from "../../../services/UserProfileService";
import { isLangRTL, handleMouseClickForDropdown, getGrantTypes, bgOfStatus, onPressEnterKey, copyClientId } from "../../../utils/AppUtils";
import { formatDate, moveToOidcClientsList, getStatusCode } from "../../../utils/AppUtils";
import { isLangRTL, formatDate, moveToOidcClientsList, getStatusCode, handleMouseClickForDropdown, getGrantTypes, bgOfStatus, copyClientId } from "../../../utils/AppUtils";
import content_copy_icon from "../../../svg/content_copy_icon.svg";
import disabled_copy_icon from "../../../svg/disabled_copy_icon.svg";
import Title from "../../common/Title";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import { useEffect, useState, useRef } from "react";
import UploadCertificate from "./UploadCertificate";
import { HttpService } from "../../../services/HttpService";
import { getUserProfile } from "../../../services/UserProfileService";
import { downloadFile, getCertificate, handleServiceErrors, isLangRTL } from "../../../utils/AppUtils";
import ErrorMessage from "../../common/ErrorMessage";
import SuccessMessage from "../../common/SuccessMessage";
import LoadingIcon from "../../common/LoadingIcon";
import { formatDate, getPartnerTypeDescription, handleMouseClickForDropdown, getPartnerManagerUrl, getPartnerDomainType } from "../../../utils/AppUtils";
import { downloadFile, getCertificate, handleServiceErrors, isLangRTL, formatDate, getPartnerTypeDescription, handleMouseClickForDropdown, getPartnerManagerUrl, getPartnerDomainType } from "../../../utils/AppUtils";
import { useTranslation } from "react-i18next";

import rectangleBox from '../../../svg/rectangle_box.svg';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { useState, useEffect, useCallback } from 'react';
import { HttpService } from "../../../services/HttpService";
import { formatDate, getPartnerTypeDescription, getPartnerManagerUrl, getPartnerDomainType, createRequest, onPressEnterKey } from '../../../utils/AppUtils';
import { isLangRTL, formatDate, getPartnerTypeDescription, getPartnerManagerUrl, getPartnerDomainType, createRequest, onPressEnterKey } from '../../../utils/AppUtils';
import { useTranslation } from 'react-i18next';
import { isLangRTL } from '../../../utils/AppUtils';
import { getUserProfile } from '../../../services/UserProfileService';
import ErrorMessage from "../../common/ErrorMessage";
import LoadingIcon from "../../common/LoadingIcon";
import SuccessMessage from '../../common/SuccessMessage';
import fileUploadImg from './../../../svg/file_upload_certificate.svg';
import fileDescription from '../../../svg/file_description.svg';
import FocusTrap from 'focus-trap-react';
import * as asn1js from "asn1js";
import { Certificate } from "pkijs";
import { fromBER } from "asn1js";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getUserProfile } from '../../../services/UserProfileService.js';
import Title from '../../common/Title.js';
import { HttpService } from '../../../services/HttpService';
import {
isLangRTL, onPressEnterKey, bgOfStatus, getStatusCode, getPartnerTypeDescription, handleServiceErrors, formatDate, getPartnerManagerUrl,
isLangRTL, bgOfStatus, getStatusCode, getPartnerTypeDescription, handleServiceErrors, formatDate, getPartnerManagerUrl,
handleMouseClickForDropdown, populateDeactivatedStatus,
createRequest
} from '../../../utils/AppUtils.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { HttpService } from '../../../services/HttpService';
import {
isLangRTL, handleServiceErrors, getPartnerManagerUrl, formatDate, getStatusCode,
handleMouseClickForDropdown, toggleSortDescOrder, toggleSortAscOrder, bgOfStatus,
onPressEnterKey, createRequest, populateDeactivatedStatus
createRequest, populateDeactivatedStatus
} from '../../../utils/AppUtils';
import ErrorMessage from '../../common/ErrorMessage';
import Title from '../../common/Title';
Expand Down
3 changes: 1 addition & 2 deletions pmp-revamp-ui/src/pages/partner/policies/RequestPolicy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { useState, useEffect, useRef } from "react";
import { useNavigate, useBlocker } from "react-router-dom";
import { useTranslation } from "react-i18next";
import { getUserProfile } from "../../../services/UserProfileService";
import { isLangRTL } from "../../../utils/AppUtils";
import { getPartnerManagerUrl, getPolicyManagerUrl, handleServiceErrors, moveToPolicies, getPartnerTypeDescription, createDropdownData, createRequest } from '../../../utils/AppUtils';
import { isLangRTL, getPartnerManagerUrl, getPolicyManagerUrl, handleServiceErrors, moveToPolicies, getPartnerTypeDescription, createDropdownData, createRequest } from '../../../utils/AppUtils';
import { HttpService } from '../../../services/HttpService';
import LoadingIcon from "../../common/LoadingIcon";
import ErrorMessage from "../../common/ErrorMessage";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { useState, useEffect } from "react";
import { useNavigate } from "react-router-dom";
import { useTranslation } from "react-i18next";
import { getUserProfile } from "../../../services/UserProfileService";
import { isLangRTL } from "../../../utils/AppUtils";
import { formatDate, moveToPolicies, getStatusCode, getPartnerTypeDescription, bgOfStatus } from "../../../utils/AppUtils";
import { isLangRTL, formatDate, moveToPolicies, getStatusCode, getPartnerTypeDescription, bgOfStatus } from "../../../utils/AppUtils";
import adminImage from "../../../svg/admin.png";
import partnerImage from "../../../svg/partner.png";
import Title from "../../common/Title";
Expand Down

0 comments on commit 8cddd6c

Please sign in to comment.