Browse Source

feat: Integrated new record button with mobile view

pull/6474/head
Muhammed Mustafa 12 months ago
parent
commit
335c0d6cdc
  1. 4
      packages/nc-gui/components/smartsheet/Pagination.vue
  2. 6
      packages/nc-gui/components/smartsheet/grid/Table.vue

4
packages/nc-gui/components/smartsheet/Pagination.vue

@ -58,8 +58,8 @@ const isRTLLanguage = computed(() => isRtlLang(locale.value as keyof typeof Lang
<template>
<div
class="flex items-center bg-white border-gray-200 h-10 nc-pagination-wrapper"
:class="{ 'border-t-1': !isGroupBy }"
class="flex items-center bg-white border-gray-200 nc-pagination-wrapper"
:class="{ 'border-t-1': !isGroupBy, 'h-13': isMobileMode, 'h-10': !isMobileMode }"
:style="`${fixedSize ? `width: ${fixedSize}px;` : ''}${
isGroupBy ? 'margin-top:1px; border-radius: 0 0 12px 12px !important;' : ''
}${extraStyle}`"

6
packages/nc-gui/components/smartsheet/grid/Table.vue

@ -121,6 +121,8 @@ const reloadViewDataHook = inject(ReloadViewDataHookInj, createEventHook())
const openNewRecordFormHook = inject(OpenNewRecordFormHookInj, createEventHook())
const { isMobileMode } = useGlobal()
const scrollParent = inject(ScrollParentInj, ref<undefined>())
const { isPkAvail, isSqlView, eventBus } = useSmartsheetStoreOrThrow()
@ -1593,7 +1595,11 @@ const expandAndLooseFocus = (row: Row, col: Record<string, any>) => {
>
<template #add-record>
<div v-if="isAddingEmptyRowAllowed" class="flex ml-1">
<NcButton v-if="isMobileMode" class="nc-grid-add-new-row" type="secondary" @click="onNewRecordToFormClick()">
{{ $t('activity.newRecord') }}
</NcButton>
<a-dropdown-button
v-else
class="nc-grid-add-new-row"
placement="top"
@click="isAddNewRecordGridMode ? addEmptyRow() : onNewRecordToFormClick()"

Loading…
Cancel
Save