Skip to content

Setting for app preview#13779

Merged
nickpell merged 20 commits intomasterfrom
br/hardware-settings-2
Nov 2, 2016
Merged

Setting for app preview#13779
nickpell merged 20 commits intomasterfrom
br/hardware-settings-2

Conversation

@benrudolph
Copy link
Copy Markdown
Contributor

@benrudolph benrudolph commented Oct 31, 2016

@biyeun @wpride Adds basic ability to turn on and off one question per screen. label because there are a few things i want to do first

  • write some tests
  • fix navigate for phone preview after selecting a setting
  • one question per screen for full screen mode

Here's what it currently looks like (looks a bit better in full screen mode):

screen shot 2016-10-31 at 5 30 13 pm

screen shot 2016-10-31 at 5 30 04 pm

@biyeun one question per screen doesn't work in full screen mode because i think we conflate the phoneMode and oneQuestionPerScreen mode. will try and make a pass at getting OQPS to work in full screen mode:

screen shot 2016-10-31 at 5 30 56 pm

@benrudolph benrudolph added the Open for review: do not merge A work in progress label Oct 31, 2016
@benrudolph
Copy link
Copy Markdown
Contributor Author

cc: @emord @nickpell

Copy link
Copy Markdown
Contributor Author

@benrudolph benrudolph left a comment

Choose a reason for hiding this comment

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

(easiest to review all at once)

_private.navigateBack = function() {
var previewWindow = $appPreviewIframe[0].contentWindow;
var $appPreviewIframe = $(module.SELECTORS.PREVIEW_WINDOW.IFRAME),
previewWindow = $appPreviewIframe[0].contentWindow;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this fixes a minor issue in this PR: #13774 (comment)

savedDisplayOptions = _.pick(
Util.getSavedDisplayOptions(),
FormplayerFrontend.Constants.ALLOWED_SAVED_OPTIONS
);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

essentially we'll load the saved display options from localStorage. the key is namespaced by domain and username

// For Chrome, the origin property is in the event.originalEvent object
var origin = event.origin || event.originalEvent.origin,
data = event.data,
returnValue = null,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this was unfortunate, but it's impossible to use postMessage with callbacks since it only accepts serializable data. the only other option is to use eval which i don't want to do. i think we'll have to use this as a one way messaging API

.btn-hardware {
display: inline-block;
}
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is only temporary until redesign of hardware buttons happen

FormplayerFrontend.on('clearRestoreAsUser', function() {
var user = FormplayerFrontend.request('currentUser');
var user = FormplayerFrontend.request('currentUser'),
appId;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

'appId' is defined but never used (no-unused-vars)

domain: 'domain',
apps: [],
};
sinon.stub(Backbone.history, 'start', sinon.spy());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

'Backbone' is not defined. (no-undef)


afterEach(function() {
server.restore();
Backbone.history.start.restore();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

'Backbone' is not defined. (no-undef)

});

it('should retrieve saved display options', function() {
var options = { option: 'yes' }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Missing semicolon. (semi)

@benrudolph benrudolph force-pushed the br/hardware-settings-2 branch from 1757bc1 to 7c783cc Compare November 1, 2016 21:13
@benrudolph
Copy link
Copy Markdown
Contributor Author

3772d57 @biyeun i moved the form entry navigation to the form entry templates. was curious if you had it outside of the templates for a reason. anyways, doing that enabled one question per screen to work on both preview and regular formplayer (with a little jankiness):

screen shot 2016-11-01 at 4 41 56 pm

screen shot 2016-11-01 at 4 40 52 pm

@benrudolph
Copy link
Copy Markdown
Contributor Author

Ok this should now be g2g. made a last minute decision to not show the settings tile on regular formplayer until one question per screen is better supported

@nickpell nickpell merged commit b0750a9 into master Nov 2, 2016
@nickpell nickpell deleted the br/hardware-settings-2 branch November 2, 2016 17:44
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