Closed mo-azfar closed 6 months ago
You can see the block is called in every group with no value checking. https://github.com/znuny/Znuny/blob/4ba26a0ec2e3f0c72bc96710c208b2318989e96e/Kernel/Modules/AgentTicketZoom.pm#L1658
Below is some code that i applied to tackle this. Perhaps you guys has a better way.
my @FieldsInAGroup;
for my $GroupName (
sort keys %{ $Self->{DisplaySettings}->{ProcessWidgetDynamicFieldGroups} }
)
{
# --
# Remove empty block group for dynamic field.
# --
# $LayoutObject->Block(
# Name => 'ProcessWidgetDynamicFieldGroups',
# );
# --
my $GroupFieldsString = $Self->{DisplaySettings}->{ProcessWidgetDynamicFieldGroups}->{$GroupName};
$GroupFieldsString =~ s{\s}{}xmsg;
my @GroupFields = split( ',', $GroupFieldsString );
# --
# Remove empty block group for dynamic field.
# --
my $ShowBlock = 0;
for my $FieldChecker (@FieldsWidget) {
if ( !$ShowBlock ){
if ( grep { $_ eq $FieldChecker->{Name} } @GroupFields ) {
$ShowBlock = 1;
}
}
}
if ( $ShowBlock ) {
$LayoutObject->Block(
Name => 'ProcessWidgetDynamicFieldGroups',
);
}
# --
if ( $#GroupFields + 1 ) {
We can't verify your issue with our existing example processes. Would you be able to send us your process used in the issue?
We can't verify your issue with our existing example processes. Would you be able to send us your process used in the issue?
Hi, basically my ProcessWidgetDynamicGroups as below with contain multiple df group across all process:
Let say i create a process ticket 'Software Support' as below (which only utilize 'Software Support' df group), we can see all the df group block has been called and display as horizontal line.
Export_ProcessEntityID_Process-22cfb5eb43279532308232c678671c34.zip
@mo-azfar Can you also add the dynamics (and screens) export?
@rkaldung Yes..please refer attached zip file..also attached Config for ProcessWidgetDynamicFieldGroups
$Self->{'Ticket::Frontend::AgentTicketZoom'}->{'ProcessWidgetDynamicFieldGroups'} = {
'1. Basic Info' => 'Playbook, Status, DeviceName, UserType, Hash, HashResponse, DoubleCheckPreviousData, FalsePositive, PreviousDataNote, NetworkDetectionTools',
'2. Affected Credentials & Level of Access' => 'AffectedCredentialsNote, AccessLevelCustomer, AccessLevelInternal, AccessLevel, AccessLevelAccountType, AccessLevelNote',
'2. Threat Analysis & Forensic' => 'ThreatCategory, ThreatAnalysisNote, ThreatAnalysisStatus, SecurityRiskLevel',
'2. Threat Classification' => 'InformationReviewed, InformationReviewedNote, ThreatLevel',
'3. Live Threat Actor and Analysis Log' => 'LiveThreatActor, LiveThreatActorNote, LogAnalysisFailedLogin, LogAnalysisSuccessLogin, LogAnalysisLateralMovement, LogAnalysisLateralMovementPath, LogAnalysisNote ',
'3. Remediate Action' => 'RemediateMethod, RemediateNote, RemediateStatus',
'3. Threat Scope' => 'EnvironmentLogReviewed, EnvironmentLogReviewedNote',
'4. Password Checking' => 'PasswordReused, PasswordStrength',
'4. Scanned Device' => 'ScanDeviceNote, ScanDeviceStatus',
'4. Threat Mitigation' => 'ThreatMitigated, ThreatMitigatedNote',
'5. Root Cause Analysis' => 'RootCauseAnalysis, RootCauseAnalysisNote',
'Software Support' => 'RelatedContract, ContractID, ContractStartDate, ContractEndDate, SupportTag, RelatedContractDetail'
};
Internal issue 782
Hi @mo-azfar,
thanks for your report and the fix suggestion.
I have attached a patch here that is much simpler. Can you please check if the error is fixed with this patch.
0001-782-Bug-Empty-block-horizontal-line-dynamic-field-gr.patch
Hi @mo-azfar,
thanks for your report and the fix suggestion.
I have attached a patch here that is much simpler. Can you please check if the error is fixed with this patch.
0001-782-Bug-Empty-block-horizontal-line-dynamic-field-gr.patch
Hi @dennykorsukewitz ..thanks for the patch..
Before patch
However the display result as below after patched. Notice the dynamic field display is 1 x 1 instead of 4 x 1.
Hi @mo-azfar
Ah, thanks for testing. I'll take another look at it then.
Hi @mo-azfar
I have adopted your idea and adapted it a little. Can you check the fix again?
Thank you.
0002-782-Bug-Empty-block-horizontal-line-dynamic-field-gr.patch
Hi @dennykorsukewitz ,
Tested with group and no-group.. Perfect :)
Environment
Expected behavior
There is multiple process defined and multiple group in dynamic field widget group. If some process didnt have the dynamic field value in defined widget group, the block should be hidden / remove.
Actual behavior
There is multiple process defined and multiple group in dynamic field widget group. If some process didnt have the dynamic field value in defined widget group, the block actually there and quite waste the space.
We can see it from the horizontal line there.
How to reproduce
Steps to reproduce the behavior: