Skip to content

Commit

Permalink
chore: upgrade to latest KDK
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Nov 27, 2024
1 parent 840b709 commit e4e3198
Show file tree
Hide file tree
Showing 13 changed files with 317 additions and 328 deletions.
156 changes: 81 additions & 75 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,35 +750,37 @@ module.exports = {
mode: 'default'
},
rightPane: {
content: {
'user-layers': [
catalogTabbar(['user-layers', 'user-views', 'catalog-layers'], 'user-layers'),
{ id: 'user-layers', component: 'catalog/KLayersPanel',
layers: ':layers', layerCategories: ':layerCategories',
layersFilter: { scope: { $in: ['user', 'activity'] } }, layerCategoriesFilter: { _id: { $exists: true } } },
{ component: 'QSpace' },
{ id: 'catalog-footer', component: 'KPanel', content: [{
id: 'manage-layer-categories',
icon: 'las la-cog',
label: 'KLayerCategories.LAYER_CATEGORIES_LABEL',
route: { name: 'manage-layer-categories' }
}],
class: 'justify-center'
}
],
'user-views': [
catalogTabbar(['user-layers', 'user-views', 'catalog-layers'], 'user-views'),
{ id: 'user-views', component: 'catalog/KViewsPanel', suspense: true },
],
'catalog-layers': [
catalogTabbar(['user-layers', 'user-views', 'catalog-layers'], 'catalog-layers'),
{ id: 'catalog-layers', component: 'catalog/KLayersPanel',
layers: ':layers', layerCategories: ':layerCategories',
layersFilter: { scope: { $nin: ['user', 'system', 'activity'] } }, layerCategoriesFilter: { _id: { $exists: false } },
forecastModels: ':forecastModels' }
]
},
mode: 'user-layers'
content: [{
component: 'KTab',
content: {
'user-layers': [
{ id: 'user-layers', component: 'catalog/KLayersPanel',
layers: ':layers', layerCategories: ':layerCategories',
layersFilter: { scope: { $in: ['user', 'activity'] } }, layerCategoriesFilter: { _id: { $exists: true } } },
{ component: 'QSpace' },
{ id: 'catalog-footer', component: 'KPanel', content: [{
id: 'manage-layer-categories',
icon: 'las la-cog',
label: 'KLayerCategories.LAYER_CATEGORIES_LABEL',
route: { name: 'manage-layer-categories' }
}],
class: 'justify-center'
}
],
'user-views': [
{ id: 'user-views', component: 'catalog/KViewsPanel', suspense: true },
],
'catalog-layers': [
{ id: 'catalog-layers', component: 'catalog/KLayersPanel',
layers: ':layers', layerCategories: ':layerCategories',
layersFilter: { scope: { $nin: ['user', 'system', 'activity'] } }, layerCategoriesFilter: { _id: { $exists: false } },
forecastModels: ':forecastModels' }
]
},
labels: ['LAYERS_LABEL', 'VIEWS_LABEL', 'CATALOG_LABEL'],
mode: 'user-layers'
}],
state: 'responsive'
},
bottomPane: {
content: [
Expand Down Expand Up @@ -842,28 +844,31 @@ module.exports = {
mode: 'history'
},
rightPane: {
content: {
'history': [],
'user-layers': [
catalogTabbar(['user-layers', 'user-views', 'catalog-layers'], 'user-layers'),
{ id: 'user-layers', component: 'catalog/KLayersPanel',
layers: ':layers', layerCategories: ':layerCategories',
layersFilter: { scope: { $in: ['user', 'activity'] } }, layerCategoriesFilter: { _id: { $exists: true } } }
],
'user-views': [
catalogTabbar(['user-layers', 'user-views', 'catalog-layers'], 'user-views'),
{ id: 'user-views', component: 'catalog/KViewsPanel', suspense: true },
],
'catalog-layers': [
catalogTabbar(['user-layers', 'user-views', 'catalog-layers'], 'catalog-layers'),
{ id: 'catalog-layers', component: 'catalog/KLayersPanel',
layers: ':layers', layerCategories: ':layerCategories',
layersFilter: { scope: { $nin: ['user', 'system', 'activity'] } }, layerCategoriesFilter: { _id: { $exists: false } },
forecastModels: ':forecastModels' }
],
'chart': []
},
mode: 'history'
content: [{
component: 'KTab',
content: {
'history': [],
'user-layers': [
{ id: 'user-layers', component: 'catalog/KLayersPanel',
layers: ':layers', layerCategories: ':layerCategories',
layersFilter: { scope: { $in: ['user', 'activity'] } }, layerCategoriesFilter: { _id: { $exists: true } } }
],
'user-views': [
{ id: 'user-views', component: 'catalog/KViewsPanel', suspense: true },
],
'catalog-layers': [
{ id: 'catalog-layers', component: 'catalog/KLayersPanel',
layers: ':layers', layerCategories: ':layerCategories',
layersFilter: { scope: { $nin: ['user', 'system', 'activity'] } }, layerCategoriesFilter: { _id: { $exists: false } },
forecastModels: ':forecastModels' }
],
'chart': []
},
mode: 'history',
labels: ['HISTORY', 'LAYERS_LABEL', 'VIEWS_LABEL', 'CATALOG_LABEL', 'CHART'],
mode: 'history'
}],
state: 'responsive'
},
bottomPane: {
content: [
Expand Down Expand Up @@ -1190,30 +1195,31 @@ module.exports = {
mode: 'default'
},
rightPane: {
content: {
'event-participants': [
catalogTabbar(['user-layers', 'user-views', 'catalog-layers', 'event-participants'], 'event-participants'),
{ id: 'event-participants', component: 'EventActivityPanel', event: ':event', participants: ':participants' }
],
'user-layers': [
catalogTabbar(['user-layers', 'user-views', 'catalog-layers', 'event-participants'], 'user-layers'),
{ id: 'user-layers', component: 'catalog/KLayersPanel',
layers: ':layers', layerCategories: ':layerCategories',
layersFilter: { scope: { $in: ['user', 'activity'] } }, layerCategoriesFilter: { _id: { $exists: true } } }
],
'user-views': [
catalogTabbar(['user-layers', 'user-views', 'catalog-layers', 'event-participants'], 'user-views'),
{ id: 'user-views', component: 'catalog/KViewsPanel', suspense: true },
],
'catalog-layers': [
catalogTabbar(['user-layers', 'user-views', 'catalog-layers', 'event-participants'], 'catalog-layers'),
{ id: 'catalog-layers', component: 'catalog/KLayersPanel',
layers: ':layers', layerCategories: ':layerCategories',
layersFilter: { scope: { $nin: ['user', 'system', 'activity'] } }, layerCategoriesFilter: { _id: { $exists: false } },
forecastModels: ':forecastModels' }
]
},
mode: 'event-participants'
content: [{
component: 'KTab',
content: {
'event-participants': [
{ id: 'event-participants', component: 'EventActivityPanel', event: ':event', participants: ':participants' }
],
'user-layers': [
{ id: 'user-layers', component: 'catalog/KLayersPanel',
layers: ':layers', layerCategories: ':layerCategories',
layersFilter: { scope: { $in: ['user', 'activity'] } }, layerCategoriesFilter: { _id: { $exists: true } } }
],
'user-views': [
{ id: 'user-views', component: 'catalog/KViewsPanel', suspense: true },
],
'catalog-layers': [
{ id: 'catalog-layers', component: 'catalog/KLayersPanel',
layers: ':layers', layerCategories: ':layerCategories',
layersFilter: { scope: { $nin: ['user', 'system', 'activity'] } }, layerCategoriesFilter: { _id: { $exists: false } },
forecastModels: ':forecastModels' }
],
mode: 'event-participants'
},
labels: ['EventActivityPanel.PARTICIPANTS_LABEL', 'LAYERS_LABEL', 'VIEWS_LABEL', 'CATALOG_LABEL'],
}],
state: 'responsive'
},
bottomPane: {
content: [
Expand Down
1 change: 0 additions & 1 deletion src/boot/kdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export default async ({ app }) => {
app.component('KDialog', await kdkCoreUtils.loadComponent('KDialog'))
app.component('KMenu', await kdkCoreUtils.loadComponent('menu/KMenu'))
app.component('KForm', await kdkCoreUtils.loadComponent('form/KForm'))
app.component('KList', await kdkCoreUtils.loadComponent('collection/KList'))
app.component('KGrid', await kdkCoreUtils.loadComponent('collection/KGrid'))
app.component('KBoard', await kdkCoreUtils.loadComponent('collection/KBoard'))
app.component('KHistory', await kdkCoreUtils.loadComponent('collection/KHistory'))
Expand Down
132 changes: 65 additions & 67 deletions src/components/ArchivedEventsActivity.vue
Original file line number Diff line number Diff line change
@@ -1,76 +1,74 @@
<template>
<KPage :padding="!showMap" @content-resized="onPageContentResized">
<template v-slot:page-content>
<q-page-sticky v-show="showMap && heatmap" position="bottom" :offset="[0, 16]" style="z-index: 1">
<div class="row">
<div class="col-12">
<q-slider id="heatmap-radius" v-model="heatmapRadius" :min="1" :max="100" :step="1"
label-always :label-value="$t('ArchivedEventsActivity.HEATMAP_RADIUS_LABEL') + ': ' + heatmapRadius + ' Kms'" @change="onHeatmapRadius"></q-slider>
</div>
<q-page-sticky v-show="showMap && heatmap" position="bottom" :offset="[0, 16]" style="z-index: 1">
<div class="row">
<div class="col-12">
<q-slider id="heatmap-radius" v-model="heatmapRadius" :min="1" :max="100" :step="1"
label-always :label-value="$t('ArchivedEventsActivity.HEATMAP_RADIUS_LABEL') + ': ' + heatmapRadius + ' Kms'" @change="onHeatmapRadius"></q-slider>
</div>
</q-page-sticky>
<!--
Events history: switch append-items on to activate infinite scroll
-->
<div v-if="showHistory && height" class="row justify-center q-pl-lg q-pr-none">
<KHistory
style="padding-top: 80px;"
id="history"
service="archived-events"
:base-query="baseQuery"
:filter-query="filterQuery"
:renderer="renderer"
date-field="createdAt"
:contextId="contextId"
:list-strategy="'smart'"
:width="width"
:height="height - 124"
>
<template v-slot:empty-history>
<div class="absolute-center">
<KStamp icon="las la-exclamation-circle" icon-size="3rem" :text="$t('KHistory.EMPTY_HISTORY')" />
</div>
</template>
</KHistory>
</div>
<!--
Events map
-->
<div v-show="showMap">
<div :ref="configureMap" :style="viewStyle">
<q-resize-observer @resize="onMapResized" />
</div>
</q-page-sticky>
<!--
Events history: switch append-items on to activate infinite scroll
-->
<div v-if="showHistory && height" class="row justify-center q-pl-lg q-pr-none">
<KHistory
style="padding-top: 80px;"
id="history"
service="archived-events"
:base-query="baseQuery"
:filter-query="filterQuery"
:renderer="renderer"
date-field="createdAt"
:contextId="contextId"
:list-strategy="'smart'"
:width="width"
:height="height - 124"
>
<template v-slot:empty-history>
<div class="absolute-center">
<KStamp icon="las la-exclamation-circle" icon-size="3rem" :text="$t('KHistory.EMPTY_HISTORY')" />
</div>
</template>
</KHistory>
</div>
<!--
Events map
-->
<div v-show="showMap">
<div :ref="configureMap" :style="viewStyle">
<q-resize-observer @resize="onMapResized" />
</div>
<!--
Events graph
-->
<div v-show="showChart" class="fit row items-center text-center q-ma-none q-pa-none" >
<KStatisticsChart ref="chart" :style="chartStyle" class="col"/>
<q-btn v-show="currentChart > 1" size="1rem" flat round color="primary"
icon="las la-chevron-left" class="absolute-left" @click="onPreviousChart"/>
<q-btn v-show="currentChart < nbCharts" size="1rem" flat round color="primary"
icon="las la-chevron-right" class="absolute-right" @click="onNextChart" />
</div>
<!--
Events graph
-->
<div v-show="showChart" class="fit row items-center text-center q-ma-none q-pa-none" >
<KStatisticsChart ref="chart" :style="chartStyle" class="col"/>
<q-btn v-show="currentChart > 1" size="1rem" flat round color="primary"
icon="las la-chevron-left" class="absolute-left" @click="onPreviousChart"/>
<q-btn v-show="currentChart < nbCharts" size="1rem" flat round color="primary"
icon="las la-chevron-right" class="absolute-right" @click="onNextChart" />
</div>
<KModal
id="chart-settings-modal"
:title="$t('ArchivedEventsActivity.CHART_SETTINGS_MODAL_TITLE')"
:buttons="getChartSettingsModalButtons()"
ref="chartSettingsModal"
>
<div>
<q-select id="chart-type" v-model="selectedChartType" :label="$t('ArchivedEventsActivity.CHART_LABEL')"
:options="availableChartTypes" @update:modelValue="refreshChart"/>
<q-select id="count-per-chart" v-model="nbValuesPerChart" :label="$t('ArchivedEventsActivity.PAGINATION_LABEL')"
:options="paginationOptions" @update:modelValue="refreshChartAndPagination"/>
<q-select id="chart-render" v-model="render" :label="$t('ArchivedEventsActivity.RENDER_LABEL')"
:options="renderOptions" @update:modelValue="refreshChart"/>
</div>
<KModal
id="chart-settings-modal"
:title="$t('ArchivedEventsActivity.CHART_SETTINGS_MODAL_TITLE')"
:buttons="getChartSettingsModalButtons()"
ref="chartSettingsModal"
>
<div>
<q-select id="chart-type" v-model="selectedChartType" :label="$t('ArchivedEventsActivity.CHART_LABEL')"
:options="availableChartTypes" @update:modelValue="refreshChart"/>
<q-select id="count-per-chart" v-model="nbValuesPerChart" :label="$t('ArchivedEventsActivity.PAGINATION_LABEL')"
:options="paginationOptions" @update:modelValue="refreshChartAndPagination"/>
<q-select id="chart-render" v-model="render" :label="$t('ArchivedEventsActivity.RENDER_LABEL')"
:options="renderOptions" @update:modelValue="refreshChart"/>
</div>
</KModal>
<!--
Router view to enable routing to modals
-->
<router-view service="archived-events"></router-view>
</template>
</KModal>
<!--
Router view to enable routing to modals
-->
<router-view service="archived-events"></router-view>
</KPage>
</template>

Expand Down
56 changes: 27 additions & 29 deletions src/components/ArchivedPlansActivity.vue
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
<template>
<KPage padding @content-resized="onPageContentResized">
<template v-slot:page-content>
<!--
Page content
-->
<div class="row justify-center q-pa-lg">
<KHistory
v-if="height"
id="history"
service="archived-plans"
:append-items="true"
:base-query="baseQuery"
:filter-query="filterQuery"
:renderer="renderer"
date-field="updatedAt"
:contextId="contextId"
:width="width"
:height="height"
>
<template v-slot:empty-history>
<div class="absolute-center">
<KStamp icon="las la-exclamation-circle" icon-size="3rem" :text="$t('KHistory.EMPTY_HISTORY')" />
</div>
</template>
</KHistory>
</div>
<!--
Router view to enable routing to modals
<!--
Page content
-->
<router-view service="archived-plans"></router-view>
</template>
<div class="row justify-center q-pa-lg">
<KHistory
v-if="height"
id="history"
service="archived-plans"
:append-items="true"
:base-query="baseQuery"
:filter-query="filterQuery"
:renderer="renderer"
date-field="updatedAt"
:contextId="contextId"
:width="width"
:height="height"
>
<template v-slot:empty-history>
<div class="absolute-center">
<KStamp icon="las la-exclamation-circle" icon-size="3rem" :text="$t('KHistory.EMPTY_HISTORY')" />
</div>
</template>
</KHistory>
</div>
<!--
Router view to enable routing to modals
-->
<router-view service="archived-plans"></router-view>
</KPage>
</template>

Expand Down
Loading

0 comments on commit e4e3198

Please sign in to comment.