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

Created confirm dialog to check for empty variants by role #1463

Merged
merged 3 commits into from
Jan 3, 2024

Conversation

atGit2021
Copy link
Contributor

@atGit2021 atGit2021 commented Aug 3, 2023

Andrew, I started a draft PR now that I have some functionality up and running, but it uses some "dummy" buttons which are not tied into the workflow. I'm also not sure of some of the other design changes that might be needed to incorporate/integrate this into the front end design standards. Let me know if you have any bandwidth to review/huddle or if you want me to reach out to Brent or Adam. Thank you sir.

Monday Ticket

@atGit2021 atGit2021 self-assigned this Aug 3, 2023
@atGit2021
Copy link
Contributor Author

I would like to remove the "any" type in the following function, const getEmptyResponsesForRole = (list: any, roles: Set<Role>) => { if (list.items.length === 0) return []; const responsesForRole = list.items[0]?.responses.filter((item: any) => { return item.variant.responsibleRole ? roles.has(item.variant.responsibleRole) : false; }); but the fragment type is not straight forward so I'm not sure how to create an interface or type to replace the "any" parameter type. Any suggestions are appreciated.

@atGit2021 atGit2021 requested a review from bryanjnelson August 4, 2023 14:38
@bryanjnelson
Copy link
Contributor

I think you may want this:

import { PromptResponseListFragment } from '../../../../../common/fragments/promptResponse.graphql';



const getEmptyResponsesForRole = (
    list: PromptResponseListFragment,
    roles: Set<Role>
  ) => {```

@atGit2021 atGit2021 requested review from adam-soltech and removed request for andrewmurraydavid August 7, 2023 23:31
@atGit2021
Copy link
Contributor Author

atGit2021 commented Aug 10, 2023

Hi Adam, I'm having a lint error issue that I can't seem to figure out. It's showing up [here].
(a54f3a1#:~:text=%7BhandleDialogCancel%7D-,onContinue%3D%7BhandleDialogConfirm%7D,-/%3E). I tried modifying the return type to 'Promise' up and down the call chain to see if that would resolve, but so far no success. Could you take a look and also review all the changes I made? Thank you.

@atGit2021 atGit2021 force-pushed the 0005-Check-For-Empty-Variants branch from a54f3a1 to 5f9125a Compare August 10, 2023 18:18
@atGit2021 atGit2021 marked this pull request as ready for review August 10, 2023 21:37
@atGit2021 atGit2021 requested a review from CarsonF as a code owner August 10, 2023 21:37
@atGit2021
Copy link
Contributor Author

@adam-soltech It's ready for your review now. Thank you.

Copy link
Contributor

@adam-soltech adam-soltech left a comment

Choose a reason for hiding this comment

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

Hey Andre, thanks for asking for my review. Overall looks good. I added some comments when you have time.

@atGit2021 atGit2021 force-pushed the 0005-Check-For-Empty-Variants branch from 8cad678 to a0133fa Compare August 11, 2023 17:37
@atGit2021
Copy link
Contributor Author

Updated per your feedback, thank you @adam-soltech

@atGit2021 atGit2021 requested a review from adam-soltech August 11, 2023 17:45
Copy link
Contributor

@adam-soltech adam-soltech left a comment

Choose a reason for hiding this comment

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

One last nit - otherwise lgtm. Good job! Thanks!

@adam-soltech adam-soltech self-requested a review August 14, 2023 17:02
Copy link
Contributor

@adam-soltech adam-soltech left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for the opportunity to review

@atGit2021
Copy link
Contributor Author

Thank you Adam. Hi @CarsonF, Please take a look when you get a chance and let me know if there are any other changes you want me to make?

@bryanjnelson bryanjnelson removed their request for review August 22, 2023 18:33
Copy link
Member

@CarsonF CarsonF left a comment

Choose a reason for hiding this comment

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

Sorry for the huge delay in reviewing this 😞

We have a dynamic way to register steps already.
https://github.com/SeedCompany/cord-field/blob/master/src/scenes/ProgressReports/EditForm/Steps/index.ts#L9-L20
It would be better to re-use this to dynamically create your list here.
This could be iterated through just like ProgressReportStepper does.

Each step component could be updated to declare an isMissing function.
https://github.com/SeedCompany/cord-field/blob/master/src/scenes/ProgressReports/EditForm/Steps/step.types.ts#L4-L6

isMissing?: (report: ReportProp & { currentUserRoles: ReadonlySet<Role> }) => boolean;

Perhaps this could be called right after confirming the step is enabled, here

@atGit2021 atGit2021 force-pushed the 0005-Check-For-Empty-Variants branch from f52076a to e13b74c Compare November 30, 2023 19:52
Copy link
Contributor Author

@atGit2021 atGit2021 left a comment

Choose a reason for hiding this comment

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

Thank you @CarsonF

@atGit2021 atGit2021 requested a review from CarsonF December 1, 2023 14:20
@CarsonF CarsonF force-pushed the 0005-Check-For-Empty-Variants branch from 93f31ca to faee9fc Compare January 2, 2024 20:15
@CarsonF
Copy link
Member

CarsonF commented Jan 2, 2024

@atGit2021 I renamed "missing" to "incomplete" - I think this is a better representation. I also tweaked the dialog: renamed the component to make sense, renamed the filename to match, tweaked the styling to not have duplicate <DialogContent>, dropped the dividers to be consistent with our theme & MD, used proper semantic markup for the lists.

@atGit2021 atGit2021 merged commit 6b09a3e into develop Jan 3, 2024
3 checks passed
@atGit2021 atGit2021 deleted the 0005-Check-For-Empty-Variants branch January 3, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants