Browse Source

fix(gui-v2): keep font color normal even in readonly mode

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3447/head
Pranav C 2 years ago
parent
commit
b33cdd97b4
  1. 6
      packages/nc-gui-v2/components/cell/DatePicker.vue
  2. 6
      packages/nc-gui-v2/components/cell/DateTimePicker.vue
  3. 6
      packages/nc-gui-v2/components/cell/TimePicker.vue
  4. 6
      packages/nc-gui-v2/components/cell/YearPicker.vue
  5. 9
      packages/nc-gui-v2/components/virtual-cell/Lookup.vue
  6. 2
      packages/nc-gui-v2/composables/useViewData.ts

6
packages/nc-gui-v2/components/cell/DatePicker.vue

@ -75,4 +75,8 @@ const placeholder = computed(() => (isDateInvalid ? 'Invalid date' : ''))
</a-date-picker> </a-date-picker>
</template> </template>
<style scoped></style> <style scoped>
:deep(.ant-picker-input > input[disabled]) {
@apply !text-current;
}
</style>

6
packages/nc-gui-v2/components/cell/DateTimePicker.vue

@ -77,4 +77,8 @@ watch(
</a-date-picker> </a-date-picker>
</template> </template>
<style scoped></style> <style scoped>
:deep(.ant-picker-input > input[disabled]) {
@apply !text-current;
}
</style>

6
packages/nc-gui-v2/components/cell/TimePicker.vue

@ -87,4 +87,8 @@ watch(
</a-time-picker> </a-time-picker>
</template> </template>
<style scoped></style> <style scoped>
:deep(.ant-picker-input > input[disabled]) {
@apply !text-current;
}
</style>

6
packages/nc-gui-v2/components/cell/YearPicker.vue

@ -73,3 +73,9 @@ const placeholder = computed(() => (isYearInvalid ? 'Invalid year' : ''))
<template #suffixIcon></template> <template #suffixIcon></template>
</a-date-picker> </a-date-picker>
</template> </template>
<style scoped>
:deep(.ant-picker-input > input[disabled]) {
@apply !text-current;
}
</style>

9
packages/nc-gui-v2/components/virtual-cell/Lookup.vue

@ -37,7 +37,7 @@ const lookupColumnMetaProps = useColumn(lookupColumn)
</script> </script>
<template> <template>
<div class=" h-full flex gap-1"> <div class="h-full flex gap-1">
<template v-if="lookupColumn"> <template v-if="lookupColumn">
<!-- Render virtual cell --> <!-- Render virtual cell -->
<div v-if="isVirtualCol(lookupColumn)"> <div v-if="isVirtualCol(lookupColumn)">
@ -63,7 +63,12 @@ const lookupColumnMetaProps = useColumn(lookupColumn)
v-for="(v, i) of arrValue" v-for="(v, i) of arrValue"
:key="i" :key="i"
class="min-w-max" class="min-w-max"
:class="{ 'bg-gray-100 px-1 rounded-full flex-1': !lookupColumnMetaProps.isAttachment , ' border-gray-200 rounded border-1' : ![UITypes.Attachment, UITypes.MultiSelect, UITypes.SingleSelect].includes(lookupColumn.uidt) }" :class="{
'bg-gray-100 px-1 rounded-full flex-1': !lookupColumnMetaProps.isAttachment,
' border-gray-200 rounded border-1': ![UITypes.Attachment, UITypes.MultiSelect, UITypes.SingleSelect].includes(
lookupColumn.uidt,
),
}"
> >
<SmartsheetCell :model-value="v" :column="lookupColumn" :edit-enabled="false" :virtual="true" /> <SmartsheetCell :model-value="v" :column="lookupColumn" :edit-enabled="false" :virtual="true" />
</div> </div>

2
packages/nc-gui-v2/composables/useViewData.ts

@ -162,7 +162,7 @@ export function useViewData(
async function loadData(params: Parameters<Api<any>['dbViewRow']['list']>[4] = {}) { async function loadData(params: Parameters<Api<any>['dbViewRow']['list']>[4] = {}) {
if ((!project?.value?.id || !meta?.value?.id || !viewMeta?.value?.id) && !isPublic.value) return if ((!project?.value?.id || !meta?.value?.id || !viewMeta?.value?.id) && !isPublic.value) return
const response = !isPublic.value const response = !isPublic.value
? await api.dbViewRow.list('noco', project.value.id!, meta?.value.id!, viewMeta!.value.id, { ? await api.dbViewRow.list('noco', project.value.id!, meta!.value.id!, viewMeta!.value.id, {
...params, ...params,
...(isUIAllowed('sortSync') ? {} : { sortArrJson: JSON.stringify(sorts.value) }), ...(isUIAllowed('sortSync') ? {} : { sortArrJson: JSON.stringify(sorts.value) }),
...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }), ...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }),

Loading…
Cancel
Save