Skip to content

Commit

Permalink
Placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Sep 24, 2024
1 parent ab1b98e commit 97a8685
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions webapp/src/components/CollectionInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,29 @@
<CollectionRelationshipVisualization :collection_id="collection_id" />
</div>
</div>
<DynamicDataTable
:data="children"
:columns="collectionTableColumns"
:data-type="'samples'"
:global-filter-fields="['item_id', 'type', 'name', 'chemform', 'creatorsList', 'nblocks']"
/>
</div>
</template>

<script>
import { createComputedSetterForCollectionField } from "@/field_utils.js";
import { getCollectionSampleList } from "@/server_fetch_utils";
import TinyMceInline from "@/components/TinyMceInline";
import Creators from "@/components/Creators";
import CollectionRelationshipVisualization from "@/components/CollectionRelationshipVisualization";
import DynamicDataTable from "@/components/DynamicDataTable";
export default {
components: {
TinyMceInline,
Creators,
CollectionRelationshipVisualization,
DynamicDataTable,
},
props: {
collection_id: {
Expand All @@ -58,6 +67,41 @@ export default {
Title: createComputedSetterForCollectionField("title"),
Name: createComputedSetterForCollectionField("name"),
CollectionCreators: createComputedSetterForCollectionField("creators"),
children() {
return this.$store.state.all_collection_children[this.collection_id] || [];
},
},
created() {
this.getCollectionChildren();
},
data() {
return {
collectionTableColumns: [
{
field: "item_id",
header: "ID",
body: "FormattedItemName",
filter: true,
},
{ field: "type", header: "Type", filter: true },
{ field: "name", header: "Sample name" },
{ field: "chemform", header: "Formula", body: "ChemicalFormula" },
{ field: "date", header: "Date" },
{ field: "creators", header: "Creators", body: "Creators" },
{ field: "nblocks", header: "# of blocks" },
],
};
},
methods: {
getCollectionChildren() {
getCollectionSampleList(this.collection_id)
.then(() => {
this.tableIsReady = true;
})
.catch(() => {
this.fetchError = true;
});
},
},
};
</script>

0 comments on commit 97a8685

Please sign in to comment.