Skip to content

Commit

Permalink
Issue #2298: show edit field of the targeted attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmalhofer committed Jul 7, 2023
1 parent 15abb48 commit 7769696
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions Kernel/System/DynamicField/Driver/Lens.pm
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,30 @@ sub SearchSQLOrderFieldGet {
sub EditFieldRender {
my ( $Self, %Param ) = @_;

# TODO: only render the label
my $AttributeDFID = $Param{DynamicFieldConfig}->{Config}->{AttributeDF};

return unless $AttributeDFID;

my $DynamicFieldObject = $Kernel::OM->Get('Kernel::System::DynamicField');
my $AttributeDFConfig = $DynamicFieldObject->DynamicFieldGet(
ID => $AttributeDFID
);

return unless $AttributeDFConfig;

# call EditLabelRender on the common Driver
my $BackendObject = $Kernel::OM->Get('Kernel::System::DynamicField::Backend');
my $AttributeFieldHTML = $BackendObject->EditFieldRender(
%Param,
DynamicFieldConfig => $AttributeDFConfig,
);

return unless $AttributeFieldHTML;

# But use the label of the Lens
return {
Field => 'TODO: EditLabelRender for Lens',
Field => $AttributeFieldHTML->{Field},
Label => $Param{DynamicFieldConfig}->{Label},
};
}

Expand Down

0 comments on commit 7769696

Please sign in to comment.