Skip to content

Commit

Permalink
Merge branch 'test-rook-NK-AH-FOIMOD-3583' of https://github.com/bcgo…
Browse files Browse the repository at this point in the history
…v/foi-flow into test-rook-NK-AH-FOIMOD-3583
  • Loading branch information
nkan-aot2 committed Jan 6, 2025
2 parents 62fdd88 + a00e158 commit 15ccea3
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
getFullName,
getDaysLeft,
getReceivedDate,
// onBehalfFullName,
getRecordsDue,
LightTooltip,
displayQueueFlagIcons,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const ActionProvider = ({ children }) => {

const defaultSortModel = [
{ field: "currentState", sort: "desc" },
// { field: "receivedDateUF", sort: "desc" },
];

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
30 changes: 1 addition & 29 deletions forms-flow-web/src/components/FOI/Dashboard/OI/Queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ 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";
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"

Expand All @@ -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();
Expand Down Expand Up @@ -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",
Expand Down
13 changes: 1 addition & 12 deletions forms-flow-web/src/components/FOI/FOIAuthenticateRouting.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 (
<>
Expand All @@ -57,13 +53,6 @@ const FOIAuthenticateRouting = React.memo((props) => {
<>
<FOIHeader />
<Route exact path="/foi/dashboard">
{/* {isOITeam ? (
<OIDashboard userDetail={userDetail} />
) : isMinistry ? (
<MinistryDashboard userDetail={userDetail} />
) : (
<Dashboard userDetail={userDetail} />
)} */}
{isMinistry ? (
<MinistryDashboard userDetail={userDetail} />
) : (
Expand Down
2 changes: 0 additions & 2 deletions forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1182,8 +1182,6 @@ const FOIRequest = React.memo(({ userDetail, openApplicantProfileModal }) => {
isValidationError={isValidationError}
requestType={requestDetails?.requestType}
isOITeam={isOITeam}
// isDivisionalCoordinator={false}
// isHistoricalRequest={isHistoricalRequest}
/>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,6 @@ const OpenInfo = ({
}));
}

console.log("req", requestDetails)
console.log("oi info", oiPublicationData)
console.log("isOIUser", isOITeam)

return (
<>
<div className="oi-section">
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -132,11 +131,7 @@ const handleOIAssigneeUpdate = async (event: any) => {
}
})
);
}else{
console.log("username is OI Team");
}


}

const [menuItems, setMenuItems] = useState<any>([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,19 @@
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
from .ApplicantCategories import ApplicantCategory
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
Expand Down Expand Up @@ -249,7 +243,7 @@ def getoibasequery(cls, additionalfilter=None, userid=None, isiaorestrictedfilem
or_(
and_(
FOIMinistryRequest.oistatus_id.isnot(None),
#FOIMinistryRequest.requeststatuslabel != StateName.closed.name
FOIMinistryRequest.oistatus_id != OIStatusEnum.PUBLISHED.value
),
and_(
FOIMinistryRequest.oistatus_id.is_(None),
Expand Down
4 changes: 1 addition & 3 deletions request-management-api/request_api/resources/foiopeninfo.py
Original file line number Diff line number Diff line change
@@ -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()
Expand Down

0 comments on commit 15ccea3

Please sign in to comment.