Untitled

 avatar
unknown
plain_text
a year ago
3.7 kB
6
Indexable
Update the below code to filter the state values from the state ref table val stored in refTableContent which matches the state value present in the loginDetails. and save that in a list to pass on to next screen RFIFilters.

refTableContent=
PROGRAM: 
0: {EE: "Y", CS: "N", CODE: "AU", CW: "N", DESCRIPTION: "AU"}
1: {EE: "Y", CS: "N", CODE: "SNAP", CW: "N", DESCRIPTION: "SNAP"}
2: {EE: "Y", CS: "N", CODE: "MA", CW: "N", DESCRIPTION: "MA"}
3: {EE: "Y", CS: "N", CODE: "LIHEAP", CW: "N", DESCRIPTION: "LIHEAP"}
4: {EE: "Y", CS: "N", CODE: "CC", CW: "N", DESCRIPTION: "CC"}
5: {EE: "Y", CS: "N", CODE: "PIPP", CW: "N", DESCRIPTION: "PIPP"}
6: {EE: "Y", CS: "Y", CODE: "ALL", CW: "Y", DESCRIPTION: "ALL"}

STATE: 
0: {CODE: "CT", DESCRIPTION: "Kanteki"}
1: {CODE: "IN", DESCRIPTION: "India"}

OFFERING: 
0: {CODE: "EE", DESCRIPTION: "Eligibility and Enrollment"}
1: {CODE: "CS", DESCRIPTION: "Child Support"}
2: {CODE: "CW", DESCRIPTION: "Child Welfare"}

ELIGIBILITY:
0: {EE: "Y", CS: "N", CODE: "FO", CW: "N", DESCRIPTION: "Font Office"}
1: {EE: "Y", CS: "N", CODE: "AL", CW: "N", DESCRIPTION: "All"}
2: {EE: "Y", CS: "N", CODE: "MA", CW: "N", DESCRIPTION: "Macho"}





import BodySection from '@/Layout/BodySection';
import RightSection from '@/Layout/RightSection';
import { useAppState, withPage, Lift, Util } from '@d-lift/core';
import { Page } from '@d-lift/uxcomponents';
import React, { useEffect } from 'react';
import RFIFilters from './Components/RFIFilters';
import RFIRequestForm from './Components/RFIRequestForm';
import './createRfi.scss';
import ConstantKeys from '@/Constants/ConstantKeys';
import webService from '@/Services/WebService';
import RFIUtil from '@/Util/RFIUtil';

const RFIRequest = () => {
    const defaultRFIRequest = {
        title: '',
        reqDescription: '',
        questionsList: [{ question: '', description: '' }],
        requestedBy: '',
        neededBy: '',
        offering: ConstantKeys.DEFAULT_OPTION.OFFERING,
        category: [...ConstantKeys.DEFAULT_OPTION.CATEGORY],
        programs: [...ConstantKeys.DEFAULT_OPTION.PROGRAM],
        status: '',
    };

    const [rfiRequest, setRFIRequest] = useAppState('rfiRequest', defaultRFIRequest);

    const updateRFIRequest = (newState) => {
        setRFIRequest(newState);
    };

    useEffect(() => {
        let refTableContent = JSON.parse(Util.getSessionData(ConstantKeys.REF_TABLE.GET_OFFERING));
    }, []);

    const getLoginData = () => {
        // const loginDetails = webService.getLoginDetails({
        //     requestBody: '',
        // });
        const loginDetails = [
            {
                state: 'SS',
                offering: ['EE'],
            },
            {
                state: 'ST',
                offering: ['EE', 'EF'],
            },
        ];
    };

    return (
        <Page ref-table-list="PROGRAM, CATEGORY, OFFERING, STATE">
            <div className="d-flex">
                <BodySection>
                    <RFIRequestForm
                        rfiRequest={rfiRequest}
                        updateRFIRequest={updateRFIRequest}
                        resetRFIRequest={() =>
                            updateRFIRequest(defaultRFIRequest)
                        }></RFIRequestForm>
                </BodySection>
                <RightSection>
                    <RFIFilters
                        rfiRequest={rfiRequest}
                        updateRFIRequest={updateRFIRequest}></RFIFilters>
                </RightSection>
            </div>
        </Page>
    );
};

export default withPage(
    {
        Description: 'Make a Request Page',
        ContentManager: true,
        LayoutStyle: 'rfi-dashboard',
    },
    RFIRequest,
);
Editor is loading...
Leave a Comment