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

Task/wp 715 react exception form follow on #330

Draft
wants to merge 8 commits into
base: feat/apcd-react-conversion
Choose a base branch
from
18 changes: 5 additions & 13 deletions apcd-cms/src/apps/exception/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
logger = logging.getLogger(__name__)

class ExceptionFormView(TemplateView):
template_name = "exception_submission_form.html"

def post(self, request):
logger.debug("Am I here" * 10)
if (request.user.is_authenticated) and has_apcd_group(request.user):

form = request.POST.copy()
logger.debug(print(form))
errors = []
submitters = apcd_database.get_submitter_info(request.user.username)
# To create counter of exception requests and corresponding fields
Expand All @@ -34,18 +33,11 @@ def post(self, request):
if _err_msg(except_response):
errors.append(_err_msg(except_response))

if len(errors):
template = loader.get_template(
"exception_submission_form/exception_submission_error.html"
)
response = HttpResponse(template.render({}, request))
if errors:
return JsonResponse({'status': 'error', 'errors': errors}, status=400)
else:
template = loader.get_template(
"exception_submission_form/exception_form_success.html"
)
response = HttpResponse(template.render({}, request))
return JsonResponse({'status': 'success'}, status=200)

return response
else:
return HttpResponseRedirect('/')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
.paginatorContainer {
display: flex;
justify-content: center; /* Centers the child horizontally */
align-items: center; /* Centers the child vertically */
height: 100%; /* Adjust as needed */
padding-top: 20px;
}

display: flex;
justify-content: center; /* Centers the child horizontally */
align-items: center; /* Centers the child vertically */
height: 100%; /* Adjust as needed */
padding-top: 20px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ const ViewRegistrationModal: React.FC<{
{for_self ? 'Self' : 'Other'}
</dd>
<dt className="c-data-list__key">Registration Year</dt>
<dd className={styles.verticalDataValue}>{year ? year : "None"}</dd>
<dd className={styles.verticalDataValue}>
{year ? year : 'None'}
</dd>
<dt className="c-data-list__key">Type</dt>
<dd className={styles.verticalDataValue}>{type}</dd>
<dt className="c-data-list__key">Business Name</dt>
Expand All @@ -69,11 +71,17 @@ const ViewRegistrationModal: React.FC<{
<dt className="c-data-list__key">Name</dt>
<dd className={styles.verticalDataValue}>{entity.ent_name}</dd>
<dt className="c-data-list__key">FEIN</dt>
<dd className={styles.verticalDataValue}>{entity.fein ? entity.fein : "None"}</dd>
<dd className={styles.verticalDataValue}>
{entity.fein ? entity.fein : 'None'}
</dd>
<dt className="c-data-list__key">License Number</dt>
<dd className={styles.verticalDataValue}>{entity.license ? entity.license : "None"}</dd>
<dd className={styles.verticalDataValue}>
{entity.license ? entity.license : 'None'}
</dd>
<dt className="c-data-list__key">NAIC Company Code</dt>
<dd className={styles.verticalDataValue}>{entity.naic ? entity.naic : "None"}</dd>
<dd className={styles.verticalDataValue}>
{entity.naic ? entity.naic : 'None'}
</dd>
<h6>Type of Plan</h6>
<dd>
<dl className="c-data-list--is-vert c-data-list--is-wide">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@
.expirationDate {
min-width: 15ch;
}
.dateRow {
display: inline-flex;
flex-direction: row;
justify-content: space-around;
.fieldRows {
display: flex;
gap: 5rem;
margin-top: 1rem;
margin-bottom: 1rem;
min-width: 15ch;
}
.dateRow input {
width: 35px;
font-size: 16px;
.fieldRows input {
font-size: inherit;
}
.loadingField {
display: inline-flex;
Expand All @@ -35,3 +31,17 @@
border-color: #ced4da;
cursor: not-allowed;
}
.requiredThreshold,
.thresholdRequested {
-webkit-appearance: none;
margin: 0;
-moz-appearance: textfield;
}
.termsCheckbox input {
position: unset;
margin-left: 0;
}

.justification {
font-size: unset;
}
Loading