Skip to content

Conversation

@canac
Copy link
Contributor

@canac canac commented Jan 10, 2024

Description

  • Prevent blurring contacts and assignee autocomplete from removing the highlighted option
  • Fix selecting tags
  • Use desktop-optimized date and time pickers
  • Default appointments' completed date to their start date

There are other places that could use these new inputs, but that refactoring is part of a proposed tech debt item that will be addressed later.

Testing

Please specifically test keyboard usage for the task inputs and let me know if there's improvements to be made there. @caleballdrin I would love to get your feedback on that too.

https://jira.cru.org/browse/MPDX-7828

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels. (Add the label "On Staging" to get the branch automatically merged into staging.)
  • I have requested a review from another person on the project

@canac canac requested review from caleballdrin and dr-bizz January 10, 2024 18:04
@canac canac added the On Staging Will be merged to the staging branch by Github Actions label Jan 10, 2024
@aws-amplify-us-east-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-851.d3dytjb8adxkk5.amplifyapp.com

@canac canac force-pushed the 7828-task-modal branch 2 times, most recently from 8c3d47e to ef339b8 Compare January 12, 2024 16:18
Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

This is great! It adds a layer of simplicity to our fields. I had a few questions. The UI/UX looked great, but with a PR of this size, it's easy for me to miss something while reviewing

Comment on lines +36 to +42
Copy link
Contributor

Choose a reason for hiding this comment

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

You're missing the activity === 'DONT_CHANGE' functionality at src/components/Task/MassActions/EditTasks/MassActionsEditTasksModal.tsx on line 188 - 191

Copy link
Contributor

Choose a reason for hiding this comment

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

I know the Don't change functioanilty is only used when editing items already set, but we will lose this functionailty. Maybe we can have a isUpdatingField prop which allows for the don't change functionailty.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing the "Don't change" option is intentional because Autocomplete already lets you click an X to clear the selection. If the user clears their selection, the autocomplete will be blank again and MassActionsEditTasksModal won't change the tasks' activity type. But let me know if there's a bug.

Copy link
Contributor

Choose a reason for hiding this comment

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

The reason I mentioned it is that I liked the don't change as it's clear what it does. It's fine to leave it out. Something which could be good further down the road, making the edit modals list out the changes the user is making. To ensure the user knows what is about to happen.
Changing title to "new title"
Updating action to "Call"

@dr-bizz
Copy link
Contributor

dr-bizz commented Jan 16, 2024

The error is with the file src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/CreateMultipleContacts/CreateMultipleContacts.test.tsx Line 355

@canac
Copy link
Contributor Author

canac commented Jan 16, 2024

The error is with the file src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/CreateMultipleContacts/CreateMultipleContacts.test.tsx Line 355

Are you getting a test failure? I get that error locally occasionally. It probably needs a higher timeout. It usually works when testing just that file.

@dr-bizz
Copy link
Contributor

dr-bizz commented Jan 17, 2024

CreateMultipleContacts.test.ts

This can be a different PR, could it be worth changing how it's testing the autocomplete address, so it doesn't need a 20-second timeout? such as mocking the predictions

@canac
Copy link
Contributor Author

canac commented Jan 17, 2024

This can be a different PR, could it be worth changing how it's testing the autocomplete address, so it doesn't need a 20-second timeout? such as mocking the predictions

It will probably be in a different PR. I have an approved BC item for it. I believe that some of the tests are slow because jsdom emulating the DOM is slow, but I agree that speeding up the tests if possible is preferable to increasing the timeout.

@canac canac requested a review from dr-bizz January 23, 2024 21:12
@dr-bizz
Copy link
Contributor

dr-bizz commented Jan 25, 2024

Awesome work!

@canac
Copy link
Contributor Author

canac commented Feb 23, 2024

@dr-bizz Can I get a re-review on this? I added some more commits to address Scott's feedback in this comment.

I didn't love having to patch the autocomplete dependency, but it was the only way I could get it to work since autocomplete doesn't expose anything about controlling the highlight.

If Scott likes the date picker improvements, I'll modify the rest of the modals in the app, probably in a follow-up PR.

Also, if you test, do it locally because I'm still trying to get staging to update.

@canac canac requested a review from dr-bizz February 23, 2024 18:06
Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

It's looking great. I found some issues with it while testing it locally.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this will be fine, as users will know to click outside of the popup, but we might have to revert this if users complain about it.

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 don't love this change either, but Scott wants it to not close after selecting the minutes because he chooses AM/PM after choosing the minutes. If he chose AM/PM, then hours, then minutes, we could keep closeOnSelect enabled.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't believe this fixes Scott concern about the time component. The time is still in 24 hours and it doesn't close when you enter the AM/PM. I believe this input might be better (Scrrenshot below.)

Screenshot 2024-02-26 at 8 48 32 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unless I'm mistaken, that example is from the v6 page. We'd have to upgrade @mui/x-date-pickers from v5 to v6 to use that component. I'm not saying we can't or shouldn't upgrade, just pointing that out that it will be a little more work. I think that new picker is a better interface though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I didn't see that

@canac
Copy link
Contributor Author

canac commented Feb 28, 2024

@dr-bizz Could I get a re-review? I ended up reverting the changes that added support for year and time abbreviations because I couldn't get them working correctly.

@canac canac requested a review from dr-bizz February 28, 2024 20:27
@canac
Copy link
Contributor Author

canac commented Feb 29, 2024

@dr-bizz OK this is now actually ready for review. Scott gave me permission to remove the calendar and clock dropdowns in the task modals so that we can add support for date and time shortcuts like "1/1/24" and "1pm". I was unable to get the shortcuts working with the desktop dropdowns. If he likes how it works, I'll refactor the other date and time components to use <DateTimeFieldPair>.

@dr-bizz
Copy link
Contributor

dr-bizz commented Mar 1, 2024

@dr-bizz OK this is now actually ready for review. Scott gave me permission to remove the calendar and clock dropdowns in the task modals so that we can add support for date and time shortcuts like "1/1/24" and "1pm". I was unable to get the shortcuts working with the desktop dropdowns. If he likes how it works, I'll refactor the other date and time components to use .

I think I'm a little confused. I feel like removing the Calendar date popups, removes a key part of the UX. Making it harder for users to enter the date.

Screenshot 2024-03-01 at 9 19 25 AM

Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

The code looks great I had a few comments, but that is it.

@canac canac requested a review from dr-bizz March 1, 2024 17:32
Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

The fields and code look awesome! 🔥🔥🔥🔥🔥 I know how much effort you put into this. Great work.
I won't approve this until all input fields are updated, but overwise I would.

@canac canac force-pushed the 7828-task-modal branch from 5719675 to 554dedb Compare March 6, 2024 19:40
@canac canac removed the On Staging Will be merged to the staging branch by Github Actions label Mar 6, 2024
@canac canac requested a review from dr-bizz March 6, 2024 19:43
@canac
Copy link
Contributor Author

canac commented Mar 6, 2024

@dr-bizz The rest of the app uses the custom date/time pickers now. There will be one more to fix once Caleb A's preferences PR merges, but that will be trivial to add.

@canac
Copy link
Contributor Author

canac commented Mar 7, 2024

@dr-bizz I migrated Caleb's new preferences date pickers.

@caleballdrin In the most recent commit, I tweaked the preferences UI slightly when I migrated to my new custom date pickers. Can you look over that commit, run it locally, and make sure it still looks good? I mostly changed how we're doing the start and end date labels to be more Material-esque.

Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

You've used three different ways to verify if a value is correct or invalid and set it to null. Was that intentional?

src/components/Settings/preferences/accordions/MpdInfoAccordion/MpdInfoAccordion.tsx - L119
activeMpdStartAt: typeof activeMpdStartAt === 'string'
              ? DateTime.fromISO(activeMpdStartAt)
              : null,
src/components/Task/Modal/Form/TaskModalForm.tsx - L115
completedAt: task.completedAt
              ? DateTime.fromISO(task.completedAt)
              : null,
src/components/Task/Modal/Form/Complete/TaskModalCompleteForm.tsx - L95
completedAt: completedAt?.toISO()

@dr-bizz dr-bizz self-requested a review March 7, 2024 18:57
Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

Looks good on Local. Everything worked apart from the Newsletter completed on field

@dr-bizz dr-bizz self-requested a review March 7, 2024 19:09
@canac
Copy link
Contributor Author

canac commented Mar 7, 2024

You've used three different ways to verify if a value is correct or invalid and set it to null. Was that intentional?

@dr-bizz The src/components/Task/Modal/Form/Complete/TaskModalCompleteForm.tsx one is different because it is setting the GraphQL attributes whereas the other two are initializing the Formik form. But the other two aren't intentionally different.

@canac canac force-pushed the 7828-task-modal branch from 5240f7b to b22a238 Compare March 7, 2024 19:26
@caleballdrin
Copy link
Contributor

@dr-bizz I migrated Caleb's new preferences date pickers.

@caleballdrin In the most recent commit, I tweaked the preferences UI slightly when I migrated to my new custom date pickers. Can you look over that commit, run it locally, and make sure it still looks good? I mostly changed how we're doing the start and end date labels to be more Material-esque.

@canac The date pickers look great and work well!

canac added 5 commits March 13, 2024 10:15
* Upgrade to @mui/x-date-pickers v6
* Support 2-digit years and omitted minutes
* Use custom date and time pickers throughout the app
@canac canac force-pushed the 7828-task-modal branch from b22a238 to ea2c914 Compare March 13, 2024 16:05
@canac canac merged commit 11017aa into main Mar 13, 2024
@canac canac deleted the 7828-task-modal branch March 13, 2024 16:15
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