Skip to content

Commit 502e89b

Browse files
Revert "fix for job description new PR"
1 parent 5a4a704 commit 502e89b

21 files changed

+49
-1012
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
"supertest": "^3.1.0",
141141
"tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3",
142142
"tc-ui": "^1.0.12",
143-
"topcoder-react-lib": "1000.25.8",
143+
"topcoder-react-lib": "1000.25.7",
144144
"topcoder-react-ui-kit": "2.0.1",
145145
"topcoder-react-utils": "0.7.8",
146146
"turndown": "^4.0.2",

src/assets/images/settings/profile/work/tc-text-16-bold-active.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/assets/images/settings/profile/work/tc-text-16-bold.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/assets/images/settings/profile/work/tc-text-16-italic-active.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/assets/images/settings/profile/work/tc-text-16-italic.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/assets/images/settings/profile/work/tc-text-16-underline-active.svg

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/assets/images/settings/profile/work/tc-text-16-underline.svg

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/assets/images/settings/profile/work/text-16px_list-bullet-active.svg

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/assets/images/settings/profile/work/text-16px_list-bullet.svg

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/assets/images/settings/profile/work/text-16px_list-numbers-active.svg

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/assets/images/settings/profile/work/text-16px_list-numbers.svg

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/shared/components/Editor/index.jsx

Lines changed: 18 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -46,69 +46,37 @@ export default class EditorWrapper extends React.Component {
4646
this.customPlugin = createCustomPlugin({
4747
editor: this,
4848
});
49-
50-
this.onBeforeInput = this.onBeforeInput.bind(this);
51-
this.onPasteText = this.onPasteText.bind(this);
5249
}
5350

5451
componentDidMount() {
5552
const { connector, initialContent } = this.props;
5653
connector.addEditor(this);
57-
this.setInitialContent(initialContent);
54+
if (initialContent) {
55+
let editorState = convertFromHTML(initialContent);
56+
editorState = ContentState.createFromBlockArray(
57+
editorState.contentBlocks,
58+
editorState.entityMap,
59+
);
60+
editorState = EditorState.createWithContent(editorState);
61+
this.initialContent = editorState.getCurrentContent();
62+
setImmediate(() => this.setState({ editor: editorState }));
63+
}
5864
}
5965

60-
componentWillReceiveProps({ connector, id, initialContent }) {
61-
const { connector: prevConnector, initialContent: prevInitialContent } = this.props;
66+
componentWillReceiveProps({ connector, id }) {
67+
const { connector: prevConnector } = this.props;
6268
this.id = id;
6369
if (connector !== prevConnector) {
6470
if (prevConnector) prevConnector.removeEditor(this);
6571
if (connector) connector.addEditor(this);
6672
}
67-
if (initialContent !== prevInitialContent) {
68-
this.setInitialContent(initialContent);
69-
}
7073
}
7174

7275
componentWillUnmount() {
7376
const { connector } = this.props;
7477
connector.removeEditor(this);
7578
}
7679

77-
onBeforeInput() { // eslint-disable-line consistent-return
78-
const { maxLength } = this.props;
79-
const { editor: editorState } = this.state;
80-
if (maxLength !== -1 && maxLength <= editorState.getCurrentContent().getPlainText('').length) {
81-
return 'handled';
82-
}
83-
}
84-
85-
onPasteText(text) { // eslint-disable-line consistent-return
86-
const { maxLength } = this.props;
87-
const { editor: editorState } = this.state;
88-
if (maxLength !== -1 && maxLength <= text.length + editorState.getCurrentContent().getPlainText('').length) {
89-
return 'handled';
90-
}
91-
}
92-
93-
setInitialContent(content) {
94-
if (content) {
95-
let editorState = convertFromHTML(content);
96-
if (editorState.contentBlocks) {
97-
editorState = ContentState.createFromBlockArray(
98-
editorState.contentBlocks,
99-
editorState.entityMap,
100-
);
101-
editorState = EditorState.createWithContent(editorState);
102-
this.initialContent = editorState.getCurrentContent();
103-
setImmediate(() => this.setState({ editor: editorState }));
104-
}
105-
} else {
106-
let { editor: editorState } = this.state;
107-
editorState = EditorState.push(editorState, ContentState.createFromText(''));
108-
this.setState({ editor: editorState });
109-
}
110-
}
111-
11280
getHtml() {
11381
const { editor } = this.state;
11482
return editorStateToHTML(editor.getCurrentContent());
@@ -130,9 +98,10 @@ export default class EditorWrapper extends React.Component {
13098
* @param {String} type The new block style
13199
*/
132100
applyBlockStyle(type) {
133-
let { editor: editorState } = this.state;
101+
const { editor } = this.state;
102+
let editorState = editor;
134103
editorState = RichUtils.toggleBlockType(editorState, type);
135-
this.setState({ editor: editorState }); // eslint-disable-line
104+
this.setState({ editorState }); // eslint-disable-line
136105
}
137106

138107
/**
@@ -262,16 +231,13 @@ export default class EditorWrapper extends React.Component {
262231
}
263232

264233
render() {
265-
const { connector, theme, placeholder } = this.props;
234+
const { connector, theme } = this.props;
266235

267236
const st = this.state;
268237

269238
let containerStyles = style.container;
270239
if (st.editor.getSelection().getHasFocus()) {
271-
containerStyles += ` ${style.focused} is-focused`;
272-
}
273-
if (st.editor.getCurrentContent().hasText() || /<ol>|<ul>/.test(this.getHtml())) {
274-
containerStyles += ' has-user-input';
240+
containerStyles += ` ${style.focused}`;
275241
}
276242
if (theme.container) {
277243
containerStyles += ` ${theme.container}`;
@@ -287,7 +253,6 @@ export default class EditorWrapper extends React.Component {
287253
tabIndex={0}
288254
>
289255
<Editor
290-
placeholder={placeholder}
291256
editorState={st.editor}
292257
handleKeyCommand={(command, state) => {
293258
const editorState = RichUtils.handleKeyCommand(state, command);
@@ -318,8 +283,6 @@ export default class EditorWrapper extends React.Component {
318283
]}
319284
ref={(node) => { this.node = node; }}
320285
spellCheck
321-
handleBeforeInput={this.onBeforeInput}
322-
handlePastedText={this.onPasteText}
323286
/>
324287
</div>
325288
);
@@ -329,17 +292,13 @@ export default class EditorWrapper extends React.Component {
329292
EditorWrapper.defaultProps = {
330293
connector: new Connector(),
331294
id: null,
332-
initialContent: '',
295+
initialContent: null,
333296
theme: {},
334-
placeholder: '',
335-
maxLength: -1,
336297
};
337298

338299
EditorWrapper.propTypes = {
339300
connector: PT.instanceOf(Connector),
340301
id: PT.string,
341302
initialContent: PT.string,
342303
theme: PT.shape(),
343-
placeholder: PT.string,
344-
maxLength: PT.number,
345304
};

src/shared/components/Settings/Profile/Work/List/Item/_mixin.scss

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)