Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
Remove store_on_contact from dialogue state models.
Browse files Browse the repository at this point in the history
  • Loading branch information
hodgestar committed Feb 18, 2015
1 parent 900d913 commit 6880e66
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 42 deletions.
5 changes: 0 additions & 5 deletions go/base/static/js/src/apps/dialogue/states/states.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
'change .type': 'onTypeChange',
'change .name': 'onNameChange',
'click .name-extras': 'onNameExtras',
'change .store-on-contact': 'onStoreOnContact'
},

resetModal: new ConfirmView({
Expand Down Expand Up @@ -191,10 +190,6 @@
this.nameExtras.toggle();
},

onStoreOnContact: function(e) {
this.model.set('store_on_contact', this.$('.store-on-contact').prop('checked'));
},

// Keep a backup to restore the model for when the user cancels the edit
backupModel: function() {
this.modelBackup = this.model.toJSON();
Expand Down
32 changes: 0 additions & 32 deletions go/base/static/js/test/apps/dialogue/states/states.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ describe("go.apps.dialogue.states", function() {
entry_endpoint: {'uuid':'endpoint6'},
exit_endpoint: {'uuid':'endpoint7'},
user_defined_store_as: false,
store_on_contact: false,
ordinal: 3
});

Expand All @@ -138,7 +137,6 @@ describe("go.apps.dialogue.states", function() {
entry_endpoint: {'uuid':'endpoint6'},
exit_endpoint: {'uuid':'endpoint7'},
user_defined_store_as: false,
store_on_contact: false,
ordinal: 3
});

Expand All @@ -147,19 +145,6 @@ describe("go.apps.dialogue.states", function() {
});
});

describe(".render", function() {
it("should mark whether the user's answer should be stored on the contact",
function() {
state.model.set('store_on_contact', true);
state.render();
assert(state.$('.store-on-contact').prop('checked'));

state.model.set('store_on_contact', false);
state.render();
assert(!state.$('.store-on-contact').prop('checked'));
});
});

describe(".cancel", function() {
it("should change the model back to its old state", function() {
assert.deepEqual(state.model.toJSON(), {
Expand All @@ -170,7 +155,6 @@ describe("go.apps.dialogue.states", function() {
entry_endpoint: {'uuid':'endpoint6'},
exit_endpoint: {'uuid':'endpoint7'},
user_defined_store_as: false,
store_on_contact: false,
ordinal: 3
});

Expand All @@ -185,7 +169,6 @@ describe("go.apps.dialogue.states", function() {
entry_endpoint: {'uuid':'endpoint6'},
exit_endpoint: {'uuid':'endpoint7'},
user_defined_store_as: false,
store_on_contact: false,
ordinal: 3
});
});
Expand Down Expand Up @@ -284,7 +267,6 @@ describe("go.apps.dialogue.states", function() {
entry_endpoint: {'uuid':'endpoint6'},
exit_endpoint: {'uuid':'endpoint7'},
user_defined_store_as: false,
store_on_contact: false,
ordinal: 3
});

Expand All @@ -299,7 +281,6 @@ describe("go.apps.dialogue.states", function() {
entry_endpoint: {'uuid':'endpoint6'},
exit_endpoint: {'uuid':'endpoint7'},
user_defined_store_as: false,
store_on_contact: false,
ordinal: 3
});
});
Expand All @@ -318,19 +299,6 @@ describe("go.apps.dialogue.states", function() {
assert.equal(state.modeName, 'preview');
});
});

describe("when '.store-on-contact' changes", function() {
it("should set its model's 'store_on_contact' attr accordingly",
function() {
assert.equal(state.model.get('store_on_contact'), false);

editMode.$('.store-on-contact')
.prop('checked', true)
.change();

assert.equal(state.model.get('store_on_contact'), true);
});
});
});

describe(".DialogueStatePreviewView", function() {
Expand Down
5 changes: 0 additions & 5 deletions go/base/static/js/test/apps/dialogue/testHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
store_as: 'message-1',
text: 'What is your favourite colour?',
user_defined_store_as: false,
store_on_contact: false,
entry_endpoint: {uuid: 'endpoint0'},
choice_endpoints: [{
value: 'red',
Expand All @@ -57,7 +56,6 @@
type: 'freetext',
store_as: 'message-2',
user_defined_store_as: false,
store_on_contact: false,
entry_endpoint: {uuid: 'endpoint3'},
exit_endpoint: {uuid: 'endpoint4'},
text: 'What is your name?'
Expand All @@ -67,15 +65,13 @@
type: 'end',
store_as: 'ending-1',
user_defined_store_as: false,
store_on_contact: false,
entry_endpoint: {uuid: 'endpoint5'},
text: 'Thank you for taking our survey'
}, {
uuid: 'state4',
name: 'Dummy Message 1',
type: 'dummy',
user_defined_store_as: false,
store_on_contact: false,
store_as: 'dummy-message-1',
entry_endpoint: {uuid: 'endpoint6'},
exit_endpoint: {uuid: 'endpoint7'}
Expand All @@ -85,7 +81,6 @@
type: 'group',
group: {key: 'group1'},
user_defined_store_as: false,
store_on_contact: false,
store_as: 'message-5',
entry_endpoint: {uuid: 'endpoint8'},
exit_endpoint: {uuid: 'endpoint9'}
Expand Down

0 comments on commit 6880e66

Please sign in to comment.