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

Enhancement - Feature to include all columns in listview #526

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion frontend/src/components/ColumnSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@
</Button>
</template>
</Autocomplete>
<Button
class="w-full !justify-start !text-gray-600"
variant="ghost"
@click="addAllColumns(close)"
:label="__('Add All Columns')"
>
<template #prefix>
<FeatherIcon name="plus" class="h-4" />
</template>
</Button>
<Button
v-if="columnsUpdated"
class="w-full !justify-start !text-ink-gray-5"
Expand Down Expand Up @@ -215,7 +225,7 @@ const fields = computed(() => {
})

function addColumn(c) {
let align = ['Float', 'Int', 'Percent', 'Currency'].includes(c.type) ? 'right' : 'left'
let align = ['Float', 'Int', 'Percent', 'Currency'].includes(c.type) ? 'right': 'left'
let _column = {
label: c.label,
type: c.type,
Expand All @@ -228,6 +238,21 @@ function addColumn(c) {
apply(true)
}

function addAllColumns(close) {
for (const c of fields.value) {
const _column = {
label: c.label,
type: c.type,
key: c.value,
width: '10rem',
};
columns.value.push(_column)
rows.value.push(c.value)
}
apply(true)
close()
}

function removeColumn(c) {
columns.value = columns.value.filter((column) => column.key !== c.key)
if (c.key !== 'name') {
Expand Down
Loading