Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Setup columns
  • Loading branch information
caleeli committed Feb 6, 2024
commit ab8f19533d775441b98406fb170d22b8276d424b
4 changes: 2 additions & 2 deletions resources/js/components/shared/Column.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<span class="column-label" :class="{'without-format': withoutFormat}">{{ item.label }}</span>
</div>
<div>
<a v-show="!withoutConfig" class="text-primary column-button" v-b-modal.column-modal v-if="! item.default" @click="onConfig"><i class="fa fa-cog fa-fw"></i></a>
<a v-show="!withoutConfig" class="text-primary column-button" v-b-modal.column-modal v-if="! item.default || forceEnableConfig" @click="onConfig"><i class="fa fa-cog fa-fw"></i></a>
<a v-show="!withoutRemove" class="text-primary column-button" @click="onRemove"><i class="fa fa-times fa-fw"></i></a>
</div>
</div>
Expand All @@ -22,7 +22,7 @@
import DataFormats from '../../data-formats';

export default {
props: ["column","withoutConfig","withoutRemove","withoutFormat"],
props: ["column","withoutConfig","withoutRemove","withoutFormat","forceEnableConfig"],
data() {
return {
item: this.column
Expand Down
12 changes: 9 additions & 3 deletions resources/js/components/shared/ColumnConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
<b-input v-model="column.label" ref="labelInput"></b-input>
</b-form-group>
<b-form-group :label="$t('Field')" class="mb-4">
<b-input v-model="column.field"></b-input>
<b-input v-model="column.field" :disabled="editOnlyLabel"></b-input>
</b-form-group>
<b-form-group :label="$t('Format')" class="mb-4">
<data-format-selector v-model="column.format"></data-format-selector>
<data-format-selector v-model="column.format" :disabled="editOnlyLabel"></data-format-selector>
</b-form-group>
<b-form-group :label="$t('Currency Format')" class="mb-4" v-if="column.format == 'currency'">
<data-mask-selector v-model="column.mask"></data-mask-selector>
</b-form-group>
<b-form-group class="mb-4">
<b-form-checkbox v-model="column.sortable" switch>
<b-form-checkbox v-model="column.sortable" :disabled="editOnlyLabel" switch>
{{ $t('Sortable') }}
</b-form-checkbox>
</b-form-group>
Expand All @@ -44,6 +44,12 @@ export default {
DataFormatSelector,
DataMaskSelector
},
props: {
editOnlyLabel: {
type: Boolean,
default: false,
},
},
data() {
return {
disabled: true,
Expand Down