Skip to content

Commit

Permalink
Merge pull request #124 from OpenTechStrategies/123-toggleable-metadata
Browse files Browse the repository at this point in the history
123 toggleable metadata
  • Loading branch information
hminsky2002 authored Oct 4, 2024
2 parents 109adac + 7b66c97 commit d3cc6e6
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 20 deletions.
4 changes: 2 additions & 2 deletions archesdataviewer/static/vite_build/.vite/manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"index.html": {
"file": "assets/index-D59f8yLq.js",
"file": "assets/index-BQr2MO2B.js",
"name": "index",
"src": "index.html",
"isEntry": true,
"css": [
"assets/index-BIL9014k.css"
"assets/index-BzCkL01G.css"
]
}
}

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions archesdataviewer/static/vite_build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Arches Data Viewer</title>
<script type="module" crossorigin src="/assets/index-D59f8yLq.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BIL9014k.css">
<script type="module" crossorigin src="/assets/index-BQr2MO2B.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BzCkL01G.css">
</head>
<body>
<div id="app"></div>
Expand Down
32 changes: 27 additions & 5 deletions front-end/src/components/ResourceDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,32 @@
</div>

<slot name="items"></slot>

<div v-if="$slots['more-by-artist']" class="resource-detail-more-by-artist">
<slot name="more-by-artist"></slot>
</div>

<div class="resource-detail-metadata">
<button type="button" class="toggle-metadata" @click="toggleMetadata">
<span>{{ showMetadata ? 'Hide arches metadata' : 'Show arches metadata' }}</span>
</button>

<div :class="['resource-detail-metadata', { collapsed: !showMetadata }]">
<div class="resource-detail-metadata-title">Arches metadata:</div>
<div class="resource-detail-metadata-content">
<slot name="metadata"></slot>
</div>
</div>
</template>

<script setup lang="ts"></script>
<script setup lang="ts">
import { ref } from 'vue';
const showMetadata = ref<boolean>(false);
const toggleMetadata = () => {
showMetadata.value = !showMetadata.value;
};
</script>

<style scoped>
.resource-detail-header {
Expand Down Expand Up @@ -50,13 +63,22 @@
}
.resource-detail-metadata {
display: flex;
flex-direction: column;
gap: var(--wac--semantic-spacing--quartary);
overflow: hidden;
max-height: 50px;
transition: max-height 0.5s ease;
color: var(--wac--color--gray);
}
.resource-detail-metadata.collapsed {
max-height: 0px;
}
.resource-detail-metadata-title {
font-weight: var(--wac--font-weight--bold);
}
.toggle-metadata {
display: inline-block;
max-width: 180px;
}
</style>
1 change: 0 additions & 1 deletion front-end/src/components/ResourcePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
/>
</template>
<template #metadata>
<div>Graph ID: {{ props.resource.graph_id }}</div>
<div>
Resource Instance ID:
<a :href="`${archesUrl}/report/${props.resource.resourceinstanceid}`">{{
Expand Down

0 comments on commit d3cc6e6

Please sign in to comment.