Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug - Empty block (horizontal line) dynamic field group process management #513

Closed
mo-azfar opened this issue Nov 20, 2023 · 12 comments
Closed
Assignees
Labels
1 - 🐞 bug 🐞 An issue with the system. 4 - internal Issue/MR 4 - verified This issue or pull request was verified.
Milestone

Comments

@mo-azfar
Copy link

Environment

  • Server OS: Ubuntu 22
  • Browser: Brave / Edge
  • Znuny version: 7.0.13

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.

image

How to reproduce

Steps to reproduce the behavior:

  1. Create 2 process management.
  2. Define dynamic field widget group.
  3. See at ticket zoom view
@mo-azfar
Copy link
Author

mo-azfar commented Nov 20, 2023

You can see the block is called in every group with no value checking.

Name => 'ProcessWidgetDynamicFieldGroups',

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 ) {

image

@KaldungJr
Copy link

We can't verify your issue with our existing example processes. Would you be able to send us your process used in the issue?

@KaldungJr KaldungJr added the 4 - clarification The issue or pull requests needs more information. label Nov 23, 2023
@mo-azfar
Copy link
Author

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:

image

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.

image

Export_ProcessEntityID_Process-22cfb5eb43279532308232c678671c34.zip

@rkaldung
Copy link
Contributor

@mo-azfar Can you also add the dynamics (and screens) export?

@mo-azfar
Copy link
Author

mo-azfar commented Nov 23, 2023

@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'
};

Export Process and DF.zip

@rkaldung rkaldung added 4 - verified This issue or pull request was verified. 1 - 🐞 bug 🐞 An issue with the system. 4 - internal Issue/MR and removed 4 - clarification The issue or pull requests needs more information. labels Nov 23, 2023
@rkaldung
Copy link
Contributor

Internal issue 782

@rkaldung rkaldung self-assigned this Nov 23, 2023
@dennykorsukewitz dennykorsukewitz self-assigned this Dec 28, 2023
@dennykorsukewitz
Copy link
Member

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

@dennykorsukewitz dennykorsukewitz added the 3 - wait for contributor Contributor, it's your turn. label Dec 28, 2023
@dennykorsukewitz dennykorsukewitz added this to the rel-7_0_15 milestone Dec 28, 2023
@mo-azfar
Copy link
Author

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

before-patch-00001

However the display result as below after patched. Notice the dynamic field display is 1 x 1 instead of 4 x 1.

after-patch-0001

@dennykorsukewitz
Copy link
Member

Hi @mo-azfar

Ah, thanks for testing.
I'll take another look at it then.

@dennykorsukewitz
Copy link
Member

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

@mo-azfar
Copy link
Author

Hi @dennykorsukewitz ,

Tested with group and no-group..
Perfect :)

image

@dennykorsukewitz dennykorsukewitz removed the 3 - wait for contributor Contributor, it's your turn. label Jan 2, 2024
@dennykorsukewitz
Copy link
Member

dennykorsukewitz commented Jan 2, 2024

7.0.15 a6a3c3f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - 🐞 bug 🐞 An issue with the system. 4 - internal Issue/MR 4 - verified This issue or pull request was verified.
Development

No branches or pull requests

4 participants