Skip to content

Commit

Permalink
Add message to DLP when assets summary is being recalculated
Browse files Browse the repository at this point in the history
  • Loading branch information
mvandenburgh committed Jan 30, 2023
1 parent c45a09a commit 165c4e5
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions web/src/components/DLP/OverviewTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,20 @@
</MetadataCard>

<v-card
v-if="assetSummary && Object.keys(assetSummary) && Object.keys(assetSummary).length"
v-if="assetSummary"
outlined
>
<v-card-title class="font-weight-regular">
<v-icon class="mr-3 grey--text text--lighten-1">
<v-progress-circular
v-if="assetSummaryBeingComputed"
class="mr-3"
size="20"
indeterminate
/>
<v-icon
v-else
class="mr-3 grey--text text--lighten-1"
>
mdi-clipboard-list
</v-icon>
Assets Summary
Expand All @@ -122,8 +131,21 @@
:style="`column-count: ${assetSummaryColumnCount};`"
class="px-3 ml-2"
>
<div
v-if="assetSummaryBeingComputed"
class="text-subtitle-2"
>
The assets summary is being computed, please wait.
</div>
<div
v-else-if="!assetSummary || !Object.keys(assetSummary).length"
class="text-subtitle-2"
>
Assets summary computation failed. This dandiset does not contain any assets.
</div>
<div
v-for="([type, items], i) in Object.entries(assetSummary)"
v-else
:key="i"
>
<div
Expand Down Expand Up @@ -210,6 +232,7 @@ import {
} from 'vue';
import MetadataCard from '@/components/DLP/MetadataCard.vue';
import { useDandisetStore } from '@/stores/dandiset';
// Asset summary fields to hide
const ASSET_SUMMARY_BLACKLIST = new Set([
Expand Down Expand Up @@ -248,6 +271,9 @@ export default defineComponent({
setup(props) {
const $vuetify = computed(() => getCurrentInstance()?.proxy.$vuetify);
const store = useDandisetStore();
const currentDandiset = computed(() => store.dandiset);
const contributors = computed(
() => props.meta.contributor?.filter(
(contributor) => !!(contributor.includeInCitation) && !!(contributor.schemaKey === 'Person'),
Expand Down Expand Up @@ -290,6 +316,8 @@ export default defineComponent({
: Math.min(Object.keys(assetSummary.value).length, 3)),
);
const assetSummaryBeingComputed = computed<boolean>(() => currentDandiset.value?.status === 'Pending');
const contactPeople = computed(
() => new Set(contributors.value
.filter((contributor) => contributor.roleName?.includes('dcite:ContactPerson'))
Expand All @@ -303,6 +331,7 @@ export default defineComponent({
associatedProjects,
assetSummary,
assetSummaryColumnCount,
assetSummaryBeingComputed,
contactPeople,
isURL,
};
Expand Down

0 comments on commit 165c4e5

Please sign in to comment.