Skip to content

Conversation

@dustbuster
Copy link
Contributor

@dustbuster dustbuster commented Nov 21, 2025

The datepicker works!

Screen.Recording.2025-11-20.at.16.22.54.mov

OPTIONAL:
Some quality of life updates for seeder.
Screenshot 2025-11-24 at 14 08 54

Better dates:
Screenshot 2025-11-24 at 14 18 50

@github-actions github-actions bot added server Relates to the server. client Relates to the client. labels Nov 21, 2025
@demos-git-service-account
Copy link
Contributor

demos-git-service-account commented Nov 21, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Comment on lines +199 to +233
const healthFocusDemoTypes = [
"Beneficiary Engagement",
"PHE-COVID-19", "Aggregate Cap", "Annual Limits",
"Basic Health Plan (BHP)", "Behavioral Health",
"Children's Health Insurance Program (CHIP)",
"CMMI - AHEAD", "CMMI - Integrated Care for Kids (IncK)",
"CMMI - Maternal Opioid Misuse (MOM)",
"Community Engagement", "Contingency Management",
"Continuous Eligibility",
"Delivery System Reform Incentive Payment (DSRIP)",
"Dental", "Designated State Health Programs (DSHP)",
"Employment Supports", "Enrollment Cap",
"End-Stage Renal Disease (ESRD)", "Expenditure Cap",
"Former Foster Care Youth (FFCY)",
"Global Payment Program (GPP)", "Health Equity",
"Health-Related Social Needs (HRSN)",
"Healthy Behavior Incentives",
"HIV", "Home Community Based Services (HCBS)",
"Lead Exposure", "Lifetime Limits",
"Long-Term Services and Supports (LTSS)",
"Managed Care", "Marketplace Coverage/Premium Assistance Wrap",
"New Adult Group Expansion", "Non-Eligibility Period",
"Non-Emergency Medical Transportation (NEMT)",
"Partial Expansion of the New Adult Group", "Pharmacy", "PHE-Appendix K",
"PHE-Reasonable Opportunity Period (ROP)", "PHE-Risk Mitigation",
"PHE-Vaccine Coverage", "Premiums/Cost-Sharing",
"Provider Cap", "Provider Restriction", "ReEntry",
"Reproductive Health: Family Planning", "Reproductive Health: Fertility",
"Reproductive Health: Hyde", "Reproductive Health: Maternal Health",
"Reproductive Health: Post-Partum Extension", "Reproductive Health: RAD",
"Retroactive Eligibility", "Serious Mental Illness (SMI)", "Special Needs",
"Substance Use Disorder (SUD)", "Targeted Population Expansion", "Tribal",
"Uncompensated Care","Value Based Care (VBC)", "Vision",
];
const demonstrationTypes = ["Section 1115", "Section 1915(b)", "Section 1915(c)"];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i reallze it's very listy and slgihtly uggo, but it's better than voloptious lambda ipsum chalupa
And Connor, the demos you create will show in "my demos" so should be easy to tell.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulled this from demonstration type from PMDA, just to add something a bit more "not latin"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defining demonstrationTypes here might get a little confusing when we start building out the actual demonstrationTypes modal. It looks like that is only used for coming up with demonstration names, so it might be better to call this something like "areaOfFocus" or something.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, we do have a lot of name things for demos.

So that we can't just add like the kitchen sink to this, thus most
configuring has to be done in the component and not where it's used.
Also cleaned up implementation in column fitler
The issue i am trying to fix is that the document dates are all the
same, So hard to test filter.
Could be candidate for "and the rest of the input stuff" but not yet
documentTypeId: stateApplicationDocumentType,
applicationId: amendmentId.id,
phaseId: applicationIntakePhaseName,
createdAt: randomBackdatedDate(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This populates the doc tables inside demos, but gives range of dates so we can test filters.

@dustbuster dustbuster changed the title DEMOS-975: made a centralized date picker. - WIP DEMOS-975: Minimal centralized date picker, and seeder stuff Nov 24, 2025
Comment on lines +101 to +120
<DatePicker
label={`${columnDisplayName} Start`}
id="date-filter-start"
name="date-filter-start"
type="date"
className="w-full border border-border-fields px-1 py-1 text-sm rounded"
onChange={(e) => {
const value = e.target.value;
onRangeChange(parseISO(value), filterRangeValue.end);
}}
placeholder="Start date"
value={filterRangeValue.start ? format(filterRangeValue.start, "yyyy-MM-dd") : ""}
onValueChange={(val) =>
onRangeChange(val ? parseISO(val) : null, filterRangeValue.end)
}
/>
</div>
<div>
<label
className="block text-sm font-bold mb-1"
htmlFor="date-filter-end"
>{`${columnDisplayName} End`}</label>
<input
<DatePicker
label={`${columnDisplayName} End`}
id="date-filter-end"
name="date-filter-end"
type="date"
onChange={(e) => onRangeChange(filterRangeValue.start, parseISO(e.target.value))}
className="w-full border border-border-fields px-1 py-1 text-sm rounded"
placeholder="End date"
value={filterRangeValue.end ? format(filterRangeValue.end, "yyyy-MM-dd") : ""}
onValueChange={(val) =>
onRangeChange(filterRangeValue.start, val ? parseISO(val) : null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this does is implement the DatePicker. Everyting works as before.

Comment on lines +117 to +129
for (const demonstration of demonstrations) {
const fakeName = faker.lorem.sentence(2);
await prisma().document.create({
data: {
name: fakeName,
description: "Application for " + fakeName,
s3Path: "s3://" + faker.lorem.word() + "/" + faker.lorem.word(),
ownerUserId: (await prisma().user.findRandom())!.id,
documentTypeId: stateApplicationDocumentType,
applicationId: demonstration.id,
phaseId: applicationIntakePhaseName,
createdAt: randomBackdatedDate(),
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was pulled, but having a few documents with varying dates helps test the sorting on the doc table.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was intentionally reworked into the seedDocuments method towards the top of the seeder. It is currently set to populate 15 documents of random types on every application (demos, extensions, and amendments). The intention of that change was to make sure that if there is a seeded document in the db that it is also backed by a seeded file in s3, such that documents visible on the page can be deleted (primarily on Dev). It also retains the behavior for the simple local upload bypass, such that if that is set, the backing to s3 is not produced. I think we should probably pull out this particular section, so that we dont have a mix of documents with and without s3 backing. We can set some random dates to the created Documents there

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. That's all i was looking for was random dates.

Comment on lines +208 to +211
function randomBackdatedDate() {
const daysBack = faker.number.int({ min: 90, max: 210 }); // roughly 3-7 months ago
return faker.date.recent({ days: daysBack });
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just sets a random date within the last 7 months. (oddly specific)

Comment on lines +415 to +428
let stateSelection = sampleFromArray(person.personStates, 1)[0];
if (!stateSelection) {
const fallbackState = await prisma().state.findRandom();
if (!fallbackState) {
throw new Error("No states available to assign to demonstration");
}
stateSelection = { stateId: fallbackState.id, state: fallbackState, personId: person.id };
}

const stateName = stateSelection.state?.name ?? stateSelection.stateId;
const waiverType = sampleFromArray(demonstrationTypes, 1)[0];
const focusArea = sampleFromArray(healthFocusDemoTypes, 1)[0];
const demoName = `${stateName} ${waiverType} Waiver: ${focusArea}`;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we just set those names randomly.

So we wind up with something like:
Arizona Section 1915(b) Waiver: Healthy Behavior Incentives

Comment on lines +24 to +32
return (
<Input
type="date"
label={label}
name={name ?? id ?? ""}
isRequired={required ?? false}
value={value}
onChange={handleChange}
/>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is like as simple as i could make and still work with ColumnFilter

Copy link
Contributor

@connor-parke-icf connor-parke-icf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the things ive been trying to get working on Dev is how documents are seeded such that they can be downloaded or deleted. In order for this to work though, each of the documents should correspond to a file that exists in s3. If we have a document entry in the document table that does not have a file associated to it, it wont be able to be deleted (it will error). On our locals, this is resolved by using the SIMPLE_LOCAL_UPLOAD flag, but that isnt something i think we should be propagating to the other environments. So instead of a new section for seeding documents, i think we should just expand the existing one to introduce some of the random createdAt dates.

Comment on lines +117 to +129
for (const demonstration of demonstrations) {
const fakeName = faker.lorem.sentence(2);
await prisma().document.create({
data: {
name: fakeName,
description: "Application for " + fakeName,
s3Path: "s3://" + faker.lorem.word() + "/" + faker.lorem.word(),
ownerUserId: (await prisma().user.findRandom())!.id,
documentTypeId: stateApplicationDocumentType,
applicationId: demonstration.id,
phaseId: applicationIntakePhaseName,
createdAt: randomBackdatedDate(),
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was intentionally reworked into the seedDocuments method towards the top of the seeder. It is currently set to populate 15 documents of random types on every application (demos, extensions, and amendments). The intention of that change was to make sure that if there is a seeded document in the db that it is also backed by a seeded file in s3, such that documents visible on the page can be deleted (primarily on Dev). It also retains the behavior for the simple local upload bypass, such that if that is set, the backing to s3 is not produced. I think we should probably pull out this particular section, so that we dont have a mix of documents with and without s3 backing. We can set some random dates to the created Documents there

Comment on lines +199 to +233
const healthFocusDemoTypes = [
"Beneficiary Engagement",
"PHE-COVID-19", "Aggregate Cap", "Annual Limits",
"Basic Health Plan (BHP)", "Behavioral Health",
"Children's Health Insurance Program (CHIP)",
"CMMI - AHEAD", "CMMI - Integrated Care for Kids (IncK)",
"CMMI - Maternal Opioid Misuse (MOM)",
"Community Engagement", "Contingency Management",
"Continuous Eligibility",
"Delivery System Reform Incentive Payment (DSRIP)",
"Dental", "Designated State Health Programs (DSHP)",
"Employment Supports", "Enrollment Cap",
"End-Stage Renal Disease (ESRD)", "Expenditure Cap",
"Former Foster Care Youth (FFCY)",
"Global Payment Program (GPP)", "Health Equity",
"Health-Related Social Needs (HRSN)",
"Healthy Behavior Incentives",
"HIV", "Home Community Based Services (HCBS)",
"Lead Exposure", "Lifetime Limits",
"Long-Term Services and Supports (LTSS)",
"Managed Care", "Marketplace Coverage/Premium Assistance Wrap",
"New Adult Group Expansion", "Non-Eligibility Period",
"Non-Emergency Medical Transportation (NEMT)",
"Partial Expansion of the New Adult Group", "Pharmacy", "PHE-Appendix K",
"PHE-Reasonable Opportunity Period (ROP)", "PHE-Risk Mitigation",
"PHE-Vaccine Coverage", "Premiums/Cost-Sharing",
"Provider Cap", "Provider Restriction", "ReEntry",
"Reproductive Health: Family Planning", "Reproductive Health: Fertility",
"Reproductive Health: Hyde", "Reproductive Health: Maternal Health",
"Reproductive Health: Post-Partum Extension", "Reproductive Health: RAD",
"Retroactive Eligibility", "Serious Mental Illness (SMI)", "Special Needs",
"Substance Use Disorder (SUD)", "Targeted Population Expansion", "Tribal",
"Uncompensated Care","Value Based Care (VBC)", "Vision",
];
const demonstrationTypes = ["Section 1115", "Section 1915(b)", "Section 1915(c)"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defining demonstrationTypes here might get a little confusing when we start building out the actual demonstrationTypes modal. It looks like that is only used for coming up with demonstration names, so it might be better to call this something like "areaOfFocus" or something.

@dustbuster
Copy link
Contributor Author

So @connor-parke-icf @tresdonicf Take away from review:

  • Reset document changes, then add date scatter.
  • rename demo type to "healthAreas" or something like other than using the precious demo types.

@tresdonicf
Copy link
Contributor

The DatePicker changes look good to me! Deferring to Connor regarding the seeder changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client Relates to the client. server Relates to the server.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants