3 var _ = require('lodash');
4 var restSerializer = require('../../serializers/rest-serializer');
5 var generateRoomCardContext = require('gitter-web-shared/templates/partials/room-card-context-generator');
6 var exploreTagUtils = require('../../utils/explore-tag-utils');
15 module.exports = function getSnapshotsForPageContext(options) {
16 var opts = _.extend({}, defaults, options);
18 var tagMap = exploreTagUtils.generateTagMap(opts.fauxTagMap);
19 if (!opts.isLoggedIn) {
21 exploreTagUtils.tagConstants.FAUX_KEY_TAG_MAP_KEY_PREFIX + ':suggested'
22 ].needsAuthentication = true;
24 var selectedTagMap = exploreTagUtils.generateSelectedTagMap(tagMap, opts.selectedTags);
26 var strategy = restSerializer.TroupeStrategy.createSuggestionStrategy();
27 return restSerializer.serialize(opts.rooms, strategy).then(function(rooms) {
28 var resultantRooms = rooms.map(function(roomObj) {
29 return generateRoomCardContext(roomObj);
33 tagMap: selectedTagMap,