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

[Feature] Add text widget to the edition form #4635

Merged
merged 3 commits into from
Oct 17, 2024

Conversation

mind84
Copy link
Contributor

@mind84 mind84 commented Jul 17, 2024

Since version 3.30, QGIS has introduced a Text Widget feature available in layer form configuration using the "Drag and Drop" form designer.

Lizmap already supports this feature on Popup (see lizmap-plugin release 3.17.1 and qgis-lizmap-server-plugin release 2.8.1)

With this PR I would introduce Text Widget support also on the edition form.

NOTES:

  • currently the behavior is NOT dynamic, it means that the Text Widget expression is not evaluated "live" if it depends on some other layer field, but only after the form is saved.
  • If the Text Widget expression contains geometry references, then it can be evaluated only if the Add geometry to feature response option in the QGIS Server tab is checked.
    image
  • invalid expressions are not evaluated and will be returned as "raw expression" to the client .

Funded by Faunalia

@github-actions github-actions bot added this to the 3.9.0 milestone Jul 17, 2024
@Gustry Gustry added the run end2end If the PR must run end2end tests or not label Jul 29, 2024
@rldhont
Copy link
Collaborator

rldhont commented Sep 3, 2024

Hi @mind84 , I would like merge your feature. Can you rebase your branch and fix the conflct ? Thanks

@mind84
Copy link
Contributor Author

mind84 commented Sep 4, 2024

Hi @rldhont, e2e fails but seems not related to this new feature

@rldhont
Copy link
Collaborator

rldhont commented Sep 5, 2024

Hi @mind84, the e2e failed is not related to your code but I will check the tests and try to fix it before merging.

@mind84
Copy link
Contributor Author

mind84 commented Sep 5, 2024

@rldhont ok thanks, let me know if I can help

@mind84 mind84 force-pushed the form_text_widget branch 3 times, most recently from 13baab5 to 8906205 Compare September 9, 2024 12:56
@rldhont
Copy link
Collaborator

rldhont commented Sep 16, 2024

@mind84 can you perform a rebase and we will merge.

@Gustry
Copy link
Member

Gustry commented Sep 16, 2024

@mind84 can you perform a rebase and we will merge.

I did using the button on GH

@mind84
Copy link
Contributor Author

mind84 commented Sep 17, 2024

I did using the button on GH

Yep, me too

Didi it, thanks

@rldhont
Copy link
Collaborator

rldhont commented Sep 17, 2024

@mind84 it seems your test failed

[end2end] › edition-form.spec.js:521:9 › Text widget in a form › Edit form with text widget in it 

@mind84
Copy link
Contributor Author

mind84 commented Sep 17, 2024

@mind84 it seems your test failed

Yep, just checking

@mind84
Copy link
Contributor Author

mind84 commented Sep 17, 2024

@rldhont

I see that also n_to_m_relations.spec fails. I cannot reproduce this error on my local env, are you aware of the reason?

@Gustry
Copy link
Member

Gustry commented Sep 17, 2024

I see that also n_to_m_relations.spec fails. I cannot reproduce this error on my local env, are you aware of the reason?

I think we can see the error as well in #4764 as well :(

@mind84
Copy link
Contributor Author

mind84 commented Sep 17, 2024

I think we can see the error as well in #4764 as well :(

Yes you are right, here too #4746.

I'm trying to change some statement, see what happens

@Gustry
Copy link
Member

Gustry commented Sep 17, 2024

Might be linked to the PR from @nboisteault with #4752

@mind84 mind84 force-pushed the form_text_widget branch 2 times, most recently from ef91d7a to 0033531 Compare September 17, 2024 09:54
@Gustry Gustry modified the milestones: 3.9.0, 3.10.0 Oct 15, 2024
@rldhont
Copy link
Collaborator

rldhont commented Oct 16, 2024

@mind84 this PR #4870 will help to understand the error in Timemanager end to end tests.

@Gustry
Copy link
Member

Gustry commented Oct 16, 2024

Did you try the test on your local @mind84 about the time manager ?

@rldhont
Copy link
Collaborator

rldhont commented Oct 16, 2024

@mind84 can you add in timemanage.spec.js

expect(URL.canParse(originalUrl), originalUrl+' is not an URL!').toBeTruthy();

@mind84
Copy link
Contributor Author

mind84 commented Oct 16, 2024

@Gustry, @rldhont
I receive a different error:

Error: expect(received).not.toContain(expected) // indexOf

    Expected substring: not "unfound"
    Received string:        "unfound"

      55 |             // When the request has not been logged by echo proxy
      56 |             console.log(originalUrl)
    > 57 |             await expect(originalUrl).not.toContain('unfound')
         |                                           ^
      58 |
      59 |             // expected request params

something related to the echo request, I'm not familiar with that, any hint?

@rldhont
ok for adding the line, but I think previous error is a blocker

Thanks

@Gustry
Copy link
Member

Gustry commented Oct 16, 2024

@mind84 Please add the snippet from @rldhont, the line just after the creation of the variable originalUrl. We need to understand why your PR is constantly failing on this time manager test.

@rldhont
Copy link
Collaborator

rldhont commented Oct 16, 2024

@mind84 you have to find the echoproxy.log file in your local lizmap/var/log directory.

@rldhont
Copy link
Collaborator

rldhont commented Oct 16, 2024

Thanks @mind84 to have adjust timemanage test spec!

The echoprox.log is toobig

            // Only display content if the file is small to avoid memory issues
            if (filesize($logPath) > 512000) {
                return 'toobig';
            }

@mind84
Copy link
Contributor Author

mind84 commented Oct 16, 2024

@rldhont,

okay, there is no echoproxy.log on my local stack, that's why I received 'unfound' as response.
I created manually the echoproxy.log file but the application cannot write on it. For example function logRequestToEcho does:

        \jLog::log($md5."\t".$url.'?'.$body, 'echoproxy');

but the echoproxy file remains empty.

Maybe could be something related to jApp::config()->logger. Here's the dump of this property:

array (
  '_all' => '',
  'default' => 'file',
  'error' => 'file',
  'warning' => 'file',
  'notice' => 'file',
  'deprecated' => '',
  'strict' => 'file',
  'debug' => '',
  'sql' => '',
  'soap' => '',
  'metric' => 'syslog',
  'auth' => '',
  'lizmapadmin' => 'file',
)

there is no echoproxy logger defined

ECHO_OGC_ORIGINAL_REQUEST=on

Advice on that?

Thanks!

@mind84
Copy link
Contributor Author

mind84 commented Oct 16, 2024

@rldhont,

there is no echoproxy logger defined

nevermind, cache issue.

Sorry for the noise.

@rldhont
Copy link
Collaborator

rldhont commented Oct 16, 2024

@mind84 checks your localconfig.ini.php

[logger]
default = file
error = file
warning = file
notice = file
deprecated = file
auth = file
echoproxy = file

[fileLogger]
echoproxy = echoproxy.log

@rldhont
Copy link
Collaborator

rldhont commented Oct 16, 2024

@mind84 New PR to enhance e2e tests and especially proxylog reading. #4876

@mind84
Copy link
Contributor Author

mind84 commented Oct 16, 2024

@mind84 New PR to enhance e2e tests and especially proxylog reading. #4876

Great! I'll wait for it and then rebase this one

Thanks @rldhont!

@rldhont
Copy link
Collaborator

rldhont commented Oct 16, 2024

@mind84 you can rebase. You will have a conflict with adjust time test spec commit

@rldhont
Copy link
Collaborator

rldhont commented Oct 17, 2024

@mind84 can you remove the commit adjust timemanage test spec then we can merge ?

@mind84
Copy link
Contributor Author

mind84 commented Oct 17, 2024

@rldhont,

yes sorry for the delay

@mind84
Copy link
Contributor Author

mind84 commented Oct 17, 2024

@rldhont, @Gustry

is it possible to backport to 3.8 or there are some drawbacks?

Thanks!

@Gustry
Copy link
Member

Gustry commented Oct 17, 2024

@mind84 We plan to introduce new feature in the 3.9 branch only.

  • 3.8 has been released now
  • 3.9, the branch has been created two days ago, from master but excluding all commits related to Bootstrap 5, to be able to make a new major release sooner than expected, without all the work to migrate to Bootstrap5
  • master, all the bootstrap5 migration, and maybe more

@Gustry Gustry merged commit f4cd65e into 3liz:master Oct 17, 2024
13 checks passed
@mind84 mind84 deleted the form_text_widget branch October 17, 2024 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants