-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
Add reloading of lexicon entries for any namespace #16333
Conversation
core/src/Revolution/Processors/Workspace/Lexicon/ReloadFromBase.php
Outdated
Show resolved
Hide resolved
Codecov ReportBase: 16.91% // Head: 17.84% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## 3.x #16333 +/- ##
============================================
+ Coverage 16.91% 17.84% +0.92%
+ Complexity 10447 10440 -7
============================================
Files 561 561
Lines 38028 39042 +1014
============================================
+ Hits 6433 6967 +534
- Misses 31595 32075 +480
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First off, nice job extending this to reversion of Lexicons beyond the core ones! Re my suggestions — they are mostly of the fine-tuning variety and this PR works as intended without them, so I intend to approve once you get a look. I am hoping you'll agree with most of what I proposed though ;-)
For the future: I do think it's a bit of a weird UI move to use the MODX console here. This has nothing to do with @Ruslan-Aleev's work (it was already that way). I think that should be reserved only for installation procedures and cache-clearing. At worst a regular Window showing success/fail feedback makes more sense; at best IMO we move toward a UI model where the user doesn't have to click or otherwise be interrupted by this feedback (such as a "Toast"-like message that is less obtrusive and disappears on its own). That's a job for another day.
Better-yet, for this area and others like it, a more elegant flow would report how many and which items are about to be changed (and from "x" to "y") in the confirmation window and have the final notification window (or Toast) simply say that the action succeeded (or failed).
$_lang['lexicon_revert_confirm'] = 'Are you sure you want to revert the "[[+namespace]]" namespace > "[[+topic]]" topic > "[[+language]]" lexicon to its default strings?'; | ||
$_lang['lexicon_revert_success'] = 'Reverted [[+total]] total string(s): [[+names]]'; | ||
$_lang['lexicon_revert_error'] = 'No lexicon entries found to revert.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The language used still is a bit clunky IMO and the term strings is not going to be clear to most users unfamiliar with coding. Consider the following:
$_lang['lexicon_revert_confirm'] = 'Are you sure you want to revert the "[[+namespace]]" namespace > "[[+topic]]" topic > "[[+language]]" lexicon to its default strings?'; | |
$_lang['lexicon_revert_success'] = 'Reverted [[+total]] total string(s): [[+names]]'; | |
$_lang['lexicon_revert_error'] = 'No lexicon entries found to revert.'; | |
$_lang['lexicon_revert_confirm'] = 'This action will permanently replace all overridden Lexicon entries in the selected namespace/topic/language with their original text. User-created entries will not be affected. Continue?'; | |
$_lang['lexicon_revert_multiple_success'] = 'Successfully reverted [[+total]] overridden entries: [[+names]]'; | |
$_lang['lexicon_revert_success'] = 'Successfully reverted one overridden entry: [[+names]]'; | |
$_lang['lexicon_revert_error'] = 'No Lexicon entries found to revert.'; |
Note that the only change to the final entry is capitalization of “Lexicon.”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I'm still in favor of displaying both "[[+namespace]]", and "[[+topic]]", and "[[+language]]" in the message, because pop-up window may cover the selection in the grid and it will not be clear what is selected.
- @rthrash @smg6511 Can you decide on the final spelling? So that the final version is as clear or we can leave the current one?
core/src/Revolution/Processors/Workspace/Lexicon/ReloadFromBase.php
Outdated
Show resolved
Hide resolved
core/src/Revolution/Processors/Workspace/Lexicon/ReloadFromBase.php
Outdated
Show resolved
Hide resolved
### What does it do? Add reloading of lexicon entries for any namespace: - Move the button up, it's was almost invisible. - Added a pop-up window with confirmation, where the namespace, topic and language are indicated. - The name of the strings is now returned to the console, and not just their amount. ![lexicons_reload](https://user-images.githubusercontent.com/12523676/208910173-49426e6e-a70a-4c55-9ced-4e1a0afdcb5a.gif) p.s. In a good way, this PR should be improved and merged after this (#15942), although the current version is also working. ### Related issue(s)/PR(s) #16333 #14442 --------- Co-authored-by: Jason Coward <jason@opengeek.com>
What does it do?
Add reloading of lexicon entries for any namespace:
p.s. In a good way, this PR should be improved and merged after this (#15942), although the current version is also working.
Related issue(s)/PR(s)
#14442