Skip to content

Commit df6b338

Browse files
committed
1.2.1cleanup: Clean lint on EdgeEditor.
1 parent 423d25b commit df6b338

File tree

1 file changed

+37
-46
lines changed

1 file changed

+37
-46
lines changed

build/app/view/netcreate/components/EdgeEditor.jsx

Lines changed: 37 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ class EdgeEditor extends UNISYS.Component {
267267
this.onCitationChange = this.onCitationChange.bind(this);
268268
this.onCategoryChange = this.onCategoryChange.bind(this);
269269
this.onSubmit = this.onSubmit.bind(this);
270-
this.checkUnload = this.checkUnload.bind(this);
271-
this.doUnload = this.doUnload.bind(this);
270+
this.checkUnload = this.checkUnload.bind(this);
271+
this.doUnload = this.doUnload.bind(this);
272272

273273
// Always make sure class methods are bind()'d before using them
274274
// as a handler, otherwise object context is lost
@@ -639,9 +639,9 @@ class EdgeEditor extends UNISYS.Component {
639639

640640
} // this.onCloseCiteClick
641641

642-
dateFormatted (){
642+
dateFormatted () {
643643
var today = new Date();
644-
var year = "" + today.getFullYear();
644+
var year = String(today.getFullYear());
645645
var date = (today.getMonth()+1)+"/"+today.getDate()+"/"+ year.substr(2,4);
646646
var time = today.toTimeString().substr(0,5);
647647
var dateTime = time+' on '+date;
@@ -818,16 +818,14 @@ class EdgeEditor extends UNISYS.Component {
818818
const { edgeID, parentNodeLabel } = this.props;
819819
const { formData, sourceNode, targetNode, edgePrompts} = this.state;
820820
let {citationPrompts} = this.state;
821-
if(edgePrompts.category == undefined) // for backwards compatability
822-
{
821+
if (edgePrompts.category === undefined) { // for backwards compatability
823822
edgePrompts.category = {};
824823
edgePrompts.category.label = "";
825824
edgePrompts.category.hidden = true;
826825
}
827-
if(citationPrompts==undefined) // if citationPrompts were lefft out, simply make them hidden
828-
{
829-
citationPrompts = {};
830-
citationPrompts.hidden = true;
826+
if (citationPrompts === undefined) { // if citationPrompts were left out, simply make them hidden
827+
citationPrompts = {};
828+
citationPrompts.hidden = true;
831829
}
832830
const me = <span style={{ color: "rgba(0,0,0,0.2)", fontStyle: "italic" }}>this node</span>;
833831
// special override to allow editing an edge that has the same parent node for both source and target
@@ -1010,21 +1008,17 @@ class EdgeEditor extends UNISYS.Component {
10101008
window.addEventListener("unload", this.doUnload);
10111009
}
10121010

1013-
checkUnload(e)
1014-
{
1015-
if(this.state.isEditable)
1016-
{
1017-
(e || window.event).returnValue = null;
1018-
return null;
1019-
}
1011+
checkUnload(e) {
1012+
if (this.state.isEditable) {
1013+
(e || window.event).returnValue = null;
1014+
return null;
1015+
}
10201016
}
10211017

1022-
doUnload(e)
1023-
{
1024-
if(this.state.isEditable)
1025-
{
1026-
this.NetCall('SRV_DBUNLOCKEDGE', { edgeID: this.state.formData.id })
1027-
}
1018+
doUnload(e) {
1019+
if (this.state.isEditable) {
1020+
this.NetCall('SRV_DBUNLOCKEDGE', { edgeID: this.state.formData.id })
1021+
}
10281022
}
10291023

10301024
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -1053,33 +1047,30 @@ class EdgeEditor extends UNISYS.Component {
10531047
/*/
10541048
/*/
10551049

1056-
helpText(obj)
1057-
{
1058-
var text = "";
1059-
1060-
if(obj.help == undefined || obj.help == "")
1061-
text = obj.label;
1062-
else
1063-
text = obj.help;
1064-
return text;
1065-
}
1066-
1067-
1068-
markdownDisplay (text){
1050+
helpText(obj) {
1051+
var text = "";
1052+
if (obj.help === undefined || obj.help === "") text = obj.label;
1053+
else text = obj.help;
1054+
return text;
1055+
}
10691056

1070-
if(!this.state.isEditable)
1071-
return mdReact({onIterate: this.markdownIterate, markdownOptions:{ typographer: true, linkify: true}, plugins: [mdplugins.emoji]
1072-
})(text);
1073-
}
10741057

1075-
markdownIterate(Tag, props, children, level){
1076-
if (Tag === 'a') {
1077-
props.target = '_blank';
1058+
markdownDisplay (text) {
1059+
if (!this.state.isEditable) {
1060+
return mdReact({
1061+
onIterate: this.markdownIterate,
1062+
markdownOptions: { typographer: true, linkify: true },
1063+
plugins: [mdplugins.emoji]
1064+
})(text);
1065+
}
10781066
}
10791067

1080-
return <Tag {...props}>{children}</Tag>;
1081-
1082-
}
1068+
markdownIterate(Tag, props, children, level) {
1069+
if (Tag === 'a') {
1070+
props.target = '_blank';
1071+
}
1072+
return <Tag {...props}>{children}</Tag>;
1073+
}
10831074

10841075
} // class EdgeEditor
10851076

0 commit comments

Comments
 (0)