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] DynamicField label in front of the value in CustomerUserInterface in DynamicField_Lens #3944

Open
AlexanderOesterling-OTOBO opened this issue Nov 20, 2024 · 4 comments
Assignees
Labels
bug Something isn't working as intended style Beautify please
Milestone

Comments

@AlexanderOesterling-OTOBO
Copy link
Contributor

AlexanderOesterling-OTOBO commented Nov 20, 2024

Environment

  • Server OS Distribution:
  • OTOBO installation typ: Native
  • Browser Chrome
  • OTOBO version: 11.0.7

Expected behavior

I am in CustomerTicketMessage and select a value of a DynamicField_Reference.
I have a DynamicField_Lens that refereneces to a attribute of that selected object in the DynamicField_Reference.

Now the DynamicField_Lens should be filled with the value of that attribute and the label of the DynamicFIeld_Lens should move up so i can see the value.

Actual behavior

I am in CustomerTicketMessage and select a value of a DynamicField_Reference.
I have a DynamicField_Lens that refereneces to a attribute of that selected object in the DynamicField_Reference.

Now the DynamicField_Lens is filled but the label of the field is in front of the value so i dont see parts of the value.

How to reproduce

Steps to reproduce the behavior:

  1. Add a DyamicField_Reference and a DynamicField_Lens and link the lens to the reference field.
  2. Add them to CustomerTicketMessage.
  3. Select an object in the DynamicField_Reference.
  4. See error

Additional information

Screenshots

Here is a screenshot that shows my DynamicField_Reference "Sim Card" and also my DynamicField_Lens "Mobil Number".
The label is in front of the actual value of the field. I can only see the last four digits.

Bildschirmfoto_2024-11-15_14-14-13

@AlexanderOesterling-OTOBO AlexanderOesterling-OTOBO added the bug Something isn't working as intended label Nov 20, 2024
@stefanhaerter stefanhaerter added the style Beautify please label Nov 21, 2024
@stefanhaerter stefanhaerter added this to the OTOBO 11.0 milestone Nov 21, 2024
@svenoe svenoe modified the milestones: OTOBO 11.0, OTOBO 11.0.8 Nov 21, 2024
@svenoe
Copy link
Contributor

svenoe commented Nov 21, 2024

I assume the field type of the field the lens points at is "Text", and as for those there was no way to fill them via AJAXUpdate yet, I assume some js is missing which sets the html class. Maybe in the Core.AJAX.js it suffices to simply trigger a blur on the field for simple text inputs, where select fields are redrawn etc.

Edit: Textfield is confirmed.

@MichaelThumes
Copy link
Contributor

replicated locally on rel-11_0

on initial load of page, the DF lense field renders as:

<div class="Field">                    
  <input type="text" class="DynamicFieldText W50pc" id="DynamicField_TicketLense" name="DynamicField_TicketLense" title="TicketLense" value="" aria-invalid="false">
</div>

which triggers described erroneous behaviour until the DF is focused by clicking, which changes the rendered HTML to (note the additional css class 'oooFull'!) :

<div class="Field oooFull">                    
  <input type="text" class="DynamicFieldText W50pc oooFull" id="DynamicField_TicketLense" name="DynamicField_TicketLense" title="TicketLense" value="" aria-invalid="false">
</div>

Experimental JS executed after page load through JS dev console:

document.getElementById('DynamicField_TicketLense').parentNode.classList.add('oooFull');

Solves the problem and the label no longer hides the Value. However we'd need that for all Lense DFs shown?

@svenoe
Copy link
Contributor

svenoe commented Jan 9, 2025

Ah, here again - probably triggering a blur on changed text fields should solve this. Always adding oooFull likely is wrong, because maybe you just emptied the field. See:

// check whether field is filled
if ( $.trim(FieldValue).length ) {
$(this).addClass('oooFull');
$(this).parent('.Field').addClass('oooFull');
}
else {
$(this).removeClass('oooFull');
$(this).parent('.Field').removeClass('oooFull');
}

The background here is, that up until now text fields could not be changed via ACLs, but since lenses can point at text fields of different reference objects, indirectly now they can be changed.

Other field types other than text might be affected, too, but I think not too many are left, which are not handled in this routine explicitely anyways, by now. I was thinking of adding a general blur, but probably it's unnecessary.

@MichaelThumes
Copy link
Contributor

see comment in #4030 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended style Beautify please
Projects
None yet
Development

No branches or pull requests

4 participants