Skip to content

Commit

Permalink
Merge pull request #32 from CMSgov/remove-filename-check
Browse files Browse the repository at this point in the history
removing the filename check during validation
  • Loading branch information
shaselton-usds authored Mar 20, 2024
2 parents ab8e955 + 15d6d44 commit 3536a88
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 41 deletions.
29 changes: 0 additions & 29 deletions src/components/ValidationResults.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const createCsvString = (errors, warnings) =>
*/
const ValidationResults = ({
filename,
filenameValid,
valid,
errors,
warnings,
Expand Down Expand Up @@ -86,33 +85,6 @@ const ValidationResults = ({
>
Download results as spreadsheet
</a> */}

<h3>File name</h3>
<Alert
type={filenameValid ? `success` : `error`}
aria-live="polite"
aria-atomic="true"
>
{filenameValid ? (
<>
<span className="text-bold">File name valid</span>:{" "}
<span className="text-underline">{filename}</span>
</>
) : (
<>
<span className="text-bold">File name invalid</span>:{" "}
<span className="text-underline">{filename}</span>
<br />
<span>
Must match format:
&lt;ein&gt;_&lt;hospitalname&gt;_standardcharges.[json|csv].{" "}
<a href={`${import.meta.env.BASE_URL}filename-wizard/`}>
Click here to use the file name wizard.
</a>
</span>
</>
)}
</Alert>
<h3>Errors</h3>
<Alert
type={valid ? `success` : `error`}
Expand Down Expand Up @@ -220,7 +192,6 @@ const ValidationResults = ({

ValidationResults.propTypes = {
filename: PropTypes.string,
filenameValid: PropTypes.bool,
valid: PropTypes.bool,
errors: PropTypes.arrayOf(PropTypes.object),
warnings: PropTypes.arrayOf(PropTypes.object),
Expand Down
13 changes: 1 addition & 12 deletions src/pages/online-validator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "@trussworks/react-uswds"
import { FileInput } from "../components/FileInput"
import ValidationResults from "../components/ValidationResults"
import { validateCsv, validateJson, validateFilename } from "hpt-validator"
import { validateCsv, validateJson } from "hpt-validator"
import Layout from "../layouts"

const MAX_ERRORS = 250
Expand All @@ -29,7 +29,6 @@ const OnlineValidator = () => {
valid: true,
filename: "",
schemaVersion: "v2.0",
filenameValid: true,
fileUrl: "",
pageUrl: "",
loading: false,
Expand All @@ -44,7 +43,6 @@ const OnlineValidator = () => {
const file = evt.target.files[0]
const initialState = {
filename: file.name,
filenameValid: validateFilename(file.name),
schemaVersion: state.schemaVersion,
}
setState({ ...state, ...initialState, readError: false, loading: true })
Expand Down Expand Up @@ -129,14 +127,6 @@ const OnlineValidator = () => {
Loading file {state.filename}...
</p>
)}
<p className="text-italic">
Having trouble formatting your file name?
</p>
<p className="text-italic text-bold">
<a href={`${import.meta.env.BASE_URL}filename-wizard/`}>
Leverage the file name wizard!
</a>
</p>
</Grid>
<Grid
gap
Expand Down Expand Up @@ -211,7 +201,6 @@ const OnlineValidator = () => {
<section className="grid-container usa-section">
<ValidationResults
filename={state.filename}
filenameValid={state.filenameValid}
valid={state.valid}
errors={state.errors}
warnings={state.warnings}
Expand Down

0 comments on commit 3536a88

Please sign in to comment.