Remove subTargetUid query string

This commit is contained in:
soupette 2019-12-26 10:41:24 +01:00
parent b076cc43ec
commit 3ba4e96957
5 changed files with 2 additions and 76 deletions

View File

@ -71,7 +71,7 @@ const AttributeOption = forwardRef(({ tabIndex, type }, ref) => {
targetUid,
attributeType: type,
step: type === 'component' ? '1' : null,
subTargetUid: query.get('subTargetUid'),
header_label_1,
header_info_name_1,
header_info_category_1,

View File

@ -1,69 +0,0 @@
import React from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import UpperFirst from '../UpperFirst';
import ComponentInfos from './ComponentInfos';
import IconWrapper from './IconWrapper';
const Header = ({
category,
name,
subCategory,
target,
targetUid,
subTargetUid,
}) => {
const shouldDisplayComponentCatInfos = target === 'components';
const content = (
<>
<span>
<UpperFirst content={category} />
</span>
<IconWrapper>
<FontAwesomeIcon icon="chevron-right" />
</IconWrapper>
{subCategory && (
<>
<span>
<UpperFirst content={subCategory} />
</span>
<ComponentInfos uid={subTargetUid} />
<IconWrapper>
<FontAwesomeIcon icon="chevron-right" />
</IconWrapper>
</>
)}
</>
);
return (
<>
{category && content}
<span>
<UpperFirst content={name} />
</span>
{shouldDisplayComponentCatInfos && <ComponentInfos uid={targetUid} />}
</>
);
};
Header.defaultProps = {
category: null,
name: null,
subCategory: null,
subTargetUid: null,
target: null,
targetUid: null,
};
Header.propTypes = {
category: PropTypes.string,
name: PropTypes.string,
subCategory: PropTypes.string,
subTargetUid: PropTypes.string,
target: PropTypes.string,
targetUid: PropTypes.string,
};
export default Header;

View File

@ -85,7 +85,6 @@ const FormModal = () => {
const modalType = query.get('modalType');
const targetUid = query.get('targetUid');
const settingType = query.get('settingType');
const subTargetUid = query.get('subTargetUid');
const headerId = query.get('headerId');
const header_label_1 = query.get('header_label_1');
const header_icon_name_1 = query.get('header_icon_name_1');
@ -127,7 +126,6 @@ const FormModal = () => {
modalType,
pathToSchema,
settingType,
subTargetUid,
step,
targetUid,
header_label_1,

View File

@ -10,7 +10,6 @@ const INITIAL_STATE_DATA = {
pathToSchema: [],
settingType: null,
step: null,
subTargetUid: null,
targetUid: null,
headerId: null,
header_label_1: null,

View File

@ -12,7 +12,6 @@ describe('FormModal | utils | createHeadersArray', () => {
pathToSchema: [],
settingType: null,
step: null,
subTargetUid: null,
targetUid: null,
headerId: null,
header_label_1: null,
@ -47,7 +46,6 @@ describe('FormModal | utils | createHeadersArray', () => {
pathToSchema: [],
settingType: null,
step: null,
subTargetUid: null,
targetUid: null,
headerId: null,
header_label_1: 'restaurant',
@ -95,7 +93,7 @@ describe('FormModal | utils | createHeadersArray', () => {
pathToSchema: [],
settingType: null,
step: null,
subTargetUid: null,
targetUid: null,
headerId: null,
header_label_1: 'restaurant',