-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
[connectors] Make cluster/database and datasource/table read-only in views #7073
[connectors] Make cluster/database and datasource/table read-only in views #7073
Conversation
b94fd12
to
db58bae
Compare
db58bae
to
ae13516
Compare
Codecov Report
@@ Coverage Diff @@
## master #7073 +/- ##
=========================================
+ Coverage 64.48% 64.5% +0.02%
=========================================
Files 421 421
Lines 20547 20561 +14
Branches 2250 2250
=========================================
+ Hits 13249 13263 +14
Misses 7171 7171
Partials 127 127
Continue to review full report at Codecov.
|
I struggled with this in the past, it seemed like an odd FAB requirement/bug. @dpgaspar may have some input/pointers as to how to fix this in FAB. |
Hi @john-bodley, @mistercrunch This seems to be nicely done. The readonly field gives some context to the users, and prevents mistakes. I've removed the database field from the edit fields on TableModelView without problems. The problem is with the related view CompactCRUDMixin on master detail (Table->Metrics or Table-Columns), showing a blank on the table field. This is working fine for the edit but seems strange when adding, right? |
Personally all I remember is issues with the Inline elements on add and/or edit when the "parent" field is missing. In the example above it would be Knowing it's an Inline, we probably should not even allow to alter the link to the parent. Maybe the form that's built needs some sort of Keep in mind now that I think those are the last FAB Inline used in Superset, and we're moving away from this particular form as I've re-written the TableEditor in React. Maybe the real action item here is deprecating the Superset CRUD view for Tables/DruidDatasource. For that, we need to build our own CRUD list view in place of the FAB one. |
Yes, probably the best plan of action. My two cents would be to implement it using React components backed by the "new" CRUD REST API. |
@dpgaspar @mistercrunch is there any additional changes you are requesting from this PR? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue |
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.
LGTM
In the CRUD views the cluster/database and datasource/table are required in the forms to ensure that either an added or edited entity is correctly assigned to the parent. This value is normally left blank however it does provide the ability for the user to re-assign (possibly without intent) an entity to another parent which is undesirable.
@mistercrunch ideally it would be great to simply hide these fields from the views, however this doesn't seem to be possible. The only viable solution I am aware of is simply to make the fields read-only per the suggestion outlined here.
Edit
Add
Note for adding we allow blanks otherwise the default displayed value is ill-defined entity even though the entity is correctly parented.
to: @graceguo-supercat @michellethomas @mistercrunch @xtinec