-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(editor): implement renameProperty configurator
- Loading branch information
1 parent
d1e1d19
commit 9e723b5
Showing
8 changed files
with
87 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/main/frontend/sections/editor/types/RenamePropertyStep.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<StepEditor parentHops={parentHops} hop={hop} title={shortDescription(hop)}> | ||
<Input label="Property Name" value={hop.propertyName ?? ''} onChange={propertyName => (hop.propertyName = propertyName)} /> | ||
<Input | ||
label={ | ||
<> | ||
New Name of Property{' '} | ||
<small> | ||
(use <code>/dev/null</code> to delete) | ||
</small> | ||
</> | ||
} | ||
value={hop.newName ?? ''} | ||
onChange={newName => (hop.newName = newName)} | ||
/> | ||
<Conflict | ||
label="If the source property does not exist" | ||
forceLabel="Ignore but do not warn" | ||
value={hop.doesNotExist ?? 'ignore'} | ||
onChange={doesNotExist => (hop.doesNotExist = doesNotExist)} | ||
/> | ||
<Conflict | ||
label="If the target property exists" | ||
forceLabel="Overwrite the existing property" | ||
value={hop.conflict ?? 'ignore'} | ||
onChange={conflict => (hop.conflict = conflict)} | ||
/> | ||
<Help title={title}> | ||
<h5>Current Name of the Property</h5> | ||
<p>The name of the property you want to change.</p> | ||
<h5>New Name of the Property</h5> | ||
<p>The new name of the property</p> | ||
<p> | ||
Setting <code>{DEV_NULL}</code> as the new name will delete the property. | ||
</p> | ||
</Help> | ||
</StepEditor> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters