Conversation
|
@jlamanskygitt It looks like you created a new field type for this component. It should actually be used for the existing |
409bff8 to
6303cfd
Compare
| <div class="input-group"> | ||
| <input | ||
| type="text" | ||
| class="link-input input-group-field" |
There was a problem hiding this comment.
Please do a search in the project for link-input to find all of the javascript that is run based on that class. We need to test that we can remove that outdated js code without affected functionality.
Code ReviewThanks for this refactor! Moving the Bug: Deleted options not filteredThe original code explicitly skipped options marked as deleted: if ( isset( $option_value['deleted'] ) && $option_value['deleted'] === true ) {
continue;
}The new $filtered_options = array_filter($default_options, function ($value) {
return \!(isset($value['deleted']) && $value['deleted'] === true);
});
$options_array = array_map(function ($key, $value) {
return [
'id' => (string) $key,
'label' => $value['label'] ?? $key,
];
}, array_keys($filtered_options), $filtered_options);Missing icon data in optionsThe original dropdown rendered per-option icons via 'icon' => $value['icon'] ?? null,Minor:
|
| Architecture | ✅ Correct approach — moves link rendering into DT_Components alongside other field types |
| Deleted options filter | ❌ Missing — will expose deleted link types to users |
| Icon support | |
| Code consistency | ✅ Matches existing patterns in the class |
The deleted-options bug should be fixed before merge. The icon question depends on whether dt-multi-text-groups supports per-group icons, but worth verifying.
|
Functionally, this looks great. Really nice work! Just waiting on the cleanup of the old code. |
Code ReviewThanks for working on migrating the Critical: Missing web componentThe new This means link fields will not render at all after this PR is merged. Is this component being developed in a separate PR against Bug: Deleted link options not filteredThe original code explicitly skipped options marked as deleted: if ( isset( $option_value['deleted'] ) && $option_value['deleted'] === true ) {
continue;
}The new $options_array = array_map(function ( $key, $value ) {
return [
'id' => (string) $key,
'label' => $value['label'] ?? $key
];
}, array_keys( $default_options ), $default_options);Deleted link types will appear as options in the UI unless Bug: Missing null check on
|
| Severity | Issue |
|---|---|
| Critical | dt-multi-text-groups web component does not exist in the codebase |
| Bug | Deleted options not filtered from groups array |
| Bug | Missing ?? [] null check on default key |
| Cleanup | Orphaned JS: addLink, add-link-dropdown handlers, is_link_field_value_already_in_primary |
| Cleanup | Orphaned SCSS for link field styles |
| Minor | icon not forwarded in options array |
The architectural direction is good and consistent with the existing component pattern. Once the dt-multi-text-groups component exists and the above issues are resolved, this will be a clean migration.
Implemented multi-text-groups changes for the theme