Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dataset column information redesign #4582

Merged
merged 60 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
2274f6f
prepare new layout
shawnyama Aug 21, 2024
84f86c9
Merge branch 'main' into dataset-enrich-update
shawnyama Aug 22, 2024
c78c452
Merge branch 'main' into dataset-enrich-update
shawnyama Aug 22, 2024
1f06753
Merge branch 'main' into dataset-enrich-update
shawnyama Aug 23, 2024
dc33be4
migrate description to parent
shawnyama Aug 23, 2024
9ea770f
new layout
shawnyama Aug 23, 2024
4ebd5ba
update drilldown
shawnyama Aug 23, 2024
9aa91d2
Merge branch 'main' into dataset-enrich-update
shawnyama Aug 23, 2024
5814a92
Merge branch 'main' into dataset-enrich-update
shawnyama Aug 23, 2024
3ad5d96
new enrich modal
shawnyama Aug 23, 2024
5625ec9
type import
shawnyama Aug 23, 2024
78aeef4
imort enum
shawnyama Aug 23, 2024
e6fab4e
imort enum
shawnyama Aug 23, 2024
d8f1ec8
accept null in service functions, new radio selection
shawnyama Aug 23, 2024
14d3616
simplify prop
shawnyama Aug 26, 2024
f8916e8
finsh enrich modal
shawnyama Aug 26, 2024
7d613d1
data column comp
shawnyama Aug 26, 2024
530d40f
resolve
shawnyama Aug 26, 2024
cc68fbb
no need to accept null
shawnyama Aug 26, 2024
5614e84
type
shawnyama Aug 26, 2024
0d8a0ad
comment
shawnyama Aug 26, 2024
a7d02b4
Merge branch 'dataset-enrich-update' into data-column-info
shawnyama Aug 26, 2024
48e4c7b
Merge branch 'main' into dataset-enrich-update
shawnyama Aug 26, 2024
ad124ff
Merge branch 'dataset-enrich-update' into data-column-info
shawnyama Aug 26, 2024
7c0b40c
Merge branch 'main' into data-column-info
shawnyama Aug 27, 2024
a8d5108
Merge branch 'main' into data-column-info
shawnyama Aug 28, 2024
bcb5e41
await for enrichment
shawnyama Aug 28, 2024
2c3324c
Merge branch 'main' into data-column-info
shawnyama Aug 28, 2024
a00eee7
Merge branch 'main' into data-column-info
shawnyama Aug 28, 2024
9ba1235
rm ancient uselessness
shawnyama Aug 28, 2024
5afb2e4
col info editing works
shawnyama Aug 29, 2024
1b06e43
Merge branch 'main' into data-column-info
shawnyama Aug 29, 2024
067b2df
revert accidnet
shawnyama Aug 29, 2024
31eff26
Merge branch 'main' into data-column-info
shawnyama Aug 29, 2024
96cf28c
Merge branch 'main' into data-column-info
shawnyama Aug 29, 2024
62b22ad
edit works except for concept
shawnyama Aug 30, 2024
c991e01
fix import
shawnyama Aug 30, 2024
37fb58b
Merge branch 'main' into data-column-info
shawnyama Aug 30, 2024
d99472f
edit a concept
shawnyama Aug 30, 2024
55dba92
lock on overwriting
shawnyama Aug 30, 2024
9f14af8
Merge branch 'data-column-info' of https://github.com/DARPA-ASKEM/ter…
shawnyama Aug 30, 2024
841f7ab
Merge branch 'main' into data-column-info
shawnyama Aug 30, 2024
6fec5ac
commetn
shawnyama Aug 30, 2024
6e99588
linter
shawnyama Aug 30, 2024
117ea44
Merge branch 'data-column-info' of https://github.com/DARPA-ASKEM/ter…
shawnyama Aug 30, 2024
7f907f8
linter
shawnyama Aug 30, 2024
228a3a1
resolve
shawnyama Sep 9, 2024
9333919
Merge branch 'main' into data-column-info
shawnyama Sep 9, 2024
e638642
comemnt
shawnyama Sep 9, 2024
fe2442a
explain await
shawnyama Sep 9, 2024
bd8b26f
create metadata obj if undefined
shawnyama Sep 9, 2024
027e826
typecheck fix
shawnyama Sep 9, 2024
a0ad5cf
Merge branch 'main' into data-column-info
shawnyama Sep 9, 2024
1eefbab
enable regular string input, will add to model parts in another pr
shawnyama Sep 9, 2024
0baeb3d
rm log
shawnyama Sep 9, 2024
d6d4d8d
Merge branch 'main' into data-column-info
shawnyama Sep 9, 2024
75e0864
rm async
shawnyama Sep 9, 2024
fd85f73
Merge branch 'data-column-info' of https://github.com/DARPA-ASKEM/ter…
shawnyama Sep 9, 2024
f91cc69
Merge branch 'main' into data-column-info
shawnyama Sep 9, 2024
a3abee2
Merge branch 'main' into data-column-info
shawnyama Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
padding-right: var(--gap-1-5);
font-size: var(--font-caption);
align-self: center;
text-wrap: nowrap;
};
& > main {
display: flex;
Expand Down
18 changes: 9 additions & 9 deletions packages/client/hmi-client/src/components/asset/tera-asset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ nav {
flex-direction: column;
width: fit-content;
gap: 1rem;
padding: var(--gap) var(--gap-large) 0 var(--gap-small);
padding: var(--gap) var(--gap-large) 0 var(--gap-2);
/* Responsible for stickiness */
position: sticky;
top: 0;
Expand All @@ -270,8 +270,8 @@ header {
flex-direction: column;
justify-content: space-between;
height: fit-content;
padding: var(--gap-small) var(--gap);
gap: var(--gap-small);
padding: var(--gap-2) var(--gap);
gap: var(--gap-2);
background-color: var(--surface-0);
backdrop-filter: blur(6px);
overflow: hidden;
Expand Down Expand Up @@ -305,7 +305,7 @@ header.overview-banner section {
}

header.with-tabs {
padding: var(--gap-small) var(--gap) 0;
padding: var(--gap-2) var(--gap) 0;
}

.overview-banner {
Expand Down Expand Up @@ -337,7 +337,7 @@ header section:deep(> input) {
}

.authors i {
margin-right: var(--gap-small);
margin-right: var(--gap-2);
}

.authors ~ * {
Expand All @@ -352,7 +352,7 @@ header section:deep(> input) {
header aside {
display: flex;
flex-direction: row;
gap: var(--gap-small);
gap: var(--gap-2);
}

.shadow {
Expand All @@ -363,17 +363,17 @@ header aside {

/* Affects child components put in the slot*/
main:deep(.p-accordion) {
margin: var(--gap-small);
margin: var(--gap-2);
}

main:deep(.p-accordion-content) {
padding-bottom: var(--gap-small);
padding-bottom: var(--gap-2);
}

main:deep(.p-accordion-content ul) {
display: flex;
flex-direction: column;
gap: var(--gap-small);
gap: var(--gap-2);
list-style: none;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
<template>
<div class="flex gap-3">
<section class="entries">
<h6>{{ column.symbol }}</h6>
<span class="name">
<template v-if="featureConfig.isPreview">{{ column.name }}</template>
<tera-input-text
v-else
placeholder="Add a name"
:model-value="column.name ?? ''"
@update:model-value="$emit('update-column', { key: 'name', value: $event })"
/>
</span>
<span class="unit">
<template v-if="featureConfig.isPreview"><label>Unit</label>{{ column.unit }}</template>
<tera-input-text
v-else
label="Unit"
placeholder="Add a unit"
:characters-to-reject="[' ']"
:model-value="column.unit ?? ''"
@update:model-value="$emit('update-column', { key: 'unit', value: $event })"
/>
</span>
<span class="data-type">
<label>Data type</label>
<template v-if="featureConfig.isPreview">{{ column.dataType }}</template>
<Dropdown
v-else
placeholder="Select a data type"
:model-value="column.dataType ?? ''"
@update:model-value="$emit('update-column', { key: 'dataType', value: $event })"
:options="Object.values(ColumnType)"
/>
</span>
<span v-if="showConcept" class="concept">
<label>Concept</label>
<template v-if="featureConfig.isPreview">{{ query }}</template>
<AutoComplete
v-else
size="small"
placeholder="Search concepts"
v-model="query"
:suggestions="results"
optionLabel="name"
@complete="async () => (results = await searchCuriesEntities(query))"
@item-select="
$emit('update-column', { key: 'concept', value: { curie: $event.value.curie, name: $event.value.name } })
"
@keyup.enter="applyValidConcept"
@blur="applyValidConcept"
/>
</span>
<span class="description">
<template v-if="featureConfig.isPreview">{{ column.description }}</template>
<tera-input-text
v-else
placeholder="Add a description"
:model-value="column.description ?? ''"
@update:model-value="$emit('update-column', { key: 'description', value: $event })"
/>
</span>
</section>
<tera-boxplot class="flex-1" v-if="column.stats" :stats="column.stats" />
</div>
</template>

<script setup lang="ts">
/* Copied the structure of tera-model-parts.vue */
import { ref, computed, watch } from 'vue';
import TeraInputText from '@/components/widgets/tera-input-text.vue';
import TeraBoxplot from '@/components/widgets/tera-boxplot.vue';
import AutoComplete from 'primevue/autocomplete';
import Dropdown from 'primevue/dropdown';
import { type DKG, ColumnType, type Grounding } from '@/types/Types';
import { searchCuriesEntities } from '@/services/concept';
import type { FeatureConfig } from '@/types/common';

type ColumnInfo = {
symbol: string;
dataType?: ColumnType;
description?: string;
grounding?: Grounding;
// Metadata
unit?: string;
name?: string;
shawnyama marked this conversation as resolved.
Show resolved Hide resolved
stats?: any;
};

const props = defineProps<{
column: ColumnInfo;
featureConfig: FeatureConfig;
}>();

const emit = defineEmits(['update-column']);

const query = ref('');
const results = ref<DKG[]>([]);

// If we are in preview mode and there is no content, show nothing
const showConcept = computed(() => !(props.featureConfig.isPreview && !query.value));

// Used if an option isn't selected from the Autocomplete suggestions but is typed in regularly
function applyValidConcept() {
// Allows to empty the concept
if (query.value === '') {
emit('update-column', { key: 'concept', value: { curie: '', name: '' } });
}
// If what was typed was one of the results then choose that result
else {
const concept = results.value.find((result) => result.name === query.value);
if (concept) {
emit('update-column', { key: 'concept', value: { curie: concept.curie, name: concept.name } });
}
}
}

watch(
() => props.column.grounding?.identifiers,
async (identifiers) => {
// console.log(identifiers); // FIXME: Multiple identifiers are held in here after enrichment! Designs have to be updated to handle more.
shawnyama marked this conversation as resolved.
Show resolved Hide resolved
query.value = identifiers?.[0].name ?? ''; // Just show first one for now.
},
{ immediate: true }
);
</script>

<style scoped>
section.entries {
display: grid;
grid-template-areas:
'symbol name unit data-type . concept'
'expression expression expression expression expression expression'
'description description description description description description';
grid-template-columns: max-content max-content max-content auto max-content;
grid-auto-flow: dense;
overflow: hidden;
gap: var(--gap-2);
align-items: center;
font-size: var(--font-caption);
overflow: auto;
width: 85%;

& > *:empty {
display: none;
}
}

label {
color: var(--text-color-subdued);
text-wrap: nowrap;
}

h6 {
grid-area: symbol;
justify-self: center;
&::after {
content: '|';
color: var(--text-color-light);
margin-left: var(--gap-2);
}
}

.name {
grid-area: name;
}

.description {
grid-area: description;
color: var(--text-color-subdued);
}

.unit {
grid-area: unit;
}

.data-type {
grid-area: data-type;
}

.unit,
.data-type {
max-width: 15rem;
}

.expression {
grid-area: expression;
font-size: var(--font-body-small);
}

.concept {
grid-area: concept;
margin-left: auto;
}

.unit,
.data-type,
.concept {
display: flex;
align-items: center;
gap: var(--gap-1);
}

:deep(.p-dropdown > span),
:deep(.p-autocomplete-input) {
padding: var(--gap-1) var(--gap-2);
}
</style>
Loading
Loading