)
}
+ {/* TEMPORARY DISABLE CHANGE E-MAIL - community-app#5107
-
+
-
+
-
+
-
+ */}
)
}
From 8e6fbd96237c6d3651671018825135391813b3a7 Mon Sep 17 00:00:00 2001
From: Luiz Ricardo Rodrigues
Date: Mon, 9 Nov 2020 23:42:32 -0300
Subject: [PATCH 40/42] ci: deploy tcx-202011 to Stag env
Issues: #5107 #5168
---
.circleci/config.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.circleci/config.yml b/.circleci/config.yml
index abe65e8480..7ab9cd7d31 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -261,6 +261,7 @@ workflows:
branches:
only:
- develop
+ - tcx-202011
# Production builds are exectuted
# when PR is merged to the master
# Don't change anything in this configuration
From 502e89bc6a1c57448bd7f2eab3742c4c67c6074c Mon Sep 17 00:00:00 2001
From: Luiz Ricardo Rodrigues
Date: Tue, 10 Nov 2020 07:46:42 -0300
Subject: [PATCH 41/42] Revert "fix for job description new PR"
---
package.json | 2 +-
.../profile/work/tc-text-16-bold-active.svg | 3 -
.../settings/profile/work/tc-text-16-bold.svg | 3 -
.../profile/work/tc-text-16-italic-active.svg | 3 -
.../profile/work/tc-text-16-italic.svg | 3 -
.../work/tc-text-16-underline-active.svg | 6 -
.../profile/work/tc-text-16-underline.svg | 6 -
.../work/text-16px_list-bullet-active.svg | 12 -
.../profile/work/text-16px_list-bullet.svg | 12 -
.../work/text-16px_list-numbers-active.svg | 23 --
.../profile/work/text-16px_list-numbers.svg | 23 --
src/shared/components/Editor/index.jsx | 77 +---
.../Profile/Work/List/Item/_mixin.scss | 42 ---
.../Settings/Profile/Work/List/Item/index.jsx | 37 +-
.../Profile/Work/List/Item/styles.scss | 49 ---
.../Settings/Profile/Work/Toolbar/index.jsx | 176 ----------
.../Settings/Profile/Work/Toolbar/style.scss | 37 --
.../Settings/Profile/Work/index.jsx | 332 +-----------------
.../Settings/Profile/Work/styles.scss | 195 +---------
src/shared/containers/Settings.jsx | 2 -
src/shared/utils/settings.js | 18 +-
21 files changed, 49 insertions(+), 1012 deletions(-)
delete mode 100644 src/assets/images/settings/profile/work/tc-text-16-bold-active.svg
delete mode 100644 src/assets/images/settings/profile/work/tc-text-16-bold.svg
delete mode 100644 src/assets/images/settings/profile/work/tc-text-16-italic-active.svg
delete mode 100644 src/assets/images/settings/profile/work/tc-text-16-italic.svg
delete mode 100644 src/assets/images/settings/profile/work/tc-text-16-underline-active.svg
delete mode 100644 src/assets/images/settings/profile/work/tc-text-16-underline.svg
delete mode 100644 src/assets/images/settings/profile/work/text-16px_list-bullet-active.svg
delete mode 100644 src/assets/images/settings/profile/work/text-16px_list-bullet.svg
delete mode 100644 src/assets/images/settings/profile/work/text-16px_list-numbers-active.svg
delete mode 100644 src/assets/images/settings/profile/work/text-16px_list-numbers.svg
delete mode 100644 src/shared/components/Settings/Profile/Work/List/Item/_mixin.scss
delete mode 100644 src/shared/components/Settings/Profile/Work/Toolbar/index.jsx
delete mode 100644 src/shared/components/Settings/Profile/Work/Toolbar/style.scss
diff --git a/package.json b/package.json
index 0793860305..36a5ba9991 100644
--- a/package.json
+++ b/package.json
@@ -140,7 +140,7 @@
"supertest": "^3.1.0",
"tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3",
"tc-ui": "^1.0.12",
- "topcoder-react-lib": "1000.25.8",
+ "topcoder-react-lib": "1000.25.7",
"topcoder-react-ui-kit": "2.0.1",
"topcoder-react-utils": "0.7.8",
"turndown": "^4.0.2",
diff --git a/src/assets/images/settings/profile/work/tc-text-16-bold-active.svg b/src/assets/images/settings/profile/work/tc-text-16-bold-active.svg
deleted file mode 100644
index 3aa72fbbae..0000000000
--- a/src/assets/images/settings/profile/work/tc-text-16-bold-active.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/src/assets/images/settings/profile/work/tc-text-16-bold.svg b/src/assets/images/settings/profile/work/tc-text-16-bold.svg
deleted file mode 100644
index 133a76cf16..0000000000
--- a/src/assets/images/settings/profile/work/tc-text-16-bold.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/src/assets/images/settings/profile/work/tc-text-16-italic-active.svg b/src/assets/images/settings/profile/work/tc-text-16-italic-active.svg
deleted file mode 100644
index 4be060733d..0000000000
--- a/src/assets/images/settings/profile/work/tc-text-16-italic-active.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/src/assets/images/settings/profile/work/tc-text-16-italic.svg b/src/assets/images/settings/profile/work/tc-text-16-italic.svg
deleted file mode 100644
index df5bb5e7be..0000000000
--- a/src/assets/images/settings/profile/work/tc-text-16-italic.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/src/assets/images/settings/profile/work/tc-text-16-underline-active.svg b/src/assets/images/settings/profile/work/tc-text-16-underline-active.svg
deleted file mode 100644
index 9586af3aa8..0000000000
--- a/src/assets/images/settings/profile/work/tc-text-16-underline-active.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
diff --git a/src/assets/images/settings/profile/work/tc-text-16-underline.svg b/src/assets/images/settings/profile/work/tc-text-16-underline.svg
deleted file mode 100644
index 26d903b0fe..0000000000
--- a/src/assets/images/settings/profile/work/tc-text-16-underline.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
diff --git a/src/assets/images/settings/profile/work/text-16px_list-bullet-active.svg b/src/assets/images/settings/profile/work/text-16px_list-bullet-active.svg
deleted file mode 100644
index 568ce8ffb3..0000000000
--- a/src/assets/images/settings/profile/work/text-16px_list-bullet-active.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
diff --git a/src/assets/images/settings/profile/work/text-16px_list-bullet.svg b/src/assets/images/settings/profile/work/text-16px_list-bullet.svg
deleted file mode 100644
index df85bf388f..0000000000
--- a/src/assets/images/settings/profile/work/text-16px_list-bullet.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
diff --git a/src/assets/images/settings/profile/work/text-16px_list-numbers-active.svg b/src/assets/images/settings/profile/work/text-16px_list-numbers-active.svg
deleted file mode 100644
index 302f06e53f..0000000000
--- a/src/assets/images/settings/profile/work/text-16px_list-numbers-active.svg
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
diff --git a/src/assets/images/settings/profile/work/text-16px_list-numbers.svg b/src/assets/images/settings/profile/work/text-16px_list-numbers.svg
deleted file mode 100644
index 9baebe060d..0000000000
--- a/src/assets/images/settings/profile/work/text-16px_list-numbers.svg
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
diff --git a/src/shared/components/Editor/index.jsx b/src/shared/components/Editor/index.jsx
index 58cc02b467..40762b3513 100644
--- a/src/shared/components/Editor/index.jsx
+++ b/src/shared/components/Editor/index.jsx
@@ -46,27 +46,30 @@ export default class EditorWrapper extends React.Component {
this.customPlugin = createCustomPlugin({
editor: this,
});
-
- this.onBeforeInput = this.onBeforeInput.bind(this);
- this.onPasteText = this.onPasteText.bind(this);
}
componentDidMount() {
const { connector, initialContent } = this.props;
connector.addEditor(this);
- this.setInitialContent(initialContent);
+ if (initialContent) {
+ let editorState = convertFromHTML(initialContent);
+ editorState = ContentState.createFromBlockArray(
+ editorState.contentBlocks,
+ editorState.entityMap,
+ );
+ editorState = EditorState.createWithContent(editorState);
+ this.initialContent = editorState.getCurrentContent();
+ setImmediate(() => this.setState({ editor: editorState }));
+ }
}
- componentWillReceiveProps({ connector, id, initialContent }) {
- const { connector: prevConnector, initialContent: prevInitialContent } = this.props;
+ componentWillReceiveProps({ connector, id }) {
+ const { connector: prevConnector } = this.props;
this.id = id;
if (connector !== prevConnector) {
if (prevConnector) prevConnector.removeEditor(this);
if (connector) connector.addEditor(this);
}
- if (initialContent !== prevInitialContent) {
- this.setInitialContent(initialContent);
- }
}
componentWillUnmount() {
@@ -74,41 +77,6 @@ export default class EditorWrapper extends React.Component {
connector.removeEditor(this);
}
- onBeforeInput() { // eslint-disable-line consistent-return
- const { maxLength } = this.props;
- const { editor: editorState } = this.state;
- if (maxLength !== -1 && maxLength <= editorState.getCurrentContent().getPlainText('').length) {
- return 'handled';
- }
- }
-
- onPasteText(text) { // eslint-disable-line consistent-return
- const { maxLength } = this.props;
- const { editor: editorState } = this.state;
- if (maxLength !== -1 && maxLength <= text.length + editorState.getCurrentContent().getPlainText('').length) {
- return 'handled';
- }
- }
-
- setInitialContent(content) {
- if (content) {
- let editorState = convertFromHTML(content);
- if (editorState.contentBlocks) {
- editorState = ContentState.createFromBlockArray(
- editorState.contentBlocks,
- editorState.entityMap,
- );
- editorState = EditorState.createWithContent(editorState);
- this.initialContent = editorState.getCurrentContent();
- setImmediate(() => this.setState({ editor: editorState }));
- }
- } else {
- let { editor: editorState } = this.state;
- editorState = EditorState.push(editorState, ContentState.createFromText(''));
- this.setState({ editor: editorState });
- }
- }
-
getHtml() {
const { editor } = this.state;
return editorStateToHTML(editor.getCurrentContent());
@@ -130,9 +98,10 @@ export default class EditorWrapper extends React.Component {
* @param {String} type The new block style
*/
applyBlockStyle(type) {
- let { editor: editorState } = this.state;
+ const { editor } = this.state;
+ let editorState = editor;
editorState = RichUtils.toggleBlockType(editorState, type);
- this.setState({ editor: editorState }); // eslint-disable-line
+ this.setState({ editorState }); // eslint-disable-line
}
/**
@@ -262,16 +231,13 @@ export default class EditorWrapper extends React.Component {
}
render() {
- const { connector, theme, placeholder } = this.props;
+ const { connector, theme } = this.props;
const st = this.state;
let containerStyles = style.container;
if (st.editor.getSelection().getHasFocus()) {
- containerStyles += ` ${style.focused} is-focused`;
- }
- if (st.editor.getCurrentContent().hasText() || /|/.test(this.getHtml())) {
- containerStyles += ' has-user-input';
+ containerStyles += ` ${style.focused}`;
}
if (theme.container) {
containerStyles += ` ${theme.container}`;
@@ -287,7 +253,6 @@ export default class EditorWrapper extends React.Component {
tabIndex={0}
>
{
const editorState = RichUtils.handleKeyCommand(state, command);
@@ -318,8 +283,6 @@ export default class EditorWrapper extends React.Component {
]}
ref={(node) => { this.node = node; }}
spellCheck
- handleBeforeInput={this.onBeforeInput}
- handlePastedText={this.onPasteText}
/>
);
@@ -329,10 +292,8 @@ export default class EditorWrapper extends React.Component {
EditorWrapper.defaultProps = {
connector: new Connector(),
id: null,
- initialContent: '',
+ initialContent: null,
theme: {},
- placeholder: '',
- maxLength: -1,
};
EditorWrapper.propTypes = {
@@ -340,6 +301,4 @@ EditorWrapper.propTypes = {
id: PT.string,
initialContent: PT.string,
theme: PT.shape(),
- placeholder: PT.string,
- maxLength: PT.number,
};
diff --git a/src/shared/components/Settings/Profile/Work/List/Item/_mixin.scss b/src/shared/components/Settings/Profile/Work/List/Item/_mixin.scss
deleted file mode 100644
index 0bd71a8ed4..0000000000
--- a/src/shared/components/Settings/Profile/Work/List/Item/_mixin.scss
+++ /dev/null
@@ -1,42 +0,0 @@
-@import "~styles/mixins";
-
-@mixin html-content-style() {
- @include roboto-regular;
-
- font-size: 15px;
- color: #262628;
-
- em {
- font-style: italic;
- }
-
- p {
- margin: 6px 0 10px;
- line-height: 20px;
- }
-
- ul {
- list-style-type: disc;
- }
-
- ol {
- list-style-type: decimal;
- }
-
- ul,
- ol {
- margin: 0 0 0 25px;
-
- li {
- min-height: auto;
- line-height: 20px;
- padding: 0 0 0 12px;
-
- &:last-child {
- border: 0;
- }
- }
- }
-
- @content;
-}
diff --git a/src/shared/components/Settings/Profile/Work/List/Item/index.jsx b/src/shared/components/Settings/Profile/Work/List/Item/index.jsx
index 1c76633130..a745a2fe6d 100644
--- a/src/shared/components/Settings/Profile/Work/List/Item/index.jsx
+++ b/src/shared/components/Settings/Profile/Work/List/Item/index.jsx
@@ -7,7 +7,6 @@ import PT from 'prop-types';
import ReactSVG from 'react-svg';
import moment from 'moment';
import { isomorphy } from 'topcoder-react-utils';
-import { isEmpty as isDateEmpty } from 'utils/settings';
import './styles.scss';
@@ -24,14 +23,8 @@ export default function Item(props) {
onEditItem,
} = props;
- const {
- jobDescription,
- technologies,
- jobAchievements,
- } = work;
-
const hasSecondLine = () => {
- if (isDateEmpty(work.timePeriodFrom) && isDateEmpty(work.timePeriodTo)
+ if (_.isEmpty(work.timePeriodFrom) && _.isEmpty(work.timePeriodTo)
&& _.isEmpty(work.position) && !work.working) {
return false;
}
@@ -52,11 +45,11 @@ export default function Item(props) {
{ `${work.company}${_.isEmpty(work.industry) ? '' : ` | ${work.industry}`}${_.isEmpty(work.cityTown) ? '' : ` | ${work.cityTown}`}` }
- { `${!isDateEmpty(work.timePeriodFrom) ? moment(work.timePeriodFrom).format('YYYY') : ''}${!isDateEmpty(work.timePeriodTo) ? ` - ${moment(work.timePeriodTo).format('YYYY')}` : ` ${current}`} ${!_.isEmpty(work.position) && (!isDateEmpty(work.timePeriodTo) || !isDateEmpty(work.timePeriodFrom)) ? ' | ' : ''}${!_.isEmpty(work.position) ? `${work.position}` : ''}` }
+ { `${!_.isEmpty(work.timePeriodFrom) ? moment(work.timePeriodFrom).format('YYYY') : ''}${!_.isEmpty(work.timePeriodTo) ? ` - ${moment(work.timePeriodTo).format('YYYY')}` : ` ${current}`} ${!_.isEmpty(work.position) && (!_.isEmpty(work.timePeriodTo) || !_.isEmpty(work.timePeriodFrom)) ? ' | ' : ''}${!_.isEmpty(work.position) ? `${work.position}` : ''}` }
- {`${!isDateEmpty(work.timePeriodFrom) ? moment(work.timePeriodFrom).format('YYYY') : ''}${!isDateEmpty(work.timePeriodTo) ? ` - ${moment(work.timePeriodTo).format('YYYY')}` : ` ${current}`}`}
+ {`${!_.isEmpty(work.timePeriodFrom) ? moment(work.timePeriodFrom).format('YYYY') : ''}${!_.isEmpty(work.timePeriodTo) ? ` - ${moment(work.timePeriodTo).format('YYYY')}` : ` ${current}`}`}
{`${!_.isEmpty(work.position) ? `${work.position}` : ''}`}
@@ -90,30 +83,6 @@ export default function Item(props) {
- { !_.isEmpty(jobDescription) && jobDescription !== '
'
- && (
-
- )
- }
- { !_.isEmpty(technologies)
- && (
-
-
Technologies
-
{technologies.map(item => item.name).join(', ')}
-
- )
- }
- { !_.isEmpty(jobAchievements) && jobAchievements !== '
'
- && (
-
-
Outputs and Achievements Within the Role
-
-
- )
- }
);
}
diff --git a/src/shared/components/Settings/Profile/Work/List/Item/styles.scss b/src/shared/components/Settings/Profile/Work/List/Item/styles.scss
index 5b2ac9f208..d419082362 100644
--- a/src/shared/components/Settings/Profile/Work/List/Item/styles.scss
+++ b/src/shared/components/Settings/Profile/Work/List/Item/styles.scss
@@ -1,10 +1,8 @@
@import "../../../../style";
-@import './mixin';
.container {
display: flex;
flex-direction: row;
- flex-wrap: wrap;
justify-items: center;
justify-content: space-between;
height: 100%;
@@ -153,50 +151,3 @@
}
}
}
-
-.operation-container + div {
- margin-top: 15px;
- padding-top: 20px;
- border-top: 1px solid #ededf2;
-}
-
-.job-description,
-.technologies,
-.achievements {
- @include roboto-regular;
-
- width: 100%;
- margin: 0 0 20px;
- margin-left: 66px;
- font-size: 15px;
- color: #262628;
-
- .title {
- @include roboto-medium;
-
- line-height: 25px;
- margin-bottom: 4px;
- }
-}
-
-.technologies {
- .title {
- margin: 0;
- line-height: 1;
- }
-
- div {
- line-height: 25px;
- }
-}
-
-.achievements {
- margin-bottom: 5px;
-}
-
-.job-description,
-.achievements {
- .html-content {
- @include html-content-style;
- }
-}
diff --git a/src/shared/components/Settings/Profile/Work/Toolbar/index.jsx b/src/shared/components/Settings/Profile/Work/Toolbar/index.jsx
deleted file mode 100644
index 7291362eaa..0000000000
--- a/src/shared/components/Settings/Profile/Work/Toolbar/index.jsx
+++ /dev/null
@@ -1,176 +0,0 @@
-import React from 'react';
-import PT from 'prop-types';
-import Connector from 'components/Editor/Connector';
-import { RichUtils } from 'draft-js';
-import IconBold from 'assets/images/settings/profile/work/tc-text-16-bold.svg';
-import IconBoldActive from 'assets/images/settings/profile/work/tc-text-16-bold-active.svg';
-import IconItalic from 'assets/images/settings/profile/work/tc-text-16-italic.svg';
-import IconItalicActive from 'assets/images/settings/profile/work/tc-text-16-italic-active.svg';
-import IconUnderline from 'assets/images/settings/profile/work/tc-text-16-underline.svg';
-import IconUnderlineActive from 'assets/images/settings/profile/work/tc-text-16-underline-active.svg';
-import IconListBullet from 'assets/images/settings/profile/work/text-16px_list-bullet.svg';
-import IconListBulletActive from 'assets/images/settings/profile/work/text-16px_list-bullet-active.svg';
-import IconListNumbers from 'assets/images/settings/profile/work/text-16px_list-numbers.svg';
-import IconListNumbersActive from 'assets/images/settings/profile/work/text-16px_list-numbers-active.svg';
-
-import './style.scss';
-
-export default class Toolbar extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = {
- editor: null,
- bold: false,
- italic: false,
- underline: false,
- unorderedList: false,
- orderedList: false,
- hidden: true,
- };
-
- this.onClickBoldButton = this.onClickBoldButton.bind(this);
- this.onClickItalicButton = this.onClickItalicButton.bind(this);
- this.onClickUnderlineButton = this.onClickUnderlineButton.bind(this);
- this.onClickUnorderedListButton = this.onClickUnorderedListButton.bind(this);
- this.onClickOrderedListButton = this.onClickOrderedListButton.bind(this);
- }
-
- componentDidMount() {
- const { connector } = this.props;
- connector.setToolbar(this);
- }
-
- componentWillReceiveProps(nextProps) {
- const { connector: prevConnector } = this.props;
- const { connector: newConnector } = nextProps;
-
- if (newConnector !== prevConnector) {
- if (prevConnector) prevConnector.setToolbar(null);
- if (newConnector) newConnector.setToolbar(this);
- }
- }
-
- componentWillUnmount() {
- const { connector } = this.props;
- connector.setToolbar(null);
- }
-
- onClickBoldButton(event) {
- event.preventDefault();
- const { editor } = this.state;
- const newStyle = editor.toggleInlineStyle('BOLD');
- this.setState({ bold: newStyle.has('BOLD') });
- }
-
- onClickItalicButton(event) {
- event.preventDefault();
- const { editor } = this.state;
- const newStyle = editor.toggleInlineStyle('ITALIC');
- this.setState({ italic: newStyle.has('ITALIC') });
- }
-
- onClickUnderlineButton(event) {
- event.preventDefault();
- const { editor } = this.state;
- const newStyle = editor.toggleInlineStyle('UNDERLINE');
- this.setState({ underline: newStyle.has('UNDERLINE') });
- }
-
- onClickUnorderedListButton(event) {
- event.preventDefault();
- const { editor, unorderedList: prevUnorderedList } = this.state;
- this.setState({ unorderedList: !prevUnorderedList, orderedList: false }, () => {
- const { unorderedList } = this.state;
- if (unorderedList) {
- editor.applyBlockStyle('unordered-list-item');
- } else {
- editor.applyBlockStyle('unstyled');
- }
- });
- }
-
- onClickOrderedListButton(event) {
- event.preventDefault();
- const { editor, orderedList: prevOrderedList } = this.state;
- this.setState({ unorderedList: false, orderedList: !prevOrderedList }, () => {
- const { orderedList } = this.state;
- if (orderedList) {
- editor.applyBlockStyle('ordered-list-item');
- } else {
- editor.applyBlockStyle('unstyled');
- }
- });
- }
-
- onFocusedEditorChanged(newState) {
- const { connector, onEditorChange } = this.props;
- const editor = connector.focusedEditor;
- if (editor) {
- const inlineStyle = newState.getCurrentInlineStyle();
- const block = RichUtils.getCurrentBlockType(newState);
- this.setState({
- editor,
- bold: inlineStyle.has('BOLD'),
- italic: inlineStyle.has('ITALIC'),
- underline: inlineStyle.has('UNDERLINE'),
- unorderedList: block === 'unordered-list-item',
- orderedList: block === 'ordered-list-item',
- hidden: false,
- }, () => {
- onEditorChange(editor);
- });
- } else {
- this.setState({
- bold: false,
- italic: false,
- underline: false,
- unorderedList: false,
- orderedList: false,
- hidden: true,
- });
- }
- }
-
- render() {
- const {
- hidden,
- bold,
- italic,
- underline,
- orderedList,
- unorderedList,
- } = this.state;
-
- return (
-
-
-
-
-
-
-
-
- );
- }
-}
-
-Toolbar.defaultProps = {
- connector: new Connector(),
- onEditorChange: () => {},
-};
-
-Toolbar.propTypes = {
- connector: PT.instanceOf(Connector),
- onEditorChange: PT.func,
-};
diff --git a/src/shared/components/Settings/Profile/Work/Toolbar/style.scss b/src/shared/components/Settings/Profile/Work/Toolbar/style.scss
deleted file mode 100644
index a540b27adc..0000000000
--- a/src/shared/components/Settings/Profile/Work/Toolbar/style.scss
+++ /dev/null
@@ -1,37 +0,0 @@
-@import "~styles/mixins";
-
-.container {
- display: flex;
- align-items: center;
- width: 100%;
- height: 44px;
- background: $tc-gray-neutral-light;
- border: 1px solid #c3c3c8;
- border-radius: 4px 4px 0 0;
-
- button {
- width: 20px;
- height: 20px;
- line-height: 20px;
- margin: 0 13px;
- padding: 0;
- font-size: 13px;
- font-weight: bold;
- color: $tc-gray-80;
- text-align: center;
- appearance: none;
- background: none;
- border: 0;
-
- svg {
- vertical-align: bottom;
- }
- }
-
- .separator {
- display: block;
- width: 1px;
- height: 20px;
- background: $tc-gray-80;
- }
-}
diff --git a/src/shared/components/Settings/Profile/Work/index.jsx b/src/shared/components/Settings/Profile/Work/index.jsx
index ee9d7b0ec3..0bbfa631bf 100644
--- a/src/shared/components/Settings/Profile/Work/index.jsx
+++ b/src/shared/components/Settings/Profile/Work/index.jsx
@@ -6,7 +6,6 @@
/* eslint-disable no-nested-ternary */
/* eslint-disable jsx-a11y/label-has-for */
/* eslint-disable no-undef */
-/* eslint-disable react/jsx-boolean-value */
import React from 'react';
import PT from 'prop-types';
import _ from 'lodash';
@@ -15,13 +14,9 @@ import ConsentComponent from 'components/Settings/ConsentComponent';
import { PrimaryButton } from 'topcoder-react-ui-kit';
import DatePicker from 'components/challenge-listing/Filters/DatePicker';
import ErrorMessage from 'components/Settings/ErrorMessage';
-import { validateStartDate, validateEndDate, isEmpty as isDateEmpty } from 'utils/settings';
-import Connector from 'components/Editor/Connector';
-import Select from 'components/Select';
-import Editor from 'components/Editor';
+import { validateStartDate, validateEndDate } from 'utils/settings';
import ConfirmationModal from '../../CofirmationModal';
import WorkList from './List';
-import Toolbar from './Toolbar';
import './styles.scss';
@@ -39,9 +34,6 @@ export default class Work extends ConsentComponent {
this.updatePredicate = this.updatePredicate.bind(this);
this.onUpdateDate = this.onUpdateDate.bind(this);
this.onCancelEditStatus = this.onCancelEditStatus.bind(this);
- this.onUpdateJobDescription = this.onUpdateJobDescription.bind(this);
- this.onUpdateAchievements = this.onUpdateAchievements.bind(this);
- this.onUpdateTechnologies = this.onUpdateTechnologies.bind(this);
const { userTraits } = props;
this.state = {
@@ -62,14 +54,6 @@ export default class Work extends ConsentComponent {
timePeriodTo: '',
industry: '',
working: false,
- jobDescription: '',
- jobAchievements: '',
- technologies: [],
- initialJobDescription: '',
- initialJobAchievements: '',
- numJobDescription: 0,
- numJobAchievements: 0,
- numTechnologies: 0,
},
isMobileView: false,
screenSM: 767,
@@ -77,11 +61,6 @@ export default class Work extends ConsentComponent {
indexNo: null,
showConfirmation: false,
};
-
- this.connectorJobDescription = new Connector();
- this.connectorAchievements = new Connector();
- this.connectorJobDescriptionMobile = new Connector();
- this.connectorAchievementsMobile = new Connector();
}
componentDidMount() {
@@ -110,16 +89,8 @@ export default class Work extends ConsentComponent {
timePeriodTo: '',
industry: '',
working: false,
- jobDescription: '',
- jobAchievements: '',
- technologies: [],
- initialJobDescription: '',
- initialJobAchievements: '',
- numJobDescription: 0,
- numJobAchievements: 0,
- numTechnologies: 0,
},
- }, () => this.resetEditorContents());
+ });
}
componentWillUnmount() {
@@ -180,7 +151,7 @@ export default class Work extends ConsentComponent {
if (date) {
const { newWork: oldWork } = this.state;
const newWork = { ...oldWork };
- newWork[timePeriod] = date.toISOString();
+ newWork[timePeriod] = date;
this.setState({ newWork, isSubmit: false });
}
}
@@ -234,34 +205,10 @@ export default class Work extends ConsentComponent {
company: workTrait.traits.data[indexNo].company,
position: _.isEmpty(workTrait.traits.data[indexNo].position) ? '' : workTrait.traits.data[indexNo].position,
cityTown: _.isEmpty(workTrait.traits.data[indexNo].cityTown) ? '' : workTrait.traits.data[indexNo].cityTown,
- timePeriodFrom: isDateEmpty(workTrait.traits.data[indexNo].timePeriodFrom) ? '' : workTrait.traits.data[indexNo].timePeriodFrom,
- timePeriodTo: isDateEmpty(workTrait.traits.data[indexNo].timePeriodTo) ? '' : workTrait.traits.data[indexNo].timePeriodTo,
+ timePeriodFrom: _.isEmpty(workTrait.traits.data[indexNo].timePeriodFrom) ? '' : workTrait.traits.data[indexNo].timePeriodFrom,
+ timePeriodTo: _.isEmpty(workTrait.traits.data[indexNo].timePeriodTo) ? '' : workTrait.traits.data[indexNo].timePeriodTo,
industry: _.isEmpty(workTrait.traits.data[indexNo].industry) ? '' : workTrait.traits.data[indexNo].industry,
working: workTrait.traits.data[indexNo].working,
- jobDescription: _.isEmpty(workTrait.traits.data[indexNo].jobDescription)
- ? ''
- : workTrait.traits.data[indexNo].jobDescription,
- jobAchievements: _.isEmpty(workTrait.traits.data[indexNo].jobAchievements)
- ? ''
- : workTrait.traits.data[indexNo].jobAchievements,
- technologies: _.isEmpty(workTrait.traits.data[indexNo].technologies)
- ? []
- : workTrait.traits.data[indexNo].technologies,
- initialJobDescription: _.isEmpty(workTrait.traits.data[indexNo].jobDescription)
- ? ''
- : workTrait.traits.data[indexNo].jobDescription,
- initialJobAchievements: _.isEmpty(workTrait.traits.data[indexNo].jobAchievements)
- ? ''
- : workTrait.traits.data[indexNo].jobAchievements,
- numJobDescription: _.isEmpty(workTrait.traits.data[indexNo].jobDescription)
- ? 0
- : workTrait.traits.data[indexNo].jobDescription.length,
- numJobAchievements: _.isEmpty(workTrait.traits.data[indexNo].jobAchievements)
- ? 0
- : workTrait.traits.data[indexNo].jobAchievements.length,
- numTechnologies: _.isEmpty(workTrait.traits.data[indexNo].technologies)
- ? 0
- : workTrait.traits.data[indexNo].technologies.length,
},
isEdit: true,
indexNo,
@@ -300,12 +247,12 @@ export default class Work extends ConsentComponent {
if (_.isEmpty(work.cityTown)) {
delete work.cityTown;
}
- if (isDateEmpty(work.timePeriodFrom)) {
+ if (_.isEmpty(work.timePeriodFrom)) {
delete work.timePeriodFrom;
} else {
work.timePeriodFrom = new Date(work.timePeriodFrom).getTime();
}
- if (isDateEmpty(work.timePeriodTo)) {
+ if (_.isEmpty(work.timePeriodTo)) {
delete work.timePeriodTo;
} else {
work.timePeriodTo = new Date(work.timePeriodTo).getTime();
@@ -313,24 +260,6 @@ export default class Work extends ConsentComponent {
if (_.isEmpty(work.industry)) {
delete work.industry;
}
- if (_.isEmpty(work.jobDescription)) {
- delete work.jobDescription;
- } else {
- work.jobDescription = _.escape(work.jobDescription);
- }
- if (_.isEmpty(work.jobAchievements)) {
- delete work.jobAchievements;
- } else {
- work.jobAchievements = _.escape(work.jobAchievements);
- }
- if (_.isEmpty(work.technologies)) {
- delete work.technologies;
- }
- delete work.initialJobDescription;
- delete work.initialJobAchievements;
- delete work.numJobDescription;
- delete work.numJobAchievements;
- delete work.numTechnologies;
if (workTrait.traits && workTrait.traits.data.length > 0) {
const newWorkTrait = _.cloneDeep(workTrait);
@@ -391,14 +320,6 @@ export default class Work extends ConsentComponent {
loadWorkTrait = (userTraits) => {
const trait = userTraits.filter(t => t.traitId === 'work');
const works = trait.length === 0 ? {} : trait[0];
- if (works.traits && works.traits.data) {
- works.traits.data = works.traits.data.map((item) => {
- const result = _.assign({}, item);
- result.jobDescription = _.unescape(item.jobDescription);
- result.jobAchievements = _.unescape(item.jobAchievements);
- return result;
- });
- }
return _.assign({}, works);
}
@@ -432,14 +353,6 @@ export default class Work extends ConsentComponent {
timePeriodTo: '',
industry: '',
working: false,
- jobDescription: '',
- jobAchievements: '',
- technologies: [],
- initialJobDescription: '',
- initialJobAchievements: '',
- numJobDescription: 0,
- numJobAchievements: 0,
- numTechnologies: 0,
},
formInvalid: false,
startDateInvalid: false,
@@ -447,53 +360,13 @@ export default class Work extends ConsentComponent {
endDateInvalid: false,
endDateDisabled: false,
endDateInvalidMsg: '',
- }, () => this.resetEditorContents());
+ });
}
}
- onUpdateJobDescription(editor) {
- const html = editor.getHtml();
- const length = editor.state.editor.getCurrentContent().getPlainText('').length; // eslint-disable-line prefer-destructuring
- const { newWork: oldWork } = this.state;
-
- const newWork = { ...oldWork, jobDescription: html, numJobDescription: length };
- this.setState({ newWork, isSubmit: false, endDateDisabled: newWork.working });
- }
-
- onUpdateAchievements(editor) {
- const html = editor.getHtml();
- const length = editor.state.editor.getCurrentContent().getPlainText('').length; // eslint-disable-line prefer-destructuring
- const { newWork: oldWork } = this.state;
-
- const newWork = { ...oldWork, jobAchievements: html, numJobAchievements: length };
- this.setState({ newWork, isSubmit: false, endDateDisabled: newWork.working });
- }
-
- onUpdateTechnologies(value) {
- if (value.length > 3) {
- value.shift();
- }
-
- const { newWork: oldWork } = this.state;
- const newWork = {
- ...oldWork,
- technologies: value.map(val => ({ id: val.id, name: val.name })),
- numTechnologies: value.length,
- };
- this.setState({ newWork, isSubmit: false, endDateDisabled: newWork.working });
- }
-
- resetEditorContents() {
- this.connectorJobDescription.editors[0].setInitialContent('');
- this.connectorAchievements.editors[0].setInitialContent('');
- this.connectorJobDescriptionMobile.editors[0].setInitialContent('');
- this.connectorAchievementsMobile.editors[0].setInitialContent('');
- }
-
render() {
const {
settingsUI,
- lookupData,
} = this.props;
const {
workTrait,
@@ -515,16 +388,6 @@ export default class Work extends ConsentComponent {
const workItems = workTrait.traits
? workTrait.traits.data.slice() : [];
const { newWork } = this.state;
- const {
- initialJobDescription,
- initialJobAchievements,
- technologies,
- numJobDescription,
- numTechnologies,
- numJobAchievements,
- } = newWork;
- const techTags = lookupData.technologies
- .sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
return (
@@ -630,11 +493,7 @@ export default class Work extends ConsentComponent {
readOnly
numberOfMonths={1}
isOutsideRange={moment().subtract(1, 'd')}
- date={
- isDateEmpty(newWork.timePeriodFrom)
- ? null
- : moment(newWork.timePeriodFrom)
- }
+ date={newWork.timePeriodFrom}
id="date-from1"
onDateChange={date => this.onUpdateDate(date, 'timePeriodFrom')}
placeholder="dd/mm/yyyy"
@@ -662,7 +521,7 @@ export default class Work extends ConsentComponent {
disabled={endDateDisabled}
numberOfMonths={1}
isOutsideRange={moment().subtract(1, 'd')}
- date={isDateEmpty(newWork.timePeriodTo) ? null : moment(newWork.timePeriodTo)}
+ date={newWork.timePeriodTo}
id="date-to1"
onDateChange={date => this.onUpdateDate(date, 'timePeriodTo')}
placeholder="dd/mm/yyyy"
@@ -678,12 +537,13 @@ export default class Work extends ConsentComponent {