Merge branch 'master' into view-calculation-sort-by-calculations

This commit is contained in:
Sam Rose 2024-10-11 15:37:23 +01:00 committed by GitHub
commit 303ad83f75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 57 deletions

View File

@ -1,6 +1,6 @@
{ {
"$schema": "node_modules/lerna/schemas/lerna-schema.json", "$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "2.32.16", "version": "2.32.17",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*", "packages/*",

View File

@ -27,9 +27,7 @@
let candidateIndex let candidateIndex
let lastSearchId let lastSearchId
let searching = false let searching = false
let container
let anchor let anchor
let relationshipFields
$: fieldValue = parseValue(value) $: fieldValue = parseValue(value)
$: oneRowOnly = schema?.relationshipType === "one-to-many" $: oneRowOnly = schema?.relationshipType === "one-to-many"
@ -56,12 +54,6 @@
return acc return acc
}, {}) }, {})
$: showRelationshipFields =
relationshipFields &&
Object.keys(relationshipFields).length &&
focused &&
!isOpen
const parseValue = value => { const parseValue = value => {
if (Array.isArray(value) && value.every(x => x?._id)) { if (Array.isArray(value) && value.every(x => x?._id)) {
return value return value
@ -242,14 +234,6 @@
return value return value
} }
const displayRelationshipFields = relationship => {
relationshipFields = relationFields[relationship._id]
}
const hideRelationshipFields = () => {
relationshipFields = undefined
}
onMount(() => { onMount(() => {
api = { api = {
focus: open, focus: open,
@ -269,7 +253,7 @@
style="--color:{color};" style="--color:{color};"
bind:this={anchor} bind:this={anchor}
> >
<div class="container" bind:this={container}> <div class="container">
<div <div
class="values" class="values"
class:wrap={editable || contentLines > 1} class:wrap={editable || contentLines > 1}
@ -281,9 +265,7 @@
<div <div
class="badge" class="badge"
class:extra-info={!!relationFields[relationship._id]} class:extra-info={!!relationFields[relationship._id]}
on:mouseover={() => displayRelationshipFields(relationship)}
on:focus={() => {}} on:focus={() => {}}
on:mouseleave={() => hideRelationshipFields()}
> >
<span> <span>
{readable( {readable(
@ -358,21 +340,6 @@
</GridPopover> </GridPopover>
{/if} {/if}
{#if showRelationshipFields}
<GridPopover {anchor} minWidth={300} maxWidth={400}>
<div class="relationship-fields">
{#each Object.entries(relationshipFields) as [fieldName, fieldValue]}
<div class="relationship-field-name">
{fieldName}
</div>
<div class="relationship-field-value">
{fieldValue}
</div>
{/each}
</div>
</GridPopover>
{/if}
<style> <style>
.wrapper { .wrapper {
flex: 1 1 auto; flex: 1 1 auto;
@ -539,25 +506,4 @@
.search :global(.spectrum-Form-item) { .search :global(.spectrum-Form-item) {
flex: 1 1 auto; flex: 1 1 auto;
} }
.relationship-fields {
margin: var(--spacing-m) var(--spacing-l);
display: grid;
grid-template-columns: minmax(auto, 50%) auto;
grid-row-gap: var(--spacing-m);
grid-column-gap: var(--spacing-m);
}
.relationship-field-name {
text-transform: uppercase;
color: var(--spectrum-global-color-gray-600);
font-size: var(--font-size-xs);
}
.relationship-field-value {
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
line-clamp: 3;
}
</style> </style>

@ -1 +1 @@
Subproject commit aca9828117bb97f54f40ee359f1a3f6e259174e7 Subproject commit fc4c7f4925139af078480217965c3d6338dc0a7f