From 29a066fcc1929d40bad55b3cb2005a2a2f4a1601 Mon Sep 17 00:00:00 2001 From: Brijesh Date: Thu, 13 Jun 2024 10:24:54 -0700 Subject: [PATCH] Add tooltips for filter check boxes --- .../selectRangeUsePlanPage/index.js | 164 ++++++++++-------- src/constants/strings.js | 14 +- 2 files changed, 100 insertions(+), 78 deletions(-) diff --git a/src/components/selectRangeUsePlanPage/index.js b/src/components/selectRangeUsePlanPage/index.js index 32ff6e87..0bc462c3 100644 --- a/src/components/selectRangeUsePlanPage/index.js +++ b/src/components/selectRangeUsePlanPage/index.js @@ -1,36 +1,40 @@ -import React, { useState, useEffect } from 'react'; +import { Checkbox, FormControlLabel, Tooltip } from '@material-ui/core'; +import { makeStyles } from '@material-ui/core/styles'; +import React, { useEffect, useState } from 'react'; import useSWR from 'swr'; +import { + BooleanParam, + StringParam, + decodeObject, + encodeObject, + useQueryParam, +} from 'use-query-params'; import * as API from '../../constants/api'; +import { + SELECT_RUP_BANNER_CONTENT, + SELECT_RUP_BANNER_HEADER, + TOOLTIP_TEXT_ACTIVE_RUP, + TOOLTIP_TEXT_ARCHIVED_PLANS, + TOOLTIP_TEXT_RANGE_AGREEMENT, + TOOLTIP_TEXT_RUP_CREATED, +} from '../../constants/strings'; +import { useReferences } from '../../providers/ReferencesProvider'; +import { useToast } from '../../providers/ToastProvider'; +import { useUser } from '../../providers/UserProvider'; import { axios, getAuthHeaderConfig, - isUserAgrologist, - isUserAdmin, getDataFromLocalStorage, + isUserAdmin, + isUserAgrologist, saveDataInLocalStorage, } from '../../utils'; import useDebounce from '../../utils/hooks/useDebounce'; +import { Banner } from '../common'; import Error from './Error'; -import { makeStyles } from '@material-ui/core/styles'; import ZoneSelect, { ZoneSelectAll } from './ZoneSelect'; -import { Banner } from '../common'; -import { - SELECT_RUP_BANNER_HEADER, - SELECT_RUP_BANNER_CONTENT, -} from '../../constants/strings'; -import { useToast } from '../../providers/ToastProvider'; -import { - useQueryParam, - StringParam, - encodeObject, - decodeObject, - BooleanParam, -} from 'use-query-params'; -import { useReferences } from '../../providers/ReferencesProvider'; -import { useUser } from '../../providers/UserProvider'; import SortableAgreementTable from './SortableAgreementTable'; -import { Checkbox, FormControlLabel } from '@material-ui/core'; const keyValueSeparator = '-'; // default is "-" const entrySeparator = '~'; // default is "_" @@ -204,62 +208,70 @@ const SelectRangeUsePlanPage = ({ match, history }) => { />
- { - setPlanCheck(!planCheck); - setSaveFilterInfo('planCheck', !planCheck); - }} - name="planCheck" - color="primary" - /> - } - label="RUP Created" - /> - { - setAgreementCheck(!agreementCheck); - setSaveFilterInfo('agreementCheck', !agreementCheck); - }} - name="agreementCheck" - color="primary" - /> - } - label="Range Agreement" - /> - { - setActiveCheck(!activeCheck); - setSaveFilterInfo('activeCheck', !activeCheck); - }} - name="activeCheck" - color="primary" - /> - } - label="Active RUP" - /> - { - setShowReplacedPlans(!showReplacedPlans); - setSaveFilterInfo('showReplacedPlans', !showReplacedPlans); - }} - name="shwoReplacedPlans" - color="primary" - /> - } - label="Replaced Plans" - /> + + { + setPlanCheck(!planCheck); + setSaveFilterInfo('planCheck', !planCheck); + }} + name="planCheck" + color="primary" + /> + } + label="RUP Created" + /> + + + { + setAgreementCheck(!agreementCheck); + setSaveFilterInfo('agreementCheck', !agreementCheck); + }} + name="agreementCheck" + color="primary" + /> + } + label="Range Agreement" + /> + + + { + setActiveCheck(!activeCheck); + setSaveFilterInfo('activeCheck', !activeCheck); + }} + name="activeCheck" + color="primary" + /> + } + label="Active RUP" + /> + + + { + setShowReplacedPlans(!showReplacedPlans); + setSaveFilterInfo('showReplacedPlans', !showReplacedPlans); + }} + name="shwoReplacedPlans" + color="primary" + /> + } + label="Replaced Plans" + /> +
{isUserAgrologist(user) && (