Skip to content

Commit

Permalink
fix: minor layout improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Maurier committed Aug 24, 2024
1 parent 1d6a07e commit 660148f
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 54 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cznethub/cznet-vue-core",
"version": "0.2.20",
"version": "0.2.21",
"private": false,
"keywords": [
"cznet",
Expand Down
28 changes: 17 additions & 11 deletions src/renderers/controls/ObjectArrayVocabularyRenderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:title="control.schema.title"
:computedLabel="computedLabel"
@show="noData && control.enabled ? addButtonClick() : null"
class="cz-fieldset"
ref="fieldset"
>
<template #actions>
Expand Down Expand Up @@ -50,13 +51,11 @@
:class="styles.arrayList.item"
:key="index"
>
<v-expansion-panel-title :class="styles.arrayList.itemHeader">
<div
v-if="!hideAvatar"
align-self="center"
px-0
class="flex-grow-0"
>
<v-expansion-panel-title
:class="styles.arrayList.itemHeader"
class="text-body-2"
>
<div v-if="!hideAvatar" class="flex-grow-0">
<v-chip aria-label="Index" class="bg-primary">
<span class="primary--text text--lighten-5">
{{ index + 1 }}
Expand All @@ -66,10 +65,8 @@

<div
v-if="appliedOptions.elementLabelProp"
:title="getItemLabel(element)"
align-self="center"
justify-self="start"
class="text-truncate flex-grow-1"
:title="getItemLabel(element)"
>
{{ getItemLabel(element) }}
</div>
Expand Down Expand Up @@ -518,7 +515,6 @@ export default defineComponent({
methods: {
getDisplayElements(index: number) {
return this.displayProps.map(prop => {
console.log(this.deepValue(this.control.data[index], prop));
return {
label:
this.deepValue(
Expand Down Expand Up @@ -753,4 +749,14 @@ export default defineComponent({
padding: 4rem;
background: #efefef;
}
.cz-fieldset {
:deep(.v-field__field) {
width: 0;
}
:deep(.v-expansion-panel-title__overlay) {
display: none;
}
}
</style>
5 changes: 4 additions & 1 deletion src/renderers/layouts/ArrayLayoutRenderer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@
:class="styles.arrayList.item"
:key="index"
>
<v-expansion-panel-title :class="styles.arrayList.itemHeader">
<v-expansion-panel-title
:class="styles.arrayList.itemHeader"
class="text-body-2"
>
<div
v-if="!hideAvatar"
align-self="center"
Expand Down
37 changes: 10 additions & 27 deletions src/schemas/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,34 +220,17 @@
"id": {
"type": "string"
},
"funder": {
"title": "Funding Organization",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"title": "Funding Organization",
"type": "string"
}
}
"number": {
"title": "Award Number",
"type": "string"
},
"award": {
"title": "Award",
"properties": {
"id": {
"type": "string"
},
"number": {
"type": "string",
"title": "Award/Grant Number"
},
"title": {
"type": "string",
"title": "Award/Grant Title"
}
}
"title": {
"title": "Award Title",
"type": "string"
},
"fundingAgency": {
"title": "Funding Agency Name",
"type": "string"
}
}
}
Expand Down
10 changes: 8 additions & 2 deletions src/schemas/test-dataset.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"grants": [
{
"id": "10.13039/100000001::650S652"
"id": "021nxhr62::1331846",
"title": "Human and Natural Forcings of Critical Zone Dynamics and Evolution at the Calhoun Critical Zone Observatory",
"number": "1331846",
"fundingAgency": "National Science Foundation"
},
{
"id": "10.13039/100000001::67S1465"
"id": "021nxhr62::1037387",
"title": "RAPID: Susquehanna Shale Hills Critical Zone Observatory - The Critical Zone in the Susquehanna River Basin: The Shale Experiment",
"number": "1037387",
"fundingAgency": "National Science Foundation"
}
]
}
15 changes: 4 additions & 11 deletions src/schemas/uischema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"scope": "#/properties/grants",
"options": {
"showSortButtons": true,
"elementLabelProp": "award.title",
"elementLabelProp": "title",
"childLabelProp": "-",
"vocabulary": {
"jsonUrl": "https://zenodo.org/api/awards?page=1&size=5000000",
Expand All @@ -13,23 +13,16 @@
"items": "hits.hits",
"value": {
"id": {
"contents": "id"
},
"award.id": {
"contents": "id",
"hidden": true
},
"award.title": {
"title": {
"contents": "title.en"
},
"award.number": {
"number": {
"contents": "number"
},
"funder.id": {
"contents": "funder.id",
"hidden": true
},
"funder.name": {
"fundingAgency": {
"contents": "funder.name"
}
}
Expand Down
2 changes: 1 addition & 1 deletion stats.html

Large diffs are not rendered by default.

0 comments on commit 660148f

Please sign in to comment.