Skip to content

Conversation

@reosarevok
Copy link
Member

@reosarevok reosarevok commented Dec 4, 2023

Implement MBS-12217

Problem

We are able to edit most sorts of things (including entity types) from the Attributes forms, but there's currently no way to add a new alias type for any entity without adding it directly from the database.

Solution

This just reuses the existing code for attributes to also allow editing alias types, since these are basically the same as entity types already. A new "Alias types" section is added to the attributes list.

Testing

Manually (plus as much coverage as the existing attribute tests provide). Tested editing types to change their values, plus adding new ones, deleting them (blocked when in use, can delete otherwise).

Notes

On top of #2480

The attributes are rendered in Attribute, these are only
a few extra headers/columns for some types.
This removes the info that is mostly useless for people without
editing rights (such as edit links) but displays everything else.

Row ids are not removed since documenting these on the site
is apparently helpful for people putting together SQL queries
(this has been requested).

Since this is visible to users, translations are brought back.
This seems a lot more consistent than having them in two places.
Since this is no longer admin-only, there's no reason
all of this should live inside /admin folders.

Use l_admin for admin-facing strings only.
This reduces code reuse to some degree.
We could make further changes to also generalize
part of the tables for each model, but I'm not sure it's worth
the effort.
Additionally, this shows a proper translatable title
for each attribute type, since we'll display them to users now.
Only Language and Script were translated before.
This splits the list in two, one for entity types and one
for everything else.
It also sorts them by the (translated) names of the attribute types,
rather than by the static model name.
This is not the index for an attribute, it's the list of all attributes.
Consistent with RelationshipTypesList for reltypes.
Uses the existing code for attributes, since these
are basically the same as entity types already.
Also allows users to see them and their descriptions,
once we add them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New feature Non urgent new stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant