|
|
|
@ -18,7 +18,18 @@ const StepTypes = {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const LabelsStep = React.memo(
|
|
|
|
const LabelsStep = React.memo(
|
|
|
|
({ items, currentIds, title, onSelect, onDeselect, onCreate, onUpdate, onDelete, onBack }) => {
|
|
|
|
({
|
|
|
|
|
|
|
|
items,
|
|
|
|
|
|
|
|
currentIds,
|
|
|
|
|
|
|
|
title,
|
|
|
|
|
|
|
|
canEdit,
|
|
|
|
|
|
|
|
onSelect,
|
|
|
|
|
|
|
|
onDeselect,
|
|
|
|
|
|
|
|
onCreate,
|
|
|
|
|
|
|
|
onUpdate,
|
|
|
|
|
|
|
|
onDelete,
|
|
|
|
|
|
|
|
onBack,
|
|
|
|
|
|
|
|
}) => {
|
|
|
|
const [t] = useTranslation();
|
|
|
|
const [t] = useTranslation();
|
|
|
|
const [step, openStep, handleBack] = useSteps();
|
|
|
|
const [step, openStep, handleBack] = useSteps();
|
|
|
|
const [search, handleSearchChange] = useField('');
|
|
|
|
const [search, handleSearchChange] = useField('');
|
|
|
|
@ -140,6 +151,7 @@ const LabelsStep = React.memo(
|
|
|
|
color={item.color}
|
|
|
|
color={item.color}
|
|
|
|
isPersisted={item.isPersisted}
|
|
|
|
isPersisted={item.isPersisted}
|
|
|
|
isActive={currentIds.includes(item.id)}
|
|
|
|
isActive={currentIds.includes(item.id)}
|
|
|
|
|
|
|
|
canEdit={canEdit}
|
|
|
|
onSelect={() => handleSelect(item.id)}
|
|
|
|
onSelect={() => handleSelect(item.id)}
|
|
|
|
onDeselect={() => handleDeselect(item.id)}
|
|
|
|
onDeselect={() => handleDeselect(item.id)}
|
|
|
|
onEdit={() => handleEdit(item.id)}
|
|
|
|
onEdit={() => handleEdit(item.id)}
|
|
|
|
@ -147,12 +159,14 @@ const LabelsStep = React.memo(
|
|
|
|
))}
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
<Button
|
|
|
|
{canEdit && (
|
|
|
|
fluid
|
|
|
|
<Button
|
|
|
|
content={t('action.createNewLabel')}
|
|
|
|
fluid
|
|
|
|
className={styles.addButton}
|
|
|
|
content={t('action.createNewLabel')}
|
|
|
|
onClick={handleAddClick}
|
|
|
|
className={styles.addButton}
|
|
|
|
/>
|
|
|
|
onClick={handleAddClick}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
)}
|
|
|
|
</Popup.Content>
|
|
|
|
</Popup.Content>
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -165,6 +179,7 @@ LabelsStep.propTypes = {
|
|
|
|
currentIds: PropTypes.array.isRequired,
|
|
|
|
currentIds: PropTypes.array.isRequired,
|
|
|
|
/* eslint-enable react/forbid-prop-types */
|
|
|
|
/* eslint-enable react/forbid-prop-types */
|
|
|
|
title: PropTypes.string,
|
|
|
|
title: PropTypes.string,
|
|
|
|
|
|
|
|
canEdit: PropTypes.bool,
|
|
|
|
onSelect: PropTypes.func.isRequired,
|
|
|
|
onSelect: PropTypes.func.isRequired,
|
|
|
|
onDeselect: PropTypes.func.isRequired,
|
|
|
|
onDeselect: PropTypes.func.isRequired,
|
|
|
|
onCreate: PropTypes.func.isRequired,
|
|
|
|
onCreate: PropTypes.func.isRequired,
|
|
|
|
@ -175,6 +190,7 @@ LabelsStep.propTypes = {
|
|
|
|
|
|
|
|
|
|
|
|
LabelsStep.defaultProps = {
|
|
|
|
LabelsStep.defaultProps = {
|
|
|
|
title: 'common.labels',
|
|
|
|
title: 'common.labels',
|
|
|
|
|
|
|
|
canEdit: true,
|
|
|
|
onBack: undefined,
|
|
|
|
onBack: undefined,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|