-
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
70b9dde
commit e11a04d
Showing
11 changed files
with
168 additions
and
50 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
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
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
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
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
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
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
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
Oops, something went wrong.
e11a04d
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.
Introducing MultiPropertySetter
This commit finishes the new
MultiPropertySetter
feature, a solution to be able to apply similar changes in many entities without having to open-change-save each one of them.How it works?
By default if you have an operation with
CanBeModified=true
and you select more than one entity in the search control, you can now execute this operation (before was typically disabled).Simple Set Property
When you select it, you get windows where you can select the modifications you want to make:
In most of the cases, this means selecting the property and the value you want to set, but things can get more complicated...
Changing Embedded entities
If you have and embedded entity, like Address, maybe you want to modify some sub-properties:
If you want to modify more than one sub-property, you can also group them together:
Or use the group to create a new embedded entity:
Changing Collections
You can also change the operation to add elements to an MList:
Remove elements using filters:
Or change elements finding then by filter first:
NOTE: Even if the UI drop-downs look very similar, here we are using PropertyRoutes and not QueryTokens (like in the SearchControl). Expressions won't be shown and users can not go through Lites transparently.
Security concerns
This new feature allows users to change properties skipping the standad entity UI. Of course you need to have access to modify the entity and have the operation allowed, but maybe your data consitency depends on some
readonly
attributes in the UI in some points.Relying on the front-end for security was never a bullet-proof solution (user could just modify the JSON with chrome dev tools), but I can imagine this makes the insecurity much easier to exploit by an standard user.
In order to solve it, entities have a new
IsPropertyReadonly
virtual method, very similar toPropertyValidation
but returningbool
.This method is used in three places:
MultiPropertySetter
, fixin this security problem.readonlyProperties
property is filled. This property is taking into account by LineBaseController (affecting ValueLine, EntitityLine, EntityDetail, EntityStrip, etc..) so the UI will be automatically readonly as well.This change plays very well with the general philosophy of the framework, makes it more secure and gives more control to the automatic UI (
DynamicComponent
).NOTE: The
readonlyProperties
is evaluated on the server when serializing, and won't be automatically changed on the client side. For changing readonly-ness without sending the entity back-and-forth to the server you still need to change thereadonly
property in the .tsx file.Here is an example in Southwind moving readonly-ness from client to server: signumsoftware/southwind@01b8371
Conclusion
I hope your users enjoy this new feature by saving some repetitive open-change-save cycles.
Please tell me if you find some problems using it.
Enjoy!
e11a04d
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.
Wow! Great useful feature!
e11a04d
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.