## Fixes a bug caused by https://github.com/microsoft/calculator/pull/1426#.
### Description of the changes:
- The PR #1426 can cause a crash when no users are returned via `User::FindAllAsync(UserType::LocalUser)` when subsequently trying to access the first user. The existing code also does not guarantee that the returned user is the currently active user.
- This fix retrieves the user that opened the app and passes this user into a function to check if this user has the proper permissions to access the graphing mode. This makes sense since the active user is indistinguishable (at least from the app's perspective) to the user who opened the app. This user's permissions are then propagated downwards to properly set up the navigation menu of the app.
- Implementation detail worth pointing out: `s_categoryManifest` is what is used to populate the navigation menu of the app, but this variable is static by design, so a separate function was written to override the appropriate `isEnabled` value in `s_categoryManifest`. This function is called by `onLaunched`.
### How changes were validated:
- Manual testing
* fix bug: No confirmation is announced by the narrator after activating 'Remove equation' button #1386
* Unit Test: Add NarratorAnnouncementUnitTests
Co-authored-by: tain <tankle_@hotmail.com>
* Use different formatter for different currency
* Add functional tests for currency fraction digit format
* Revert "Add functional tests for currency fraction digit format"
This reverts commit bd8aab33847425f4dcfd0d76ce310c918729b2fd.
* Add TestCurrencyFormattingLogic in UnitConverterViewModelUnitTests
* Fix InitializeMultipleConverterTest
* Add comment for a line of code
* Add default case for switch in ConvertToLocalizedString
* Remove trailing decimal
Disable decimal input if maxFractionDigits is 0
Fix input may be blocked after switched active
* Fix: UpdateIsDecimalEnabled should do nothing for non-currency converter
* Remove unnecessary SetValue method
* Add a comment
* Add functional UI Tests for currency converter
Reset currency before tests
Fix: input is blocked after switching to currency with less fractional digits
* Set Priority=0 for currency format related tests
* Truncate digits in display value after switcing
To fix incorrect result after switching currency with less fractional digits
Now that #744 has been fixed, I'm adding Test Method "KeyboardInput_HistoryHotkeys" to test the functionality of history hotkeys such as [Shift] + [Ctrl] + [D] to help prevent a regression or a break.
* Fixes issue #1409
Copy pasting into Currency locks the editor.
Skipping the validation of full editor lock when backspace or clear button is clicked.
* Adding code review feedback.
* Adding code review feedback.
When the unit converter's category is changed, the corresponding property setter for the CurrentCategory variable mistakenly calls OnPropertyChanged("CurrentCategory") instead of RaisePropertyChanged("CurrentCategory"). This results in a failure to notify XAML that the CurrentCategory variable has changed, resulting in the corresponding UI to not be updated accordingly.
* Fix typo in splash screen icon names
* Update the internals version to match the internal change
* Update the internals version to match the internal change
* Updated the CanFunctionAnalysisBePerformed api to use the updated one with variableIsNotX error handling. Updated the UI to reflect the new descriptive error case to show an informative error.
* Fixed spacing and updated the moved the variableIsNotX check up into the parent if statement
* Update the internals version to match the version needed to support this change
* Simplify KeyboardShortcutManager and correctly support Alt-Gr key
* replace multimap with map
move all global fields-functions to the class
* feedback
Co-authored-by: Eric Wong <eriwong@microsoft.com>
* Take the high boundary of signed negative values into account
* UI unit tests for the Copy/Paste menu are added
* Additional corner case for the number notations without negative values
* Revert "Updated the Calculator projects to include the /Z7 compiler flag (#1337)"
This reverts commit 6299ec2303.
* Update Calculator.vcxproj
Add %(AdditionalOptions) where it is missing
* Update TraceLogging.vcxproj
Updated the AdditionalOptions to add /await /std:c++17 /utf-8 so this project is consistent with the other projects.
* Change the initialization time of Radio button's isChecked
* Rollback checkDefaultBitShift and Use Enum instead of String
* Fix Check Default
- In previous versions, there was an issue where button availability was reset when opening BitShift Flyout not when the mode is changed
* Reset Calculator Type in Calculator ViewModel when mode change to not Calculator mode
* Revert "Reset Calculator Type in Calculator ViewModel when mode change to not Calculator mode"
This reverts commit a0d2f84513bc2d36fea3d75445782e1c67bc2e8d.
* Check deferred load button
The programmer radix buttons were being disabled when the bit flip panel was selected, causing keyboard events to be ignored.
They should actually only be hidden in bit flip mode.
- Corrected programmer radix buttons to continue being enabled just hidden when the programmer calculator is in bit flip mode.
- Renamed AreProgrammerRadixOperatorsEnabled property to the more appropriate AreProgrammerRadixOperatorsVisible.
* Added the /Z7 compiler flag
* added /Z7 compiler flag to remaining calculator projects
* Add %(AdditionalOptions) to complier configuration where it is missing
* Updated APIs to use new GetClosePointData() from Graphing Engine. Now specifiying precision on API consumption to aid with correct display and rounding.
* Updated function to be const-corect
* Updated to use correct APIs
* Converted TraceValue from Point to two doubles, point's X and Y was using float and conversion between float and doubles was causing unwanted rounding.
* Update to pch file and fixing typo
* Point to updated graphing version
* updated the reset grid logic to track and set the initial range after an equation is added
* When in manual adjustment mode and an equation is added, replot the graph when reset is called
* remove members that are no longer needed
* Added logic to include the PrepareGraph() and removed re-graphing in the ResetGrid method
* skip SetDisplayRanges if TryInitialize returns a nullopt so there is no crash
* Updated the logic to handle the case where the range is updated via settings
* Fix bug with reset view hyperlink
* Updated the logic for graph settings updating the graph range
* Rebased with the latest, fixed issues with the rebase
Author: Stephanie Anderl <46726333+sanderl@users.noreply.github.com>
* Update the internals version of calculator to the latest so that the PrepareGraph API available
* Reset the graph by replotting if the graph range was changed by the user
* When calling SetDisplayRanges, just set Replot to true instead of passing in a parameter
* fixed the trig units radio buttons rounded corners and narrator issues in kgf and graph reset
* removed extra whitespace
* Update src/Calculator/Resources/en-US/Resources.resw
Co-authored-by: Eric Wong <eriwong@microsoft.com>
* Update src/Calculator/Resources/en-US/Resources.resw
Co-authored-by: Eric Wong <eriwong@microsoft.com>
Co-authored-by: Eric Wong <eriwong@microsoft.com>
* Switching from Difference between dates to Add or subtract dates ignores the first date field
https://github.com/microsoft/calculator/issues/254
Date field needs to persist across Date Difference and Add/Subtract From Date Mode.
* Update DateCalculator.xaml.cpp
Addressing review comments (white space, small code refactor), also found a null pointer exception during testing, this fix addresses that as well.
* Issue 935 - Updates to Scientific/Graphing Keypad
Update Scientific and Graphing keyboard layouts to expose square root button at the top level
* Updated ScientificModeFunctionalTests/SmokeTest_Cube()
Updated broken test to work with changes.
* Wrap theme radio buttons in MUXC RadioButtons control to fix accessibility issue where the buttons are grouped with the theme title
* Associated theme labels with radio button groups
* Update EquationButton automation name and tooltips
* added tooltips to the stylepicker and fixed the issue where the color name did not update for dark mode colors
* Update src/Calculator/Resources/en-US/Resources.resw
Co-Authored-By: ItzLevvie <11600822+ItzLevvie@users.noreply.github.com>
* fixed the issue where the colors are only listed as black in the tooltip and automation name
* Add tooltips for high contrast colors
Co-authored-by: ItzLevvie <11600822+ItzLevvie@users.noreply.github.com>
* Fixed contrast between background and foreground colors in the equation button. Fixed the issue where the text in the equation text box is white when the background is white
* Adjust the foreground color algorithm
* moved the contrast method to utils so that it is resuable
* Moved brushes for the GetContrastColor method to the app.xaml resource dictionary
* Removed the change for the edit box colors, so it can be in a different PR