Browse Source

refactor: allow label click to toggle switch

pull/9051/head
Pranav C 4 months ago
parent
commit
d1cc0a5fdc
  1. 16
      packages/nc-gui/components/smartsheet/column/LinkedToAnotherRecordOptions.vue

16
packages/nc-gui/components/smartsheet/column/LinkedToAnotherRecordOptions.vue

@ -233,6 +233,18 @@ const onCustomSwitchLabelClick = () => {
vModel.value.is_custom_link = !vModel.value.is_custom_link vModel.value.is_custom_link = !vModel.value.is_custom_link
onCustomSwitchToggle() onCustomSwitchToggle()
} }
const onViewLabelClick = () => {
if (!vModel.value.childId && !(vModel.value.is_custom_link && vModel.value.custom?.ref_model_id)) return
limitRecToView.value = !limitRecToView.value
onLimitRecToViewChange()
}
const onFilterLabelClick = () => {
if (!vModel.value.childId && !(vModel.value.is_custom_link && vModel.value.custom?.ref_model_id)) return
limitRecToCond.value = !limitRecToCond.value
}
</script> </script>
<template> <template>
@ -317,7 +329,7 @@ const onCustomSwitchLabelClick = () => {
v-e="['c:link:limit-record-by-view', { status: limitRecToView }]" v-e="['c:link:limit-record-by-view', { status: limitRecToView }]"
class="text-s" class="text-s"
data-testid="nc-limit-record-view" data-testid="nc-limit-record-view"
@click="limitRecToView = !!vModel.childId && !limitRecToView" @click="onViewLabelClick"
>Limit record selection to a view</span >Limit record selection to a view</span
> >
</div> </div>
@ -353,7 +365,7 @@ const onCustomSwitchLabelClick = () => {
<span <span
v-e="['c:link:limit-record-by-filter', { status: limitRecToCond }]" v-e="['c:link:limit-record-by-filter', { status: limitRecToCond }]"
data-testid="nc-limit-record-filters" data-testid="nc-limit-record-filters"
@click="limitRecToCond = !!vModel.childId && !limitRecToCond" @click="onFilterLabelClick"
> >
Limit record selection to filters Limit record selection to filters
</span> </span>

Loading…
Cancel
Save