Skip to content

Commit

Permalink
Merge pull request #13097 from davelopez/beta_history_additional_coll…
Browse files Browse the repository at this point in the history
…ection_fixes

Beta History: additional small fixes at collection level
  • Loading branch information
mvdbeek authored Dec 21, 2021
2 parents 36e4c33 + e9ebc20 commit 9824889
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="description">
A {{ dsc.collectionType | localize }} of {{ dsc.totalElements
}}<b v-if="isHomogeneous"> {{ homogeneousDatatype }}</b> datasets.
{{ dsc.collectionType | localize }} of {{ dsc.totalElements }}
<b v-if="isHomogeneous">{{ homogeneousDatatype }} </b>datasets
</div>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@
icon="trash-restore"
@click.stop="$emit('undelete')" />

<IconButton
class="px-1"
state="ok"
title="Collection"
icon="folder"
@click.stop="$emit('viewCollection')"
variant="link" />

<div class="content-title title flex-grow-1 overflow-hidden" @click.stop="$emit('viewCollection')">
<h5 class="text-truncate">
<span class="hid">{{ dsc.hid }}</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<template>
<section>
<nav class="d-flex justify-content-end">
<b-button-group>
<IconButton
v-if="isRoot"
class="mb-2 mx-3"
icon="download"
title="Download Collection"
:href="downloadCollectionUrl"
download />
</b-button-group>
</nav>
</section>
</template>

<script>
import IconButton from "components/IconButton";
export default {
components: { IconButton },
props: {
isRoot: { type: Boolean, required: true },
collection: { type: Object, required: true },
},
computed: {
/** @return {String} */
downloadCollectionUrl() {
return `${this.collection.url}/download`;
},
},
};
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
{{ dscName || "(Collection Name)" }}
</h3>
<p class="mt-1">
<i class="fas fa-folder"></i>
<DscDescription :dsc="dsc" />
</p>

Expand Down
17 changes: 9 additions & 8 deletions client/src/components/History/CurrentCollection/Panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
</template>

<template v-slot:localNav>
<IconButton
icon="download"
title="Download Collection"
:href="downloadCollectionUrl"
download />
<!-- Empty -->
<div />
</template>

<template v-slot:listcontrols>
<CollectionOperations :collection="selectedCollection" :is-root="isRoot" />
</template>

<template v-slot:details>
Expand Down Expand Up @@ -61,12 +62,12 @@ import { DscProvider, CollectionContentProvider } from "components/providers/His
import ExpandedItems from "../ExpandedItems";
import Layout from "../Layout";
import TopNav from "./TopNav";
import CollectionOperations from "./CollectionOperations.vue";
import Details from "./Details";
import Scroller from "../Scroller";
import { CollectionContentItem } from "../ContentItem";

import { reportPayload } from "components/providers/History/ContentProvider/helpers";
import IconButton from "components/IconButton";

export default {
filters: {
Expand All @@ -81,7 +82,7 @@ export default {
Scroller,
CollectionContentItem,
ExpandedItems,
IconButton,
CollectionOperations,
},
props: {
history: { type: History, required: true },
Expand All @@ -94,7 +95,7 @@ export default {
return selected;
},
isRoot() {
return this.selectedCollection == this.selectedCollections[0];
return this.selectedCollection == this.rootCollection;
},
writable() {
return this.isRoot;
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/History/model/DatasetCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class DatasetCollection extends Content {
}

get totalElements() {
if ("element_count" in this) {
if ("element_count" in this && this.element_count) {
return this.element_count;
}
if (this.collection_type == "paired") {
Expand Down Expand Up @@ -57,7 +57,7 @@ export class DatasetCollection extends Content {
* @return {Boolean}
*/
get isHomogeneous() {
return this.elements_datatypes.length == 1;
return this.elements_datatypes?.length == 1;
}

/** Gets the datatype shared by all elements or an empty
Expand Down

0 comments on commit 9824889

Please sign in to comment.