Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-57975

Add mustache helpers for user date

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.3
    • Component/s: Libraries
    • Labels:
    • Testing Instructions:
      Hide

      Setup

      1. Cherry pick the test commit from the end of the testing branch
        • git@github.com:ryanwyllie/moodle.git MDL-57975-master-test
        • 059c578b956a7364026d46addff9c12842cf395e
      2. You'll need to open your browser's developer tools to see the network requests, local storage and session storage
        • On Chrome the local storage and session storage view is in the "Application" section of the developer tools.
      3. Clear your local storage and session storage before testing

      Please test on multiple browsers (I've checked Chrome and Safari)

      Test with no cache

      1. Turn off caching in your moodle instance (if you're using mdk you can do mdk run dev)
      2. Go to <your_moode_instance>/test.ph (you will need to log in as a user)
      3. Confirm the output is the same for both the PHP and JavaScript render
      4. View the network requests sent and confirm a "core_get_user_dates" request was sent with only two dates requested:

        {timestamp: "1293876000", format: "%A, %d %B %Y, %I:%M %p"}
        {timestamp: "1293876000", format: "%d %B %Y"}
        

      5. View the local storage and confirm empty (except the "loglevel")
      6. View the session storage and confirm it is empty

      Test with cache

      1. Turn on caching in your moodle instance (if you're using mdk you can do mdk run undev)
      2. Go to <your_moode_instance>/test.ph (or reload if you're already there)
      3. Confirm the output is the same for both the PHP and JavaScript render
      4. View the network requests sent and confirm a "core_get_user_dates" request was sent with only two dates requested:

        {timestamp: "1293876000", format: "%A, %d %B %Y, %I:%M %p"}
        {timestamp: "1293876000", format: "%d %B %Y"}
        

      5. View the local storage and confirm there are now entries for templates and stuff but nothing for the dates
      6. View the session storage and confirm that there are now for the dates but nothing else
        • Should see keys core_user_date/1293876000/%A, %d %B %Y, %I:%M %p and core_user_date/1293876000/%d %B %Y
      7. Reload the page
      8. Confirm the output is the same for both the PHP and JavaScript render
      9. Confirm that no network request was sent for "core_get_user_dates"
      10. Delete the core_user_date/1293876000/%A, %d %B %Y, %I:%M %p key from your browsers session storage
      11. Reload the page
      12. Confirm the output is the same for both the PHP and JavaScript render
      13. View the network requests sent and confirm a "core_get_user_dates" request was sent with only one date requested:

        {timestamp: "1293876000", format: "%A, %d %B %Y, %I:%M %p"}
        

      14. View the browser's session storage and confirm that the key you deleted has now been added back
      15. Open a new tab or new window and navigate to your moodle instance (not the test.php page)
      16. Open the developer tools for the new page
      17. View the local storage and confirm it has the same (or more) values as the storage for the test.php page (local storage is persistent and shared amongst each tab in a browser)
      18. View the session storage and confirm it is empty (session storage is per tab only)
      Show
      Setup Cherry pick the test commit from the end of the testing branch git@github.com:ryanwyllie/moodle.git MDL-57975 -master-test 059c578b956a7364026d46addff9c12842cf395e You'll need to open your browser's developer tools to see the network requests, local storage and session storage On Chrome the local storage and session storage view is in the "Application" section of the developer tools. Clear your local storage and session storage before testing Please test on multiple browsers (I've checked Chrome and Safari) Test with no cache Turn off caching in your moodle instance (if you're using mdk you can do mdk run dev ) Go to <your_moode_instance>/test.ph (you will need to log in as a user) Confirm the output is the same for both the PHP and JavaScript render View the network requests sent and confirm a "core_get_user_dates" request was sent with only two dates requested: {timestamp: "1293876000", format: "%A, %d %B %Y, %I:%M %p"} {timestamp: "1293876000", format: "%d %B %Y"} View the local storage and confirm empty (except the "loglevel") View the session storage and confirm it is empty Test with cache Turn on caching in your moodle instance (if you're using mdk you can do mdk run undev ) Go to <your_moode_instance>/test.ph (or reload if you're already there) Confirm the output is the same for both the PHP and JavaScript render View the network requests sent and confirm a "core_get_user_dates" request was sent with only two dates requested: {timestamp: "1293876000", format: "%A, %d %B %Y, %I:%M %p"} {timestamp: "1293876000", format: "%d %B %Y"} View the local storage and confirm there are now entries for templates and stuff but nothing for the dates View the session storage and confirm that there are now for the dates but nothing else Should see keys core_user_date/1293876000/%A, %d %B %Y, %I:%M %p and core_user_date/1293876000/%d %B %Y Reload the page Confirm the output is the same for both the PHP and JavaScript render Confirm that no network request was sent for "core_get_user_dates" Delete the core_user_date/1293876000/%A, %d %B %Y, %I:%M %p key from your browsers session storage Reload the page Confirm the output is the same for both the PHP and JavaScript render View the network requests sent and confirm a "core_get_user_dates" request was sent with only one date requested: {timestamp: "1293876000", format: "%A, %d %B %Y, %I:%M %p"} View the browser's session storage and confirm that the key you deleted has now been added back Open a new tab or new window and navigate to your moodle instance (not the test.php page) Open the developer tools for the new page View the local storage and confirm it has the same (or more) values as the storage for the test.php page (local storage is persistent and shared amongst each tab in a browser) View the session storage and confirm it is empty (session storage is per tab only)
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull Master Branch:
      MDL-57975-master
    • Sprint:
      3.3 Project Team Sprint 3

      Description

      We need mustache helpers to properly format course start and end dates.

      Accordingly to the prototype, those dates must be formatted as Feb 15, 2017 (Mon Day, Year).

      Also the course-summary template needs to be updated to use this new helper.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ryanwyllie Ryan Wyllie
              Reporter:
              lameze Simey Lameze
              Peer reviewer:
              cameron1729
              Integrator:
              Andrew Nicols
              Tester:
              David Mudrák (@mudrd8mz)
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/May/17