Skip to content

Commit

Permalink
Edm 521 continue lc updates (#34028)
Browse files Browse the repository at this point in the history
* stabilize logic to match all user flow mockups

* extract logic into function to get/set url params | refactor pagination to show count on current results

* update routing syntax

* update pagination related markup | update onSelecton functionality

* refresh all filter options on browser refresh | update variable names for readability

* stablize logic to display modal w different messages

* refactor form logic | add custom search url hook

* update pagination markup

* only update params onSubmit | remove custom hook

* update alert text | refactor alert logic for certs when state is selected

* continue logic updates to lc search form

* refactor modal close function

* cleanup

* add feature toggle for lce

* update api endpoint, rewire w new property names

* update endpoint to fetch live data, refactor accordingly

* connect results pages to live endpoints, refactor

* reset all state values when clearing name field | update styles

* update components styles | cleanup search logic

* add faqs to ui

* remove tests to fetch data till live data is solid

---------

Co-authored-by: Nick Hibbits <[email protected]>
  • Loading branch information
nicholashibbits and nicholashibbits authored Jan 10, 2025
1 parent 7ec18a9 commit 3e795c5
Show file tree
Hide file tree
Showing 11 changed files with 310 additions and 299 deletions.
20 changes: 7 additions & 13 deletions src/applications/gi/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,9 @@ export const fetchInstitutionPrograms = (facilityCode, programType) => {
};
};

export function fetchLicenseCertificationResults(
name = null,
filterOptions = { type: 'all', state: 'all' },
) {
const { type, state } = filterOptions;
export function fetchLicenseCertificationResults() {
const url = `${api.url}/lcpe/lacs`;

const url = name
? `${api.url}/lce?type=${type}&state=${state}&name=${name}`
: `${api.url}/lce?type=${type}&state=${state}`;
return dispatch => {
dispatch({ type: FETCH_LC_RESULTS_STARTED });

Expand All @@ -179,11 +173,11 @@ export function fetchLicenseCertificationResults(
throw new Error(res.statusText);
})
.then(results => {
const { data } = results;
const { lacs } = results;

dispatch({
type: FETCH_LC_RESULTS_SUCCEEDED,
payload: data,
payload: lacs,
});
})
.catch(err => {
Expand All @@ -195,9 +189,9 @@ export function fetchLicenseCertificationResults(
};
}

export function fetchLcResult(link) {
export function fetchLcResult(id) {
return dispatch => {
const url = `${api.url}/${link}`;
const url = `${api.url}/lcpe/lacs/${id}`;
dispatch({ type: FETCH_LC_RESULT_STARTED });

return fetch(url, api.settings)
Expand All @@ -210,7 +204,7 @@ export function fetchLcResult(link) {
.then(result => {
dispatch({
type: FETCH_LC_RESULT_SUCCEEDED,
payload: result.data,
payload: result.lac,
});
})
.catch(err => {
Expand Down
16 changes: 4 additions & 12 deletions src/applications/gi/components/LicenseCertificationAdminInfo.jsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
import React from 'react';

function LicenseCertificationAdminInfo({ institution }) {
const {
name,
mailingStreet,
mailingCity,
mailingState,
mailingZip,
} = institution;
const { name, mailingAddress } = institution;
return (
<div className="address-wrapper">
<strong>
<p>The following is the headquarters address</p>
</strong>{' '}
<h3>Admin Info</h3>
<p className="va-address-block">
{name} <br />
<br />
{mailingStreet}
{mailingAddress.address1}
<br />
{mailingCity}, {mailingState} {mailingZip}
{mailingAddress.city}, {mailingAddress.state} {mailingAddress.zip}
<br />
</p>
<strong>
Expand Down
72 changes: 0 additions & 72 deletions src/applications/gi/components/LicenseCertificationInfoTabs.jsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ export default function LicenseCertificationKeywordSearch({
>
License/Certification Name
</label>
<div className="lc-name-search-container vads-u-display--flex">
<div className="vads-u-display--flex input-container">
<input
style={
inputValue === ''
? { maxWidth: '30rem' }
: { width: '100%', borderRight: 'none' }
}
aria-controls="lcKeywordSearch"
className="lc-name-search-input"
{...getInputProps({
type: 'text',
onChange: handleChange,
Expand All @@ -78,7 +77,7 @@ export default function LicenseCertificationKeywordSearch({
size={3}
icon="cancel"
id="clear-input"
class="lc-clear vads-u-display--flex vads-u-align-items--center"
class="clear-icon vads-u-display--flex vads-u-align-items--center"
onClick={handleClearInput}
/>
)}
Expand All @@ -105,11 +104,11 @@ export default function LicenseCertificationKeywordSearch({
{...getItemProps({ item })}
>
{index !== 0 ? (
item.name
item.lacNm
) : (
<div className="keyword-suggestion-container">
<span className="vads-u-padding-right--1">
{item.name}
{item.lacNm}
</span>
<span>
{`(${
Expand Down
Loading

0 comments on commit 3e795c5

Please sign in to comment.