Closed liu-samuel closed 1 month ago
I'm not sure I understand why this is needed? I assume unused user roles might have blank values?
I'm not sure I understand why this is needed? I assume unused user roles might have blank values?
The way the checkbox tree requires that there's no duplicate values, so I had to put on an id for each node in the tree to render it. It also needs the exact id for each checked off box so it loads the correct information for the tree, so I have to save the exact id for any feature that's checked off and saved.
hmmm - I thought we already stored this information with unique ids though.
Is there a schema migration for these attributes, or do they already exist in the database? I think I need to understand how it's currently modeled to understand why this change is needed.
Is there a schema migration for these attributes, or do they already exist in the database? I think I need to understand how it's currently modeled to understand why this change is needed.
When I went through it, it looked like it was stored by creating a new feature object, but this made it so I wasn't sure which specific node id it mapped to the features when I got it back in the React code
Yeah I had to make a migration, they didn't already exist.
app/models/miq_user_role.rb
As a general rule, not a fan of serialized ids, but maybe this is a good aproach. Storing as a jsonb /hstore may alleviate some of the issue with this.
My main concern is having a field named _id and it not being a numeric. If we do go this route, lets at least name the column something that sounds like a hash and not an integer id.
As a general rule, not a fan of serialized ids, but maybe this is a good aproach. Storing as a jsonb /hstore may alleviate some of the issue with this.
My main concern is having a field named _id and it not being a numeric. If we do go this route, lets at least name the column something that sounds like a hash and not an integer id.
I think we found a way to not need to store these ids so I'm actually going to close this PR
Add attributes to user role to allow for storing of checked features and unique ids for each product feature
Related: https://github.com/ManageIQ/manageiq-ui-classic/pull/9248
@miq-bot add-label enhancement @miq-bot assign @Fryguy