mirror of
https://github.com/plankanban/planka.git
synced 2025-12-17 09:13:23 +03:00
feat: Prefill label creation with search term (#307)
This commit is contained in:
@@ -10,11 +10,11 @@ import Editor from './Editor';
|
|||||||
|
|
||||||
import styles from './AddStep.module.scss';
|
import styles from './AddStep.module.scss';
|
||||||
|
|
||||||
const AddStep = React.memo(({ onCreate, onBack }) => {
|
const AddStep = React.memo(({ onCreate, onBack, initialValue }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
const [data, handleFieldChange] = useForm(() => ({
|
const [data, handleFieldChange] = useForm(() => ({
|
||||||
name: '',
|
name: initialValue,
|
||||||
color: LabelColors[0],
|
color: LabelColors[0],
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -48,6 +48,7 @@ const AddStep = React.memo(({ onCreate, onBack }) => {
|
|||||||
AddStep.propTypes = {
|
AddStep.propTypes = {
|
||||||
onCreate: PropTypes.func.isRequired,
|
onCreate: PropTypes.func.isRequired,
|
||||||
onBack: PropTypes.func.isRequired,
|
onBack: PropTypes.func.isRequired,
|
||||||
|
initialValue: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AddStep;
|
export default AddStep;
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ const LabelsStep = React.memo(
|
|||||||
if (step) {
|
if (step) {
|
||||||
switch (step.type) {
|
switch (step.type) {
|
||||||
case StepTypes.ADD:
|
case StepTypes.ADD:
|
||||||
return <AddStep onCreate={onCreate} onBack={handleBack} />;
|
return <AddStep onCreate={onCreate} onBack={handleBack} initialValue={search} />;
|
||||||
case StepTypes.EDIT: {
|
case StepTypes.EDIT: {
|
||||||
const currentItem = items.find((item) => item.id === step.params.id);
|
const currentItem = items.find((item) => item.id === step.params.id);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user