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

custom alert replace window.alert #1549

Merged
merged 8 commits into from
Sep 21, 2021
Merged

custom alert replace window.alert #1549

merged 8 commits into from
Sep 21, 2021

Conversation

yen-tt
Copy link
Contributor

@yen-tt yen-tt commented Sep 17, 2021

  • Use sweetAlert library to provide framework for browser dialogs and notifications.
  • Add custom css (to match with current window popup UI) to answers.scss
  • create alert function to wrap around sweetAlert functions with default configuration setup
  • update all window.alert calls to use alert from alert.js

J=SLAP-1524
TEST=manual

  • serve page using voicesearch functionality with mic access block, see that an alert is display on page with proper UI
  • check with screen reader and see that the popup message and button can be read

Yen Truong and others added 4 commits September 17, 2021 17:11
- Use alertifyJS library to provide framework for browser dialogs and notifications.
- Add alertifyJS library css and some custom css (to match with current window popup UI) to answers.scss
- update all window.alert calls to use alertify.alert
- expose this reference of AlertifyJS library so Theme can use it too, without the library setup to be in two repos

J=SLAP-1524
TEST=manual

- serve page using voicesearch functionality with mic access block, see that an alert is display on page with proper UI
- check with screen reader and see that the popup message and button can be read (although, there's some hidden buttons that would need to be skipped over)
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 59.334% when pulling 76fb075 on dev/custom-alert into 796a0b8 on develop.

@yen-tt yen-tt added the WIP Work in progress label Sep 20, 2021
@yen-tt yen-tt removed the WIP Work in progress label Sep 20, 2021
@cea2aj
Copy link
Member

cea2aj commented Sep 20, 2021

Unfortunately we can't use alertifyJS because it uses the GPL-3.0 License which is a copyleft license which forces us to follow certain conditions. The licenses pre-approved by legal are MIT, BSD 2, BSD 3, and Apache.

src/answers-umd.js Outdated Show resolved Hide resolved
@yen-tt yen-tt requested a review from cea2aj September 20, 2021 18:35
@yen-tt
Copy link
Contributor Author

yen-tt commented Sep 20, 2021

Window popup:
Screen Shot 2021-09-20 at 2 37 00 PM
SweetAlert + custom css:
Screen Shot 2021-09-20 at 2 36 34 PM

src/ui/alert.js Outdated Show resolved Hide resolved
@yen-tt yen-tt requested a review from cea2aj September 20, 2021 20:27
Copy link
Contributor

@oshi97 oshi97 left a comment

Choose a reason for hiding this comment

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

peeked at the npm package and this looks sweet! is there a difference between sweetalert and sweetalert2?

@yen-tt
Copy link
Contributor Author

yen-tt commented Sep 21, 2021

peeked at the npm package and this looks sweet! is there a difference between sweetalert and sweetalert2?

sweetalert2 is forked off sweetalert when there was a period it wasn't being maintained. From the documentation, sweetalert2 seems to have more configuration and themes options, but it is a bigger package. For our purpose, I think sweetalert should be sufficient!

@yen-tt yen-tt merged commit 396a6f9 into develop Sep 21, 2021
@yen-tt yen-tt deleted the dev/custom-alert branch September 21, 2021 14:31
@nmanu1 nmanu1 mentioned this pull request Nov 16, 2021
nmanu1 added a commit that referenced this pull request Nov 16, 2021
## Version 1.12.0
### Features
- Allow search rate tracking (#1558)
- Add support for setting and changing the visitor and passing it to answers-core (#1564)
- Add support for the auth token that is passed in from the config (#1566)
- Add an `environment` field to support consumer auth in Sandbox (#1597)
- Allow components to override the beforeMount function (#1547)
- Add distance to the card data and a function to format it (#1550)
- WCAG updates (allow pagination with Enter (#1575), identify current page in navigation tab (#1576), update autocomplete screen reader support (#1578, #1579))

### Changes
- Update directAnswers component data to include the searcher (#1596)
- Use custom alerts instead of window.alert (#1549)
- Update Mapbox version to match the Theme (#1551)
- Internal repo changes (#1562, #1577)

### Bugfixes
- Fix console error which would appear on google maps (#1548)
- Fix FAQ expansion when default is expanded (#1553)
- Fix error for searches on page load with no businessId (#1561)
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