Browse Source

Merge pull request #4099 from nocodb/fix/dark-mode-survey

pull/4181/head
Braks 2 years ago committed by GitHub
parent
commit
ef96178dd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nc-gui/components/smartsheet/toolbar/ShareView.vue
  2. 2
      packages/nc-gui/composables/useMultiSelect/index.ts
  3. 3
      packages/nc-gui/composables/useViewData.ts
  4. 33
      packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
  5. 10
      packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue

2
packages/nc-gui/components/smartsheet/toolbar/ShareView.vue

@ -43,7 +43,7 @@ const shared = ref<SharedView>({ id: '', meta: {}, password: undefined })
const transitionDuration = computed({
get: () => shared.value.meta.transitionDuration || 250,
set: (duration) => {
shared.value.meta = { ...shared.value.meta, transitionDuration: duration }
shared.value.meta = { ...shared.value.meta, transitionDuration: duration > 5000 ? 5000 : duration }
},
})

2
packages/nc-gui/composables/useMultiSelect/index.ts

@ -14,7 +14,7 @@ export function useMultiSelect(
fields: MaybeRef<any[]>,
data: MaybeRef<any[]>,
editEnabled: MaybeRef<boolean>,
isPkAvail: MaybeRef<boolean>,
isPkAvail: MaybeRef<boolean | undefined>,
clearCell: Function,
makeEditable: Function,
scrollToActiveCell?: (row?: number | null, col?: number | null) => void,

3
packages/nc-gui/composables/useViewData.ts

@ -202,7 +202,6 @@ export function useViewData(
async function insertRow(
currentRow: Row,
_rowIndex = formattedData.value?.length,
ltarState: Record<string, any> = {},
{ metaValue = meta.value, viewMetaValue = viewMeta.value }: { metaValue?: TableType; viewMetaValue?: ViewType } = {},
) {
@ -301,7 +300,7 @@ export function useViewData(
await until(() => !(row.rowMeta?.new && row.rowMeta?.saving)).toMatch((v) => v)
if (row.rowMeta.new) {
return await insertRow(row, formattedData.value.indexOf(row), ltarState, args)
return await insertRow(row, ltarState, args)
} else {
await updateRowProperty(row, property!, args)
}

33
packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue

@ -69,6 +69,8 @@ p {
.nc-form-view {
.nc-cell {
@apply bg-white dark:bg-slate-500;
&.nc-cell-checkbox {
@apply color-transition !border-0;
@ -91,7 +93,20 @@ p {
&.nc-input {
@apply w-full rounded p-2 min-h-[40px] flex items-center border-solid border-1 border-gray-300 dark:border-slate-200;
.duration-cell-wrapper {
@apply w-full;
input {
@apply !outline-none;
&::placeholder {
@apply text-gray-400 dark:text-slate-300;
}
}
}
input,
textarea,
&.nc-virtual-cell,
> div {
@apply bg-white dark:(bg-slate-500 text-white);
@ -104,12 +119,24 @@ p {
@apply dark:(bg-slate-700 text-white);
}
}
}
.nc-attachment-cell > div {
@apply dark:(bg-slate-100);
&.nc-cell-longtext {
@apply !p-0 pb-2px pr-2px;
}
textarea {
@apply px-4 py-2 rounded;
&:focus {
box-shadow: none !important;
}
}
}
}
.nc-attachment-cell > div {
@apply dark:(bg-slate-100);
}
}
}

10
packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue

@ -159,6 +159,12 @@ function resetForm() {
goTo(steps.value[0])
}
function submit() {
if (submitted.value) return
submitForm()
}
onReset(resetForm)
onKeyStroke(['ArrowLeft', 'ArrowDown'], () => {
@ -169,7 +175,7 @@ onKeyStroke(['ArrowRight', 'ArrowUp'], () => {
})
onKeyStroke(['Enter', 'Space'], () => {
if (isLast.value) {
submitForm()
submit()
} else {
goNext(AnimationTarget.OkButton)
}
@ -289,7 +295,7 @@ onMounted(() => {
type="submit"
class="uppercase scaling-btn prose-sm"
data-cy="nc-survey-form__btn-submit"
@click="submitForm"
@click="submit"
>
{{ $t('general.submit') }}
</button>

Loading…
Cancel
Save