mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat(editor): add readonly state for nodes (#4299)
* fix(editor): add types to Node.vue component props * fix(editor): some cleanup in NodeView * fix(editor): fix some boolean usage * feat(editor): check foreign credentials * fix(editor): passing readOnly to inputs * fix(editor): add types to component and solve property mutation * fix(editor): add types to component and solve property mutation * fix(editor): component property type * fix(editor): component property type * fix(editor): default prop values * fix(editor): fix FixedCollectionParameter.vue
This commit is contained in:
@@ -17,3 +17,11 @@ export * from './WorkflowErrors';
|
||||
export * from './WorkflowHooks';
|
||||
export { LoggerProxy, NodeHelpers, ObservableObject, TelemetryHelpers };
|
||||
export { deepCopy, jsonParse } from './utils';
|
||||
export {
|
||||
isINodeProperties,
|
||||
isINodePropertyOptions,
|
||||
isINodePropertyCollection,
|
||||
isINodePropertiesList,
|
||||
isINodePropertyCollectionList,
|
||||
isINodePropertyOptionsList,
|
||||
} from './type-guards';
|
||||
|
||||
27
packages/workflow/src/type-guards.ts
Normal file
27
packages/workflow/src/type-guards.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { INodeProperties, INodePropertyOptions, INodePropertyCollection } from './Interfaces';
|
||||
|
||||
export const isINodeProperties = (
|
||||
item: INodePropertyOptions | INodeProperties | INodePropertyCollection,
|
||||
): item is INodeProperties => 'name' in item && 'type' in item && !('value' in item);
|
||||
|
||||
export const isINodePropertyOptions = (
|
||||
item: INodePropertyOptions | INodeProperties | INodePropertyCollection,
|
||||
): item is INodePropertyOptions => 'value' in item && 'name' in item && !('displayName' in item);
|
||||
|
||||
export const isINodePropertyCollection = (
|
||||
item: INodePropertyOptions | INodeProperties | INodePropertyCollection,
|
||||
): item is INodePropertyCollection => 'values' in item && 'name' in item && 'displayName' in item;
|
||||
|
||||
export const isINodePropertiesList = (
|
||||
items: INodeProperties['options'],
|
||||
): items is INodeProperties[] => Array.isArray(items) && items.every(isINodeProperties);
|
||||
|
||||
export const isINodePropertyOptionsList = (
|
||||
items: INodeProperties['options'],
|
||||
): items is INodePropertyOptions[] => Array.isArray(items) && items.every(isINodePropertyOptions);
|
||||
|
||||
export const isINodePropertyCollectionList = (
|
||||
items: INodeProperties['options'],
|
||||
): items is INodePropertyCollection[] => {
|
||||
return Array.isArray(items) && items.every(isINodePropertyCollection);
|
||||
};
|
||||
Reference in New Issue
Block a user