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
Sector Nord AG: Added TransitionAction parameter placeholder #145
Sector Nord AG: Added TransitionAction parameter placeholder #145
Conversation
Hi @jsinagowitz , First of all, the positive statements. π Unfortunately, it is not possible to preview the current status correctly. In the Kernel/Modules/AdminProcessManagementTransitionAction.pm, 1546 changes are displayed. In reality, the diff looks different. 145c145
< # set entity sync state
---
> # set entitty sync state
333c333
< # set entity sync state
---
> # set entitty sync state
414,436d413
< # Add default parameter
< # ------------------------------------------------------------ #
< elsif ( $Self->{Subaction} eq 'GetDefaultConfigParameters' ) {
<
< my $Module = $ParamObject->GetParam( Param => 'Module' );
< my %ConfigParameter = $Self->_GetDefaultConfigParameters(
< Module => $Module,
< );
<
< my $JSON = $LayoutObject->JSONEncode(
< Data => {
< %ConfigParameter
< }
< );
< return $LayoutObject->Attachment(
< ContentType => 'application/json; charset=' . $LayoutObject->{Charset},
< Content => $JSON || '',
< Type => 'inline',
< NoCache => 1,
< );
< }
<
< # ------------------------------------------------------------ #
773,796c750
< sub _GetDefaultConfigParameters {
< my ( $Self, %Param ) = @_;
<
< for my $Needed (qw(Module)) {
< if ( !$Param{$Needed} ) {
< $Kernel::OM->Get('Kernel::System::Log')->Log(
< Priority => 'error',
< Message => 'Need '.$Needed.'!'
< );
< return;
< }
< }
<
< # replace e.g. 'Kernel::System::ProcessManagement::TransitionAction::TicketCreate' to 'TicketCreate'
< if ($Param{Module} =~ m/TransitionAction::(.+)$/) {
< my $Settings = $Kernel::OM->Get('Kernel::Config')->Get('TransitionActionDefaultParameter::Settings');
< if ( IsHashRefWithData($Settings) && IsHashRefWithData($Settings->{ $1 }) ) {
< return %{ $Settings->{ $1 } };
< }
< }
< return;
< }
<
< 1;
---
> 1;
\ No newline at end of file
The same applies to the following files:
TodoSince I cannot go into detail, I will simply give you a few points to consider.
I look forward to your changes. π π |
thank you for your feedback. I just started to improve my pull request. I already found the problem with the high number of changes in some files. Unfortunately, my code editor changed the EOL to CRLF. I fixed that and updated three files in my pull request. My first question is about the Sysconfig. Your proposal is to name the config My second question is about the functionality of GetDefaultConfigParameters. I am not sure about the benefit to use the function for transitions. There is not the same kind of key-value pair needed when creating a new transition. We did not have that use-case for our customers yet and I think there is more coding necessary to get this feature done, e.g. a new config structure. Maybe we can deliver that feature later if there is a demand. Best regards π |
Hi @jsinagowitz
ππΌ nice. This is so much better.
ππΌ
I agree. That's how we'll do it for now. π π― |
I just updated the sysconfig name. I hope now is everything fine. Thank you & best regards π |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jsinagowitz,
here are my adjustments.
In general, everything looks good. ππΌ
- AdminProcessManagementTransitionAction: Loop over SysConfig (for Packages)
- UnitTest: extended
- JS: Division into individual functions
- Tidied
If you have any questions you can reach me via Discord.
π Thank you
scripts/test/ProcessManagement/AdminProcessManagementTransitionActionParameter.t
Outdated
Show resolved
Hide resolved
Co-authored-by: Denny KorsukΓ©witz <dennykorsukewitz@gmail.com>
β¦s://github.com/jsinagowitz/Znuny into feature/snag-PMTransitionActionParameterHelper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied ZnunyCodePolicy
Hi @jsinagowitz, so last changes. |
@dennykorsukewitz I just fixed the code policy problem in the JS too. |
Additional feature that provides a placeholder for adding parameters to TransitionActions. Provided by Sector Nord AG.
Proposed change
Additional feature that provides a placeholder for adding parameters to TransitionActions.
Provided by Sector Nord AG as discussed with Roy Kaldung (@rkaldung) and Henrik Vetter (@Tronsy).
Type of change
Additional information
The placeholders can be modified in the System Configuration. The required parameters are marked with the tag (* required).
Checklist