From a00e15873cb78d493818d717c1fcb2eaeced00f7 Mon Sep 17 00:00:00 2001 From: Aman-Hundal Date: Mon, 6 Jan 2025 11:24:59 -0800 Subject: [PATCH] code clean and removal of log statements --- .../AdvancedSearch/DataGridAdvancedSearch.js | 1 - .../OI/AdvancedSearch/ActionContext.js | 1 - .../FOI/Dashboard/OI/OIDashboard.js | 1 - .../src/components/FOI/Dashboard/OI/Queue.js | 30 +------------------ .../components/FOI/FOIAuthenticateRouting.jsx | 13 +------- .../components/FOI/FOIRequest/FOIRequest.js | 2 -- .../FOIRequest/OpenInformation/OpenInfo.tsx | 4 --- .../OpenInformation/OpenInfoHeader.tsx | 5 ---- .../Comments/DisplayComments.js | 5 ---- .../io/redis_stream/redisstreamdb.py | 1 - .../models/FOIOpenInformationRequests.py | 12 ++------ .../request_api/resources/foiopeninfo.py | 4 +-- 12 files changed, 6 insertions(+), 73 deletions(-) diff --git a/forms-flow-web/src/components/FOI/Dashboard/IAO/AdvancedSearch/DataGridAdvancedSearch.js b/forms-flow-web/src/components/FOI/Dashboard/IAO/AdvancedSearch/DataGridAdvancedSearch.js index cd851b0b9..4e60c209f 100644 --- a/forms-flow-web/src/components/FOI/Dashboard/IAO/AdvancedSearch/DataGridAdvancedSearch.js +++ b/forms-flow-web/src/components/FOI/Dashboard/IAO/AdvancedSearch/DataGridAdvancedSearch.js @@ -10,7 +10,6 @@ import { getFullName, getDaysLeft, getReceivedDate, - // onBehalfFullName, getRecordsDue, LightTooltip, displayQueueFlagIcons, diff --git a/forms-flow-web/src/components/FOI/Dashboard/OI/AdvancedSearch/ActionContext.js b/forms-flow-web/src/components/FOI/Dashboard/OI/AdvancedSearch/ActionContext.js index aa74bc7f3..d02c2b7f5 100644 --- a/forms-flow-web/src/components/FOI/Dashboard/OI/AdvancedSearch/ActionContext.js +++ b/forms-flow-web/src/components/FOI/Dashboard/OI/AdvancedSearch/ActionContext.js @@ -23,7 +23,6 @@ export const ActionProvider = ({ children }) => { const defaultSortModel = [ { field: "currentState", sort: "desc" }, - // { field: "receivedDateUF", sort: "desc" }, ]; useEffect(() => { diff --git a/forms-flow-web/src/components/FOI/Dashboard/OI/OIDashboard.js b/forms-flow-web/src/components/FOI/Dashboard/OI/OIDashboard.js index 207944183..250d11cb3 100644 --- a/forms-flow-web/src/components/FOI/Dashboard/OI/OIDashboard.js +++ b/forms-flow-web/src/components/FOI/Dashboard/OI/OIDashboard.js @@ -5,7 +5,6 @@ import "../dashboard.scss"; import Grid from "@mui/material/Grid"; import { makeStyles } from "@material-ui/core/styles"; import Queue from "./Queue"; -// import EventQueue from "../EventQueue" import AdvancedSearch from "./AdvancedSearch"; import clsx from "clsx"; import Divider from "@mui/material/Divider"; diff --git a/forms-flow-web/src/components/FOI/Dashboard/OI/Queue.js b/forms-flow-web/src/components/FOI/Dashboard/OI/Queue.js index 02d57d8f9..3c27f82cc 100644 --- a/forms-flow-web/src/components/FOI/Dashboard/OI/Queue.js +++ b/forms-flow-web/src/components/FOI/Dashboard/OI/Queue.js @@ -6,7 +6,7 @@ import { useDispatch, useSelector } from "react-redux"; import { push } from "connected-react-router"; import { fetchFOIOIRequestListByPage } from "../../../../apiManager/services/FOI/foiRequestServices"; import Loading from "../../../../containers/Loading"; -import { debounce, ClickableChip, cellTooltipRender, displayQueueFlagIcons } from "../utils"; +import { debounce, ClickableChip, } from "../utils"; import Grid from "@mui/material/Grid"; import Stack from "@mui/material/Stack"; import SearchIcon from "@material-ui/icons/Search"; @@ -14,8 +14,6 @@ import InputAdornment from "@mui/material/InputAdornment"; import InputBase from "@mui/material/InputBase"; import IconButton from "@mui/material/IconButton"; import Paper from "@mui/material/Paper"; -import { formatDate } from "../../../../helper/FOI/helper"; -import { StateEnum } from "../../../../constants/FOI/statusEnum"; import { setQueueFilter, setQueueParams } from "../../../../actions/FOI/foiRequestActions"; import { CustomFooter } from "../CustomFooter" @@ -26,8 +24,6 @@ const Queue = ({ userDetail, tableInfo }) => { (state) => state.foiRequests.foiMinistryRequestsList ); - console.log("requestQueue", requestQueue); - const isLoading = useSelector((state) => state.foiRequests.isLoading); const classes = useStyles(); @@ -93,30 +89,6 @@ const Queue = ({ userDetail, tableInfo }) => { const columnsRef = React.useRef(tableInfo?.columns || []); - // function getRecordsDue(params) { - // let receivedDateString = params.row.cfrduedate; - // const currentStatus = params.row.currentState; - // if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase()) { - // return "N/A"; - // } else if(!receivedDateString) { - // return ""; - // } else { - // return formatDate(receivedDateString, "MMM dd yyyy").toUpperCase(); - // } - // } - - // function getLDD(params) { - // let receivedDateString = params.row.duedate; - // const currentStatus = params.row.currentState; - // if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase()) { - // return "N/A"; - // } else if(!receivedDateString) { - // return ""; - // } else { - // return formatDate(receivedDateString, "MMM dd yyyy").toUpperCase(); - // } - // } - const columns = React.useRef([ { field: "receivedDate", diff --git a/forms-flow-web/src/components/FOI/FOIAuthenticateRouting.jsx b/forms-flow-web/src/components/FOI/FOIAuthenticateRouting.jsx index bd0c926d4..88e5c01a5 100644 --- a/forms-flow-web/src/components/FOI/FOIAuthenticateRouting.jsx +++ b/forms-flow-web/src/components/FOI/FOIAuthenticateRouting.jsx @@ -2,17 +2,15 @@ import React, {useEffect, useState}from "react"; import { Redirect, Route } from "react-router-dom"; import { useDispatch, useSelector } from "react-redux"; import "semantic-ui-css/semantic.min.css"; - import UserService from "../../services/UserService"; import { setUserAuth } from "../../actions/bpmActions"; import Loading from "../../containers/Loading"; import FOIHeader from "./Header"; import FOIFooter from "./Footer"; -import { Dashboard, MinistryDashboard, OIDashboard } from "./Dashboard"; +import { Dashboard, MinistryDashboard } from "./Dashboard"; import FOIRequest from "./FOIRequest"; import MinistryReview from "./FOIRequest/MinistryReview/MinistryReview"; import { isMinistryLogin } from '../../helper/FOI/helper'; -//import { isMinistryLogin, isOITeam } from '../../helper/FOI/helper'; import UnAuthorized from "./UnAuthorized"; import Admin from "./Admin"; import Divisions from "./Admin/Divisions"; @@ -44,11 +42,9 @@ const FOIAuthenticateRouting = React.memo((props) => { const isAuthorized = useSelector(state=> state.user.isAuthorized); let isMinistry = false; - //let isOITeam = false; if (Object.entries(userDetail).length !== 0) { const userGroups = userDetail && userDetail.groups.map(group => group.slice(1)); isMinistry = isMinistryLogin(userGroups); - //isOITeam = isOITeamLogin(userGroups); } return ( <> @@ -57,13 +53,6 @@ const FOIAuthenticateRouting = React.memo((props) => { <> - {/* {isOITeam ? ( - - ) : isMinistry ? ( - - ) : ( - - )} */} {isMinistry ? ( ) : ( diff --git a/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js b/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js index aebfbe34e..565970995 100644 --- a/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js +++ b/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js @@ -1182,8 +1182,6 @@ const FOIRequest = React.memo(({ userDetail, openApplicantProfileModal }) => { isValidationError={isValidationError} requestType={requestDetails?.requestType} isOITeam={isOITeam} - // isDivisionalCoordinator={false} - // isHistoricalRequest={isHistoricalRequest} /> diff --git a/forms-flow-web/src/components/FOI/FOIRequest/OpenInformation/OpenInfo.tsx b/forms-flow-web/src/components/FOI/FOIRequest/OpenInformation/OpenInfo.tsx index ffac8dc30..5a458e1ed 100644 --- a/forms-flow-web/src/components/FOI/FOIRequest/OpenInformation/OpenInfo.tsx +++ b/forms-flow-web/src/components/FOI/FOIRequest/OpenInformation/OpenInfo.tsx @@ -245,10 +245,6 @@ const OpenInfo = ({ })); } - console.log("req", requestDetails) - console.log("oi info", oiPublicationData) - console.log("isOIUser", isOITeam) - return ( <>
diff --git a/forms-flow-web/src/components/FOI/FOIRequest/OpenInformation/OpenInfoHeader.tsx b/forms-flow-web/src/components/FOI/FOIRequest/OpenInformation/OpenInfoHeader.tsx index 9167ed49d..9e9e83dcb 100644 --- a/forms-flow-web/src/components/FOI/FOIRequest/OpenInformation/OpenInfoHeader.tsx +++ b/forms-flow-web/src/components/FOI/FOIRequest/OpenInformation/OpenInfoHeader.tsx @@ -1,4 +1,3 @@ -// import TextField from '@material-ui/core/TextField'; import { TextField } from "@material-ui/core"; import { useEffect, useState } from "react"; import { useSelector } from "react-redux"; @@ -132,11 +131,7 @@ const handleOIAssigneeUpdate = async (event: any) => { } }) ); - }else{ - console.log("username is OI Team"); } - - } const [menuItems, setMenuItems] = useState([]); diff --git a/forms-flow-web/src/components/FOI/customComponents/Comments/DisplayComments.js b/forms-flow-web/src/components/FOI/customComponents/Comments/DisplayComments.js index 906051773..a41738293 100644 --- a/forms-flow-web/src/components/FOI/customComponents/Comments/DisplayComments.js +++ b/forms-flow-web/src/components/FOI/customComponents/Comments/DisplayComments.js @@ -12,11 +12,6 @@ const DisplayComments = ({ comments, bcgovcode, currentUser, iaoassignedToList, const [fullnameList, setFullnameList] = useState(getFullnameList); - - // useEffect(() => { - // setTeamTagList(bcgovcode) - // }, [fullnameList]) - const finduserbyuserid = (userId) => { let user = fullnameList.find(u => u.username === userId); return user && user.fullname ? user.fullname : userId; diff --git a/notification-manager/notification_api/io/redis_stream/redisstreamdb.py b/notification-manager/notification_api/io/redis_stream/redisstreamdb.py index 03341027a..d43a16ee8 100644 --- a/notification-manager/notification_api/io/redis_stream/redisstreamdb.py +++ b/notification-manager/notification_api/io/redis_stream/redisstreamdb.py @@ -2,5 +2,4 @@ from config import REDIS_HOST,REDIS_PORT,REDIS_PASSWORD, REDIS_HEALTH_CHECK_INTERVAL #streamdb = Database(host=str(REDIS_HOST), port=str(REDIS_PORT), db=0,password=str(REDIS_PASSWORD)) -print(REDIS_HOST) streamdb = Database(host=str(REDIS_HOST), port=str(REDIS_PORT), db=0,password=str(REDIS_PASSWORD), retry_on_timeout=True, health_check_interval=int(REDIS_HEALTH_CHECK_INTERVAL), socket_keepalive=True) diff --git a/request-management-api/request_api/models/FOIOpenInformationRequests.py b/request-management-api/request_api/models/FOIOpenInformationRequests.py index 585041070..e0767a69f 100644 --- a/request-management-api/request_api/models/FOIOpenInformationRequests.py +++ b/request-management-api/request_api/models/FOIOpenInformationRequests.py @@ -5,13 +5,11 @@ from sqlalchemy.orm import relationship, backref, aliased from sqlalchemy import or_, and_, text, func, literal, cast, case, nullslast, nullsfirst, desc, asc from sqlalchemy.sql.sqltypes import String -from sqlalchemy.dialects.postgresql import JSON -from sqlalchemy.sql.sqltypes import Date, Integer -from sqlalchemy.sql.expression import distinct -from request_api.utils.enums import RequestorType, StateName, ProcessingTeamWithKeycloackGroup, IAOTeamWithKeycloackGroup, OICloseReason, ExcludedProgramArea, OIStatusEnum +from sqlalchemy.sql.sqltypes import Date +from request_api.utils.enums import StateName, IAOTeamWithKeycloackGroup, OICloseReason, ExcludedProgramArea, OIStatusEnum from .FOIMinistryRequests import FOIMinistryRequest from .FOIAssignees import FOIAssignee -from .FOIRequests import FOIRequest, FOIRequestsSchema +from .FOIRequests import FOIRequest from .FOIRequestApplicantMappings import FOIRequestApplicantMapping from .FOIRequestApplicants import FOIRequestApplicant from .FOIRequestStatus import FOIRequestStatus @@ -19,11 +17,7 @@ from .FOIRequestWatchers import FOIRequestWatcher from .FOIRestrictedMinistryRequests import FOIRestrictedMinistryRequest from .ProgramAreas import ProgramArea -from .FOIRequestExtensions import FOIRequestExtension from .OpenInformationStatuses import OpenInformationStatuses -from .FOIRequestOIPC import FOIRequestOIPC -from .SubjectCodes import SubjectCode -from .FOIMinistryRequestSubjectCodes import FOIMinistryRequestSubjectCode from .FOIRequestStatus import FOIRequestStatus from request_api.models.default_method_result import DefaultMethodResult from request_api.models.FOIRequestRecords import FOIRequestRecord diff --git a/request-management-api/request_api/resources/foiopeninfo.py b/request-management-api/request_api/resources/foiopeninfo.py index 104df9319..d0dba4fca 100644 --- a/request-management-api/request_api/resources/foiopeninfo.py +++ b/request-management-api/request_api/resources/foiopeninfo.py @@ -1,18 +1,16 @@ from flask import g, request from flask_restx import Namespace, Resource -from flask_expects_json import expects_json from flask_cors import cross_origin from request_api.auth import auth, AuthHelper from request_api.services.eventservice import eventservice from request_api.tracer import Tracer -from request_api.utils.util import cors_preflight, allowedorigins, getrequiredmemberships,str_to_bool,canrestictdata,canrestictdata_ministry +from request_api.utils.util import cors_preflight, allowedorigins, getrequiredmemberships from request_api.exceptions import BusinessException from request_api.schemas.foiopeninfo import FOIOpenInfoSchema, FOIOpenInfoAdditionalFilesSchema, FOIOpenInfoAdditionalFilesDeleteSchema from request_api.services.openinfoservice import openinfoservice from request_api.utils.enums import IAOTeamWithKeycloackGroup from marshmallow import Schema, fields, validate, ValidationError import json -import asyncio API = Namespace('FOIOPENINFO', description='Endpoints for FOI OpenInformation management') TRACER = Tracer.get_instance()