-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yamuna | FBE - 22 | Implementation of form conditions Editor #4
base: master
Are you sure you want to change the base?
Conversation
… using ref form uuid
…f preview form is clicked
…eflect only Obs without events
import { connect } from 'react-redux'; | ||
import { setChangedProperty } from '../actions/control'; | ||
|
||
export class FormConditionsContainer extends Component { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are you using this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.Forgot to delete.Deleted Now
@@ -0,0 +1,91 @@ | |||
import React, { Component } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see it has a lot of code similar to ScriptEditorModal, can we bring out a common component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ObsControlScriptEditorModal has 2 different points from ScriptEditorModal.
- CodeMirror property : example: readonly , autofocus
- componentDidUpdate to support dynamic loading of codemirror text based on obs control
We can write in a single component with some conditions, but i felt it will make one file clumsy
return cloneDeep(store); | ||
case 'FORM_LOAD': | ||
return Object.assign({}, store, { allControls: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the property be called allControlEvents?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed it to allObsControlEvents
import { JSHINT } from 'jshint'; | ||
import ObsControlScriptEditorModal from 'form-builder/components/ObsControlScriptEditorModal'; | ||
|
||
window.JSHINT = JSHINT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this required here? ObsControlScriptEditorModal has it already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required. removed here
/* it('should call FormDetail with appropriate controls', () => { | ||
sinon.stub(httpInterceptor, 'get').callsFake(() => Promise.resolve(formData)); | ||
const dispatch = sinon.spy(); | ||
const wrapper = shallow( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is not required, please remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
.withArgs(formEventUpdate(script))); | ||
sinon.assert.callCount(store.dispatch, 0); | ||
// sinon.assert.calledOnce(store.dispatch | ||
// .withArgs(formEventUpdate(script))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove all unwanted comment lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…nd fixing unit tests
…ormDetailContainer
No description provided.