-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #411 from edx/revert-388-zafzal/ENT3671-keep-email…
…-field-populated Revert "ENT-3671 Keep email field populated while switching in between new and old templates"
- Loading branch information
Showing
12 changed files
with
6 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,13 +26,6 @@ const initialState = { | |
}, | ||
}, | ||
}, | ||
form: { | ||
'code-assignment-modal-form': { | ||
values: { | ||
'email-address': '[email protected]', | ||
}, | ||
}, | ||
}, | ||
portalConfiguration: { | ||
enterpriseSlug: 'bearsRus', | ||
enableLearnerPortal: true, | ||
|
@@ -44,15 +37,13 @@ const initialState = { | |
emailTemplateSource: EMAIL_TEMPLATE_SOURCE_NEW_EMAIL, | ||
default: { | ||
assign: { | ||
'email-address': '', | ||
'email-template-subject': assignEmailTemplate.subject, | ||
'email-template-greeting': assignEmailTemplate.greeting, | ||
'email-template-body': assignEmailTemplate.body, | ||
'email-template-closing': assignEmailTemplate.closing, | ||
}, | ||
}, | ||
assign: { | ||
'email-address': '', | ||
'email-template-subject': assignEmailTemplate.subject, | ||
'email-template-greeting': assignEmailTemplate.greeting, | ||
'email-template-body': assignEmailTemplate.body, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ import { | |
SAVE_TEMPLATE_SUCCESS, | ||
SAVE_TEMPLATE_FAILURE, | ||
CURRENT_FROM_TEMPLATE, | ||
SET_EMAIL_ADDRESS, | ||
} from '../constants/emailTemplate'; | ||
|
||
import emailTemplate, { initialState as emailTemplateReducerInitialState } from './emailTemplate'; | ||
|
@@ -15,7 +14,6 @@ const saveTemplateSuccessResponse = { | |
email_body: 'I am email body', | ||
email_closing: 'I am email closing', | ||
name: 'template-1', | ||
email_address: '', | ||
id: 4, | ||
}; | ||
const saveTemplateErrorResponse = { | ||
|
@@ -66,7 +64,6 @@ describe('emailTemplate reducer', () => { | |
email_body: 'I am email body updated', | ||
email_closing: 'I am email closing updated', | ||
name: 'template-1 updated', | ||
email_address: '[email protected]', | ||
id: 4, | ||
}; | ||
|
||
|
@@ -81,7 +78,6 @@ describe('emailTemplate reducer', () => { | |
'email-template-body': saveTemplateSuccessResponse.email_body, | ||
'email-template-closing': saveTemplateSuccessResponse.email_closing, | ||
'template-name-select': saveTemplateSuccessResponse.name, | ||
'email-address': saveTemplateSuccessResponse.email_address, | ||
'template-id': saveTemplateSuccessResponse.id, | ||
}, | ||
}, | ||
|
@@ -98,7 +94,6 @@ describe('emailTemplate reducer', () => { | |
'email-template-body': saveTemplateSuccessUpdatedResponse.email_body, | ||
'email-template-closing': saveTemplateSuccessUpdatedResponse.email_closing, | ||
'template-name-select': saveTemplateSuccessUpdatedResponse.name, | ||
'email-address': saveTemplateSuccessUpdatedResponse.email_address, | ||
'template-id': saveTemplateSuccessUpdatedResponse.id, | ||
}, | ||
}, | ||
|
@@ -161,56 +156,4 @@ describe('emailTemplate reducer', () => { | |
}; | ||
expect(emailTemplate(undefined, errorResponseActionData)).toEqual(expected); | ||
}); | ||
|
||
it('updates store with email address on switching between new and saved templates', () => { | ||
const saveTemplateSuccessUpdatedResponse = { | ||
email_address: '[email protected]', | ||
}; | ||
|
||
const initialState = { | ||
...emailTemplateReducerInitialState, | ||
saving: false, | ||
error: null, | ||
...{ | ||
default: { | ||
[emailType]: { | ||
'email-template-subject': saveTemplateSuccessResponse.email_subject, | ||
'email-template-greeting': saveTemplateSuccessResponse.email_greeting, | ||
'email-template-body': saveTemplateSuccessResponse.email_body, | ||
'email-template-closing': saveTemplateSuccessResponse.email_closing, | ||
'template-name-select': saveTemplateSuccessResponse.name, | ||
'email-address': '', | ||
'template-id': saveTemplateSuccessResponse.id, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
const expected = { | ||
...emailTemplateReducerInitialState, | ||
saving: false, | ||
error: null, | ||
...{ | ||
default: { | ||
[emailType]: { | ||
'email-template-subject': saveTemplateSuccessResponse.email_subject, | ||
'email-template-greeting': saveTemplateSuccessResponse.email_greeting, | ||
'email-template-body': saveTemplateSuccessResponse.email_body, | ||
'email-template-closing': saveTemplateSuccessResponse.email_closing, | ||
'template-name-select': saveTemplateSuccessResponse.name, | ||
'email-address': saveTemplateSuccessUpdatedResponse.email_address, | ||
'template-id': saveTemplateSuccessResponse.id, | ||
}, | ||
}, | ||
}, | ||
}; | ||
const successResponseActionData = { | ||
type: SET_EMAIL_ADDRESS, | ||
payload: { | ||
emailType, | ||
emailAddress: '[email protected]', | ||
}, | ||
}; | ||
expect(emailTemplate(initialState, successResponseActionData)).toEqual(expected); | ||
}); | ||
}); |
Oops, something went wrong.