diff --git a/src/main/frontend/sections/editor/PipelineStep.tsx b/src/main/frontend/sections/editor/PipelineStep.tsx index e6cbff3..67faa8d 100644 --- a/src/main/frontend/sections/editor/PipelineStep.tsx +++ b/src/main/frontend/sections/editor/PipelineStep.tsx @@ -12,6 +12,7 @@ import { EachStep } from './types/EachStep'; import { FilterNodeStep } from './types/FilterNodeStep'; import { MoveNodeStep } from './types/MoveNodeStep'; import { NodeQueryStep } from './types/NodeQueryStep'; +import { RenamePropertyStep } from './types/RenamePropertyStep'; export const PipelineStep: FC<{ parentHops: Hop[]; hop: Hop }> = ({ parentHops, hop }) => { switch (hop.type) { @@ -31,6 +32,8 @@ export const PipelineStep: FC<{ parentHops: Hop[]; hop: Hop }> = ({ parentHops, return ; case 'nodeQuery': return ; + case 'renameProperty': + return ; default: return ; } diff --git a/src/main/frontend/sections/editor/types/ChildNodesStep.tsx b/src/main/frontend/sections/editor/types/ChildNodesStep.tsx index 9e3f56b..5004e47 100644 --- a/src/main/frontend/sections/editor/types/ChildNodesStep.tsx +++ b/src/main/frontend/sections/editor/types/ChildNodesStep.tsx @@ -28,13 +28,12 @@ export const ChildNodesStep: FC<{ parentHops: Hop[]; hop: Type }> = ({ parentHop

Gets all child nodes of this node accessible through the current Session that match namePattern. The pattern may be a full name, a partial name with one or more wildcard characters (*), or a disjunction of those (using - the | character). + the | character).

- For example, jcr:* | myapp:report | my doc will run the pipeline - actions for each accessible child node that is either called{' '} - myapp:report, my doc, or - whose name begins with the prefix jcr:. + For example, jcr:* | myapp:report | my doc will run the pipeline actions for each accessible + child node that is either called myapp:report, my doc, or whose name begins with the + prefix jcr:.

For more information, see Node#getNodes(String) diff --git a/src/main/frontend/sections/editor/types/CopyNodeStep.tsx b/src/main/frontend/sections/editor/types/CopyNodeStep.tsx index 155e75e..c11aad2 100644 --- a/src/main/frontend/sections/editor/types/CopyNodeStep.tsx +++ b/src/main/frontend/sections/editor/types/CopyNodeStep.tsx @@ -29,25 +29,20 @@ export const CopyNodeStep: FC<{ parentHops: Hop[]; hop: Type }> = ({ parentHops,
The last path segment will be the name of the new node, the rest will point to its parent.
- Thus, newNodeName,{' '} - ./newNodeName,{' '} - /absolute/path/to/newNodeName,{' '} - relative/path/to/newNodeName, and{' '} - ./relative/path/to/newNodeName are all valid values. + Thus, newNodeName, ./newNodeName, /absolute/path/to/newNodeName,{' '} + relative/path/to/newNodeName, and ./relative/path/to/newNodeName are all valid + values.

- The effective parent must already exist. Example: Target is{' '} - node1/newNodeName + The effective parent must already exist. Example: Target is node1/newNodeName

  • - If the path {'${node.parent.path}'}/node1 exists ,{' '} - newNodeName will be created as a child of the{' '} - node1 sibling of the source + If the path {'${node.parent.path}'}/node1 exists , newNodeName will be + created as a child of the node1 sibling of the source
  • - If {'${node.parent.path}'}/node1 does not exist, the - operation will throw. + If {'${node.parent.path}'}/node1 does not exist, the operation will throw.
diff --git a/src/main/frontend/sections/editor/types/CreateChildNodeStep.tsx b/src/main/frontend/sections/editor/types/CreateChildNodeStep.tsx index 9ae87b4..409edbb 100644 --- a/src/main/frontend/sections/editor/types/CreateChildNodeStep.tsx +++ b/src/main/frontend/sections/editor/types/CreateChildNodeStep.tsx @@ -33,15 +33,13 @@ export const CreateChildNodeStep: FC<{ parentHops: Hop[]; hop: Type }> = ({ pare non-existing parents will throw an exception.

- For example, a value of node1/newNodeName will create the node{' '} - newNodeName as a child of the existing{' '} - node1 child of the current node and throw if{' '} - node1 doesn’t exist. + For example, a value of node1/newNodeName will create the node newNodeName as a + child of the existing node1 child of the current node and throw if node1 doesn’t + exist.

jcr:primaryType of new node

- The primary type to set on the new node. If left empty, defaults to{' '} - nt:unstructured + The primary type to set on the new node. If left empty, defaults to nt:unstructured

If the target node exists

diff --git a/src/main/frontend/sections/editor/types/FilterNodeStep.tsx b/src/main/frontend/sections/editor/types/FilterNodeStep.tsx index 192351f..7ee7a1d 100644 --- a/src/main/frontend/sections/editor/types/FilterNodeStep.tsx +++ b/src/main/frontend/sections/editor/types/FilterNodeStep.tsx @@ -24,7 +24,7 @@ export const FilterNodeStep: FC<{ parentHops: Hop[]; hop: Type }> = ({ parentHop

This field expects an expression, thus surrounding the expression with {'${}'} is invalid.

- With the word node you can reference the current node. + With the word node you can reference the current node.

diff --git a/src/main/frontend/sections/editor/types/MoveNodeStep.tsx b/src/main/frontend/sections/editor/types/MoveNodeStep.tsx index 9591eab..90cbdd4 100644 --- a/src/main/frontend/sections/editor/types/MoveNodeStep.tsx +++ b/src/main/frontend/sections/editor/types/MoveNodeStep.tsx @@ -13,10 +13,16 @@ export const MoveNodeStep: FC<{ parentHops: Hop[]; hop: Type }> = ({ parentHops, return ( + New Name{' '} + + (use /dev/null to delete) + + + } value={hop.newName ?? ''} onChange={newName => (hop.newName = newName)} - placeholder="[]" /> = ({ parentHops, value={hop.conflict ?? 'ignore'} onChange={conflict => (hop.conflict = conflict)} /> - ,

Move the current node to a new destination

New Name
@@ -35,29 +40,24 @@ export const MoveNodeStep: FC<{ parentHops: Hop[]; hop: Type }> = ({ parentHops,
The last path segment will be the name of the new node, the rest will point to its parent.
- Thus, newNodeName,{' '} - ./newNodeName,{' '} - /absolute/path/to/newNodeName,{' '} - relative/path/to/newNodeName, and{' '} - ./relative/path/to/newNodeName are all valid values. + Thus, newNodeName, ./newNodeName, /absolute/path/to/newNodeName,{' '} + relative/path/to/newNodeName, and ./relative/path/to/newNodeName are all valid + values.

- The effective parent must already exist. Example: Target is{' '} - node1/newNodeName + The effective parent must already exist. Example: Target is node1/newNodeName

  • - If the path {'${node.parent.path}'}/node1 exists ,{' '} - newNodeName will be created as a child of the{' '} - node1 sibling of the source + If the path {'${node.parent.path}'}/node1 exists , newNodeName will be + created as a child of the node1 sibling of the source
  • - If {'${node.parent.path}'}/node1 does not exist, the - operation will throw. + If {'${node.parent.path}'}/node1 does not exist, the operation will throw.

- Setting {DEV_NULL} as the new name will delete the node. + Setting {DEV_NULL} as the new name will delete the node.

diff --git a/src/main/frontend/sections/editor/types/RenamePropertyStep.tsx b/src/main/frontend/sections/editor/types/RenamePropertyStep.tsx new file mode 100644 index 0000000..e28a819 --- /dev/null +++ b/src/main/frontend/sections/editor/types/RenamePropertyStep.tsx @@ -0,0 +1,50 @@ +import React, { FC } from 'react'; + +import { Hop } from '../../../model/hops'; +import { StepEditor } from '../../../widgets/StepEditor'; + +import { shortDescription, title, Type, DEV_NULL } from '../../../model/hops/renameProperty'; +import { Help } from '../../../widgets/Help'; +import { Input } from '../../../widgets/Input'; +import { Conflict } from '../../../widgets/Conflict'; + +export const RenamePropertyStep: FC<{ parentHops: Hop[]; hop: Type }> = ({ parentHops, hop }) => { + return ( + + (hop.propertyName = propertyName)} /> + + New Name of Property{' '} + + (use /dev/null to delete) + + + } + value={hop.newName ?? ''} + onChange={newName => (hop.newName = newName)} + /> + (hop.doesNotExist = doesNotExist)} + /> + (hop.conflict = conflict)} + /> + +
Current Name of the Property
+

The name of the property you want to change.

+
New Name of the Property
+

The new name of the property

+

+ Setting {DEV_NULL} as the new name will delete the property. +

+
+
+ ); +}; diff --git a/src/main/frontend/widgets/Input.tsx b/src/main/frontend/widgets/Input.tsx index c1ce7cf..1ff1220 100644 --- a/src/main/frontend/widgets/Input.tsx +++ b/src/main/frontend/widgets/Input.tsx @@ -1,4 +1,4 @@ -import React, { FC, useContext, useEffect, useRef, useState } from 'react'; +import React, { FC, ReactNode, useContext, useEffect, useRef, useState } from 'react'; import { ScriptContext } from '../App'; import type { CoralIcon } from '../coral/custom-elements'; @@ -6,7 +6,7 @@ import type { CoralIcon } from '../coral/custom-elements'; export type Options = [value: string, label: string, icon?: CoralIcon][]; export const Input: FC<{ - label?: string; + label?: ReactNode; value: string; name?: string; placeholder?: string;