Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-778 META: Migrate to Ionic
  3. MOBILE-1052

Implement "Mock site": be able to use any stored site

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.0
    • 2.0
    • Others
    • Hide

      This patch changes the implementation of $mmSite and $mmSitesManager, so it's important to check that the app is not broken after this patch. Some things to check that work fine:

      • Login actions: add site, delete site, login, logout, restore session, reconnect (token expired).
      • In-app actions: see courses, participants, grades, files, etc.

      Right now there's no code to use "mock site" yet, so you'd have to change the code to be able to test it. E.g. you can paste the following code to any .run function and check that you can see in the console the courses of each site stored. You can also use it to check that using .read/.write on an expired site that's not the current site doesn't redirect to reconnect page.

      $mmSitesManager.getSites().then(function(sites) {
          angular.forEach(sites, function(sitedata) {
              $mmSitesManager.getSite(sitedata.id).then(function(site) {
                  site.read('core_enrol_get_users_courses', {userid: site.infos.userid}).then(function(courses) {
                      console.log('****** COURSES FROM SITE ' + site.id + ' ******');
                      console.log(courses);
                  });
              });
          });
      });
      

      Make sure to also test with a app freshly installed, free of any data

      Show
      This patch changes the implementation of $mmSite and $mmSitesManager, so it's important to check that the app is not broken after this patch. Some things to check that work fine: Login actions: add site, delete site, login, logout, restore session, reconnect (token expired). In-app actions: see courses, participants, grades, files, etc. Right now there's no code to use "mock site" yet, so you'd have to change the code to be able to test it. E.g. you can paste the following code to any .run function and check that you can see in the console the courses of each site stored. You can also use it to check that using .read/.write on an expired site that's not the current site doesn't redirect to reconnect page. $mmSitesManager.getSites().then(function(sites) { angular.forEach(sites, function(sitedata) { $mmSitesManager.getSite(sitedata.id).then(function(site) { site.read('core_enrol_get_users_courses', {userid: site.infos.userid}).then(function(courses) { console.log('****** COURSES FROM SITE ' + site.id + ' ******'); console.log(courses); }); }); }); }); Make sure to also test with a app freshly installed, free of any data
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

      Some issues are blocked by a need of having what we call "mock site": being able to retrieve a certain site of the ones stored and use that one like we do with the current site, but without changing the current site.

      For example, we need that to upload a file to any site on iOS, or to get the events for any site on calendar events.

            dpalou Dani Palou
            dpalou Dani Palou
            Frédéric Massart Frédéric Massart
            Juan Leyva Juan Leyva
            Juan Leyva Juan Leyva
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.