Skip to content

Commit 71c5aa1

Browse files
author
vikasrohit
authored
Merge pull request #4314 from appirio-tech/hotfix/taas-intake-form-remove-2-roles
[PROD] [HOTFIX]TaaS Intake Form Updates
2 parents 2de03a6 + d1ccd5a commit 71c5aa1

File tree

6 files changed

+68
-11
lines changed

6 files changed

+68
-11
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ workflows:
136136
- build-dev
137137
filters:
138138
branches:
139-
only: ['feature/taas-jobs-2']
139+
only: ['hotfix/taas-job-editor-improvements']
140140

141141
- deployProd:
142142
context : org-global

src/components/TuiEditor/TuiEditor.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
all: revert;
99
font-size: 24px;
1010
}
11-
}
11+
}
1212

13-
b,
13+
b,
1414
i,
15-
s,
15+
s,
1616
hr,
1717
blockquote,
1818
ul,
@@ -33,7 +33,7 @@
3333
// add style for heading list in headings selection popup, because 'all:revert' has been setted before
3434
.te-heading-add ul {
3535
list-style: none;
36-
}
36+
}
3737

3838
// hide uplodd file
3939
.tui-editor-popup{

src/components/TuiEditor/index.jsx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* TuiEditor
2+
* TuiEditor
33
* wrap toast-ui editor with react and support react 15
44
*/
55

@@ -33,6 +33,12 @@ class TuiEditor extends React.Component {
3333
this.editorInst.off(eventName)
3434
this.editorInst.on(eventName, props[key])
3535
})
36+
37+
// always add `https` to the links if link was added without `http` or `https`
38+
this.editorInst.on('convertorAfterHtmlToMarkdownConverted', (inputMarkdown) => {
39+
const outputMarkdown = inputMarkdown.replace(/\[([^\]]*)\]\((?!https?)([^)]+)\)/g, '[$1](https://$2)')
40+
return outputMarkdown
41+
})
3642
}
3743

3844
componentDidMount() {
@@ -47,6 +53,17 @@ class TuiEditor extends React.Component {
4753
this.bindEventHandlers(props)
4854
}
4955

56+
componentWillUnmount() {
57+
Object.keys(this.props)
58+
.filter((key) => /^on[A-Z][a-zA-Z]+/.test(key))
59+
.forEach((key) => {
60+
const eventName = key[2].toLowerCase() + key.slice(3)
61+
this.editorInst.off(eventName)
62+
})
63+
64+
this.editorInst.off('convertorAfterHtmlToMarkdownConverted')
65+
}
66+
5067
handleValueChange(){
5168
if (this.props.onChange) {
5269
this.props.onChange(this.getInstance().getMarkdown())
@@ -68,7 +85,11 @@ class TuiEditor extends React.Component {
6885
if (this.props.className !== className) {
6986
return true
7087
}
71-
// this.bindEventHandlers(nextProps, this.props)
88+
89+
// this looks like a bed idea to re-subscribe all the event on each re-render
90+
// also, note, that we had to disable this.editorInst.off(eventName);
91+
// otherwise popup for choosing Headings never closes
92+
// this.bindEventHandlers(nextProps, this.props);
7293

7394
return false
7495
}
@@ -132,7 +153,7 @@ TuiEditor.propTypes = {
132153
// use default htmlSanitizer
133154
useDefaultHTMLSanitizer: PropTypes.bool,
134155
// toolbar items.
135-
toolbarItems: PropTypes.arrayOf(PropTypes.object),
156+
toolbarItems: PropTypes.arrayOf(PropTypes.oneOfType(PropTypes.object, PropTypes.string)),
136157
// Array of plugins. A plugin can be either a function or an array in the form of [function, options].
137158
plugins: PropTypes.arrayOf(PropTypes.object),
138159
// Using extended Autolinks specified in GFM spec
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@import '~tc-ui/src/styles/tc-includes';
2+
3+
.description-editor {
4+
:global {
5+
.tui-editor-contents {
6+
code {
7+
background-color: transparent;
8+
color: inherit;
9+
}
10+
11+
pre {
12+
background-color: transparent;
13+
color: inherit;
14+
padding: 0;
15+
}
16+
}
17+
}
18+
}

src/projects/detail/components/DescriptionField/index.jsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,30 @@ import React from 'react'
66
import PropTypes from 'prop-types'
77

88
import TuiEditor from '../../../../components/TuiEditor'
9+
import './DescriptionField.scss'
910

1011
const DescriptionField = (props) => (
1112
<TuiEditor
1213
{...props}
14+
toolbarItems={[
15+
'heading',
16+
'bold',
17+
'italic',
18+
'strike',
19+
'code',
20+
'divider',
21+
'quote',
22+
'codeblock',
23+
'hr',
24+
'divider',
25+
'ul',
26+
'ol',
27+
'divider',
28+
'image',
29+
'link',
30+
]}
31+
plugins={[]}
32+
styleName="description-editor"
1333
previewStyle="vertical"
1434
height="400px"
1535
hideModeSwitch

src/projects/detail/components/JobPickerRow/JobPickerRow.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ class JobPickerRow extends React.PureComponent {
4646
{ value: 'designer', title: 'Designer'},
4747
{ value: 'software-developer', title: 'Software Developer'},
4848
{ value: 'data-scientist', title: 'Data Scientist'},
49-
{ value: 'data-engineer', title: 'Data Engineer'},
50-
{ value: 'qa', title: 'QA Tester'},
51-
{ value: 'qa-engineer', title: 'QA Engineer'}
49+
{ value: 'data-engineer', title: 'Data Engineer'}
5250
]
5351
}
5452
handleJobTitleChange(evt) {

0 commit comments

Comments
 (0)