Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
gy4443
chemotion_eln_server
Commits
f9cff1e1
Commit
f9cff1e1
authored
Oct 04, 2017
by
jasonych99
Browse files
text bold for molecule label
parent
380171e5
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/assets/javascripts/components/report/SectionSiSynthesis.js
View file @
f9cff1e1
...
...
@@ -35,7 +35,7 @@ const userSerial = (molecule, molSerials = []) => {
const
deltaUserSerial
=
(
molecule
,
molSerials
)
=>
{
const
insert
=
userSerial
(
molecule
,
molSerials
);
return
{
insert
};
return
{
insert
,
attributes
:
{
bold
:
'
true
'
}
};
};
const
Title
=
({
el
,
counter
,
molSerials
})
=>
{
...
...
@@ -46,7 +46,7 @@ const Title = ({ el, counter, molSerials }) => {
const
comma
=
<
span
key
=
{
`
${
i
}
-comma`
}
>
,
<
/span>
;
const
smn
=
sampleMoleculeName
(
p
);
title
=
smn
?
[...
title
,
<
span
key
=
{
key
}
>
{
smn
}
({
us
})
<
/span>, comma
]
?
[...
title
,
<
span
key
=
{
key
}
>
{
smn
}
(
<
b
>
{
us
}
<
/b>
)
</
span
>
,
comma
]
:
[...
title
,
<
span
key
=
{
key
}
>
"
<b>NAME</b>
"
<
/span>, comma]
;
});
title
=
_
.
flatten
(
title
).
slice
(
0
,
-
1
);
...
...
lib/reporter/docx/detail.rb
View file @
f9cff1e1
...
...
@@ -83,9 +83,11 @@ module Reporter
def
remove_redundant_space_break
(
ops
)
# ensure one line
ops
.
map
.
with_index
do
|
op
,
i
|
op
[
"insert"
]
=
op
[
"insert"
].
gsub
(
/[\u00A0\s]{2,}/
,
" "
)
op
[
"insert"
]
=
op
[
"insert"
].
lstrip
if
i
==
0
op
[
"insert"
]
=
op
[
"insert"
].
gsub
(
/\n/
,
" "
)
if
op
[
"insert"
]
op
[
"insert"
]
=
op
[
"insert"
].
gsub
(
/[\u00A0\s]{2,}/
,
" "
)
op
[
"insert"
]
=
op
[
"insert"
].
lstrip
if
i
==
0
op
[
"insert"
]
=
op
[
"insert"
].
gsub
(
/\n/
,
" "
)
end
op
end
end
...
...
lib/reporter/docx/detail_reaction.rb
View file @
f9cff1e1
...
...
@@ -481,7 +481,7 @@ module Reporter
def
mol_serial_delta
(
mol_id
)
serial
=
mol_serial
(
mol_id
)
[{
'insert'
=>
serial
}]
[{
'insert'
=>
serial
,
'attributes'
=>
{
'bold'
=>
'true'
}
}]
end
end
end
...
...
spec/lib/report/docx/detail_reaction_spec.rb
View file @
f9cff1e1
...
...
@@ -149,12 +149,12 @@ describe 'Reporter::Docx::DetailReaction instance' do
{
"insert"
=>
"[4.
#{
prev_index
+
1
}
] "
},
{
"insert"
=>
"
#{
s2
.
molecule_name_hash
[
:label
]
}
"
},
{
"insert"
=>
" ("
},
{
"insert"
=>
serial
},
{
"insert"
=>
serial
,
"attributes"
=>
{
"bold"
=>
"true"
}
},
{
"insert"
=>
")"
},
{
"insert"
=>
", "
},
{
"insert"
=>
"
#{
s3
.
molecule_name_hash
[
:label
]
}
"
},
{
"insert"
=>
" ("
},
{
"insert"
=>
serial
},
{
"insert"
=>
serial
,
"attributes"
=>
{
"bold"
=>
"true"
}
},
{
"insert"
=>
")"
},
]
)
...
...
@@ -199,7 +199,7 @@ describe 'Reporter::Docx::DetailReaction instance' do
[
{
"insert"
=>
"
#{
tit
}
: "
},
{
"insert"
=>
"{A|"
},
{
"insert"
=>
serial
},
{
"insert"
=>
serial
,
"attributes"
=>
{
"bold"
=>
"true"
}
},
{
"insert"
=>
"} "
},
{
"insert"
=>
"
#{
s2
.
molecule_name_hash
[
:label
]
}
"
},
{
"insert"
=>
" (1.000 g, 55.508 mmol, 0.88 equiv.); "
},
...
...
@@ -209,11 +209,11 @@ describe 'Reporter::Docx::DetailReaction instance' do
{
"insert"
=>
" (0.00 mL); "
},
{
"insert"
=>
"Yield "
},
{
"insert"
=>
"{C|"
},
{
"insert"
=>
serial
},
{
"insert"
=>
serial
,
"attributes"
=>
{
"bold"
=>
"true"
}
},
{
"insert"
=>
"} =
#{
(
equiv
*
100
).
to_i
}
% (0.000 g, 0.000 mmol)"
},
{
"insert"
=>
"; "
},
{
"insert"
=>
"{D|"
},
{
"insert"
=>
serial
},
{
"insert"
=>
serial
,
"attributes"
=>
{
"bold"
=>
"true"
}
},
{
"insert"
=>
"} =
#{
(
equiv
*
100
).
to_i
}
% (0.000 g, 0.000 mmol)"
},
{
"insert"
=>
"."
},
{
"insert"
=>
"
\n
"
},
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment