feat(Airtable Node): Overhaul (#6200)
This commit is contained in:
@@ -51,7 +51,16 @@ const emit = defineEmits<{
|
||||
|
||||
const ndvStore = useNDVStore();
|
||||
|
||||
const fieldsUi = computed<INodeProperties[]>(() => {
|
||||
function markAsReadOnly(field: ResourceMapperField): boolean {
|
||||
if (
|
||||
isMatchingField(field.id, props.paramValue.matchingColumns, props.showMatchingColumnsSelector)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return field.readOnly || false;
|
||||
}
|
||||
|
||||
const fieldsUi = computed<Array<Partial<INodeProperties> & { readOnly?: boolean }>>(() => {
|
||||
return props.fieldsToMap
|
||||
.filter((field) => field.display !== false && field.removed !== true)
|
||||
.map((field) => {
|
||||
@@ -64,11 +73,12 @@ const fieldsUi = computed<INodeProperties[]>(() => {
|
||||
required: field.required,
|
||||
description: getFieldDescription(field),
|
||||
options: field.options,
|
||||
readOnly: markAsReadOnly(field),
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
const orderedFields = computed<INodeProperties[]>(() => {
|
||||
const orderedFields = computed<Array<Partial<INodeProperties> & { readOnly?: boolean }>>(() => {
|
||||
// Sort so that matching columns are first
|
||||
if (props.paramValue.matchingColumns) {
|
||||
fieldsUi.value.forEach((field, i) => {
|
||||
@@ -333,7 +343,7 @@ defineExpose({
|
||||
:value="getParameterValue(field.name)"
|
||||
:displayOptions="true"
|
||||
:path="`${props.path}.${field.name}`"
|
||||
:isReadOnly="refreshInProgress"
|
||||
:isReadOnly="refreshInProgress || field.readOnly"
|
||||
:hideIssues="true"
|
||||
:nodeValues="nodeValues"
|
||||
:class="$style.parameterInputFull"
|
||||
|
||||
@@ -48,7 +48,7 @@ const emit = defineEmits<{
|
||||
|
||||
const availableMatchingFields = computed<ResourceMapperField[]>(() => {
|
||||
return props.fieldsToMap.filter((field) => {
|
||||
return field.canBeUsedToMatch !== false && field.display !== false;
|
||||
return (field.canBeUsedToMatch || field.defaultMatch) && field.display !== false;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -167,7 +167,9 @@ const hasAvailableMatchingColumns = computed<boolean>(() => {
|
||||
return (
|
||||
state.paramValue.schema.filter(
|
||||
(field) =>
|
||||
field.canBeUsedToMatch !== false && field.display !== false && field.removed !== true,
|
||||
(field.canBeUsedToMatch || field.defaultMatch) &&
|
||||
field.display !== false &&
|
||||
field.removed !== true,
|
||||
).length > 0
|
||||
);
|
||||
}
|
||||
@@ -178,7 +180,7 @@ const defaultSelectedMatchingColumns = computed<string[]>(() => {
|
||||
return state.paramValue.schema.length === 1
|
||||
? [state.paramValue.schema[0].id]
|
||||
: state.paramValue.schema.reduce((acc, field) => {
|
||||
if (field.defaultMatch && field.canBeUsedToMatch === true) {
|
||||
if (field.defaultMatch) {
|
||||
acc.push(field.id);
|
||||
}
|
||||
return acc;
|
||||
|
||||
Reference in New Issue
Block a user