Skip to content

Commit

Permalink
[APCD] Exception, Submission and navigation bugs (#401)
Browse files Browse the repository at this point in the history
* Bugs from testing session

* revert testing change
  • Loading branch information
chandra-tacc authored Dec 11, 2024
1 parent a5dc6f6 commit a444af3
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 22 deletions.
1 change: 1 addition & 0 deletions apcd_cms/src/apps/submissions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def _set_submissions(submission):
'received_timestamp': submission['received_timestamp'],
'updated_at': submission['updated_at'],
'payor_code': submission['payor_code'],
'entity_name': submission['entity_name'],
'view_modal_content': submission['view_modal_content'],
}
for submission in submission_content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const AdminExtensions: React.FC = () => {
return (
<SectionMessage type="error">
There was an error loading the page.{''}
<a href="https://txapcd.org/workbench/dashboard/tickets/create">
<a href="/workbench/dashboard/tickets/create" className="wb-link">
Please submit a ticket.
</a>
</SectionMessage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import LoadingSpinner from 'core-components/LoadingSpinner';
import SectionMessage from 'core-components/SectionMessage';
import Button from 'core-components/Button';
import Paginator from 'core-components/Paginator';
import { Link } from 'react-router-dom';
import styles from './AdminSubmissions.module.css';
import { formatDate } from 'utils/dateUtil';
import { titleCase } from 'utils/stringUtil';
Expand Down Expand Up @@ -66,9 +65,9 @@ export const AdminSubmissions: React.FC = () => {
return (
<SectionMessage type="error">
There was an error loading the page.{' '}
<Link to="/workbench/dashboard/tickets/create" className="wb-link">
<a href="/workbench/dashboard/tickets/create" className="wb-link">
Please submit a ticket.
</Link>
</a>
</SectionMessage>
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Modal, ModalHeader, ModalBody, Row, Col } from 'reactstrap';
import { ExceptionModalContent, ExceptionRow } from 'hooks/admin';
import { ExceptionRow } from 'hooks/admin';
import { formatModalDate } from 'utils/dateUtil';
import styles from './ViewExceptionModal.module.css';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ export const ViewUsers: React.FC = () => {
<div>
<h1>List Users</h1>
<hr />
<p style={{ marginBottom: '30px' }}>List of all system users attached to a submitter.</p>
<p style={{ marginBottom: '30px' }}>
List of all system users attached to a submitter.
</p>
<hr />
<div className="filter-container">
<div className="filter-content">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect } from 'react';
import { Formik, Form, Field, ErrorMessage } from 'formik';
import { Formik, Form, Field } from 'formik';
import * as Yup from 'yup';
import { FormGroup, Label, FormFeedback } from 'reactstrap';
import { FormGroup, Label } from 'reactstrap';
import Button from 'core-components/Button';
import { useNavigate, useSearchParams } from 'react-router-dom';
import {
Expand Down Expand Up @@ -215,9 +215,8 @@ export const RegistrationForm: React.FC<{
: `register/request-to-submit/api/`;
submitForm({ url, body: values });
};
const navigate = useNavigate();
const handleClick = () => {
navigate('/workbench/dashboard');
window.location.href = '/workbench/dashboard';
};

if (isLoading) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ export const RegistrationList: React.FC<{
<>
<p className="c-message c-message--error">
An error occurred loading your registrations. For help,{' '}
<a href="/workbench/dashboard">submit a ticket</a>.
<a href="/workbench/dashboard/tickets/create" className="wb-link">
Please submit a ticket.
</a>
</p>
<a className="c-button c-button--primary" href="/">
Back to Home
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ export const ViewFileSubmissions: React.FC = () => {
return (
<SectionMessage type="error">
There was an error loading the page.{' '}
<Link to="/workbench/dashboard/tickets/create" className="wb-link">
<a href="/workbench/dashboard/tickets/create" className="wb-link">
Please submit a ticket.
</Link>
</a>
</SectionMessage>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export const ExceptionForm: React.FC<{ index: number }> = ({ index }) => {
{entitiesError && (
<SectionMessage type="error">
There was an error finding your associated businesses.{' '}
<Link to="/workbench/dashboard/tickets/create" className="wb-link">
<a href="/workbench/dashboard/tickets/create" className="wb-link">
Please submit a ticket.
</Link>
</a>
</SectionMessage>
)}
</FieldWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export const ExceptionFormPage: React.FC = () => {
.required('Business name is required'),
fileType: Yup.string().required('File type is required'),
fieldCode: Yup.string().required('Field code is required'),
expiration_date: Yup.date().required('Expiration date is required')
expiration_date: Yup.date()
.required('Expiration date is required')
.max('9999-12-31', 'Expiration date must be MM/DD/YYYY')
.min('0001-01-01', 'Expiration date must be MM/DD/YYYY'),
requested_threshold: Yup.number().required(
Expand All @@ -81,9 +82,11 @@ export const ExceptionFormPage: React.FC = () => {
}),
expirationDateOther: Yup.mixed().when('exceptionType', {
is: 'other',
then: (schema) => Yup.date().required('Required')
.max('9999-12-31', 'Date must be MM/DD/YYYY')
.min('0001-01-01', 'Date must be MM/DD/YYYY'),
then: (schema) =>
Yup.date()
.required('Required')
.max('9999-12-31', 'Date must be MM/DD/YYYY')
.min('0001-01-01', 'Date must be MM/DD/YYYY'),
otherwise: (schema) => schema.strip(),
}),
otherExceptionBusinessName: Yup.mixed().when('exceptionType', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
ApplicableDataPeriod,
} from 'hooks/entities';
import SectionMessage from 'core-components/SectionMessage';
import { Link } from 'react-router-dom';
import FieldWrapper from 'core-wrappers/FieldWrapperFormik';

const maxDate = new Date();
Expand Down Expand Up @@ -79,9 +78,9 @@ const ExtensionFormInfo: React.FC<{
{!submitterData && (
<SectionMessage type="error">
There was an error finding your associated businesses.{' '}
<Link to="/workbench/dashboard/tickets/create" className="wb-link">
<a href="/workbench/dashboard/tickets/create" className="wb-link">
Please submit a ticket.
</Link>
</a>
</SectionMessage>
)}
</FieldWrapper>
Expand Down

0 comments on commit a444af3

Please sign in to comment.