Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small improvements to filter code #1134

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/components/rangeUsePlanPage/pageForAH/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import PlanForm from '../PlanForm';
import { createAmendment, savePlan } from '../../../api';
import { canUserEditThisPlan, isPlanAmendment } from '../../../utils';
import NetworkStatus from '../../common/NetworkStatus';
import permissions from '../../../constants/permissions';

// Agreement Holder page
class PageForAH extends Component {
Expand Down Expand Up @@ -173,7 +172,6 @@ class PageForAH extends Component {
const { isSavingAsDraft, isSubmitting, isCreatingAmendment } = this.state;
const { openConfirmationModal, plan, user, clientAgreements } = this.props;
const { confirmations, status } = plan;
console.log(permissions + '****************************');
return (
<ActionBtns
permissions={{
Expand Down
14 changes: 4 additions & 10 deletions src/components/selectRangeUsePlanPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ const SelectRangeUsePlanPage = ({ match, history }) => {
const [order = 'asc', setOrder] = useQueryParam('order', StringParam);
const debouncedOrder = useDebounce(order, 500);
const filterInfo = getDataFromLocalStorage('filter-info');
const [filters = { agreementCheck: 'true' }, setFilters] = useQueryParam(
'filters',
NewObjectParam,
);
const [
filters = { agreementCheck: 'true', showReplacedPlans: 'false' },
setFilters,
] = useQueryParam('filters', NewObjectParam);
const debouncedFilters = useDebounce(filters, 500);
const [filtersInitialized, setFiltersInitialized] = useState(false);
// startup
Expand All @@ -93,11 +93,6 @@ const SelectRangeUsePlanPage = ({ match, history }) => {
if (pageInfo.pageNumber) setPage(pageInfo.pageNumber);
if (pageInfo.pageLimit) setLimit(pageInfo.pageLimit);
}
// Initialize filters
setFilters({
...filterInfo,
agreementCheck: 'true',
});
setFiltersInitialized(true); // Workaround flag for checkbox racing the filter initialization
}, []);
const [planCheck = filterInfo?.planCheck || false, setPlanCheck] =
Expand Down Expand Up @@ -132,7 +127,6 @@ const SelectRangeUsePlanPage = ({ match, history }) => {

const references = useReferences();
const user = useUser();

const zones = references.ZONES || [];
const userZones = zones.filter((zone) => user.id === zone.userId);
const districtIds = userZones.map((userZone) => {
Expand Down
Loading