Problem/Motivation

The config source overview at admin/tmgmt/sources offers selection by type and then only displays labels.

Sometimes, things can not be identified clearly.

Example:
If you filter for source config "Field", you have N times "Body" for the body field.
The core config field translation at admin/config/regional/config-translation/node_fields also shows the content types.

Proposed resolution

Figure out how we can display some more context.
Possibly also offer filters for this kind of context (content type, ..)

Remaining tasks

User interface changes

API changes

Data model changes

Comments

miro_dietiker created an issue. See original summary.

berdir’s picture

I'm not sure how much we really want to customize per config type here.

What we could do is add the config ID somehow, e.g. smaller behind the label?

The bundle filters etc. that we have for node are generic, there is no way to figure out in a generic way that fields can be filtered by entity type/bundle.

miro_dietiker’s picture

Yeah i would also vote against code per config type.

However the list overview of config translation adds extra columns per config type. Examples
- for node_fields it is CONTENT TYPE
- for block it is THEME, CATEGORY

I don't know how these are identified...
But if we pick the same, we could collect all values (yes, iterating through all items needed :-7) and offer them in a filter.. Or we offer it as a text field.

miro_dietiker’s picture

Quickly clicked through other types and most of them has no second column.

miro_dietiker’s picture

OK let's add config ID and then things are easily identifiable.

mbovan’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new2.47 KB
new36.85 KB

It looks like that most of the config types are linkable. It is also possible for fields to be linkable as well - so I am adding support with this patch. It was a bit tricky but it should be better ux now.

For config types that don't have edit form link template/route I am adding {label} ({configuration_id}).

Status: Needs review » Needs work

The last submitted patch, 6: show_more_context_in-2624240-6.patch, failed testing.

miro_dietiker’s picture

Great step.

I think that the id should get into a second column, well aligned.
Also, the link is a good idea but still i need first to click on it to understand what it is. That's too much. To provide better orientation, the id column should always be populated.

mbovan’s picture

Status: Needs work » Needs review
StatusFileSize
new37.76 KB
new3.81 KB
new2.83 KB

Added a new (configuration id) column and tests. Here is how it looks like:

miro_dietiker’s picture

That looks great. I would expect that "ID" is a abbreviation, thus all caps?.

Also tests, looks like ready. :-)

miro_dietiker’s picture

Status: Needs review » Needs work

Again quickly checked. Looks good. Test coverage nitpicks:

+++ b/sources/tmgmt_config/src/Tests/ConfigSourceUiTest.php
@@ -275,6 +275,15 @@ class ConfigSourceUiTest extends EntityTestBase {
+    $this->assertText('field.field.node.article.body');

We have multiple cases above. I think we should check one item for each case above and document them with each assert.

mbovan’s picture

Status: Needs work » Needs review
StatusFileSize
new4.01 KB
new1.85 KB

Fixed "Configuration ID" and added tests for one more case - fields without field-edit-form link template.

As now, from 4 cases possible: config entities with edit form link template, fields with specific field-edit-form link template, config entities without edit-form link template - we have no tests for fields with specific field-edit-form link template but with a wrong route...
I bumped into this case (Exception) when I enabled CRM Core module. I am pretty sure this won't happen when we fix CRM Core link templates/routes...

miro_dietiker’s picture

Status: Needs review » Needs work

Fully agree, CRM Core needs fixing. But throwing an uncaught exception is simply wrong. The UI needs to catch it and handle it gracefully. Even if the situation is unclean.
Could you please point me to the follow up in CRM Core? I can't see an issue or a pull request.

Please clarify the situation.

mbovan’s picture

Status: Needs work » Needs review

But throwing an uncaught exception is simply wrong. The UI needs to catch it and handle it gracefully. Even if the situation is unclean.

Yes, that's why we handled this exception since #6

Debugged a bit, but not sure what is the exact problem nor solution. Tried to explain a problem more in: https://github.com/md-systems/crm_core/issues/37

berdir’s picture

Status: Needs review » Needs work
+++ b/sources/tmgmt_config/src/ConfigSourcePluginUi.php
@@ -124,13 +127,34 @@ class ConfigSourcePluginUi extends SourcePluginUiBase {
+    // Do the special link handling for fields.
+    elseif ($entity instanceof FieldConfigInterface) {
+      $edit_field_form_link_template = $entity->getTargetEntityTypeId() . '-field-edit-form';
+      if ($entity->hasLinkTemplate($edit_field_form_link_template)) {
+        $link = $entity->toLink($label, $edit_field_form_link_template);
+        try {
+          if (!empty($link->getUrl()->toString())) {
+            $row['title'] = $link;
+          }
+        }

I'm not convinced this special case is worth it.

As you've found yourself, it can case problems. I think CRM is caused by CRM not having a field ui base route, or maybe that's part of a UI module that's not enabled/ported yet, not sure.

What exactly does a user gain by being able to go there? If special case anything, I'd rather build a combined label that includes the entity type and bundle for this. But as discussed above, I'd rather avoid hardcoding things.

mbovan’s picture

Status: Needs work » Needs review
StatusFileSize
new15.78 KB
new2.53 KB
new2.87 KB

What exactly does a user gain by being able to go there?

I guess it's the same benefit as for others config entities - more info about the source.

I think CRM is caused by CRM not having a field ui base route

Most likely.

Okay, removed the special case for fields. The patch looks clean now. :)

berdir’s picture

Status: Needs review » Fixed

  • Berdir committed 11b85d0 on 8.x-1.x authored by mbovan
    Issue #2624240 by mbovan: Show more context in config source overview
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.