Unverified Commit 73e838b8 authored by davelopez's avatar davelopez
Browse files

Add missing show details button for collections

If the collection has a `job_source_id` the icon to show details will be displayed
parent 988f4e58
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@
                    :item-urls="itemUrls"
                    @delete="$emit('delete')"
                    @display="onDisplay"
                    @showCollectionInfo="onShowCollectionInfo"
                    @edit="onEdit"
                    @undelete="$emit('undelete')"
                    @unhide="$emit('unhide')" />
@@ -176,6 +177,7 @@ export default {
            if (this.isCollection) {
                return {
                    edit: `collection/edit/${id}`,
                    showDetails: this.item.job_source_id ? `jobs/${this.item.job_source_id}/view` : null,
                };
            }
            return {
@@ -207,6 +209,9 @@ export default {
        onEdit() {
            backboneRoute(this.itemUrls.edit);
        },
        onShowCollectionInfo() {
            backboneRoute(this.itemUrls.showDetails);
        },
        onTags(newTags) {
            this.$emit("tag-change", this.item, newTags);
            updateContentFields(this.item, { tags: newTags });
+22 −0
Original line number Diff line number Diff line
<template>
    <span class="align-self-start btn-group">
        <!-- Special case for collections -->
        <b-button
            v-if="isCollection && canShowCollectionDetails"
            class="collection-info-btn px-1"
            title="Show Details"
            size="sm"
            variant="link"
            :href="showCollectionDetailsUrl"
            @click.prevent.stop="$emit('showCollectionInfo')">
            <icon icon="info-circle" />
        </b-button>

        <!-- Common for all content items -->
        <b-button
            v-if="isDataset"
            :disabled="displayDisabled"
@@ -88,6 +101,15 @@ export default {
        editUrl() {
            return prependPath(this.itemUrls.edit);
        },
        isCollection() {
            return !this.isDataset;
        },
        canShowCollectionDetails() {
            return !!this.itemUrls.showDetails;
        },
        showCollectionDetailsUrl() {
            return prependPath(this.itemUrls.showDetails);
        },
    },
};
</script>