-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a245a4
commit b08684d
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b08684d
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.
UI Improvements in
FrameModal
andFramePage
This commits ends a series of small-medium changes to improve the UX in the main containers of our entities:
FrameModal
andFramePage
.Don't get too exited, nothing fancy here, just removing some confusions in some gray areas:
1.
Navigator.view
andNavigator.navigate
are merged.A long time ago...
The distinction between
Navigator.view
andNavigator.navigate
made sense inSignum.Windows
:View
was opening a modal window (ShowDialog
) with Ok/Cancel buttons and returning the new version of the entity.Navigate
was opening a non-modal window (Show
) with Ok button and returning void because was fire-and-forget.The concepts where carried as-is to
Signum.Web
andSignum.React
but never made too much sense:view
was used un the entity controls (EntityLine
,EntityStrip
, etc..), when navigating to a real entity (i.e.Customer
) you had [Ok]/[Cancel] buttons but you have to save your changes first (kind or redundant), and you could save and then press [Cancel] (kind of absurd).Navigator.navigate
was returningPromise<void>
instead ofPromise<Entity>
just to keep the legacy semantics, but theEntity
was just there.Ctrl+Click
orMiddle-Click
and open a new Tab in your browser (navigateRoute
).The solution is to merge
Navigator.navigate
andNavigator.view
in one method (Navigator.view
) that contains a new parameterviewButtons
.ok_cancel
: Automatically selected forEmbeddedEntity
,ModalEntity
or Entities ofEntityKind.Part
orEntityKind.SharedPart
. This entities typically never have aSave
operation so it makes sense to have a [Ok]/[Cancel] buttons to control whether we send the changes back to the parent entity or not.close
: Automatically selected for Entities of the otherEntityKind
. This entities typically have their own save buttons (Main
,Shared
,String
,...) or are readonly (System
,SystemString
). Removing the [Save] and [Cancel] problem.Maybe there are cases where this default behavior doesn't make sense, like an InvoiceLineEntity that behaves like a Part when creating the Invoice but then becomes a self-sufficient entity, but I think the default ruele covers 99% of the cases.
Similarly,
Navigator.isNavigable
has been merged intoNavigator.isViewable
.2. New 'Lose changes' dialog.
No the dialog detects the operations that can be executed to save the entity and are visible (typically [Save]), and suggest to either use it or [Lose changes], very much like Microsoft Word does.
3. New default icons for [Save] and [Delete]
Note: You can the default icons, colors, etc... or add your own custom rules by overriding the methods in the
Defaults
namespace inOperations.tsx
.4. 'Save & New' only when creating from
SearchControl
ValueSearchControl
When creating a new entity, it could be useful to use the 'Save & New' functionality ([+] button or
Ctrl+Alt+S
), but when you are just navigating to one it was cluttering the interface and making theSave & Close
([x] button orCtrl + Shift + S
) even harder to understand for new people.For now creating from an
EntityLine
/EntityStrip
/ etc.. also does not enable this functionality.5. Prevent
Lose changes
inFramePage
When making modifications in an entity in full-screen (
FramePage
) previously there was no prompt if you tried to navigate somewhere else without saving first.Also if you try to close the browser tab:
Conclusion
As I say, nothing fancy but some simplifications for the developers and users.
To upgrade just run
Upgrade_20201210_NavigatorView
b08684d
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.
b08684d
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.
Perfect