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

UHF-8988 user inquiry popup #693

Merged
merged 10 commits into from
Feb 20, 2024
Merged

UHF-8988 user inquiry popup #693

merged 10 commits into from
Feb 20, 2024

Conversation

rpnykanen
Copy link
Contributor

@rpnykanen rpnykanen commented Feb 16, 2024

UHF-8988

Adds and configures chat-leijuke with käyttäjäkysely-popup

What was done

  • Adds and enables the block
  • Added scheduler to the javascript
    • Loads the javascript only if the pageload is within given date

How to install

  • Make sure your instance is up and running on latest dev branch.
    • git pull origin dev
    • make fresh
  • Update the Helfi Platform config
    • composer require drupal/helfi_platform_config:dev-UHF-8988
  • Run make drush-updb drush-cr

How to test

  • Log in as admin and go to /admin/structure/block

    • user inquiry block should be in attachments
    • It should have correct configurations: käyttäjätutkimus-provider, on fi,en,sv languages, only for unauthenticated users
  • Log out, since this only works for unauthenticated user

  • (the debug feature does not work incognito)

  • Go to any content page and accept all cookies

  • After page reload the popup-script should not be loaded (search for digitalfeedback)

  • The next steps must be done quite quickly:

  • There is a commented code snippet in the leijuke-js file line 116. Run this code snippet in browser inspector to activate the popup locally for 1 minute:

localStorage.setItem('user_inquiry_debug', {"start": "${new Date((Date.now()-60000)).toString()}", "end": "${new Date((Date.now()+60000))}"});

  • Refresh the page
  • Popup should appear (if you have never closed it before)
    • if popup doesn't appear, you most likely have already closed it once. you should at least see the loaded script (digitalfeedback)
  • It he popup appears, do not close it. Wait for a minute (or five) and refresh the page.
    • the popup-javascript wont be loaded (and the script won't be loaded at all)
  • Check that this feature works
  • Check that code follows our standards

@codecov-commenter
Copy link

codecov-commenter commented Feb 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d7a3a5e) 13.07% compared to head (98910f1) 13.07%.
Report is 2 commits behind head on main.

❗ Current head 98910f1 differs from pull request most recent head b0d4b7e. Consider uploading reports for the commit b0d4b7e to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #693   +/-   ##
=========================================
  Coverage     13.07%   13.07%           
  Complexity      242      242           
=========================================
  Files            28       28           
  Lines           941      941           
=========================================
  Hits            123      123           
  Misses          818      818           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@hyrsky hyrsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works but there is a PHPCS issue.

helfi_platform_config.install Outdated Show resolved Hide resolved
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants