fix(editor): Prevent NDV schema view pagination (#5844)

* fix(editor): Prevent NDV schema view pagination

* Linting fixes
This commit is contained in:
OlegIvaniv
2023-03-31 08:31:19 +02:00
committed by GitHub
parent b7a20dd3a2
commit 1eba4788f2
4 changed files with 615 additions and 5 deletions

View File

@@ -322,7 +322,7 @@
/>
<run-data-schema
v-else-if="hasNodeRun && displayMode === 'schema'"
v-else-if="hasNodeRun && isSchemaView"
:data="jsonData"
:mappingEnabled="mappingEnabled"
:distanceFromActive="distanceFromActive"
@@ -422,7 +422,7 @@
</div>
<div
:class="$style.pagination"
v-if="hasNodeRun && !hasRunError && dataCount > pageSize"
v-if="hasNodeRun && !hasRunError && dataCount > pageSize && !isSchemaView"
v-show="!editMode.enabled"
>
<el-pagination
@@ -635,6 +635,9 @@ export default mixins(externalHooks, genericHelpers, nodeHelpers, pinData).exten
}
return null;
},
isSchemaView(): boolean {
return this.displayMode === 'schema';
},
isTriggerNode(): boolean {
return this.nodeTypesStore.isTriggerNode(this.node.type);
},
@@ -789,6 +792,11 @@ export default mixins(externalHooks, genericHelpers, nodeHelpers, pinData).exten
];
}
// We don't want to paginate the schema view
if (this.isSchemaView) {
return inputData;
}
const offset = this.pageSize * (this.currentPage - 1);
inputData = inputData.slice(offset, offset + this.pageSize);