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

UI/UX fixes - 2 #7218

Merged
merged 40 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
816925c
fix: Shared grid view, nothing is displayed in first column #7210
rameshmane7218 Dec 13, 2023
e2032b7
fix: Hide paste option on shared grid view
rameshmane7218 Dec 13, 2023
c290f15
New Crowdin updates (#7214)
o1lab Dec 13, 2023
7f38ad6
[create-pull-request] automated change
mertmit Dec 13, 2023
d718e77
fix : fixed table cell overflow in uploadExcel Model
musharaf-nocodb Dec 13, 2023
6d7057d
fix : removed padding important
musharaf-nocodb Dec 13, 2023
bddb1e1
Refresh Token become more descriptive and easy to understand
aashishagrawall Nov 25, 2023
23a8a40
fix: if buffer type convert to hex value and convert to int only if t…
pranavxc Dec 13, 2023
d84888d
fix: use ids in code snippet api url
pranavxc Dec 14, 2023
9cfc296
chore: monaco editor worker loading
pranavxc Dec 14, 2023
f9887af
fix: use id instead of title in api snippet
pranavxc Dec 14, 2023
7cf4fa0
fix: monaco cross origin worker loading
pranavxc Dec 14, 2023
5a36fa8
fix: load workers inline
pranavxc Dec 14, 2023
ec9614e
chore: cleanup
pranavxc Dec 14, 2023
23eebd0
fix: handle null case
pranavxc Dec 14, 2023
8c29e39
fix: if cancelled error skip it cancelled to avoid unnecessary call
pranavxc Dec 14, 2023
77214ec
fix: support function calls for default timestamp
mertmit Dec 14, 2023
4c5ff7b
fix: append before getList
mertmit Dec 14, 2023
07138bd
chore: link nocodb-sdk locally
mertmit Dec 15, 2023
c09a2a5
fix: avoid querying null seq
mertmit Dec 15, 2023
3b969ab
fix: Horizontal scroll bar of Kanban View not visible #7210
rameshmane7218 Dec 15, 2023
62408cb
fix: groupBy dateTime/time field title format should be same as cell …
rameshmane7218 Dec 18, 2023
a07b390
fix: Set the default hook title only when creating a new hook #7210
rameshmane7218 Dec 18, 2023
f34fe0d
fix: Expand icon for long text & rich text, should become visible on …
rameshmane7218 Dec 18, 2023
3ab8ff2
fix: display tooltip only when we truncate text #7210
rameshmane7218 Dec 18, 2023
ca18ccc
fix: Show tooltip on hover of truncated select/multiselect option #7210
rameshmane7218 Dec 18, 2023
d0a071f
fix: Select option text and icon are not aligned center #7210
rameshmane7218 Dec 18, 2023
0e7001f
Merge branch 'develop' into fix/ui-ux-2
rameshmane7218 Dec 18, 2023
bfcd06a
fix: The message notice icon is not aligned center #7210
rameshmane7218 Dec 18, 2023
88afbd3
fix: success message notice icon align center issue
rameshmane7218 Dec 18, 2023
5288d99
fix: group by new record & add new row default value is not reflectin…
rameshmane7218 Dec 19, 2023
4194e1b
fix: lint error
rameshmane7218 Dec 19, 2023
2a4ed7e
fix: playwright addNewRow wait for response issue
rameshmane7218 Dec 19, 2023
0ab961c
fix: playwright test fail issue
rameshmane7218 Dec 19, 2023
9140e6c
fix: typo error
rameshmane7218 Dec 19, 2023
c2af864
fix: test addNewRow required cell waitForResponse issue
rameshmane7218 Dec 19, 2023
c7fcf70
fix: addNewColumn waitForResponse issue
rameshmane7218 Dec 20, 2023
490232a
fix: timezone playwright test fail issue
rameshmane7218 Dec 20, 2023
40c7c1e
fix: webhook playwright test cases fail issue
rameshmane7218 Dec 20, 2023
1c29d40
Merge branch 'develop' into fix/ui-ux-2
dstala Dec 20, 2023
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
7 changes: 3 additions & 4 deletions packages/nc-gui/assets/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ body {
height: var(--topbar-height) !important;
}

.anticon-check-circle {
@apply !relative top-[-1px] left-0;
}

html,
body,
#__nuxt,
Expand Down Expand Up @@ -701,4 +697,7 @@ input[type='number'] {

.ant-message-notice-content {
@apply !rounded-md;
.ant-message-custom-content{
@apply flex items-center
}
}
43 changes: 39 additions & 4 deletions packages/nc-gui/components/cell/MultiSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ const selectedOpts = computed(() => {
}"
>
<template v-for="selectedOpt of selectedOpts" :key="selectedOpt.value">
<a-tag class="rounded-tag" :color="selectedOpt.color">
<a-tag class="rounded-tag max-w-full" :color="selectedOpt.color">
<span
:style="{
'color': tinycolor.isReadable(selectedOpt.color || '#ccc', '#fff', { level: 'AA', size: 'large' })
Expand All @@ -367,7 +367,21 @@ const selectedOpts = computed(() => {
}"
:class="{ 'text-sm': isKanban }"
>
{{ selectedOpt.title }}
<NcTooltip class="truncate max-w-full" show-on-truncate-only>
<template #title>
{{ selectedOpt.title }}
</template>
<span
class="text-ellipsis overflow-hidden"
:style="{
wordBreak: 'keep-all',
whiteSpace: 'nowrap',
display: 'inline',
}"
>
{{ selectedOpt.title }}
</span>
</NcTooltip>
</span>
</a-tag>
</template>
Expand Down Expand Up @@ -402,7 +416,7 @@ const selectedOpts = computed(() => {
:class="`nc-select-option-${column.title}-${op.title}`"
@click.stop
>
<a-tag class="rounded-tag" :color="op.color">
<a-tag class="rounded-tag max-w-full" :color="op.color">
<span
:style="{
'color': tinycolor.isReadable(op.color || '#ccc', '#fff', { level: 'AA', size: 'large' })
Expand All @@ -412,7 +426,21 @@ const selectedOpts = computed(() => {
}"
:class="{ 'text-sm': isKanban }"
>
{{ op.title }}
<NcTooltip class="truncate max-w-full" show-on-truncate-only>
<template #title>
{{ op.title }}
</template>
<span
class="text-ellipsis overflow-hidden"
:style="{
wordBreak: 'keep-all',
whiteSpace: 'nowrap',
display: 'inline',
}"
>
{{ op.title }}
</span>
</NcTooltip>
</span>
</a-tag>
</a-select-option>
Expand Down Expand Up @@ -530,3 +558,10 @@ const selectedOpts = computed(() => {
@apply !text-xs;
}
</style>

<style lang="scss">
.ant-select-item-option-content,
.ant-select-item-option-state {
@apply !flex !items-center;
}
</style>
45 changes: 40 additions & 5 deletions packages/nc-gui/components/cell/SingleSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ const selectedOpt = computed(() => {

<template>
<div class="h-full w-full flex items-center nc-single-select" :class="{ 'read-only': readOnly }" @click="toggleMenu">
<div v-if="!(active || isEditable)">
<a-tag v-if="selectedOpt" class="rounded-tag" :color="selectedOpt.color">
<div v-if="!(active || isEditable)" class="w-full">
<a-tag v-if="selectedOpt" class="rounded-tag max-w-full" :color="selectedOpt.color">
<span
:style="{
'color': tinycolor.isReadable(selectedOpt.color || '#ccc', '#fff', { level: 'AA', size: 'large' })
Expand All @@ -274,7 +274,21 @@ const selectedOpt = computed(() => {
}"
:class="{ 'text-sm': isKanban }"
>
{{ selectedOpt.title }}
<NcTooltip class="truncate max-w-full" show-on-truncate-only>
<template #title>
{{ selectedOpt.title }}
</template>
<span
class="text-ellipsis overflow-hidden"
:style="{
wordBreak: 'keep-all',
whiteSpace: 'nowrap',
display: 'inline',
}"
>
{{ selectedOpt.title }}
</span>
</NcTooltip>
</span>
</a-tag>
</div>
Expand Down Expand Up @@ -305,7 +319,7 @@ const selectedOpt = computed(() => {
:class="`nc-select-option-${column.title}-${op.title}`"
@click.stop
>
<a-tag class="rounded-tag" :color="op.color">
<a-tag class="rounded-tag max-w-full" :color="op.color">
<span
:style="{
'color': tinycolor.isReadable(op.color || '#ccc', '#fff', { level: 'AA', size: 'large' })
Expand All @@ -315,7 +329,21 @@ const selectedOpt = computed(() => {
}"
:class="{ 'text-sm': isKanban }"
>
{{ op.title }}
<NcTooltip class="truncate max-w-full" show-on-truncate-only>
<template #title>
{{ op.title }}
</template>
<span
class="text-ellipsis overflow-hidden"
:style="{
wordBreak: 'keep-all',
whiteSpace: 'nowrap',
display: 'inline',
}"
>
{{ op.title }}
</span>
</NcTooltip>
</span>
</a-tag>
</a-select-option>
Expand All @@ -342,6 +370,7 @@ const selectedOpt = computed(() => {

:deep(.ant-select-clear) {
opacity: 1;
border-radius: 100%;
}

.nc-single-select:not(.read-only) {
Expand All @@ -363,3 +392,9 @@ const selectedOpt = computed(() => {
@apply block;
}
</style>

<style lang="scss">
.ant-select-item-option-content {
@apply !flex !items-center;
}
</style>
2 changes: 1 addition & 1 deletion packages/nc-gui/components/cell/TextArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ watch(editEnabled, () => {
<NcTooltip
v-if="!isVisible"
placement="bottom"
class="!absolute right-0 bottom-1 nc-text-area-expand-btn"
class="!absolute right-0 bottom-1 hidden nc-text-area-expand-btn"
:class="{ 'right-0 bottom-1': editEnabled, '!bottom-0': !isRichMode }"
>
<template #title>{{ $t('title.expand') }}</template>
Expand Down
6 changes: 3 additions & 3 deletions packages/nc-gui/components/smartsheet/Kanban.vue
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,10 @@ const getRowId = (row: RowType) => {
>
<div
ref="kanbanContainerRef"
class="nc-kanban-container flex mt-4 pb-4 px-4 overflow-y-hidden w-full nc-scrollbar-x-md"
class="nc-kanban-container flex mt-4 pb-4 px-4 overflow-y-hidden w-full nc-scrollbar-x-lg"
:style="{
minHeight: 'calc(100vh - var(--topbar-height) - 3.5rem)',
maxHeight: 'calc(100vh - var(--topbar-height) - 3.5rem)',
minHeight: 'calc(100vh - var(--topbar-height) - 4.1rem)',
maxHeight: 'calc(100vh - var(--topbar-height) - 4.1rem)',
}"
>
<div v-if="isViewDataLoading" class="flex flex-row min-h-full gap-x-2">
Expand Down
20 changes: 18 additions & 2 deletions packages/nc-gui/components/smartsheet/grid/GroupBy.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts" setup>
import tinycolor from 'tinycolor2'
import { UITypes } from 'nocodb-sdk'
import dayjs from 'dayjs'
import { UITypes, dateFormats, timeFormats } from 'nocodb-sdk'
import Table from './Table.vue'
import GroupBy from './GroupBy.vue'
import GroupByTable from './GroupByTable.vue'
Expand Down Expand Up @@ -139,7 +140,7 @@ const onScroll = (e: Event) => {

// a method to parse group key if grouped column type is LTAR or Lookup
// in these 2 scenario it will return json array or `___` separated value
const parseKey = (group) => {
const parseKey = (group: Group) => {
let key = group.key.toString()

// parse json array key if it's a lookup or link to another record
Expand All @@ -151,6 +152,21 @@ const parseKey = (group) => {
return key.split('___')
}
}

// show the groupBy dateTime field title format as like cell format
if (key && group.column?.uidt === UITypes.DateTime && dayjs(key).isValid()) {
const dateFormat = parseProp(group.column?.meta)?.date_format ?? dateFormats[0]
const timeFormat = parseProp(group.column?.meta)?.time_format ?? timeFormats[0]

const dateTimeFormat = `${dateFormat} ${timeFormat}`

return [dayjs(key).utc().local().format(dateTimeFormat)]
}

// show the groupBy time field title format as like cell format
if (key && group.column?.uidt === UITypes.Time && dayjs(key).isValid()) {
return [dayjs(key).format(timeFormats[0])]
}
return [key]
}

Expand Down
5 changes: 3 additions & 2 deletions packages/nc-gui/components/smartsheet/grid/GroupByTable.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { UITypes, isLinksOrLTAR } from 'nocodb-sdk'
import Table from './Table.vue'
import { IsGroupByInj, computed, ref } from '#imports'
import { IsGroupByInj, computed, ref, rowDefaultData } from '#imports'
import type { Group, Row } from '#imports'

const props = defineProps<{
Expand Down Expand Up @@ -38,7 +38,7 @@ const view = inject(ActiveViewInj, ref())

const reloadViewDataHook = inject(ReloadViewDataHookInj, createEventHook())

function addEmptyRow(group: Group, addAfter?: number) {
function addEmptyRow(group: Group, addAfter?: number, metaValue = meta.value) {
if (group.nested || !group.rows) return

addAfter = addAfter ?? group.rows.length
Expand All @@ -57,6 +57,7 @@ function addEmptyRow(group: Group, addAfter?: number) {

group.rows.splice(addAfter, 0, {
row: {
...rowDefaultData(metaValue?.columns),
...setGroup,
},
oldRow: {},
Expand Down
17 changes: 13 additions & 4 deletions packages/nc-gui/components/smartsheet/grid/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,8 @@ const closeAddColumnDropdown = (scrollToLastCol = false) => {
}

async function openNewRecordHandler() {
const newRow = addEmptyRow()
// skip update row when it is `New record form`
const newRow = addEmptyRow(dataRef.value.length, true)
if (newRow) expandForm?.(newRow, undefined, true)
}

Expand Down Expand Up @@ -697,8 +698,17 @@ function scrollToRow(row?: number) {
scrollToCell?.()
}

function addEmptyRow(row?: number) {
async function saveEmptyRow(rowObj: Row) {
await updateOrSaveRow?.(rowObj)
}

function addEmptyRow(row?: number, skipUpdate: boolean = false) {
const rowObj = callAddEmptyRow?.(row)

if (!skipUpdate && rowObj) {
saveEmptyRow(rowObj)
}

nextTick().then(() => {
scrollToRow(row ?? dataRef.value.length - 1)
})
Expand Down Expand Up @@ -1484,7 +1494,6 @@ onKeyStroke('ArrowDown', onDown)
>
<div class="items-center flex gap-1 min-w-[60px]">
<div
v-if="!readOnly || isMobileMode"
class="nc-row-no sm:min-w-4 text-xs text-gray-500"
:class="{ toggle: !readOnly, hidden: row.rowMeta.selected }"
>
Expand Down Expand Up @@ -1696,7 +1705,7 @@ onKeyStroke('ArrowDown', onDown)
</NcMenuItem>

<NcMenuItem
v-if="contextMenuTarget"
v-if="contextMenuTarget && hasEditPermission"
class="nc-base-menu-item"
data-testid="context-menu-item-paste"
:disabled="isSystemColumn(fields[contextMenuTarget.col])"
Expand Down
2 changes: 1 addition & 1 deletion packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const openedBaseUrl = computed(() => {
'max-w-none': isSharedBase && !isMobileMode,
}"
>
<NcTooltip class="truncate nc-active-table-title max-w-full">
<NcTooltip class="truncate nc-active-table-title max-w-full" show-on-truncate-only>
<template #title>
{{ activeTable?.title }}
</template>
Expand Down
4 changes: 3 additions & 1 deletion packages/nc-gui/components/webhook/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,9 @@ watch(
if (props.hook) {
setHook(props.hook)
onEventChange()
} else {
// Set the default hook title only when creating a new hook.
hookRef.title = getDefaultHookName(hooks.value)
}
},
{ immediate: true },
Expand All @@ -513,7 +516,6 @@ onMounted(async () => {
} else {
hookRef.eventOperation = eventList.value[0].value.join(' ')
}
hookRef.title = getDefaultHookName(hooks.value)

onNotificationTypeChange()

Expand Down
5 changes: 3 additions & 2 deletions packages/nc-gui/composables/useData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
findIndexByPk,
message,
populateInsertObject,
rowDefaultData,
rowPkData,
storeToRefs,
until,
Expand Down Expand Up @@ -53,9 +54,9 @@ export function useData(args: {
},
})

function addEmptyRow(addAfter = formattedData.value.length) {
function addEmptyRow(addAfter = formattedData.value.length, metaValue = meta.value) {
formattedData.value.splice(addAfter, 0, {
row: {},
row: { ...rowDefaultData(metaValue?.columns) },
oldRow: {},
rowMeta: { new: true },
})
Expand Down
22 changes: 21 additions & 1 deletion packages/nc-gui/utils/dataUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RelationTypes, UITypes } from 'nocodb-sdk'
import { RelationTypes, UITypes, isLinksOrLTAR, isSystemColumn, isVirtualCol } from 'nocodb-sdk'
import type { ColumnType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk'
import type { Row } from 'lib'
import { isColumnRequiredAndNull } from './columnUtils'
Expand Down Expand Up @@ -86,3 +86,23 @@ export async function populateInsertObject({

return { missingRequiredColumns, insertObj }
}

// a function to get default values of row
export const rowDefaultData = (columns: ColumnType[] = []) => {
const defaultData: Record<string, string> = columns.reduce<Record<string, any>>((acc: Record<string, any>, col: ColumnType) => {
// avoid setting default value for system col, virtual col, rollup, formula, barcode, qrcode, links, ltar
if (
!isSystemColumn(col) &&
!isVirtualCol(col) &&
!isLinksOrLTAR({ uidt: col.uidt! }) &&
![UITypes.Rollup, UITypes.Lookup, UITypes.Formula, UITypes.Barcode, UITypes.QrCode].includes(col.uidt) &&
col?.cdf
) {
const defaultValue = col.cdf
acc[col.title!] = typeof defaultValue === 'string' ? defaultValue.replace(/^'/, '').replace(/'$/, '') : defaultValue
}
return acc
}, {} as Record<string, any>)

return defaultData
}