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

Add ability to manage custom chart color schemes #1467

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
82 changes: 0 additions & 82 deletions .github/workflows/notify.yml

This file was deleted.

2 changes: 2 additions & 0 deletions client/web/admin/src/components/User/CUserEditorAvatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
data-test-id="input-text-color"
:translations="{
modalTitle: $t('colorPicker'),
cancelBtnLabel: $t('general:label.cancel'),
saveBtnLabel: $t('general:label.saveAndClose')
}"
/>
Expand All @@ -67,6 +68,7 @@
data-test-id="input-background-color"
:translations="{
modalTitle: $t('colorPicker'),
cancelBtnLabel: $t('general:label.cancel'),
saveBtnLabel: $t('general:label.saveAndClose')
}"
/>
Expand Down
1 change: 1 addition & 0 deletions client/web/compose/src/components/Chart/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export default {
}

data.labels = data.labels.map(l => l === 'undefined' ? this.$t('chart:undefined') : l)
data.customColorSchemes = this.$Settings.get('ui.charts.colorSchemes', [])

this.renderer = chart.makeOptions(data)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
v-model="f.options.backgroundColor"
:translations="{
modalTitle: $t('kind.file.view.colorPicker'),
cancelBtnLabel: $t('general:label.cancel'),
saveBtnLabel: $t('general:label.saveAndClose')
}"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
v-model="feed.options.color"
:translations="{
modalTitle: $t('calendar.recordFeed.colorPicker'),
cancelBtnLabel: $t('general:label.cancel'),
saveBtnLabel: $t('general:label.saveAndClose')
}"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
v-model="feed.options.color"
:translations="{
modalTitle: $t('calendar.recordFeed.colorPicker'),
cancelBtnLabel: $t('general:label.cancel'),
saveBtnLabel: $t('general:label.saveAndClose')
}"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
v-model="options.backgroundColor"
:translations="{
modalTitle: $t('kind.file.view.colorPicker'),
cancelBtnLabel: $t('general:label.cancel'),
saveBtnLabel: $t('general:label.saveAndClose')
}"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
v-model="feed.options.color"
:translations="{
modalTitle: $t('geometry.recordFeed.colorPicker'),
cancelBtnLabel: $t('general:label.cancel'),
saveBtnLabel: $t('general:label.saveAndClose')
}"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
v-model="options.color"
:translations="{
modalTitle: $t('metric.editStyle.colorPicker'),
cancelBtnLabel: $t('general:label.cancel'),
saveBtnLabel: $t('general:label.saveAndClose')
}"
class="mb-1"
Expand All @@ -23,6 +24,7 @@
v-model="options.backgroundColor"
:translations="{
modalTitle: $t('geometry.recordFeed.colorPicker'),
cancelBtnLabel: $t('general:label.cancel'),
saveBtnLabel: $t('general:label.saveAndClose')
}"
class="mb-1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
v-model="item.options.textColor"
:translations="{
modalTitle: $t('navigation.colorPicker'),
cancelBtnLabel: $t('general:label.cancel'),
saveBtnLabel: $t('general:label.saveAndClose')
}"
class="w-100"
Expand All @@ -144,6 +145,7 @@
v-model="item.options.backgroundColor"
:translations="{
modalTitle: $t('navigation.colorPicker'),
cancelBtnLabel: $t('general:label.cancel'),
saveBtnLabel: $t('general:label.saveAndClose')
}"
class="w-100"
Expand Down
71 changes: 58 additions & 13 deletions client/web/compose/src/components/PageBlocks/RecordListBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -620,36 +620,50 @@
/>
</template>

<template
#footer
>
<template #footer>
<div
v-if="showFooter"
class="d-flex align-items-center justify-content-between p-2"
class="d-flex align-items-center flex-wrap justify-content-between p-2"
>
<div class="text-truncate">
<div class="d-flex gap-col-3 align-items-center flex-wrap">
<div
v-if="options.showTotalCount"
class="ml-2 text-nowrap my-1"
class="ml-2 text-nowrap my-1 text-truncate"
>
<span
v-if="pagination.count > options.perPage"
v-if="pagination.count > recordsPerPage"
data-test-id="pagination-range"
>
{{ $t('recordList.pagination.showing', getPagination) }}
</span>

<span
v-else
data-test-id="pagination-single-number"
>
{{ $t('recordList.pagination.single', getPagination) }}
</span>
</div>

<div
v-if="options.showRecordPerPageOption"
class="d-flex align-items-center ml-2 my-1 gap-1 text-nowrap"
>
<span>
{{ $t('recordList.pagination.recordsPerPage') }}
</span>

<b-form-select
v-model="recordsPerPage"
:options="perPageOptions"
@change="handlePerPageChange"
/>
</div>
</div>

<div
v-if="showPageNavigation"
class="d-flex align-items-center justify-content-end"
class="d-flex align-items-center justify-content-end "
>
<b-pagination
v-if="options.fullPageNavigation"
Expand All @@ -667,15 +681,19 @@
<template #first-text>
<font-awesome-icon :icon="['fas', 'angle-double-left']" />
</template>

<template #prev-text>
<font-awesome-icon :icon="['fas', 'angle-left']" />
</template>

<template #next-text>
<font-awesome-icon :icon="['fas', 'angle-right']" />
</template>

<template #last-text>
<font-awesome-icon :icon="['fas', 'angle-double-right']" />
</template>

<template #elipsis-text>
<font-awesome-icon :icon="['fas', 'ellipsis-h']" />
</template>
Expand All @@ -691,6 +709,7 @@
>
<font-awesome-icon :icon="['fas', 'angle-double-left']" />
</b-button>

<b-button
:disabled="!hasPrevPage || processing"
data-test-id="previous-page"
Expand All @@ -704,6 +723,7 @@
/>
{{ $t('recordList.pagination.prev') }}
</b-button>

<b-button
:disabled="!hasNextPage || processing"
data-test-id="next-page"
Expand Down Expand Up @@ -833,6 +853,7 @@ export default {
selectedAllRecords: false,

abortableRequests: [],
recordsPerPage: undefined,
}
},

Expand All @@ -847,12 +868,26 @@ export default {
},

showFooter () {
return this.showPageNavigation || this.options.showTotalCount
return this.showPageNavigation || this.options.showTotalCount || this.options.showRecordPerPageOption
},

perPageOptions () {
const defaultText = this.options.perPage === 0 ? this.$t('general:label.all') : this.options.perPage.toString()
return [
{ text: defaultText, value: this.options.perPage },
{ text: '25', value: 25 },
{ text: '50', value: 50 },
{ text: '100', value: 100 },
].filter((v, i) => i === 0 || v.value !== this.options.perPage).sort((a, b) => {
if (a.value === 0) return 1
if (b.value === 0) return -1
return a.value - b.value
})
},

getPagination () {
const { page = 1, count = 0 } = this.pagination
const { perPage = 10 } = this.options
const perPage = this.recordsPerPage

return {
from: ((page - 1) * perPage) + 1,
Expand All @@ -879,6 +914,10 @@ export default {
return this.items.length && !this.options.hidePaging
},

showPerPageSelector () {
return this.options.showRecordPerPageOption
},

disableSelectAll () {
if (this.options.hidePaging) {
return !this.items.length
Expand Down Expand Up @@ -1099,6 +1138,11 @@ export default {
this.refresh(true)
},

handlePerPageChange () {
this.filter.limit = this.recordsPerPage
this.refresh(true)
},

onSaveFilterPreset (filter = []) {
this.currentCustomPresetFilter = {
filter,
Expand Down Expand Up @@ -1249,7 +1293,8 @@ export default {
// Sanitizes record list config and
// prepares prefilter
prepRecordList () {
const { moduleID, presort, prefilter, editable, perPage, refField, positionField } = this.options
this.recordsPerPage = this.options.perPage
const { moduleID, presort, prefilter, editable, refField, positionField } = this.options

// Validate props
if (!moduleID) {
Expand Down Expand Up @@ -1298,7 +1343,7 @@ export default {
}

this.prefilter = filter.join(' AND ')
const limit = perPage
const limit = this.recordsPerPage
this.filter = {
limit,
sort,
Expand Down Expand Up @@ -1594,7 +1639,7 @@ export default {
if (!paginationOptions.incTotal) {
if (pages.length > 1) {
const lastPageCount = pages[pages.length - 1].items
count = ((pages.length - 1) * this.options.perPage) + lastPageCount
count = ((pages.length - 1) * this.recordsPerPage) + lastPageCount
} else {
count = records.length
}
Expand Down