Skip to content
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

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

yamunachukka
Copy link

No description provided.

bsneha90TW and others added 20 commits March 26, 2020 14:20
import { connect } from 'react-redux';
import { setChangedProperty } from '../actions/control';

export class FormConditionsContainer extends Component {
Copy link

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?

Copy link
Author

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';
Copy link

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?

Copy link
Author

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.

  1. CodeMirror property : example: readonly , autofocus
  2. 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:
Copy link

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?

Copy link
Author

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;
Copy link

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?

Copy link
Author

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(
Copy link

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.

Copy link
Author

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)));
Copy link

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

Copy link
Author

Choose a reason for hiding this comment

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

done

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.

6 participants