Browse Source

fix(nc-gui): some review comments

pull/7786/head
Ramesh Mane 10 months ago
parent
commit
2d2ec98088
  1. 27
      packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue
  2. 19
      packages/nc-gui/components/monaco/Editor.vue
  3. 6
      packages/nc-gui/composables/useSharedFormViewStore.ts

27
packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue

@ -173,6 +173,13 @@ const formPreFill = computed({
},
})
const handleChangeFormPreFill = (value: { preFillEnabled?: boolean; preFilledMode?: PreFilledMode }) => {
formPreFill.value = {
...formPreFill.value,
...value,
}
}
function sharedViewUrl() {
if (!activeView.value) return
@ -412,14 +419,7 @@ watchEffect(() => {})
:checked="formPreFill.preFillEnabled"
data-testid="nc-modal-share-view__preFill"
size="small"
@update:checked="
(value) => {
formPreFill = {
...formPreFill,
preFillEnabled: value,
}
}
"
@update:checked="handleChangeFormPreFill({ preFillEnabled: $event as boolean })"
>
</a-switch>
</div>
@ -429,17 +429,10 @@ watchEffect(() => {})
:value="formPreFill.preFilledMode"
class="nc-modal-share-view-preFillMode"
data-testid="nc-modal-share-view__preFillMode"
@update:value="
(value) => {
formPreFill = {
...formPreFill,
preFilledMode: value,
}
}
"
@update:value="handleChangeFormPreFill({ preFilledMode: $event })"
>
<a-radio v-for="mode of Object.values(PreFilledMode)" :key="mode" :value="mode">
<div class="flex-1">{{ $t(`activity.preFilledFields.${mode || Default}`) }}</div>
<div class="flex-1">{{ $t(`activity.preFilledFields.${mode}`) }}</div>
</a-radio>
</a-radio-group>
</div>

19
packages/nc-gui/components/monaco/Editor.vue

@ -12,18 +12,17 @@ interface Props {
validate?: boolean
disableDeepCompare?: boolean
readOnly?: boolean
autoFocus: boolean
autoFocus?: boolean
}
const {
hideMinimap,
lang = 'json',
validate = true,
disableDeepCompare = false,
modelValue,
readOnly,
autoFocus = true,
} = defineProps<Props>()
const props = withDefaults(defineProps<Props>(), {
lang: 'json',
validate: true,
disableDeepCompare: false,
autoFocus: true,
})
const { hideMinimap, lang, validate, disableDeepCompare, modelValue, readOnly, autoFocus } = props
const emits = defineEmits(['update:modelValue'])

6
packages/nc-gui/composables/useSharedFormViewStore.ts

@ -267,9 +267,9 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
}
function handlePreFillForm() {
if (Object.keys(route.query).length && sharedViewMeta.value.preFillEnabled) {
columns.value = columns.value.map((c) => {
const queryParam = route.query?.[c.title as string] || route.query?.[encodeURIComponent(c.title as string)]
if (Object.keys(route.query || {}).length && sharedViewMeta.value.preFillEnabled) {
columns.value = (columns.value || []).map((c) => {
const queryParam = route.query[c.title as string] || route.query[encodeURIComponent(c.title as string)]
if (
!c.title ||
!queryParam ||

Loading…
Cancel
Save