+
{
- this.api().updateSize()
+ this.api() && this.api().updateSize()
})
},
diff --git a/client/web/compose/src/components/PageBlocks/ChartBase.vue b/client/web/compose/src/components/PageBlocks/ChartBase.vue
index 1f772e36e2..e8a7e03c5e 100644
--- a/client/web/compose/src/components/PageBlocks/ChartBase.vue
+++ b/client/web/compose/src/components/PageBlocks/ChartBase.vue
@@ -172,6 +172,7 @@ export default {
this.$root.$emit(`drill-down-recordList:${recordListUniqueID}`, prefilter)
} else {
const { title } = this.block
+ const { fields = [] } = this.options.drillDown.recordListOptions || {}
// Open in modal
const block = new compose.PageBlockRecordList({
@@ -179,6 +180,7 @@ export default {
blockID: `drillDown-${chartID}`,
options: {
moduleID,
+ fields,
prefilter,
presort: 'createdAt DESC',
hideRecordReminderButton: true,
diff --git a/client/web/compose/src/components/PageBlocks/ChartConfigurator.vue b/client/web/compose/src/components/PageBlocks/ChartConfigurator.vue
index 7d398fc2d6..ab3ec10ec0 100644
--- a/client/web/compose/src/components/PageBlocks/ChartConfigurator.vue
+++ b/client/web/compose/src/components/PageBlocks/ChartConfigurator.vue
@@ -18,11 +18,11 @@
@@ -32,6 +32,7 @@
-
+
+
+
+
+
+
+
+
+
@@ -61,6 +78,7 @@
import base from './base'
import { mapGetters } from 'vuex'
import { NoID } from '@cortezaproject/corteza-js'
+import ColumnPicker from 'corteza-webapp-compose/src/components/Admin/Module/Records/ColumnPicker'
export default {
i18nOptions: {
@@ -69,6 +87,10 @@ export default {
name: 'Chart',
+ components: {
+ ColumnPicker,
+ },
+
extends: base,
data () {
@@ -83,6 +105,7 @@ export default {
computed: {
...mapGetters({
charts: 'chart/set',
+ getModuleByID: 'module/getByID',
}),
selectedChart () {
@@ -93,6 +116,14 @@ export default {
return this.charts.find(({ chartID }) => chartID === this.options.chartID)
},
+ chartExternalLink () {
+ return !this.selectedChart ? 'admin.charts' : 'admin.charts.edit'
+ },
+
+ chartSelectorTooltip () {
+ return !this.selectedChart ? 'chart.openChartList' : 'chart.openInBuilder'
+ },
+
selectedChartModuleID () {
if (!this.selectedChart) return
@@ -101,6 +132,18 @@ export default {
return moduleID
},
+ selectedChartModule () {
+ if (!this.selectedChartModuleID) return
+
+ return this.getModuleByID(this.selectedChartModuleID)
+ },
+
+ selectedDrilldownFields () {
+ if (!this.selectedChart) return []
+
+ return this.options.drillDown.recordListOptions.fields
+ },
+
isDrillDownAvailable () {
if (!this.selectedChart) return
@@ -116,15 +159,16 @@ export default {
methods: {
chartSelected () {
- this.options.drillDown = {
- enabled: false,
- blockID: '',
- }
+ this.block.resetDrillDown()
},
getOptionKey ({ chartID }) {
return chartID
},
+
+ onUpdateFields (fields) {
+ this.options.drillDown.recordListOptions.fields = fields.map(({ fieldID }) => fieldID)
+ },
},
}
diff --git a/client/web/compose/src/components/PageBlocks/Configurator.vue b/client/web/compose/src/components/PageBlocks/Configurator.vue
index 22fd4390c6..bc4b59506a 100644
--- a/client/web/compose/src/components/PageBlocks/Configurator.vue
+++ b/client/web/compose/src/components/PageBlocks/Configurator.vue
@@ -115,6 +115,17 @@
>
{{ $t('general.border.show') }}
+
+
+ {{ $t('general.globalBlock.label') }}
+
@@ -166,6 +177,97 @@
/>
+
+
+
+
+ {{ $t('general.visibility.label') }}
+
+
+
+
+ {{ $t('general.visibility.condition.label') }}
+
+
+
+
+
+ ƒ
+
+
+
+
+
+ ?
+
+
+
+
+
+ record.values.fieldName
+ user.(userID/email...)
+ screen.(width/height)
+ isView/isCreate/isEdit
+ user.userID == record.values.createdBy
+ screen.width < 1024
+
+
+
+ user.(userID/email...)
+ screen.(width/height)
+ user.email == "test@mail.com"
+ screen.width < 1024
+
+
+
+
+
+
+
+
+
@@ -212,6 +314,23 @@ export default {
type: compose.Page,
required: true,
},
+
+ namespace: {
+ type: compose.Namespace,
+ required: true,
+ },
+ },
+
+ data () {
+ return {
+ roles: {
+ processing: false,
+ options: [],
+ },
+ abortableRequests: [],
+ initialBlockState: undefined,
+ initialBlockID: undefined,
+ }
},
computed: {
@@ -243,6 +362,41 @@ export default {
{ value: 'fullscreen', text: this.$t('general.magnifyOptions.fullscreen') },
]
},
+
+ isRecordPage () {
+ return this.page && this.page.moduleID !== NoID
+ },
+
+ visibilityDocumentationURL () {
+ // eslint-disable-next-line no-undef
+ const [year, month] = VERSION.split('.')
+ return `https://docs.cortezaproject.org/corteza-docs/${year}.${month}/integrator-guide/compose-configuration/page-layouts.html#visibility-condition`
+ },
+
+ currentRoles: {
+ get () {
+ if (!this.block.meta.visibility.roles) {
+ return []
+ }
+
+ return this.block.meta.visibility.roles
+ },
+
+ set (roles) {
+ this.$set(this.block.meta.visibility, 'roles', roles)
+ },
+ },
+ },
+
+ created () {
+ this.initialBlockState = this.block.meta.namespaceID
+ this.initialBlockID = this.block.blockID
+ this.fetchRoles()
+ },
+
+ beforeDestroy () {
+ this.abortRequests()
+ this.setDefaultValues()
},
methods: {
@@ -250,6 +404,46 @@ export default {
// If value is less than 5 but greater than 0 make it 5. Otherwise value stays the same.
this.block.options.refreshRate = e.target.value < 5 && e.target.value > 0 ? 5 : e.target.value
},
+
+ fetchRoles () {
+ this.roles.processing = true
+
+ const { response, cancel } = this.$SystemAPI
+ .roleListCancellable({})
+
+ this.abortableRequests.push(cancel)
+
+ response()
+ .then(({ set: roles = [] }) => {
+ this.roles.options = roles.filter(({ meta }) => !(meta.context && meta.context.resourceTypes))
+ }).finally(() => {
+ this.roles.processing = false
+ })
+ },
+
+ abortRequests () {
+ this.abortableRequests.forEach((cancel) => {
+ cancel()
+ })
+ },
+
+ setDefaultValues () {
+ this.roles = {
+ processing: false,
+ options: [],
+ }
+ this.abortableRequests = []
+ },
+
+ updateGlobalState (value) {
+ this.block.blockID = this.initialBlockState === value ? this.initialBlockID : NoID
+
+ if (value) {
+ this.block.meta.namespaceID = value
+ } else {
+ this.block.meta.namespaceID = undefined
+ }
+ },
},
}
diff --git a/client/web/compose/src/components/PageBlocks/MetricBase.vue b/client/web/compose/src/components/PageBlocks/MetricBase.vue
index 55d163ad94..9938aeb76c 100644
--- a/client/web/compose/src/components/PageBlocks/MetricBase.vue
+++ b/client/web/compose/src/components/PageBlocks/MetricBase.vue
@@ -222,12 +222,14 @@ export default {
} else {
// Open in modal
const metricID = `${this.block.blockID}-${name.replace(/\s+/g, '-').toLowerCase()}-${moduleID}-${metricIndex}`
+ const { fields = [] } = this.options.metrics[metricIndex].drillDown.recordListOptions || {}
const block = new compose.PageBlockRecordList({
title: name || this.$t('metric.metricDrillDown'),
blockID: `drillDown-${metricID}`,
options: {
moduleID,
+ fields,
prefilter: filter,
presort: 'createdAt DESC',
hideRecordReminderButton: true,
diff --git a/client/web/compose/src/components/PageBlocks/MetricConfigurator/index.vue b/client/web/compose/src/components/PageBlocks/MetricConfigurator/index.vue
index 52198a245f..88c6e303ba 100644
--- a/client/web/compose/src/components/PageBlocks/MetricConfigurator/index.vue
+++ b/client/web/compose/src/components/PageBlocks/MetricConfigurator/index.vue
@@ -166,7 +166,7 @@
-
diff --git a/client/web/compose/src/components/PageBlocks/RecordListBase.vue b/client/web/compose/src/components/PageBlocks/RecordListBase.vue
index b35d86653e..f84d269de6 100644
--- a/client/web/compose/src/components/PageBlocks/RecordListBase.vue
+++ b/client/web/compose/src/components/PageBlocks/RecordListBase.vue
@@ -321,7 +321,7 @@
:key="`${index}${item.r.recordID}`"
:class="{ 'pointer': !(options.editable && editing), }"
:variant="inlineEditing && item.r.deletedAt ? 'warning' : ''"
- @click="handleRowClicked(item)"
+ @click="handleRowClick(item)"
>
+
+
+
+
+
+
+
+ {{ $t('recordList.record.configureNonWrappingFelids') }}
+
+
+
@@ -296,18 +322,20 @@