fix: renamed is_default to is_standard

This commit is contained in:
Shariq Ansari 2025-02-20 13:02:55 +05:30
parent d057926f7a
commit c0bcd2a34f

View File

@ -480,11 +480,11 @@ async function exportRows() {
export_type.value = 'Excel' export_type.value = 'Excel'
} }
let defaultViews = [] let standardViews = []
let allowedViews = props.options.allowedViews || ['list'] let allowedViews = props.options.allowedViews || ['list']
if (allowedViews.includes('list')) { if (allowedViews.includes('list')) {
defaultViews.push({ standardViews.push({
name: 'list', name: 'list',
label: __(props.options?.defaultViewName) || __('List'), label: __(props.options?.defaultViewName) || __('List'),
icon: markRaw(ListIcon), icon: markRaw(ListIcon),
@ -495,7 +495,7 @@ if (allowedViews.includes('list')) {
}) })
} }
if (allowedViews.includes('kanban')) { if (allowedViews.includes('kanban')) {
defaultViews.push({ standardViews.push({
name: 'kanban', name: 'kanban',
label: __(props.options?.defaultViewName) || __('Kanban'), label: __(props.options?.defaultViewName) || __('Kanban'),
icon: markRaw(KanbanIcon), icon: markRaw(KanbanIcon),
@ -506,7 +506,7 @@ if (allowedViews.includes('kanban')) {
}) })
} }
if (allowedViews.includes('group_by')) { if (allowedViews.includes('group_by')) {
defaultViews.push({ standardViews.push({
name: 'group_by', name: 'group_by',
label: __(props.options?.defaultViewName) || __('Group By'), label: __(props.options?.defaultViewName) || __('Group By'),
icon: markRaw(GroupByIcon), icon: markRaw(GroupByIcon),
@ -531,9 +531,9 @@ function getIcon(icon, type) {
const viewsDropdownOptions = computed(() => { const viewsDropdownOptions = computed(() => {
let _views = [ let _views = [
{ {
group: __('Default Views'), group: __('Standard Views'),
hideLabel: true, hideLabel: true,
items: defaultViews, items: standardViews,
}, },
] ]
@ -904,7 +904,7 @@ const viewActions = (view) => {
let actions = [ let actions = [
{ {
group: __('Default Views'), group: __('Actions'),
hideLabel: true, hideLabel: true,
items: [ items: [
{ {
@ -916,7 +916,7 @@ const viewActions = (view) => {
}, },
] ]
if (!isStandardView(_view, isStandard)) { if (!isDefaultView(_view, isStandard)) {
actions[0].items.unshift({ actions[0].items.unshift({
label: __('Set as default'), label: __('Set as default'),
icon: () => h(CheckIcon, { class: 'h-4 w-4' }), icon: () => h(CheckIcon, { class: 'h-4 w-4' }),
@ -981,7 +981,7 @@ const viewActions = (view) => {
return actions return actions
} }
function isStandardView(v, isStandard) { function isDefaultView(v, isStandard) {
let defaultView = getDefaultView() let defaultView = getDefaultView()
if (!defaultView) return false if (!defaultView) return false