Skip to content

Commit a2f51cb

Browse files
committed
Add yields section to synthesis tables
1 parent c516234 commit a2f51cb

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

webapp/src/components/CompactConstituentTable.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ export default {
113113
},
114114
props: {
115115
modelValue: {
116-
type: String,
117-
default: "",
116+
type: Array,
117+
default: () => [],
118118
},
119119
typesToQuery: {
120120
type: Array,
@@ -132,7 +132,7 @@ export default {
132132
},
133133
computed: {
134134
newSelectIsShown() {
135-
return this.constituents.length == 0 || this.addNewConstituentIsActive;
135+
return this.addNewConstituentIsActive;
136136
},
137137
constituents: {
138138
get() {

webapp/src/components/SynthesisInformation.vue

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,32 @@
1515
class="content-container"
1616
:style="{ 'max-height': contentMaxHeight }"
1717
>
18+
<span id="synthesis-reactants-label" class="subheading mt-2 pb-2 ml-2">
19+
<label for="synthesis-reactants-table">Reactants, reagents, inputs</label>
20+
</span>
1821
<div class="card component-card">
1922
<div class="card-body pt-2 pb-0 mb-0 pl-5">
2023
<CompactConstituentTable
21-
id="synthesis-table"
24+
id="synthesis-reactants-table"
2225
v-model="constituents"
2326
:types-to-query="['samples', 'starting_materials']"
2427
/>
2528
</div>
2629
</div>
27-
<span id="synthesis-procedure-label" class="subheading ml-2">Procedure</span>
30+
<span id="synthesis-products-label" class="subheading mt-2 pb-2 ml-2"
31+
><label for="synthesis-products-table">Products</label></span
32+
>
33+
<div class="component-card">
34+
<div class="card-body pt-2 pb-0 mb-0 pl-5">
35+
<CompactConstituentTable
36+
id="synthesis-products-table"
37+
v-model="products"
38+
:types-to-query="['samples', 'starting_materials']"
39+
/>
40+
</div>
41+
</div>
42+
<span id="synthesis-procedure-label" class="subheading ml-2"><label>Procedure</label></span
43+
>
2844
<TinyMceInline
2945
v-model="SynthesisDescription"
3046
aria-labelledby="synthesis-procedure-label"
@@ -59,6 +75,7 @@ export default {
5975
},
6076
computed: {
6177
constituents: createComputedSetterForItemField("synthesis_constituents"),
78+
products: createComputedSetterForItemField("synthesis_products"),
6279
SynthesisDescription: createComputedSetterForItemField("synthesis_description"),
6380
},
6481
watch: {
@@ -69,6 +86,12 @@ export default {
6986
},
7087
deep: true,
7188
},
89+
products: {
90+
handler() {
91+
this.$store.commit("setItemSaved", { item_id: this.item_id, isSaved: false });
92+
},
93+
deep: true,
94+
},
7295
SynthesisDescription: {
7396
handler() {
7497
this.$store.commit("setItemSaved", { item_id: this.item_id, isSaved: false });
@@ -80,6 +103,7 @@ export default {
80103
// Auto-collapsed when initialised empty
81104
this.isExpanded =
82105
(this.constituents && this.constituents.length > 0) ||
106+
(this.products && this.products.length > 0) ||
83107
(this.SynthesisDescription && this.SynthesisDescription.trim() !== "");
84108
// If expanded set height to none, otherwise set to 0px
85109
if (this.isExpanded) {
@@ -201,7 +225,6 @@ export default {
201225
font-size: small;
202226
font-weight: 600;
203227
text-transform: uppercase;
204-
margin-bottom: 0px;
205228
}
206229
207230
.content-container {

0 commit comments

Comments
 (0)